BaseVideoRenderer.Frame

public final class Frame

Enclosing class: BaseVideoRenderer

Defines a frame of a video stream. Call the getBuffer method to get the frame data. The data is in I420 format.

Properties

Name Type Description
internalBuffer long protected
buffer ByteBuffer protected
format otc_video_frame_format protected
width int protected
height int protected
mirrored boolean protected
yStride int protected
uvStride int protected
metadata byte[] protected

Methods

Name Description
Frame()
convertInPlace(yPlane, uPlane, vPlane, yStride, uvStride) Converts video frame without allocating new planes.
destroy() Free all resources associated to this frame.
finalize()
getBuffer() → {ByteBuffer} Returns the byte buffer containing the video frame data, which is in I420 format.
getFormat() → {int} Gets the format of the video frame.
getHeight() → {int} Returns the height of the video frame, in pixels.
getUVplaneSize() → {int} Returns the U and V plane size.
getUplane() → {ByteBuffer} Returns the byte buffer containing the U plane video frame data.
getUvStride() → {int} Returns the value of U or V stride.
getVplane() → {ByteBuffer} Returns the byte buffer containing the V plane video frame data.
getWidth() → {int} Returns the width of the video frame, in pixels.
getYplane() → {ByteBuffer} Returns the byte buffer containing the Y plane video frame data.
getYplaneSize() → {int} Returns the Y plane size.
getYstride() → {int} Returns the value of Y stride.
isMirroredX() → {boolean} Whether the video frame is mirrored about the x-axis (true) or not (false).
recycle()

Frame()

convertInPlace(yPlane, uPlane, vPlane, yStride, uvStride)

Converts video frame without allocating new planes.

Parameters:
Name Type Description
yPlane ByteBuffer see getYplane() for details
uPlane ByteBuffer see getUplane() for details
vPlane ByteBuffer see getVplane() for details
yStride int see getYstride()} for details
uvStride int see getUvStride() for details

destroy()

Free all resources associated to this frame. Buffer is null after calling destroy

finalize()

getBuffer() → {ByteBuffer}

Returns the byte buffer containing the video frame data, which is in I420 format.

Returns:

ByteBuffer

getFormat() → {int}

Gets the format of the video frame.

Returns:

The format of the video frame.

getHeight() → {int}

Returns the height of the video frame, in pixels.

Returns:

int

getUVplaneSize() → {int}

Returns the U and V plane size.

Returns:

int

getUplane() → {ByteBuffer}

Returns the byte buffer containing the U plane video frame data.

Returns:

ByteBuffer

getUvStride() → {int}

Returns the value of U or V stride.

Returns:

int

getVplane() → {ByteBuffer}

Returns the byte buffer containing the V plane video frame data.

Returns:

ByteBuffer

getWidth() → {int}

Returns the width of the video frame, in pixels.

Returns:

int

getYplane() → {ByteBuffer}

Returns the byte buffer containing the Y plane video frame data.

Returns:

ByteBuffer

getYplaneSize() → {int}

Returns the Y plane size.

Returns:

int

getYstride() → {int}

Returns the value of Y stride.

Returns:

int

isMirroredX() → {boolean}

Whether the video frame is mirrored about the x-axis (true) or not (false).

Returns:

boolean

recycle()

Deprecated — If you want to free the memory of a frame you can just set the reference to null and wait the GC to collect it