Agora RTC Objective-C API Reference  Refactor
Properties
AgoraOutputVideoFrame Class Reference

Inherits <NSObject>.

Properties

NSInteger type
 
int width
 
int height
 
int yStride
 
int uStride
 
int vStride
 
uint8_t *_Nullable yBuffer
 
uint8_t *_Nullable uBuffer
 
uint8_t *_Nullable vBuffer
 
int rotation
 
int64_t renderTimeMs
 
int avSyncType
 
CVPixelBufferRef _Nullable pixelBuffer
 
uint8_t *_Nullable alphaBuffer
 
AgoraAlphaStitchMode alphaStitchMode
 
NSDictionary *_Nonnull metaInfo
 
AgoraColorSpace *_Nullable colorSpace
 

Detailed Description

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.

Property Documentation

◆ type

- (NSInteger) type
readwritenonatomicassign

The format of the incoming video frame. This parameter must be specified as one of the following values:

  • 1: I420
  • 2: BGRA
  • 3: NV21
  • 4: RGBA
  • 5: IMC2
  • 7: ARGB
  • 8: NV12
  • 12: iOS texture (CVPixelBufferRef)
  • 16: I422

◆ width

- (int) width
readwritenonatomicassign

The width of the video, in pixels.

◆ height

- (int) height
readwritenonatomicassign

The height of the video, in pixels.

◆ yStride

- (int) yStride
readwritenonatomicassign

For YUV data, the line span of the Y buffer; for RGBA data, the total data length.

Note
When dealing with video data, it is necessary to process the offset between each line of pixel data based on this parameter, otherwise it may result in image distortion.

◆ uStride

- (int) uStride
readwritenonatomicassign

For YUV data, the line span of the U buffer; for RGBA data, the value is 0.

Note
When dealing with video data, it is necessary to process the offset between each line of pixel data based on this parameter, otherwise it may result in image distortion.

◆ vStride

- (int) vStride
readwritenonatomicassign

For YUV data, the line span of the V buffer; for RGBA data, the value is 0.

Note
When dealing with video data, it is necessary to process the offset between each line of pixel data based on this parameter, otherwise it may result in image distortion.

◆ yBuffer

- (uint8_t* _Nullable) yBuffer
readwritenonatomicassign

For YUV data, the pointer to the Y buffer; for RGBA data, the data buffer.

◆ uBuffer

- (uint8_t* _Nullable) uBuffer
readwritenonatomicassign

For YUV data, the pointer to the U buffer; for RGBA data, the value is 0.

◆ vBuffer

- (uint8_t* _Nullable) vBuffer
readwritenonatomicassign

For YUV data, the pointer to the V buffer; for RGBA data, the value is 0.

◆ rotation

- (int) rotation
readwritenonatomicassign

The clockwise rotation of the video frame before rendering. Supported values include 0, 90, 180, and 270 degrees.

◆ renderTimeMs

- (int64_t) renderTimeMs
readwritenonatomicassign

The Unix timestamp (ms) when the video frame is rendered. This timestamp can be used to guide the rendering of the video frame. This parameter is required.

◆ avSyncType

- (int) avSyncType
readwritenonatomicassign

Reserved for future use.

◆ pixelBuffer

- (CVPixelBufferRef _Nullable) pixelBuffer
readwritenonatomicassign

Fills the data to CVPixelBuffer.

◆ alphaBuffer

- (uint8_t* _Nullable) alphaBuffer
readwritenonatomicassign

The alpha channel data output by using portrait segmentation algorithm. This data matches the size of the video frame, with each pixel value ranging from [0,255], where 0 represents the background and 255 represents the foreground (portrait). By setting this parameter, you can render the video background into various effects, such as transparent, solid color, image, video, etc.

Note
- Make sure that alphaBuf is exactly the same size as the video frame (width × height), otherwise it may cause the app to crash.

◆ alphaStitchMode

- (AgoraAlphaStitchMode) alphaStitchMode
readwritenonatomicassign

When the video frame contains alpha channel data, it represents the relative position of alphaBuffer and the video frame. See AgoraAlphaStitchMode.

◆ metaInfo

- (NSDictionary* _Nonnull) metaInfo
readwritenonatomicstrong

The meta information in the video frame. To use this parameter, contact technical support.

◆ colorSpace

- (AgoraColorSpace* _Nullable) colorSpace
readwritenonatomicstrong

By default, the color space properties of video frames will apply the Full Range and BT.709 standard configurations.