NoDropVideoProcessor
The NoDropVideoProcessor
forces every frame to be processed, even when the video stream is not being published to a room. This makes it ideal for effects that should always be visible in the local preview, such as a background blur or beauty filter.
NOTE
Your processing logic should be highly efficient to prevent video latency. To revert to the default behavior and allow frame dropping when not publishing, set the allowDropping
property to true
.
Usage Example
Here's how you can implement a simple NoDropVideoProcessor
that logs the timestamp of each frame.
class CustomProcessor : NoDropVideoProcessor() {
override fun onCapturerStarted(started: Boolean) {}
override fun onCapturerStopped() {}
override fun onFrameCaptured(frame: VideoFrame?) {
Log.d("CustomProcessor", "Processing frame with timestamp: ${frame?.timestampNs}")
}
override fun setSink(sink: VideoSink?) {}
}
// CustomProcessor with allowDropping set to true
val myCustomProcessor = CustomProcessor().apply { allowDropping = true }
val meeting = RealtimeKitMeetingBuilder()
.setVideoProcessor(myCustomProcessor)
.build(activity)