RCRTCVideoOutputStream Class Reference

Inherits from RCRTCOutputStream : RCRTCStream : NSObject
Conforms to RCRTCVideoObserverInterface
Declared in RCRTCVideoOutputStream.h

  videoConfig

本地视频配置

@property (nonatomic, copy, nullable) RCRTCVideoStreamConfig *videoConfig

Discussion

本地视频配置

Declared In

RCRTCVideoOutputStream.h

  videoSource

输出视频源

@property (nonatomic, weak, nullable) id<RCRTCVideoSourceInterface> videoSource

Discussion

输出视频源

Declared In

RCRTCVideoOutputStream.h

  videoFrameSendCallback

@property (atomic, copy, nullable) RCRTCVideoFrameCallback DEPRECATED_MSG_ATTRIBUTE ( "use RCRTCVideoOutputStream.h outputVideoStream:willEncodeVideoFrame: instead" ) videoFrameSendCallback

  videoSendBufferCallback

@property (atomic, copy, nullable) RCRTCVideoCMSampleBufferCallback DEPRECATED_MSG_ATTRIBUTE ( "use RCRTCVideoOutputStream.h outputVideoStream:willEncodeVideoFrame: instead" ) videoSendBufferCallback

  streamEventDelegate

接收到视频流事件的代理

@property (nonatomic, weak, nullable) id<RCRTCVideoOutputStreamEventDelegate> streamEventDelegate

Discussion

接收到视频流事件的代理

Declared In

RCRTCVideoOutputStream.h

– initVideoOutputStreamWithTag:

初始化视频流数据并设置标签

- (instancetype)initVideoOutputStreamWithTag:(NSString *)tag

Parameters

tag

用户自定标签,注:用户不能传特殊字符,只支持 ASCII @discussion 初始化流数据的参数

@remarks 资源管理

Return Value

流对象

Discussion

初始化视频流数据并设置标签

Declared In

RCRTCVideoOutputStream.h

– setVideoView:

设置视频流的渲染视图

- (void)setVideoView:(nullable id<RCRTCDrawer>)view

Parameters

view

渲染界面,传空则将原视图删除 @discussion 设置视频媒体数据的渲染界面

@remarks 资源管理

Discussion

设置视频流的渲染视图

Declared In

RCRTCVideoOutputStream.h

– setVideoTextureView:

设置视频媒体数据的渲染纹理界面

- (void)setVideoTextureView:(nullable RCRTCVideoTextureView *)view

Parameters

view

渲染纹理界面,传空则将原视图删除 @discussion 设置视频媒体数据的渲染纹理界面

@remarks 资源管理

Discussion

设置视频媒体数据的渲染纹理界面

Declared In

RCRTCVideoOutputStream.h

– setVideoSource:

设置视频源

- (void)setVideoSource:(nullable id<RCRTCVideoSourceInterface>)source

Parameters

source

视频源 @discussion 设置视频源,如果使用者需要自定义视频流的话,需要实现 RCRTCVideoSourceInterface 协议,视频源中通过调用 RCRTCVideoOutputStream 的 write 方法写入视频数据

@remarks 资源管理

Discussion

设置视频源

Declared In

RCRTCVideoOutputStream.h

– setWaterMark:position:

设置水印

- (BOOL)setWaterMark:(nullable UIImage *)image position:(CGRect)position

Parameters

image

水印图片,如果该参数为 nil,则移除水印

position

水印位置尺寸

Return Value

水印是否设置成功

Discussion

设置水印

Added from 5.1.15 position 范围 0 ~ 1, 左上角为原点, x:水印的坐标,取值范围为0 ~ 1的浮点数。 y:水印的坐标,取值范围为0 ~ 1的浮点数。 width:水印的宽度,取值范围为0 ~ 1的浮点数。 height:不用设置,内部会根据水印图片的宽高比自动计算一个合适的高度。

例如:当前视频的编码分辨率是 640 × 480 ,且 position 设置为(0.1,0.1,0.2,0.0) 那么水印的左上坐标点就是(480 × 0.1,640 × 0.1)即(48,64) 水印的宽度是 480 × 0.2 = 96px,水印的高度会根据水印图片的宽高比由 SDK 自动算出。

@remarks RCRTCEngine:媒体流操作

Declared In

RCRTCVideoOutputStream.h