java.lang.Object

com.opentok.android.BaseVideoRenderer.Frame

Enclosing class: : BaseVideoRenderer


public final class BaseVideoRenderer.Frame extends Object

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

See Also: : - BaseVideoRenderer.onFrame(Frame)

Field Summary

Fields

Modifier and Type

Field

Description

protected ByteBuffer

buffer

protected com.opentok.otc.otc_video_frame_format

format

protected int

height

protected long

internalBuffer

protected byte[]

metadata

protected boolean

mirrored

protected int

uvStride

protected int

width

protected int

yStride

Constructor Summary

Constructors

Modifier

Constructor

Description

protected

Frame()

Method Summary

All MethodsInstance MethodsConcrete MethodsDeprecated Methods

Modifier and Type

Method

Description

void

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

Converts video frame without allocating new planes.

void

destroy()

Free all resources associated to this frame.

protected void

finalize()

ByteBuffer

getBuffer()

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

int

getFormat()

Gets the format of the video frame.

int

getHeight()

Returns the height of the video frame, in pixels.

byte[]

getMetadata()

Deprecated.

This method is deprecated and will be removed in a future version of the library.

ByteBuffer

getUplane()

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

int

getUVplaneSize()

Returns the U and V plane size.

int

getUvStride()

Returns the value of U or V stride.

ByteBuffer

getVplane()

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

int

getWidth()

Returns the width of the video frame, in pixels.

ByteBuffer

getYplane()

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

int

getYplaneSize()

Returns the Y plane size.

int

getYstride()

Returns the value of Y stride.

boolean

isMirroredX()

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

void

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

Methods inherited from class java.lang.Object

clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Details

internalBuffer

protected long internalBuffer

buffer

protected ByteBuffer buffer

format

protected com.opentok.otc.otc_video_frame_format format

width

protected int width

height

protected int height

mirrored

protected boolean mirrored

yStride

protected int yStride

uvStride

protected int uvStride

metadata

protected byte[] metadata

Constructor Details

Frame

protected Frame()

Method Details

recycle

@Deprecated public void 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

finalize

protected void finalize() throws Throwable

Overrides: : finalize in class Object

Throws: : Throwable

destroy

public void destroy()

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

getBuffer

public ByteBuffer getBuffer()

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

getWidth

public int getWidth()

Returns the width of the video frame, in pixels.

getHeight

public int getHeight()

Returns the height of the video frame, in pixels.

getFormat

public int getFormat()

Gets the format of the video frame.

Returns: : The format of the video frame.

isMirroredX

public boolean isMirroredX()

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

getYstride

public int getYstride()

Returns the value of Y stride.

getUvStride

public int getUvStride()

Returns the value of U or V stride.

getMetadata

@Deprecated public byte[] getMetadata()

Deprecated.

This method is deprecated and will be removed in a future version of the library.

Returns the metadata associated with the frame if any, as a byte array.

getYplane

public ByteBuffer getYplane()

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

getUplane

public ByteBuffer getUplane()

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

getVplane

public ByteBuffer getVplane()

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

getYplaneSize

public int getYplaneSize()

Returns the Y plane size.

getUVplaneSize

public int getUVplaneSize()

Returns the U and V plane size.

convertInPlace

public void convertInPlace(ByteBuffer yPlane, ByteBuffer uPlane, ByteBuffer vPlane, int yStride, int uvStride)

Converts video frame without allocating new planes.

Parameters: : yPlane - see getYplane() for details : uPlane - see getUplane() for details : vPlane - see getVplane() for details : yStride - see getYstride()} for details : uvStride - see getUvStride() for details