public class I420Frame extends Object
ByteBuffer
array of
Y, U, and V pixel data with an array of strides for each plane or as a texture.
When a frame is represented as a texture, textureId
will be set to a positive
non zero value with yuvPlanes
and yuvStrides
set to null
. The YUV
data can be extracted from the texture using an instance of org.webrtc.YuvConverter
and the samplingMatrix
.
When a frame is represented as an array of ByteBuffer
, textureId
will be
0, yuvPlanes
contains the YUV pixel data, and yuvStrides
contains each
plane's stride.
Modifier and Type | Field and Description |
---|---|
int |
height
Height of frame
|
int |
rotationDegree
The degree that the frame must be rotated clockwise to be rendered correctly.
|
float[] |
samplingMatrix
Matrix that transforms standard coordinates to their proper sampling locations in
the texture.
|
int |
textureId
Id of the texture the frame is bound to.
|
int |
width
Width of frame
|
ByteBuffer[] |
yuvPlanes
Array of pixel data for each plane.
|
int[] |
yuvStrides
Array of strides for each plane.
|
Modifier and Type | Method and Description |
---|---|
void |
release()
Called when a
VideoRenderer has completed rendering a frame. |
int |
rotatedHeight()
Returns the height of the frame based on the current
rotationDegree . |
int |
rotatedWidth()
Returns the width of the frame based on the current
rotationDegree . |
String |
toString() |
public final int width
public final int height
public final int[] yuvStrides
null
when the frame is represented
as a texture.
yuvStrides[0] - Y stride.
yuvStrides[1] - U stride.
yuvStrides[2] - V stride.
public final ByteBuffer[] yuvPlanes
null
when the frame is represented
as a texture.
yuvPlanes[0] - Y pixel data.
yuvPlanes[1] - U pixel data.
yuvPlanes[2] - V pixel data.
public int rotationDegree
public int textureId
public final float[] samplingMatrix
rotationDegree
into account.public int rotatedWidth()
rotationDegree
.public int rotatedHeight()
rotationDegree
.public void release()
VideoRenderer
has completed rendering a frame. This must be invoked
for each frame to ensure that resources are not leaked.