RCRTCVideoFrame Class Reference
| Inherits from | NSObject |
|---|---|
| Declared in | RCRTCVideoFrame.h |
format
视频帧格式
@property (nonatomic, readonly) RCRTCVideoFrameFormat formatDiscussion
视频帧格式
Declared In
RCRTCVideoFrame.h
width
视频宽度,单位为像素
@property (nonatomic, readonly) NSInteger widthDiscussion
视频宽度,单位为像素
Declared In
RCRTCVideoFrame.h
height
视频高度,单位为像素
@property (nonatomic, readonly) NSInteger heightDiscussion
视频高度,单位为像素
Declared In
RCRTCVideoFrame.h
pixelBuffer
储存视频 buffer 对象
@property (nonatomic, readonly, nullable) CVPixelBufferRef pixelBufferDiscussion
储存视频 buffer 对象
Declared In
RCRTCVideoFrame.h
data
视频原始数据
@property (nonatomic, readonly, nullable) NSData *dataDiscussion
视频原始数据
Declared In
RCRTCVideoFrame.h
rotation
旋转角度,0,90,180,270 顺时针
@property (nonatomic, readonly) int rotationDiscussion
旋转角度,0,90,180,270 顺时针
Declared In
RCRTCVideoFrame.h
timeStampNs
显示时间戳,单位为纳秒
@property (nonatomic, readonly) int64_t timeStampNsDiscussion
显示时间戳,单位为纳秒
Declared In
RCRTCVideoFrame.h
– initWithPixelBuffer:timeStampNs:rotation:
初始化视频帧数据
- (nullable instancetype)initWithPixelBuffer:(CVPixelBufferRef)pixelBuffer timeStampNs:(int64_t)timeStampNs rotation:(int)rotationParameters
pixelBuffer |
储存视频 buffer 对象, 只支持 NV12(420f) 或者 BGRA 格式视频 |
|---|---|
timeStampNs |
显示时间戳,单位为纳秒 |
rotation |
旋转角度,0,90,180,270 |
Return Value
视频帧数据
Declared In
RCRTCVideoFrame.h
– initWithSampleBuffer:rotation:
初始化视频帧数据
- (nullable instancetype)initWithSampleBuffer:(CMSampleBufferRef)sampleBuffer rotation:(int)rotationParameters
sampleBuffer |
储存视频 buffer 对象, 只支持 NV12(420f) 或者 BGRA 格式视频 |
|---|---|
rotation |
旋转角度,0,90,180,270 |
Return Value
视频帧数据
Discussion
初始化视频帧数据
SDK 内部会持有 sampleBuffer,所以使用者生成的 sampleBuffer 需要 CFRelease()
Declared In
RCRTCVideoFrame.h
– convertToPixelBuffer:
转码视频数据
- (void)convertToPixelBuffer:(CVPixelBufferRef)pixelBufferParameters
pixelBuffer |
转码后保存视频数据的buffer @discussion 注意: 1.需要确保传入 CVPixelBufferRef 的宽高和 RCRTCVideoFrame 的宽高一致,否则会放弃转码。 2.请传入一个 NV12 或者 BGRA 格式的 CVPixelBufferRef, 否则会放弃转码。 added from 5.1.15 |
|---|
Discussion
转码视频数据
Declared In
RCRTCVideoFrame.h