AgoraOutputVideoFrame
视频帧的属性设置。
__attribute__((visibility("default"))) @interface AgoraOutputVideoFrame : NSObject @property (nonatomic, assign) NSInteger type; @property (nonatomic, assign) int width; @property (nonatomic, assign) int height; @property (nonatomic, assign) int yStride; @property (nonatomic, assign) int uStride; @property (nonatomic, assign) int vStride; @property (nonatomic, assign) uint8_t* _Nullable yBuffer; @property (nonatomic, assign) uint8_t* _Nullable uBuffer; @property (nonatomic, assign) uint8_t* _Nullable vBuffer; @property (nonatomic, assign) int rotation; @property (nonatomic, assign) int64_t renderTimeMs; @property (nonatomic, assign) int avSyncType; @property(assign, nonatomic) CVPixelBufferRef _Nullable pixelBuffer; @end
缓冲区给出的是指向指针的指针,该接口不能修改缓冲区的指针,只能修改缓冲区的内容。
属性
- type
- 传入的视频帧的格式,必须指定为下面的某一个值:
- 1: I420。
- 2: BGRA。
- 3: NV21。
- 4: RGBA。
- 5: IMC2。
- 7: ARGB。
- 8: NV12。
- 12: iOS 纹理 (CVPixelBufferRef)。
- 16: I422。
- width
- 视频像素宽度。
- height
- 视频像素高度。
- yStride
- 对 YUV 数据,表示 Y 缓冲区的行跨度;对 RGBA 数据,表示总的数据长度。
- uStride
- 对 YUV 数据,表示 U 缓冲区的行跨度;对 RGBA 数据,值为 0。
- vStride
- 对 YUV 数据,表示 V 缓冲区的行跨度;对 RGBA 数据,值为 0。
- yBuffer
- 对 YUV 数据,表示 Y 缓冲区的指针;对 RGBA 数据,表示数据缓冲区。
- uBuffer
- 对 YUV 数据,表示 U 缓冲区的指针;对 RGBA 数据,值为空。
- vBuffer
- 对 YUV 数据,表示 V 缓冲区的指针;对 RGBA 数据,值为空。
- rotation
- 在渲染视频前设置该帧的顺时针旋转角度,目前支持 0 度、90 度、180 度,和 270 度。
- renderTimeMs
- 视频帧被渲染时的 Unix 时间戳(毫秒)。该时间戳可用于指导渲染视频帧。该参数为必填。
- avsync_type
- 保留参数。
- pixelBuffer
- 将数据填充到 CVPixelBuffer。