Agora C++ API Reference for All Platforms
agora::media::ExternalVideoFrame Struct Reference

#include <IAgoraMediaEngine.h>

Public Types

enum  VIDEO_BUFFER_TYPE { VIDEO_BUFFER_RAW_DATA = 1 , VIDEO_BUFFER_PIXEL_BUFFER = 2 }
 
enum  VIDEO_PIXEL_FORMAT {
  VIDEO_PIXEL_UNKNOWN = 0 , VIDEO_PIXEL_I420 = 1 , VIDEO_PIXEL_BGRA = 2 , VIDEO_PIXEL_NV21 = 3 ,
  VIDEO_PIXEL_RGBA = 4 , VIDEO_PIXEL_IMC2 = 5 , VIDEO_PIXEL_ARGB = 7 , VIDEO_PIXEL_NV12 = 8 ,
  VIDEO_PIXEL_I422 = 16 , VIDEO_TEXTURE_2D = 17 , VIDEO_TEXTURE_OES = 18
}
 

Public Member Functions

 ExternalVideoFrame ()
 

Public Attributes

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
 

Detailed Description

The external video frame.

Member Enumeration Documentation

◆ VIDEO_BUFFER_TYPE

The data type of the video frame.

Since
v3.5.0
Enumerator
VIDEO_BUFFER_RAW_DATA 

1: The data type is raw data.

VIDEO_BUFFER_PIXEL_BUFFER 

2: The data type is the pixel.

◆ VIDEO_PIXEL_FORMAT

The video pixel format.

Note
The SDK does not support the alpha channel, and discards any alpha value passed to the SDK.
Enumerator
VIDEO_PIXEL_UNKNOWN 

0: The video pixel format is unknown.

VIDEO_PIXEL_I420 

1: The video pixel format is I420.

VIDEO_PIXEL_BGRA 

2: The video pixel format is BGRA.

VIDEO_PIXEL_NV21 

3: The video pixel format is NV21.

VIDEO_PIXEL_RGBA 

4: The video pixel format is RGBA.

VIDEO_PIXEL_IMC2 

5: The video pixel format is IMC2.

VIDEO_PIXEL_ARGB 

7: The video pixel format is ARGB.

VIDEO_PIXEL_NV12 

8: The video pixel format is NV12.

VIDEO_PIXEL_I422 

16: The video pixel format is I422.

VIDEO_TEXTURE_2D 

17: The video pixel format is GL_TEXTURE_2D.

VIDEO_TEXTURE_OES 

18: The video pixel format is GL_TEXTURE_OES.

Constructor & Destructor Documentation

◆ ExternalVideoFrame()

agora::media::ExternalVideoFrame::ExternalVideoFrame ( )
inline

Member Data Documentation

◆ type

VIDEO_BUFFER_TYPE agora::media::ExternalVideoFrame::type

The buffer type. See VIDEO_BUFFER_TYPE

◆ format

VIDEO_PIXEL_FORMAT agora::media::ExternalVideoFrame::format

The pixel format. See VIDEO_PIXEL_FORMAT

◆ buffer

void* agora::media::ExternalVideoFrame::buffer

The video buffer.

◆ stride

int agora::media::ExternalVideoFrame::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

int agora::media::ExternalVideoFrame::height

Height of the incoming video frame.

◆ cropLeft

int agora::media::ExternalVideoFrame::cropLeft

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

◆ cropTop

int agora::media::ExternalVideoFrame::cropTop

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

◆ cropRight

int agora::media::ExternalVideoFrame::cropRight

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

◆ cropBottom

int agora::media::ExternalVideoFrame::cropBottom

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

◆ rotation

int agora::media::ExternalVideoFrame::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

long long agora::media::ExternalVideoFrame::timestamp

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