AgoraVideoFrame
外部视频帧。
Objective-C
__attribute__((visibility("default"))) @interface AgoraVideoFrame : NSObject
@property(assign, nonatomic) NSInteger format;
@property(assign, nonatomic) CMTime time;
@property(assign, nonatomic) int stride DEPRECATED_MSG_ATTRIBUTE("use strideInPixels instead");
@property(assign, nonatomic) int strideInPixels;
@property(assign, nonatomic) int height;
@property(assign, nonatomic) CVPixelBufferRef _Nullable textureBuf;
@property(strong, nonatomic) NSData *_Nullable dataBuf;
@property(assign, nonatomic) int cropLeft;
@property(assign, nonatomic) int cropTop;
@property(assign, nonatomic) int cropRight;
@property(assign, nonatomic) int cropBottom;
@property(assign, nonatomic) int rotation;
@end
format
传入的视频帧的格式,必须指定为下面的某一个值:
- 1: I420。
- 2: BGRA。
- 3: NV21。
- 4: RGBA。
- 5: IMC2。
- 7: ARGB。
- 8: NV12。
- 12: iOS 纹理 (CVPixelBufferRef)。
- 16: I422。
dataBuf
原始数据缓冲区,该参数不用于 iOS 纹理。
textureBuf
iOS 纹理的 Buffer。
stride
传入视频帧的行间距,单位为像素而不是字节。对于 Texture,该值指的是 Texture 的宽度。
弃用
用 strideInPixels 代替。弃用:
用 strideInPixels 代替。
strideInPixels
该帧的行跨度,即相邻两行视频帧之间的像素点数。
注意:
- 该参数单位为像素,不是字节数。
- 如果视频为 Texture 格式,则将该参数设为 Texture 的宽度。
- 如果视频帧格式设为 12,则不使用该字段。
height
传入视频帧的高度。
eglType
该参数仅适用于 Texture 格式的视频数据。指该视频帧的 Texture ID。
cropLeft
该参数仅适用于 Texture 格式的视频数据。指 MetaData 的数据缓冲区,默认值为 NULL。
cropTop
该参数仅适用于 Texture 格式的视频数据。指 MetaData 的大小,默认值为 0。
cropRight
原始数据相关字段。指定左边裁剪掉的像素数量。默认为 0。
cropBottom
原始数据相关字段。指定顶边裁剪掉的像素数量。默认为 0。
rotation
原始数据相关字段。指定右边裁剪掉的像素数量。默认为 0。
time
原始数据相关字段。指定底边裁剪掉的像素数量。默认为 0。