FrameSink

interface FrameSink

Receives decoded video frames so you can draw them yourself instead of letting VideoView draw them.

Install it with VideoView.setFrameSink BEFORE VideoView.addTrack; a track that is already attached keeps feeding the previous sink until it is detached and re-added.

Not every source reaches a sink. The local screen-share preview arrives through onFrameNv12. Through onFrameI420 come the local camera in a room once VideoView.setMirror or VideoView.setScalingType has been called, and a remote track attached before the SDK has registered it. Other video is drawn by the view directly.

Callbacks arrive on a background dispatcher, never the main thread, one frame at a time. Do not block: the next poll waits for you to return, and the tile drops frames.

Functions

Link copied to clipboard
open fun onFrameI420(i420: JavaI420Buffer, rotationDegrees: Int = 0, timestampNs: Long = System.nanoTime())

An I420 frame is ready. See FrameSink for the sources that arrive here.

Link copied to clipboard
abstract fun onFrameNv12(y: ByteBuffer, yStride: Int, uv: ByteBuffer, uvStride: Int, width: Int, height: Int, rotationDegrees: Int = 0, timestampNs: Long = System.nanoTime())

An NV12 frame is ready.

Link copied to clipboard
abstract fun release()

Frees whatever this sink allocated.