onFrame

abstract fun onFrame(frame: VideoFrame, processedFrameListener: ProcessedVideoFrameListener)

Called on a worker thread when a new frame is available from the local camera.

Frames are in YUV I420 planar or semi-planar (not fully interleaved) format.

Important: processedFrameListener must be called exactly once when processing is complete, from the same thread as this callback. Failure to do so will stop frames from reaching the remote party. The listener accepts the original frame, a modified frame, or an entirely new frame.

Parameters

frame

The YUV I420 frame captured from the local camera.

processedFrameListener

Must be called once processing is complete to deliver the frame to WebRTC for encoding and transmission.

See also