on Frame Nv12
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.
y and uv belong to the SDK and are overwritten by the next frame, so copy or upload before returning. Address rows by the strides rather than by width — the planes may be allocated with row padding.
Parameters
y
luma plane, yStride × height bytes.
y Stride
bytes per luma row; never less than width.
uv
interleaved chroma plane (U₀V₀U₁V₁…), uvStride × height / 2 bytes.
uv Stride
bytes per chroma row; never less than width.
width
visible frame width in pixels.
height
visible frame height in pixels.
rotation Degrees
clockwise rotation to apply when drawing. The SDK's own sources deliver upright frames, so this is 0 today.
timestamp Ns
capture time on this device's monotonic clock; useful for pacing, not comparable with other participants' clocks.