AgoraVideoFrame Class Reference

Inherits from NSObject
Declared in AgoraObjects.h

Overview

用于封装视频帧数据传递给 SDK 的类

  format

传入的视频帧的格式

@property (assign, nonatomic) NSInteger format

Discussion

必须指定为下面的某一个值:

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

Declared In

AgoraObjects.h

  time

传入的视频帧的时间戳

@property (assign, nonatomic) CMTime time

Discussion

以毫秒为单位。不正确的时间戳会导致丢帧或者音视频不同步。

Declared In

AgoraObjects.h

  strideInPixels

传入视频帧的行间距

@property (assign, nonatomic) int strideInPixels

Discussion

单位为像素而不是字节。如果视频帧格式设为 12,则不使用该字段。

Declared In

AgoraObjects.h

  height

传入视频帧的高度

@property (assign, nonatomic) int height

Discussion

单位为像素而不是字节。如果视频帧格式设为 12,则不使用该字段。

Declared In

AgoraObjects.h

  textureBuf

iOS 纹理的 Buffer

@property (assign, nonatomic) CVPixelBufferRef _Nullable textureBuf

Declared In

AgoraObjects.h

  dataBuf

裸数据格式的 Buffer

@property (strong, nonatomic) NSData *dataBuf

Discussion

如果视频帧格式设为 12,则不使用该字段。

Declared In

AgoraObjects.h

  cropLeft

视频左边裁减掉的像素数量,默认为 0

@property (assign, nonatomic) int cropLeft

Declared In

AgoraObjects.h

  cropTop

视频顶部裁减掉的像素数量,默认为 0

@property (assign, nonatomic) int cropTop

Declared In

AgoraObjects.h

  cropRight

视频右边裁减掉的像素数量,默认为 0

@property (assign, nonatomic) int cropRight

Declared In

AgoraObjects.h

  cropBottom

视频底部裁减掉的像素数量,默认为 0

@property (assign, nonatomic) int cropBottom

Declared In

AgoraObjects.h

  rotation

是否对传入的视频做顺时针旋转操作

@property (assign, nonatomic) int rotation

Discussion

可选值为 0,90,180,270。默认为 0。

Declared In

AgoraObjects.h