更新时间:2023-10-26 GMT+08:00
分享

辅流管理

startRemoteAuxiliaryStreamView

- (int)startRemoteAuxiliaryStreamView:(HWRtcVideoCanvas *)streamView streamType:(HWRtcStreamType)streamType;

功能说明

当远端开启屏幕共享,本地接收到远端屏幕共享开启并通过onUserAuxiliaryStreamAvailable回调得到消息后,设置屏幕辅流窗口视图并开始选看(发起辅流选看)。

请求参数

返回参数

  • 0:方法调用成功。
  • > 0:方法调用失败。具体请参见HWRtcErrorCode
  • 收到onUserAuxiliaryStreamAvailable消息后,获取对应的userId。
  • 多辅流场景,一个用户同时只能订阅一条辅流;当前正在订阅用户A的辅流,需要订阅另一个用户B的辅流时,需要先停止订阅用户A的辅流,再订阅用户B的辅流。

stopRemoteAuxiliaryStreamView

- (int)stopRemoteAuxiliaryStreamView:(NSString *)userid;

功能说明

停止选看辅流视图。

请求参数

userid:远端用户的唯一标识。对应onUserAuxiliaryStreamAvailable返回的共享用户标识

返回参数

  • 0:方法调用成功。
  • > 0:方法调用失败。具体请参见HWRtcErrorCode

收到onUserAuxiliaryStreamAvailable消息后,如果选看的远端屏幕辅流不可用,则必须调用stopRemoteAuxiliaryStreamView关闭。

updateRemoteAuxiliaryStreamRenderMode

- (int)updateRemoteAuxiliaryStreamRenderMode:(NSString *)userid displayMode(HWRtcVideoDisplayMode)displayMode mirrorMode:(HWRtcVideoMirrorType)mirrorMode;

功能说明

设置辅流视图显示模式。

请求参数
  • displayMode:显示模式,默认模式为HWRtcVideoDisplayModeFit,具体请参见HWRtcVideoDisplayMode
  • userid:远端用户的唯一标识。
  • mirrorMode:镜像模式,默认模式为HWRtcVideoMirrorTypeDisable,具体请参见HWRtcVideoMirrorType
返回参数
  • 0:方法调用成功。
  • > 0:方法调用失败。具体请参见HWRtcErrorCode

setRemoteAuxiliaryStreamViewRotation

- (int)setRemoteAuxiliaryStreamViewRotation:(HWRtcVideoRotation)rotation userid:(NSString *_Nonnull)userid;

功能说明

设置辅流视图角度。

请求参数
  • rotation:视图角度,默认角度为HWRtcVideoRotation0,具体请参见HWRtcVideoRotation
  • userid:远端用户的唯一标识。
返回参数
  • 0:方法调用成功。
  • > 0:方法调用失败。具体请参见HWRtcErrorCode

setAuxiliaryVideoEncoderConfig

- (int)setAuxiliaryVideoEncoderConfig:(HWRtcVideoAuxiliarEncParam *_Nonnull)encParam;

功能说明

设置辅流的编码能力。

请求参数

encParam:编码参数设置。具体参考HWRtcVideoAuxiliarEncParam

返回参数
  • 0:成功。
  • > 0:方法调用失败。具体请参见HWRtcErrorCode

setAuxiliaryVideoEncodeSmooth

- (int)setAuxiliaryVideoEncodeSmooth:(BOOL)enable;

功能说明

设置是否开启辅流的流畅度优先。

请求参数

enable:YES表示辅流分辨率为720P;NO表示辅流分辨率为1080P。

返回参数
  • 0:成功。
  • > 0:方法调用失败。具体请参见HWRtcErrorCode
  • 如果手机分辨率不超过1080p,不可以设置为NO。
  • 开启后,辅流发流分辨率为720p,否则发流分辨率为1080p。默认不开启。

pushAuxExternalVideoFrame

- (int)pushAuxExternalVideoFrame:(HWRtcVideoFrame * _Nonnull)videoFrame;

功能说明

推送辅流数据到SDK。

请求参数

videoFrame:具体参考HWRtcVideoFrame

返回参数
  • 0:方法调用成功。
  • > 0:方法调用失败。具体请参见HWRtcErrorCode
分享:

    相关文档

    相关产品