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
| read write nonatomic assign

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
| read write nonatomic assign

The width of the video, in pixels.

## ◆ height

- (int) height
| read write nonatomic assign

The height of the video, in pixels.

## ◆ yStride

- (int) yStride
| read write nonatomic assign

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
| read write nonatomic assign

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
| read write nonatomic assign

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
| read write nonatomic assign

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

## ◆ uBuffer

- (uint8_t* _Nullable) uBuffer
| read write nonatomic assign

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

## ◆ vBuffer

- (uint8_t* _Nullable) vBuffer
| read write nonatomic assign

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

## ◆ rotation

- (int) rotation
| read write nonatomic assign

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

## ◆ renderTimeMs

- (int64_t) renderTimeMs
| read write nonatomic assign

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
| read write nonatomic assign

Reserved for future use.

## ◆ pixelBuffer

- (CVPixelBufferRef _Nullable) pixelBuffer
| read write nonatomic assign

Fills the data to CVPixelBuffer.

## ◆ alphaBuffer

- (uint8_t* _Nullable) alphaBuffer
| read write nonatomic assign

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
| read write nonatomic assign

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
| read write nonatomic strong

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

## ◆ colorSpace

- (AgoraColorSpace* _Nullable) colorSpace
| read write nonatomic strong

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