VideoFrameRGBABuffer

class VideoFrameRGBABuffer(val width: Int, val height: Int, val data: ByteBuffer, val stride: Int, releaseCallback: Runnable) : VideoFrameBuffer

VideoFrameRGBABuffer provides an reference counted wrapper of an RGBA natively (i.e. in JNI) allocated direct byte buffer.

Constructors

Link copied to clipboard
constructor(width: Int, height: Int, data: ByteBuffer, stride: Int, releaseCallback: Runnable)

Properties

Link copied to clipboard

RGBA 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
open override val height: Int

Height of the video frame buffer

Link copied to clipboard
val stride: Int

Stride of RGBA 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