VideoFrame
Configurations of the video frame.
struct VideoFrame { VideoFrame(): type(VIDEO_PIXEL_DEFAULT), width(0), height(0), yStride(0), uStride(0), vStride(0), yBuffer(NULL), uBuffer(NULL), vBuffer(NULL), rotation(0), renderTimeMs(0), avsync_type(0), metadata_buffer(NULL), metadata_size(0), sharedContext(0), textureId(0), VIDEO_PIXEL_FORMAT type; int width; int height; int yStride; int uStride; int vStride; uint8_t* yBuffer; uint8_t* uBuffer; uint8_t* vBuffer; int rotation; int64_t renderTimeMs; int avsync_type; uint8_t* metadata_buffer; int metadata_size; void* sharedContext; int textureId; float matrix[16]; };
The video data format is YUV420. Note that the buffer provides a pointer to a pointer. This interface cannot modify the pointer of the buffer, but it can modify the content of the buffer.
Attributes
- type
- The pixel format. See VIDEO_PIXEL_FORMAT.
- width
- The width of the video, in pixels.
- height
- The height of the video, in pixels.
- yStride
- For YUV data, the line span of the Y buffer; for RGBA data, the total data length.
- uStride
- For YUV data, the line span of the U buffer; for RGBA data, the value is 0.
- vStride
- For YUV data, the line span of the V buffer; for RGBA data, the value is 0.
- yBuffer
- For YUV data, the pointer to the Y buffer; for RGBA data, the data buffer.
- uBuffer
- For YUV data, the pointer to the U buffer; for RGBA data, the value is 0.
- vBuffer
- For YUV data, the pointer to the V buffer; for RGBA data, the value is 0.
- rotation
- The clockwise rotation of the video frame before rendering. Supported values include 0, 90, 180, and 270 degrees.
- renderTimeMs
- The Unix timestamp (ms) when the video frame is rendered. This timestamp can be used to guide the rendering of the video frame. It is required.
- avsync_type
- Reserved for future use.
- metadata_buffer
- This parameter only applies to video data in Texture format. The MetaData buffer. The default value is
NULL
. - metadata_size
- This parameter only applies to video data in Texture format. The MetaData size. The default value is
0
. - sharedContext
- This parameter only applies to video data in Texture format. EGL Context.
- textureId
- This parameter only applies to video data in Texture format. Texture ID.
- matrix
- This parameter only applies to video data in Texture format. Incoming 4 × 4 transformational matrix. The typical value is a unit matrix.