Package com.opentok.android
Class BaseVideoRenderer.Frame
- java.lang.Object
-
- com.opentok.android.BaseVideoRenderer.Frame
-
- Enclosing class:
- BaseVideoRenderer
public final class BaseVideoRenderer.Frame extends java.lang.Object
Defines a frame of a video stream. Call thegetBuffer()
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 java.nio.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 Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
convertInPlace(java.nio.ByteBuffer yPlane, java.nio.ByteBuffer uPlane, java.nio.ByteBuffer vPlane, int yStride, int uvStride)
void
destroy()
Free all resources associated to this frame.protected void
finalize()
java.nio.ByteBuffer
getBuffer()
Returns the byte buffer containing the video frame data, which is in I420 format.int
getFormat()
int
getHeight()
Returns the height of the video frame, in pixels.byte[]
getMetadata()
java.nio.ByteBuffer
getUplane()
int
getUVplaneSize()
int
getUvStride()
java.nio.ByteBuffer
getVplane()
int
getWidth()
java.nio.ByteBuffer
getYplane()
int
getYplaneSize()
int
getYstride()
boolean
isMirroredX()
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
-
-
-
Field Detail
-
internalBuffer
protected long internalBuffer
-
buffer
protected java.nio.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
-
-
Method Detail
-
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 java.lang.Throwable
- Overrides:
finalize
in classjava.lang.Object
- Throws:
java.lang.Throwable
-
destroy
public void destroy()
Free all resources associated to this frame. Buffer is null after calling destroy
-
getBuffer
public java.nio.ByteBuffer getBuffer()
Returns the byte buffer containing the video frame data, which is in I420 format.
-
getWidth
public int getWidth()
- Returns:
- 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()
-
isMirroredX
public boolean isMirroredX()
- Returns:
- Whether the video frame is mirrored about the x-axis (
true
) or not (false
).
-
getYstride
public int getYstride()
-
getUvStride
public int getUvStride()
-
getMetadata
public byte[] getMetadata()
- Returns:
- Returns the metadata associated with the frame if any, as a byte array.
-
getYplane
public java.nio.ByteBuffer getYplane()
-
getUplane
public java.nio.ByteBuffer getUplane()
-
getVplane
public java.nio.ByteBuffer getVplane()
-
getYplaneSize
public int getYplaneSize()
-
getUVplaneSize
public int getUVplaneSize()
-
convertInPlace
public void convertInPlace(java.nio.ByteBuffer yPlane, java.nio.ByteBuffer uPlane, java.nio.ByteBuffer vPlane, int yStride, int uvStride)
-
-