Agora RTC Objective-C API Reference Refactor

Public Types | Data Fields
ExternalVideoFrame Struct Reference

## Public Types
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 }

## Data Fields
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
long long | fenceObject
float | matrix [16]
uint8_t * | metadataBuffer
int | metadataSize
uint8_t * | alphaBuffer
bool | fillAlphaBuffer
ALPHA_STITCH_MODE | alphaStitchMode
void * | d3d11Texture2d
int | textureSliceIndex
Hdr10MetadataInfo | hdr10MetadataInfo
ColorSpace | colorSpace

## Detailed Description

The definition of the ExternalVideoFrame struct.

## Member Enumeration Documentation

## ◆ EGL_CONTEXT_TYPE

enum EGL_CONTEXT_TYPE

The EGL context type.

Enumerator
EGL_CONTEXT10 | 0: When using the OpenGL interface (javax.microedition.khronos.egl.*) defined by Khronos
EGL_CONTEXT14 | 0: When using the OpenGL interface (android.opengl.*) defined by Android

## ◆ VIDEO_BUFFER_TYPE

enum VIDEO_BUFFER_TYPE

Video buffer types.

Enumerator
VIDEO_BUFFER_RAW_DATA | 1: Raw data.
VIDEO_BUFFER_ARRAY | 2: The same as VIDEO_BUFFER_RAW_DATA.
VIDEO_BUFFER_TEXTURE | 3: The video buffer in the format of texture.

## Constructor & Destructor Documentation

## ◆ ExternalVideoFrame()

ExternalVideoFrame | ( |  | ) |
| inline

## Field Documentation

## ◆ type

VIDEO_BUFFER_TYPE type

The buffer type: VIDEO_BUFFER_TYPE.

## ◆ format

VIDEO_PIXEL_FORMAT format

The pixel format: VIDEO_PIXEL_FORMAT

## ◆ buffer

void* buffer

The video buffer.

## ◆ stride

int stride

The line spacing of the incoming video frame (px). For texture, it is the width of the texture.

## ◆ height

int height

The height of the incoming video frame.

## ◆ cropLeft

int cropLeft

[Raw data related parameter] The number of pixels trimmed from the left. The default value is 0.

## ◆ cropTop

int cropTop

[Raw data related parameter] The number of pixels trimmed from the top. The default value is 0.

## ◆ cropRight

int cropRight

[Raw data related parameter] The number of pixels trimmed from the right. The default value is 0.

## ◆ cropBottom

int cropBottom

[Raw data related parameter] The number of pixels trimmed from the bottom. The default value is 0.

## ◆ rotation

int rotation

[Raw data related parameter] The clockwise rotation information of the video frame. You can set the rotation angle as 0, 90, 180, or 270. The default value is 0.

## ◆ timestamp

long long timestamp

The timestamp (ms) of the incoming video frame. An incorrect timestamp results in a frame loss or unsynchronized audio and video.

Please refer to getAgoraCurrentMonotonicTimeInMs or getCurrentMonotonicTimeInMs to determine how to fill this filed.

## ◆ eglContext

void* eglContext

[Texture-related parameter] 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

EGL_CONTEXT_TYPE eglType

[Texture related parameter] Texture ID used by the video frame.

## ◆ textureId

int textureId

[Texture related parameter] Incoming 4 × 4 transformational matrix. The typical value is a unit matrix.

## ◆ fenceObject

long long fenceObject

[Texture related parameter] The fence object related to the textureId parameter, indicating the synchronization status of the video data in Texture format. The default value is 0

## ◆ matrix

float matrix[16]

[Texture related parameter] Incoming 4 × 4 transformational matrix. The typical value is a unit matrix.

## ◆ metadataBuffer

uint8_t* metadataBuffer

[Texture related parameter] The MetaData buffer. The default value is NULL

## ◆ metadataSize

int metadataSize

[Texture related parameter] The MetaData size. The default value is 0

## ◆ alphaBuffer

uint8_t* alphaBuffer

Indicates the alpha channel of current frame, which is consistent with the dimension of the video frame. The value range of each pixel is [0,255], where 0 represents the background; 255 represents the foreground. The default value is NULL.

## ◆ fillAlphaBuffer

bool fillAlphaBuffer

[For bgra or rgba only] Extract alphaBuffer from bgra or rgba data. Set it true if you do not explicitly specify the alphabuffer. The default value is false

## ◆ alphaStitchMode

ALPHA_STITCH_MODE alphaStitchMode

The relative position between alphabuffer and the frame. 0: Normal frame; 1: Alphabuffer is above the frame; 2: Alphabuffer is below the frame; 3: Alphabuffer is on the left of frame; 4: Alphabuffer is on the right of frame; The default value is 0.

## ◆ d3d11Texture2d

void* d3d11Texture2d

[For Windows only] The pointer of ID3D11Texture2D used by the video frame.

## ◆ textureSliceIndex

int textureSliceIndex

[For Windows only] The index of ID3D11Texture2D array used by the video frame.

## ◆ hdr10MetadataInfo

Hdr10MetadataInfo hdr10MetadataInfo

metadata info used for hdr video data

## ◆ colorSpace

ColorSpace colorSpace

The ColorSpace of the video frame.