ExternalVideoFrame
The external video frame.
struct ExternalVideoFrame { ExternalVideoFrame() : type(VIDEO_BUFFER_RAW_DATA), format(VIDEO_PIXEL_DEFAULT), buffer(NULL), stride(0), height(0), cropLeft(0), cropTop(0), cropRight(0), cropBottom(0), rotation(0), timestamp(0), eglContext(NULL), eglType(EGL_CONTEXT10), textureId(0), metadata_buffer(NULL), metadata_size(0), d3d11_texture_2d(NULL), texture_slice_index(0){} enum EGL_CONTEXT_TYPE { EGL_CONTEXT10 = 0, EGL_CONTEXT14 = 1, }; enum VIDEO_BUFFER_TYPE { VIDEO_BUFFER_RAW_DATA = 1, VIDEO_BUFFER_ARRAY = 2, VIDEO_BUFFER_TEXTURE = 3, }; VIDEO_BUFFER_TYPE type; VIDEO_PIXEL_FORMAT format; void* buffer; int stride; int height; int cropLeft; int cropTop; int cropRight; int cropBottom; int rotation; long long timestamp; void *eglContext; EGL_CONTEXT_TYPE eglType; int textureId; float matrix[16]; uint8_t* metadata_buffer; int metadata_size; void *d3d11_texture_2d; int texture_slice_index; };
Attributes
- type
-
The video type. See VIDEO_BUFFER_TYPE.
- format
- The pixel format. See VIDEO_PIXEL_FORMAT.
- buffer
- Video frame buffer.
- stride
- Line spacing of the incoming video frame, which must be in pixels instead of bytes. For textures, it is the width of the texture.
- height
- Height of the incoming video frame.
- eglContext
- This parameter only applies to video data in Texture format.
- When using the OpenGL interface (javax.microedition.khronos.egl.*) defined by Khronos, set eglContext to this field.
- When using the OpenGL interface (android.opengl.*) defined by Android, set eglContext to this field.
- eglType
- This parameter only applies to video data in Texture format. Texture ID of the video frame.
- textureId
- This parameter only applies to video data in Texture format. Incoming 4 × 4 transformational matrix. The typical value is a unit matrix.
- 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
. - d3d11_texture_2d
- This parameter only applies to video data in Windows Texture format. It represents a pointer to an object of type
ID3D11Texture2D
, which is used by a video frame. - texture_slice_index
- This parameter only applies to video data in Windows Texture format. It represents an index of an
ID3D11Texture2D
texture object used by the video frame in theID3D11Texture2D
array. - cropLeft
- Raw data related parameter. The number of pixels trimmed from the left. The default value is 0.
- cropTop
- Raw data related parameter. The number of pixels trimmed from the top. The default value is 0.
- cropRight
- Raw data related parameter. The number of pixels trimmed from the right. The default value is 0.
- cropBottom
- Raw data related parameter. The number of pixels trimmed from the bottom. The default value is 0.
- rotation
- Raw data related parameter. The clockwise rotation of the video frame. You can set the rotation angle as 0, 90, 180, or 270. The default value is 0.
- timestamp
- Timestamp (ms) of the incoming video frame. An incorrect timestamp results in frame loss or unsynchronized audio and video.