Agora RTC Objective-C API Reference Refactor

Instance Methods | Properties
AgoraVideoFrame Class Reference

Inherits <NSObject>.

## Instance Methods
(void) | - fillAlphaData

## Properties
NSInteger | format
CMTime | time
int | stride
int | strideInPixels
int | height
CVPixelBufferRef _Nullable | textureBuf
IMAGE_CLASS *_Nullable | image
NSData *_Nullable | dataBuf
NSData *_Nullable | alphaBuf
AgoraAlphaStitchMode | alphaStitchMode
int | cropLeft
int | cropTop
int | cropRight
int | cropBottom
int | rotation
AgoraColorSpace *_Nullable | colorSpace

## Detailed Description

Properties of the AgoraVideoFrame object.

## Method Documentation

## ◆ fillAlphaData

- (void) fillAlphaData |  |  |

If data format is BGRA or RGBA and alphaBuf is nill, it is required to call fillAlphaData to fill alphaBuf.

## Property Documentation

## ◆ format

- (NSInteger) format
| read write nonatomic assign

Video format:

- 1: I420
- 2: BGRA
- 3: NV21
- 4: RGBA
- 5: IMC2
- 7: ARGB
- 8: NV12
- 12: iOS texture (CVPixelBufferRef)
- 13: Still Image (UIImage for iPhone, NSImage for Mac)

## ◆ time

- (CMTime) time
| read write nonatomic assign

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

## ◆ stride

- (int) stride
| read write nonatomic assign

Deprecated:
  Use strideInPixels instead.

## ◆ strideInPixels

- (int) strideInPixels
| read write nonatomic assign

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

Height of the incoming video frame.

## ◆ textureBuf

- (CVPixelBufferRef _Nullable) textureBuf
| read write nonatomic assign

CVPixelBuffer

## ◆ image

- (IMAGE_CLASS* _Nullable) image
| read write nonatomic strong

Still Image (UIImage for iPhone, NSImage for Mac)

## ◆ dataBuf

- (NSData* _Nullable) dataBuf
| read write nonatomic strong

Raw data buffer.

## ◆ alphaBuf

- (NSData* _Nullable) alphaBuf
| read write nonatomic strong

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 nill.

## ◆ alphaStitchMode

- (AgoraAlphaStitchMode) alphaStitchMode
| read write nonatomic assign

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.

## ◆ cropLeft

- (int) cropLeft
| read write nonatomic assign

(Optional) Specifies the number of pixels trimmed from the left, which is set as 0 by default.

## ◆ cropTop

- (int) cropTop
| read write nonatomic assign

(Optional) Specifies the number of pixels trimmed from the top, which is set as 0 by default.

## ◆ cropRight

- (int) cropRight
| read write nonatomic assign

(Optional) Specifies the number of pixels trimmed from the right, which is set as 0 by default.

## ◆ cropBottom

- (int) cropBottom
| read write nonatomic assign

(Optional) Specifies the number of pixels trimmed from the bottom, which is set as 0 by default.

## ◆ rotation

- (int) rotation
| read write nonatomic assign

(Optional) Specifies whether to rotate the incoming video group. Optional values: 0, 90, 180, or 270 clockwise. Set as 0 by default.

## ◆ colorSpace

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

Specifies the color space.