VideoFrameI420Buffer

class VideoFrameI420Buffer(val width: Int, val height: Int, val dataY: ByteBuffer, val dataU: ByteBuffer, val dataV: ByteBuffer, val strideY: Int, val strideU: Int, val strideV: Int, releaseCallback: Runnable) : VideoFrameBuffer

VideoFrameI420Buffer provides an reference counted wrapper of a YUV where planes are natively (i.e. in JNI) allocated direct byte buffers.

Constructors

Link copied to clipboard
constructor(width: Int, height: Int, dataY: ByteBuffer, dataU: ByteBuffer, dataV: ByteBuffer, strideY: Int, strideU: Int, strideV: Int, releaseCallback: Runnable)

Properties

Link copied to clipboard

U plane data of video frame in memory. This must be a natively allocated direct byte buffer so that it can be passed to native code

Link copied to clipboard

V plane data of video frame in memory. This must be a natively allocated direct byte buffer so that it can be passed to native code

Link copied to clipboard

Y plane data of video frame in memory. This must be a natively allocated direct byte buffer that it can be passed to native code

Link copied to clipboard
open override val height: Int

Height of the video frame buffer

Link copied to clipboard

Stride of U plane of video frame

Link copied to clipboard

Stride of V plane of video frame

Link copied to clipboard

Stride of Y plane of video frame

Link copied to clipboard
open override val width: Int

Width of the video frame buffer

Functions

Link copied to clipboard
open override fun release()

Release the video frame buffer. Use after frame construction or release after the frame is no longer needed. Will trigger appropriate release of any internally allocated resources. Not using may result in leaks.

Link copied to clipboard
open override fun retain()

Retain the video frame buffer. Use when shared ownership of the buffer is desired (e.g. when passing to separate thread), otherwise the frame may be spuriously released