ByteRTCRenderMode

typedef NS_ENUM(NSUInteger, ByteRTCRenderMode)

视频渲染模式

枚举值

类型 值 说明
ByteRTCRenderModeHidden 1 视窗填满优先。

视频帧等比缩放,直至视窗被视频填满。如果视频帧长宽比例与视窗不同,视频帧的多出部分将无法显示。

缩放完成后,视频帧的一边长和视窗的对应边长一致,另一边长大于等于视窗对应边长。
ByteRTCRenderModeFit 2 视频帧内容全部显示优先。

视频帧等比缩放,直至视频帧能够在视窗上全部显示。如果视频帧长宽比例与视窗不同,视窗上未被视频帧填满区域将被涂黑。

缩放完成后,视频帧的一边长和视窗的对应边长一致,另一边长小于等于视窗对应边长。
ByteRTCRenderModeAdaptive 3 视频帧自适应视窗
视频帧非等比缩放,直至视窗被视频填满。如果视频帧长宽比例与视窗不同,视频帧的高或宽会被拉伸。

ByteRTCUserOfflineReason

typedef NS_ENUM(NSUInteger, ByteRTCUserOfflineReason)

用户离开房间的原因。

枚举值

类型 值 说明
ByteRTCUserOfflineReasonQuit 0 远端用户调用 leaveRoom: 方法主动退出房间,或将身份切换至静默观众。
ByteRTCUserOfflineReasonDropped 1 远端用户因网络等原因掉线。

ByteRTCStreamRemoveReason

typedef NS_ENUM(NSInteger, ByteRTCStreamRemoveReason)

房间内远端流移除原因。

枚举值

类型 值 说明
ByteRTCStreamRemoveReasonUnpublish 0 远端用户停止发布流。
ByteRTCStreamRemoveReasonPublishFailed 1 远端用户发布流失败。
ByteRTCStreamRemoveReasonKeepLiveFailed 2 保活失败。
ByteRTCStreamRemoveReasonClientDisconnected 3 远端用户断网。
ByteRTCStreamRemoveReasonRepublish 4 远端用户重新发布流。
ByteRTCStreamRemoveReasonOther 5 其他原因。

ByteRTCRoomProfile

typedef NS_ENUM(NSInteger, ByteRTCRoomProfile)

房间模式

枚举值

类型 值 说明
ByteRTCRoomProfileCommunication 0 通信模式。
ByteRTCRoomProfileLiveBroadcasting 1 直播模式。
ByteRTCRoomProfileGame 2 游戏模式。SDK 会使用低延时设置。
ByteRTCRoomProfileCloudGame 3 云游戏模式。SDK 会使用低延时设置。
ByteRTCRoomProfileLowLatency 4 低时延模式。SDK 会使用低延时设置。

当你的场景非游戏或云游戏场景,又需要极低延时的体验时,可以使用该模式。

该模式下,音视频通话延时会明显降低,但同时,弱网抗性、通话音质等均会受到一定影响。

在使用此模式前,强烈建议咨询技术支持同学。

ByteRTCUserRoleType

typedef NS_ENUM(NSInteger, ByteRTCUserRoleType)

用户角色。

枚举值

类型 值 说明
ByteRTCUserRoleTypeBroadcaster 1 主播角色。该角色用户可在房间内发布和订阅音视频流,房间中的其他用户可以感知到该用户的存在。
ByteRTCUserRoleTypeSilentAudience 2 静默观众角色。该众角色用户只可在房间内订阅音视频流,房间中的其他用户无法感知到该用户的存在。

ByteRTCAudioScenarioType

typedef NS_ENUM(NSInteger, ByteRTCAudioScenarioType)

音频场景类型。
选择音频场景后,RTC 会自动根据客户端音频路由和发布订阅状态,适用通话音量/媒体音量。
你可以调用 setAudioScenario: 设置音频场景。
如果以下音频场景类型无法满足你的业务需要,请联系技术支持同学进行定制。

枚举值

类型 值 说明
ByteRTCAudioScenarioMusic 0 音乐场景。默认为此场景。

此场景适用于对音乐表现力有要求的场景,如音乐直播等。

音频路由和发布订阅状态,到音量类型的映射如下:






仅发布音视频流仅订阅音视频流发布并订阅音视频流备注
设备自带麦克风和扬声器/听筒媒体音量媒体音量通话音量/
有线耳机媒体音量媒体音量媒体音量/
蓝牙耳机媒体音量媒体音量媒体音量即使蓝牙耳机有麦克风,也只能使用设备自带麦克风进行本地音频采集。
ByteRTCAudioScenarioHighqualityCommunication 1 高质量通话场景。

此场景适用于对音乐表现力有要求,但又希望能够使用蓝牙耳机上自带的麦克风进行音频采集的场景。

此场景可以兼顾外放/使用蓝牙耳机时的音频体验,并避免使用蓝牙耳机时音量类型切换导致的听感突变。

音频路由和发布订阅状态,到音量类型的映射如下:






仅发布音视频流仅订阅音视频流发布并订阅音视频流 备注
设备自带麦克风和扬声器/听筒媒体音量媒体音量通话音量/
有线耳机媒体音量媒体音量媒体音量/
蓝牙耳机通话音量通话音量通话音量使用蓝牙耳机上自带的麦克风进行音频采集。
ByteRTCAudioScenarioCommunication 2 纯通话音量场景。

此场景下,无论客户端音频路由情况和发布订阅状态,全程使用通话音量。
适用于需要频繁上下麦的通话或会议场景。

此场景可以保持统一的音频模式,不会有音量突变的听感;
最大程度地消除回声,使通话清晰度达到最优;
使用蓝牙耳机时,能够使用蓝牙耳机上自带的麦克风进行音频采集。

但是,会压低使用媒体音量进行播放的其他音频的音量,且音质会变差。
ByteRTCAudioScenarioMedia 3 纯媒体场景。一般不建议使用。

此场景下,无论客户端音频路由情况和发布订阅状态,全程使用媒体音量。

外放通话时,极易出现回声和啸叫。

ByteRTCConnectionState

typedef NS_ENUM(NSInteger, ByteRTCConnectionState)

SDK 与信令服务器连接状态。

枚举值

类型 值 说明
ByteRTCConnectionStateDisconnected 1 连接中断。
ByteRTCConnectionStateConnecting 2 首次连接,正在连接中。
ByteRTCConnectionStateConnected 3 首次连接成功。
ByteRTCConnectionStateReconnecting 4 连接断开后重新连接中。
ByteRTCConnectionStateReconnected 5 连接断开后重连成功。
ByteRTCConnectionStateLost 6 网络连接断开超过 10 秒,仍然会继续重连。

ByteRTCNetworkType

typedef NS_ENUM(NSInteger, ByteRTCNetworkType)

SDK 网络连接类型。

枚举值

类型 值 说明
ByteRTCNetworkTypeUnknown -1 网络连接类型未知。
ByteRTCNetworkTypeDisconnected 0 网络连接已断开。
ByteRTCNetworkTypeLAN 1 网络连接类型为 LAN 。
ByteRTCNetworkTypeWIFI 2 网络连接类型为 Wi-Fi(包含热点)。
ByteRTCNetworkTypeMobile2G 3 网络连接类型为 2G 移动网络。
ByteRTCNetworkTypeMobile3G 4 网络连接类型为 3G 移动网络。
ByteRTCNetworkTypeMobile4G 5 网络连接类型为 4G 移动网络。
ByteRTCNetworkTypeMobile5G 6 网络连接类型为 5G 移动网络。

ByteRTCVideoStreamType

typedef NS_ENUM(NSInteger, ByteRTCVideoStreamType)

视频流类型 目前C++ SDK 只支持 ByteRTCVideoStreamTypeHigh 类型

枚举值

类型 值 说明
ByteRTCVideoStreamTypeHigh 0 高分辨率视频流
ByteRTCVideoStreamTypeLow 1 低分辨率视频

ByteRTCNetworkQuality

typedef NS_ENUM(NSUInteger, ByteRTCNetworkQuality)

媒体流网络质量。

枚举值

类型 值 说明
ByteRTCNetworkQualityUnknown 0 网络质量未知。
ByteRTCNetworkQualityExcellent 1 网络质量极好。
ByteRTCNetworkQualityGood 2 主观感觉和 kNetworkQualityExcellent 差不多,但码率可能略低。
ByteRTCNetworkQualityPoor 3 主观感受有瑕疵但不影响沟通。
ByteRTCNetworkQualityBad 4 勉强能沟通但不顺畅。
ByteRTCNetworkQualityVeryBad 5 网络质量非常差,基本不能沟通。

ByteRTCVideoStreamState

typedef NS_ENUM(NSInteger, ByteRTCVideoStreamState)

设置本地视频属性的返回状态。

枚举值

类型 值 说明
ByteRTCVideoStreamStateSuccess 0 设置本地视频属性成功
ByteRTCVideoStreamStateInvalid -2 本地视频属性参数不合法

ByteRTCPerformanceAlarmReason

typedef NS_ENUM(NSInteger, ByteRTCPerformanceAlarmReason)

性能回退或者恢复的原因

枚举值

类型 值 说明
ByteRTCPerformanceAlarmReasonBandwidthFallback 0 网络原因差,造成了发送性能回退。仅在开启发送性能回退时,会收到此原因。
ByteRTCPerformanceAlarmReasonBandwidthResumed 1 网络性能恢复,发送性能回退恢复。仅在开启发送性能回退时,会收到此原因。
ByteRTCPerformanceAlarmReasonFallback 2 如果未开启发送性能回退,收到此告警时,意味着性能不足;

如果开启了发送性能回退,收到此告警时,意味着性能不足,且已发生发送性能回退。
ByteRTCPerformanceAlarmReasonResumed 3 如果未开启发送性能回退,收到此告警时,意味着性能不足已恢复;

如果开启了发送性能回退,收到此告警时,意味着性能不足已恢复,且已发生发送性能回退恢复。

ByteRTCPerformanceAlarmMode

typedef NS_ENUM(NSInteger, ByteRTCPerformanceAlarmMode)

性能回退的模式

枚举值

类型 值 说明
ByteRTCPerformanceAlarmModeNormal 0 未开启发布性能回退
ByteRTCPerformanceAlarmModeSimulcast 1 已开启发布性能回退

ByteRTCVideoOutputOrientationMode

typedef NS_ENUM(NSInteger, ByteRTCVideoOutputOrientationMode)

视频输出方向模式

枚举值

类型 值 说明
ByteRTCVideoOutputOrientationModeAdaptative 0 自适应布局
ByteRTCVideoOutputOrientationModeFixedLandscape 1 横屏布局
ByteRTCVideoOutputOrientationModeFixedPortrait 2 竖屏布局

ByteRTCMirrorMode

typedef NS_ENUM(NSUInteger, ByteRTCMirrorMode)

是否开启镜像模式

枚举值

类型 值 说明
ByteRTCMirrorModeOff 0 不开启
ByteRTCMirrorModeOn 1 开启

ByteRTCVideoRotation

typedef NS_ENUM(NSInteger, ByteRTCVideoRotation)

视频旋转信息,枚举类型,定义了以 90 度为间隔的四种旋转模式。

枚举值

类型 值 说明
ByteRTCVideoRotation0 0 视频不做旋转
ByteRTCVideoRotation90 90 视频顺时针旋转 90 度
ByteRTCVideoRotation180 180 视频顺时针旋转 180 度
ByteRTCVideoRotation270 270 视频顺时针旋转 270 度

ByteRTCVideoStreamScaleMode

typedef NS_ENUM(NSInteger, ByteRTCVideoStreamScaleMode)

视频帧缩放模式

枚举值

类型 值 说明
ByteRTCVideoStreamScaleModeAuto 0 自动缩放模式,默认设置为 ByteRTCVideoStreamScaleModeFitWithCropping。
ByteRTCVideoStreamScaleModeStretch 1 对视频帧进行缩放,直至充满和视窗分辨率一致为止。这一过程不保证等比缩放。
ByteRTCVideoStreamScaleModeFitWithCropping 2 视窗填满优先。

视频帧等比缩放,直至视窗被视频填满。如果视频帧长宽比例与视窗不同,视频帧的多出部分将无法显示。

缩放完成后,视频帧的一边长和视窗的对应边长一致,另一边长大于等于视窗对应边长。
ByteRTCVideoStreamScaleModeFitWithFilling 3 视频帧内容全部显示优先。

视频帧等比缩放,直至视频帧能够在视窗上全部显示。如果视频帧长宽比例与视窗不同,视窗上未被视频帧填满区域将被涂黑。

缩放完成后,视频帧的一边长和视窗的对应边长一致,另一边长小于等于视窗对应边长。保持纵横比来缩放图像,填充短边

ByteRTCVideoCodecMode

typedef NS_ENUM(NSInteger, ByteRTCVideoCodecMode)

视频编码模式

枚举值

类型 值 说明
ByteRTCVideoCodecModeAuto 0 自动选择
ByteRTCVideoCodecModeHardware 1 硬编码
ByteRTCVideoCodecModeSoftware 2 软编码

ByteRTCVideoCodecType

typedef NS_ENUM(NSInteger, ByteRTCVideoCodecType)

视频编码类型

枚举值

类型 值 说明
ByteRTCVideoCodecTypeUnknown 0 未知类型
ByteRTCVideoCodecTypeH264 1 标准 H264 编码器
ByteRTCVideoCodecTypeByteVC1 2 标准 ByteVC1 编码器

ByteRTCVideoPictureType

typedef NS_ENUM(NSInteger, ByteRTCVideoPictureType)

编码帧类型

枚举值

类型 值 说明
ByteRTCVideoPictureTypeUnknown 0 未知类型
ByteRTCVideoPictureTypeI 1 I帧,关键帧,编解码不需要参考其他视频帧
ByteRTCVideoPictureTypeP 2 P帧,向前参考帧,编解码需要参考前一帧视频帧
ByteRTCVideoPictureTypeB 3 B帧,前后参考帧,编解码需要参考前后两帧视频帧

ByteRTCVideoEncoderPreference

typedef NS_ENUM(NSInteger, ByteRTCVideoEncoderPreference)

网络不好时的视频编码降级策略

枚举值

类型 值 说明
ByteRTCVideoEncoderPreferenceDisabled 0 不降级
ByteRTCVideoEncoderPreferenceMaintainFramerate 1 优先保证帧率,以保证视频流畅度
ByteRTCVideoEncoderPreferenceMaintainQuality 2 优先保证画质
ByteRTCVideoEncoderPreferenceBalance 3 平衡画质与帧率

ByteRTCUserMessageSendResult

typedef NS_ENUM(NSInteger, ByteRTCUserMessageSendResult)

消息发送结果。

枚举值

类型 值 说明
ByteRTCUserMessageSendResultSuccess 0 向房间内单个用户发送消息成功
ByteRTCUserMessageSendResultTimeout 1 发送超时,没有发送。
ByteRTCUserMessageSendResultBroken 2 通道断开,没有发送
ByteRTCUserMessageSendResultNoReceiver 3 找不到接收方
ByteRTCUserMessageSendResultNoRelayPath 4 获取级联路径失败
ByteRTCUserMessageSendResultNotJoin 100 消息发送方没有加入房间
ByteRTCUserMessageSendResultInit 101 连接未完成初始化
ByteRTCUserMessageSendResultNoConnection 102 没有可用的数据传输通道连接
ByteRTCUserMessageSendResultExceedMaxLength 103 消息超过最大长度,当前为64KB
ByteRTCUserMessageSendResultEmptyUser 104 接收消息的单个用户 id 为空
ByteRTCUserMessageSendResultUnknown 1000 失败,未知错误。

ByteRTCRoomMessageSendResult

typedef NS_ENUM(NSInteger, ByteRTCRoomMessageSendResult)

广播消息发送结果。

枚举值

类型 值 说明
ByteRTCRoomMessageSendResultSuccess 200 向房间内所有用户发送消息成功
ByteRTCRoomMessageSendResultNotJoin 100 失败,没有加入房间。
ByteRTCRoomMessageSendResultInit 101 失败,连接未完成初始化。
ByteRTCRoomMessageSendResultNoConnection 102 失败,没有可用的连接。
ByteRTCRoomMessageSendResultExceedMaxLength 103 消息超过最大长度,当前为64KB
ByteRTCRoomMessageSendResultUnknown 1000 失败,未知错误。

ByteRTCPublishFallbackOption

typedef NS_ENUM(NSUInteger, ByteRTCPublishFallbackOption)

本地发布的音视频流回退选项

枚举值

类型 值 说明
ByteRTCPublishFallbackOptionDisabled 0 关闭发送视频流时的性能回退功能,默认值
ByteRTCPublishFallbackOptionSimulcast 1 开启在网络情况不佳或设备性能不足时只发送小流的功能

ByteRTCSubscribeMode

typedef NS_ENUM(NSUInteger, ByteRTCSubscribeMode)

订阅模式选项。业务方在加入房间前,调用 enableAutoSubscribe:videoMode: 接口设置订阅模式。

枚举值

类型 值 说明
ByteRTCSubscribeModeAuto 0 自动订阅模式。SDK 会自动为你订阅房间中的每一路流。
ByteRTCSubscribeModeManual 1 手动订阅模式。SDK 不自动订阅房间内的音视频流。你应根据需要调用 subscribeStream:subscribeConfig: 方法手动订阅其他用户发布的音视频流。

ByteRTCSubscribeFallbackOption

typedef NS_ENUM(NSUInteger, ByteRTCSubscribeFallbackOption)

订阅回退选项

枚举值

类型 值 说明
ByteRTCSubscribeFallbackOptionDisabled 0 下行网络较弱时,关闭订阅音视频流时的性能回退功能,默认值
ByteRTCSubscribeFallbackOptionVideoStreamLow 1 下行网络较弱时只接收视频小流
ByteRTCSubscribeFallbackOptionAudioOnly 2 下行网络较弱时,先尝试只接收视频小流;如果网络环境无法显示视频,则再回退到只接收远端订阅的音频流

ByteRTCRemoteUserPriority

typedef NS_ENUM(NSUInteger, ByteRTCRemoteUserPriority)

远端用户优先级。在性能不足需要回退时,会先回退优先级低的用户的音视频流

枚举值

类型 值 说明
ByteRTCRemoteUserPriorityLow 0 用户优先级为低,默认值
ByteRTCRemoteUserPriorityMedium 100 用户优先级为正常
ByteRTCRemoteUserPriorityHigh 200 用户优先级为高

ByteRTCFallbackOrRecoverReason

typedef NS_ENUM(NSInteger, ByteRTCFallbackOrRecoverReason)

本地用户订阅的远端流触发回退策略的原因。

枚举值

类型 值 说明
ByteRTCFallbackOrRecoverReasonUnknown -1 其他原因,非带宽和性能原因引起的回退或恢复。默认值
ByteRTCFallbackOrRecoverReasonSubscribeFallbackByBandwidth 0 由带宽不足导致的订阅端音视频流回退。
ByteRTCFallbackOrRecoverReasonSubscribeFallbackByPerformance 1 由性能不足导致的订阅端音视频流回退。
ByteRTCFallbackOrRecoverReasonSubscribeRecoverByBandwidth 2 由带宽恢复导致的订阅端音视频流恢复。
ByteRTCFallbackOrRecoverReasonSubscribeRecoverByPerformance 3 由性能恢复导致的订阅端音视频流恢复。
ByteRTCFallbackOrRecoverReasonPublishFallbackByBandwidth 4 由带宽不足导致的发布端音视频流回退。
ByteRTCFallbackOrRecoverReasonPublishFallbackByPerformance 5 由性能不足导致的发布端音视频流回退。
ByteRTCFallbackOrRecoverReasonPublishRecoverByBandwidth 6 由带宽恢复导致的发布端音视频流恢复。
ByteRTCFallbackOrRecoverReasonPublishRecoverByPerformance 7 由性能恢复导致的发布端音视频流恢复。

ByteRTCLocalAudioStreamState

typedef NS_ENUM(NSInteger, ByteRTCLocalAudioStreamState)

本地音频流状态。
SDK 通过 rtcEngine:onLocalAudioStateChanged:error: 回调该状态。

枚举值

类型 值 说明
ByteRTCLocalAudioStreamStateStopped 0 本地音频默认初始状态。
麦克风停止工作时回调该状态,对应错误码 ByteRTCLocalAudioStreamError.ByteRTCLocalAudioStreamErrorOkByteRTCLocalAudioStreamError
ByteRTCLocalAudioStreamStateRecording 1 本地音频录制设备启动成功。
采集到音频首帧时回调该状态,对应错误码 ByteRTCLocalAudioStreamError.ByteRTCLocalAudioStreamErrorOk
ByteRTCLocalAudioStreamStateEncoding 2 本地音频首帧编码成功。
音频首帧编码成功时回调该状态,对应错误码 ByteRTCLocalAudioStreamError.ByteRTCLocalAudioStreamErrorOkByteRTCLocalAudioStreamError
ByteRTCLocalAudioStreamStateFailed 3 本地音频启动失败,在以下时机回调该状态:

+ 本地录音设备启动失败,对应错误码 ByteRTCLocalAudioStreamError 中的 ByteRTCLocalAudioStreamErrorRecordFailure

+ 检测到没有录音设备权限,对应错误码 ByteRTCLocalAudioStreamError 中的 ByteRTCLocalAudioStreamErrorDeviceNoPermission

+ 音频编码失败,对应错误码 ByteRTCLocalAudioStreamError 中的 ByteRTCLocalAudioStreamError

ByteRTCLocalAudioStreamError

typedef NS_ENUM(NSInteger, ByteRTCLocalAudioStreamError)

本地音频流状态改变时的错误码。 SDK 通过 rtcEngine:onLocalAudioStateChanged:error: 回调该错误码。

枚举值

类型 值 说明
ByteRTCLocalAudioStreamErrorOk 0 本地音频状态正常
ByteRTCLocalAudioStreamErrorFailure 1 本地音频出错原因未知
ByteRTCLocalAudioStreamErrorDeviceNoPermission 2 没有权限启动本地音频录制设备
ByteRTCLocalAudioStreamErrorRecordFailure 4 本地音频录制失败,建议你检查录制设备是否正常工作
ByteRTCLocalAudioStreamErrorEncodeFailure 5 本地音频编码失败
ByteRTCLocalAudioStreamErrorNoRecordingDevice 6 没有可用的音频录制设备

ByteRTCLocalVideoStreamState

typedef NS_ENUM(NSInteger, ByteRTCLocalVideoStreamState)

本地视频流状态

枚举值

类型 值 说明
ByteRTCLocalVideoStreamStateStopped 0 本地视频默认初始状态
摄像头停止工作时回调该状态,对应错误码 ByteRTCLocalVideoStreamErrorOk
ByteRTCLocalVideoStreamStateRecording 1 本地视频录制设备启动成功
采集到视频首帧时回调该状态,对应错误码 ByteRTCLocalVideoStreamErrorOk
ByteRTCLocalVideoStreamStateEncoding 2 本地视频首帧编码成功
本地视频首帧编码成功时回调该状态,对应错误码 ByteRTCLocalVideoStreamErrorOk
ByteRTCLocalVideoStreamStateFailed 3 本地视频启动失败, 在以下时机回调该状态:

+ 本地采集设备启动失败,对应错误码 ByteRTCLocalVideoStreamError 中的 ByteRTCLocalVideoStreamErrorCaptureFailure

+ 检测到没有摄像头权限,对应错误码 ByteRTCLocalVideoStreamError 中的 ByteRTCLocalVideoStreamErrorDeviceNoPermission

+ 视频编码失败,对应错误码 ByteRTCLocalVideoStreamError 中的 ByteRTCLocalVideoStreamErrorEncodeFailure

ByteRTCLocalVideoStreamError

typedef NS_ENUM(NSInteger, ByteRTCLocalVideoStreamError)

本地视频状态改变时的错误码

枚举值

类型 值 说明
ByteRTCLocalVideoStreamErrorOk 0 本地视频状态正常(本地视频状态改变正常时默认返回值)
ByteRTCLocalVideoStreamErrorFailure 1 本地视频流发布失败
ByteRTCLocalVideoStreamErrorDeviceNoPermission 2 没有权限启动本地视频采集设备
ByteRTCLocalVideoStreamErrorDeviceBusy 3 本地视频采集设备被占用
ByteRTCLocalVideoStreamErrorDeviceNotFound 4 本地视频采集设备不存在或已移除
ByteRTCLocalVideoStreamErrorCaptureFailure 5 本地视频采集失败,建议检查采集设备是否正常工作
ByteRTCLocalVideoStreamErrorEncodeFailure 6 本地视频编码失败

ByteRTCRemoteAudioState

typedef NS_ENUM(NSInteger, ByteRTCRemoteAudioState)

用户订阅的远端音频流状态。
SDK 通过 rtcEngine:onRemoteAudioStateChanged:state:reason: 回调该状态。

枚举值

类型 值 说明
ByteRTCRemoteAudioStateStopped 0 远端音频流默认初始状态,在以下时机回调该状态:

+ 本地用户停止接收远端音频流,对应原因是 ByteRTCRemoteAudioStateChangeReason.ByteRTCRemoteAudioStateChangeReasonLocalMutedByteRTCRemoteAudioStateChangeReason

+ 远端用户停止发送音频流,对应原因是 ByteRTCRemoteAudioStateChangeReason.ByteRTCRemoteAudioStateChangeReasonRemoteMutedByteRTCRemoteAudioStateChangeReason

+ 远端用户离开房间,对应原因是 ByteRTCRemoteAudioStateChangeReason.ByteRTCRemoteAudioStateChangeReasonRemoteOfflineByteRTCRemoteAudioStateChangeReason
ByteRTCRemoteAudioStateStarting 1 开始接收远端音频流首包。

刚收到远端音频流首包时,会触发回调 rtcEngine:onRemoteAudioStateChanged:state:reason:,
对应原因是 ByteRTCRemoteAudioStateChangeReason.ByteRTCRemoteAudioStateChangeReasonLocalUnmutedByteRTCRemoteAudioStateChangeReason。
ByteRTCRemoteAudioStateDecoding 2 远端音频流正在解码,正常播放,在以下时机回调该状态:

+ 成功解码远端音频首帧,对应原因是 ByteRTCRemoteAudioStateChangeReason.ByteRTCRemoteAudioStateChangeReasonLocalUnmutedByteRTCRemoteAudioStateChangeReason

+ 网络由阻塞恢复正常,对应原因是 ByteRTCRemoteAudioStateChangeReason.ByteRTCRemoteAudioStateChangeReasonNetworkRecoveryByteRTCRemoteAudioStateChangeReason

+ 本地用户恢复接收远端音频流,对应原因是 ByteRTCRemoteAudioStateChangeReason.ByteRTCRemoteAudioStateChangeReasonLocalUnmutedByteRTCRemoteAudioStateChangeReason

+ 远端用户恢复发送音频流,对应原因是 ByteRTCRemoteAudioStateChangeReason.ByteRTCRemoteAudioStateChangeReasonRemoteUnmutedByteRTCRemoteAudioStateChangeReason
ByteRTCRemoteAudioStateFrozen 3 远端音频流卡顿。

网络阻塞导致丢包率大于 40% 时,会触发回调 rtcEngine:onRemoteAudioStateChanged:state:reason:,
对应原因是 ByteRTCRemoteAudioStateChangeReason.ByteRTCRemoteAudioStateChangeReasonNetworkCongestionByteRTCRemoteAudioStateChangeReason

ByteRTCRemoteAudioStateChangeReason

typedef NS_ENUM(NSInteger, ByteRTCRemoteAudioStateChangeReason)

接收远端音频流状态改变的原因。
用户可以通过 rtcEngine:onRemoteAudioStateChanged:state:reason: 了解该状态。

枚举值

类型 值 说明
ByteRTCRemoteAudioStateChangeReasonInternal 0 内部原因
ByteRTCRemoteAudioStateChangeReasonNetworkCongestion 1 网络阻塞
ByteRTCRemoteAudioStateChangeReasonNetworkRecovery 2 网络恢复正常
ByteRTCRemoteAudioStateChangeReasonLocalMuted 3 本地用户停止接收远端音频流
ByteRTCRemoteAudioStateChangeReasonLocalUnmuted 4 本地用户恢复接收远端音频流
ByteRTCRemoteAudioStateChangeReasonRemoteMuted 5 远端用户停止发送音频流
ByteRTCRemoteAudioStateChangeReasonRemoteUnmuted 6 远端用户恢复发送音频流
ByteRTCRemoteAudioStateChangeReasonRemoteOffline 7 远端用户离开房间

ByteRTCRemoteVideoState

typedef NS_ENUM(NSInteger, ByteRTCRemoteVideoState)

远端视频流状态

枚举值

类型 值 说明
ByteRTCRemoteVideoStateStopped 0 远端视频流默认初始状态, 在以下时机回调该状态:

+ 本地用户停止接收远端视频流,对应错误码 ByteRTCRemoteVideoStateChangeReason 中的 ByteRTCRemoteVideoStateChangeReasonLocalMuted

+ 远端用户停止发送视频流,对应错误码 ByteRTCRemoteVideoStateChangeReason 中的 ByteRTCRemoteVideoStateChangeReasonRemoteMuted

+ 远端用户离开房间,对应错误码 ByteRTCRemoteVideoStateChangeReason 中的 ByteRTCRemoteVideoStateChangeReasonRemoteOffline
ByteRTCRemoteVideoStateStarting 1 本地用户已接收远端视频首包

收到远端视频首包时回调该状态,对应错误码 ByteRTCRemoteVideoStateChangeReason 中的 ByteRTCRemoteVideoStateChangeReasonLocalUnmuted
ByteRTCRemoteVideoStateDecoding 2 远端视频流正在解码,正常播放, 在以下时机回调该状态:

+ 成功解码远端视频首帧,对应错误码 ByteRTCRemoteVideoStateChangeReason 中的 ByteRTCRemoteVideoStateChangeReasonLocalUnmuted

+ 网络由阻塞恢复正常,对应错误码 ByteRTCRemoteVideoStateChangeReason 中的 ByteRTCRemoteVideoStateChangeReasonNetworkRecovery

+ 本地用户恢复接收远端视频流,对应错误码 ByteRTCRemoteVideoStateChangeReason 中的 ByteRTCRemoteVideoStateChangeReasonLocalUnmuted

+ 远端用户恢复发送视频流,对应错误码 ByteRTCRemoteVideoStateChangeReason 中的 ByteRTCRemoteVideoStateChangeReasonRemoteUnmuted
ByteRTCRemoteVideoStateFrozen 3 远端视频流卡顿

网络阻塞、丢包率等原因造成视频卡顿流时会回报该状态,对应错误码 ByteRTCRemoteVideoStateChangeReason 中的 ByteRTCRemoteVideoStateChangeReasonNetworkCongestion
ByteRTCRemoteVideoStateFailed 4 远端音频流播放失败

ByteRTCRemoteVideoStateChangeReason

typedef NS_ENUM(NSInteger, ByteRTCRemoteVideoStateChangeReason)

远端视频流状态改变的原因

枚举值

类型 值 说明
ByteRTCRemoteVideoStateChangeReasonInternal 0 内部原因
ByteRTCRemoteVideoStateChangeReasonNetworkCongestion 1 网络阻塞
ByteRTCRemoteVideoStateChangeReasonNetworkRecovery 2 网络恢复正常
ByteRTCRemoteVideoStateChangeReasonLocalMuted 3 本地用户停止接收远端视频流或本地用户禁用视频模块
ByteRTCRemoteVideoStateChangeReasonLocalUnmuted 4 本地用户恢复接收远端视频流或本地用户启用视频模块
ByteRTCRemoteVideoStateChangeReasonRemoteMuted 5 远端用户停止发送视频流或远端用户禁用视频模块
ByteRTCRemoteVideoStateChangeReasonRemoteUnmuted 6 远端用户恢复发送视频流或远端用户启用视频模块
ByteRTCRemoteVideoStateChangeReasonRemoteOffline 7 远端用户离开频道

ByteRTCMediaDeviceType

typedef NS_ENUM(NSInteger, ByteRTCMediaDeviceType)

当前媒体设备类型

枚举值

类型 值 说明
ByteRTCMediaDeviceTypeAudioRenderDevice 0 音频渲染设备类型
ByteRTCMediaDeviceTypeAudioCaptureDevice 1 音频采集设备类型
ByteRTCMediaDeviceTypeVideoCaptureDevice 3 视频采集设备类型

ByteRTCMediaDeviceState

typedef NS_ENUM(NSInteger, ByteRTCMediaDeviceState)

设备状态

枚举值

类型 值 说明
ByteRTCMediaDeviceStateStarted 1 设备已开启
ByteRTCMediaDeviceStateStopped 2 设备已停止
ByteRTCMediaDeviceStateRuntimeError 3 设备运行时错误
ByteRTCMediaDeviceStateAdded 10 设备已插入
ByteRTCMediaDeviceStateRemoved 11 设备被移除

ByteRTCMediaDeviceError

typedef NS_ENUM(NSInteger, ByteRTCMediaDeviceError)

媒体设备错误类型

枚举值

类型 值 说明
ByteRTCMediaDeviceErrorOK 0 媒体设备正常
ByteRTCMediaDeviceErrorDeviceNoPermission 1 没有权限启动媒体设备
ByteRTCMediaDeviceErrorDeviceBusy 2 媒体设备已经在使用中
ByteRTCMediaDeviceErrorDeviceFailure 3 媒体设备错误
ByteRTCMediaDeviceErrorDeviceNotFound 4 未找到指定的媒体设备
ByteRTCMediaDeviceErrorDeviceDisconnected 5 媒体设备被移除

ByteRTCProblemFeedbackOption

typedef NS_OPTIONS(NSUInteger, ByteRTCProblemFeedbackOption)

音视频质量反馈问题类型

枚举值

类型 值 说明
ByteRTCProblemFeedbackOptionNone 0 没有问题
ByteRTCProblemFeedbackOptionOtherMessage (1 << 0) 其他问题
ByteRTCProblemFeedbackOptionAudioNotClear (1 << 1) 声音不清晰
ByteRTCProblemFeedbackOptionVideoNotClear (1 << 2) 视频不清晰
ByteRTCProblemFeedbackOptionNotSync (1 << 3) 音视频不同步
ByteRTCProblemFeedbackOptionAudioLagging (1 << 4) 音频卡顿
ByteRTCProblemFeedbackOptionVideoLagging (1 << 5) 视频卡顿
ByteRTCProblemFeedbackOptionConnectionFailed (1 << 6) 无法连接
ByteRTCProblemFeedbackOptionAudioDelay (1 << 7) 音频延迟
ByteRTCProblemFeedbackOptionVideoDelay (1 << 8) 视频延迟
ByteRTCProblemFeedbackOptionDisconnected (1 << 9) 连接断开
ByteRTCProblemFeedbackOptionNoAudio (1 << 10) 无声音
ByteRTCProblemFeedbackOptionNoVideo (1 << 11) 无画面
ByteRTCProblemFeedbackOptionAudioStrength (1 << 12) 声音过大或过小
ByteRTCProblemFeedbackOptionEcho (1 << 13) 回声噪音

ByteRTCBackgroundMode

typedef NS_ENUM(NSUInteger, ByteRTCBackgroundMode)

背景模式设置。

枚举值

类型 值 说明
ByteRTCBackgroundModeNone 0 无
ByteRTCBackgroundModeBlur 1 虚化
ByteRTCBackgroundModeA 2 背景 1
ByteRTCBackgroundModeB 3 背景 2

ByteRTCDivideModel

typedef NS_ENUM(NSUInteger, ByteRTCDivideModel)

分割模型设置。

枚举值

类型 值 说明
ByteRTCDivideModelDefault 0 自研
ByteRTCDivideModelEffect 1 effect

ByteRTCFirstFrameSendState

typedef NS_ENUM(NSUInteger, ByteRTCFirstFrameSendState)

首帧发送状态

枚举值

类型 值 说明
ByteRTCFirstFrameSendStateSending 0 发送中
ByteRTCFirstFrameSendStateSent 1 发送成功
ByteRTCFirstFrameSendStateEnd 2 发送失败

ByteRTCFirstFramePlayState

typedef NS_ENUM(NSUInteger, ByteRTCFirstFramePlayState)

首帧播放状态

枚举值

类型 值 说明
ByteRTCFirstFramePlayStatePlaying 0
ByteRTCFirstFramePlayStatePlay 1
ByteRTCFirstFramePlayStateEnd 2

ByteRTCEncryptType

typedef NS_OPTIONS(NSUInteger, ByteRTCEncryptType)

自定义加密类型

枚举值

类型 值 说明
ByteRTCEncryptTypeCustomize 0 不使用内置加密。默认值。
ByteRTCEncryptTypeAES128CBC 1 AES-128-CBC 加密算法
ByteRTCEncryptTypeAES256CBC 2 AES-256-CBC 加密算法
ByteRTCEncryptTypeAES128ECB 3 AES-128-ECB 加密算法
ByteRTCEncryptTypeAES256ECB 4 AES-256-ECB 加密算法

ByteRTCDataFrameType

typedef NS_ENUM(NSUInteger, ByteRTCDataFrameType)

数据类型

枚举值

类型 值 说明
ByteRTCDataFrameTypeSei 0 SEI 数据
ByteRTCDataFrameTypeRoi 1 人脸识别数据
ByteRTCDataFrameTypeOther 2 其他数据帧类型

ByteRTCVideoCanvas

@interface ByteRTCVideoCanvas : NSObject

画布信息和渲染模式。

成员变量

类型 名称
UIView* view
ByteRTCRenderMode renderMode
NSString* roomId
NSString* uid

变量说明

view

@property (strong, nonatomic) UIView* _Nullable view;

本地视图句柄

renderMode

@property (assign, nonatomic) ByteRTCRenderMode renderMode;

渲染模式,参看 ByteRTCRenderMode

roomId

@property (strong, nonatomic) NSString* _Nullable roomId;

视图所在的房间 ID

uid

@property (strong, nonatomic) NSString* _Nullable uid;

视图对应的用户 ID

ByteRTCFrameExtendedData

@interface ByteRTCFrameExtendedData : NSObject

视频帧附加的数据,视频解码后获得的附加数据

成员变量

类型 名称
ByteRTCDataFrameType frameType
NSData* extendedData
NSInteger extendedDataLen

变量说明

frameType

@property (assign, nonatomic) ByteRTCDataFrameType frameType;

数据类型,详见 ByteRTCDataFrameType。

extendedData

@property (strong, nonatomic) NSData * _Nullable extendedData;

附加数据

extendedDataLen

@property (assign, nonatomic) NSInteger extendedDataLen;

附加数据长度

ByteRTCVideoSolution

@interface ByteRTCVideoSolution: NSObject

视频参数

成员变量

类型 名称
CGSize videoSize
NSInteger frameRate
NSInteger maxKbps
ByteRTCVideoStreamScaleMode mode
ByteRTCVideoEncoderPreference encoderPreference

变量说明

videoSize

@property (nonatomic, assign) CGSize videoSize;

视频分辨率

frameRate

@property (nonatomic, assign) NSInteger frameRate;

视频预设帧率

maxKbps

@property (nonatomic, assign) NSInteger maxKbps;

最高编码码率(千比特每秒)
建议使用预估值。

mode

@property (nonatomic, assign) ByteRTCVideoStreamScaleMode mode;

视频帧缩放模式。你可以设置缩放以适应视窗,参见 ByteRTCVideoStreamScaleMode

encoderPreference

@property (nonatomic, assign) ByteRTCVideoEncoderPreference encoderPreference;

视频编码质量策略,参见 ByteRTCVideoEncoderPreference

ByteRTCStream

@protocol ByteRTCStream <NSObject>

流属性。

成员变量

类型 名称
NSString* userId
BOOL isScreen
BOOL hasVideo
BOOL hasAudio
NSArray* videoStreamDescriptions

变量说明

userId

@property (nonatomic, copy, readonly) NSString * userId;

发布此流的用户 ID 。

isScreen

@property (nonatomic, assign, readonly) BOOL isScreen;

此流是否为共享屏幕流。

hasVideo

@property (nonatomic, assign, readonly) BOOL hasVideo;

此流是否包括视频流。

hasAudio

@property (nonatomic, assign, readonly) BOOL hasAudio;

流是否包括音频流。

videoStreamDescriptions

@property (nonatomic, copy, readonly) NSArray<ByteRTCVideoSolution *> * videoStreamDescriptions;

视频流的分辨率信息。
当远端用户调用 setVideoEncoderConfig: 方法发布多个配置的视频流时,此处会包含该用户发布的所有视频流的属性信息。
参看 ByteRTCVideoSolution。

ByteRTCSubscribeConfig

@interface ByteRTCSubscribeConfig: NSObject

订阅流的参数配置。用户手动订阅一路音视频流所使用的订阅配置参数。
用户关闭自动订阅功能,使用手动订阅模式时,通过调用 subscribeStream:subscribeConfig: 方法订阅音视频流,调用时传入的参数即为此数据类型。

成员变量

类型 名称
BOOL isScreen
BOOL subscribeVideo
BOOL subscribeAudio
NSInteger videoIndex

变量说明

isScreen

@property (nonatomic, assign) BOOL isScreen;

是否是屏幕流。
用户通过设置此参数,订阅该远端用户发布的屏幕共享流或非屏幕共享流。 YES 为订阅屏幕共享流,NO 为订阅非屏幕共享流,默认值为 YES 。

subscribeVideo

@property (nonatomic, assign) BOOL subscribeVideo;

是否订阅视频。
用户通过设置此参数,选择是否订阅远端流中的视频。 YES 为订阅视频,NO 为不订阅视频,默认值为 YES 。

subscribeAudio

@property (nonatomic, assign) BOOL subscribeAudio;

是否订阅音频。
用户通过设置此参数,选择是否订阅远端流中的音频。YES 为订阅音频,NO 为不订阅音频,默认值为 YES 。

videoIndex

@property (nonatomic, assign) NSInteger videoIndex;

订阅的视频流分辨率下标。
用户可以通过调用 setVideoProfilessetVideoProfiles: 方法在一路流中发布多个不同分辨率的视频。因此订阅流时,需要指定订阅的具体分辨率。此参数即用于指定需订阅的分辨率的下标,默认值为 0 。

ByteRTCVideoFrameType

typedef NS_ENUM(NSInteger, ByteRTCVideoFrameType)

视频帧类型

枚举值

类型 值 说明
ByteRTCVideoFrameTypeRawMemory 0 视频帧类型:内存数据
ByteRTCVideoFrameTypePixelBuffer 0 视频帧类型:CVPixelBuffer

ByteRTCVideoPixelFormat

typedef NS_ENUM(NSInteger, ByteRTCVideoPixelFormat)

视频帧格式

枚举值

类型 值 说明
ByteRTCVideoPixelFormatUnknown 0 未知格式
ByteRTCVideoPixelFormatI420 1 I420
ByteRTCVideoPixelFormatBGRA 2 BGRA
ByteRTCVideoPixelFormatNV21 3 NV21
ByteRTCVideoPixelFormatRGBA 4 RGBA
ByteRTCVideoPixelFormatIMC2 5 IMC2
ByteRTCVideoPixelFormatARGB 7 ARGB
ByteRTCVideoPixelFormatNV12 8 NV12
ByteRTCVideoPixelFormatGLTexture2D 10 Opengl Texture2D纹理
ByteRTCVideoPixelFormatGLTextureOES 11 Opengl OES纹理
ByteRTCVideoPixelFormatCVPixelBuffer 12 CVPixelBuffer

ByteRTCStreamMixingType

typedef NS_ENUM(NSUInteger, ByteRTCStreamMixingType)

枚举值

类型 值 说明
StreamMixingTypeByServer 0 通过服务端转推
StreamMixingTypeByClient 1 端云一体转推

ByteRTCStreamMixingEvent

typedef NS_ENUM(NSUInteger, ByteRTCStreamMixingEvent)

枚举值

类型 值 说明
StreamMixingStart 1 合流开始
StreamMixingStartSuccess 2 合流启动成功
StreamMixingStartFailed 3 合流启动失败
StreamMixingStop 4 合流结束
StreamMixingChangeMixeType 5 服务端合流/端云一体合流
StreamMixingFirstAudioFrameByClientMixer 6 收到合流音频首帧
StreamMixingFirstVideoFrameByClientMixer 7 收到合流视频首帧
StreamMixingStopTimeOutByServer 9 停止服务端合流超时
StreamMixingUpdateTimeOut 10 更新合流超时

ByteRTCVideoFrame

@interface ByteRTCVideoFrame : NSObject

待 SDK 编码的视频数据

成员变量

类型 名称
int format
CMTime time
int strideInPixels
int width
int height
CVPixelBufferRef textureBuf
NSData* dataBuf
int cropLeft
int cropTop
int cropRight
int cropBottom
ByteRTCVideoRotation rotation
ByteRTCFrameExtendedData* extendedData

变量说明

format

@property (assign, nonatomic) int format;

视频帧格式,参考 ByteRTCVideoPixelFormat

time

@property (assign, nonatomic) CMTime time;

当前帧的时间戳信息

strideInPixels

@property (assign, nonatomic) int strideInPixels;

每一行像素占用的字节数

width

@property (assign, nonatomic) int width;

视频帧宽度

height

@property (assign, nonatomic) int height;

视频帧高度

textureBuf

@property (assign, nonatomic) CVPixelBufferRef _Nullable textureBuf;

CVPixelBufferRef 类型的数据,当 format 为 kPixelFormatCVPixelBuffer 时有效

dataBuf

@property (strong, nonatomic) NSData * _Nullable dataBuf;

视频帧内存块首地址

cropLeft

@property (assign, nonatomic) int cropLeft;

视频帧左边裁剪的尺寸(像素)

cropTop

@property (assign, nonatomic) int cropTop;

视频帧上部裁剪的尺寸(像素)

cropRight

@property (assign, nonatomic) int cropRight;

视频帧右边裁剪的尺寸(像素)

cropBottom

@property (assign, nonatomic) int cropBottom;

视频帧底部裁剪的尺寸(像素)

rotation

@property (assign, nonatomic) ByteRTCVideoRotation rotation;

视频帧旋转角度:0, 90, 180, 270

extendedData

@property (strong, nonatomic) ByteRTCFrameExtendedData * _Nullable extendedData;

视频帧附加的数据

ByteRTCEncodedVideoFrame

@interface ByteRTCEncodedVideoFrame : NSObject

视频帧信息

成员变量

类型 名称
ByteRTCVideoCodecType codecType
ByteRTCVideoPictureType pictureType
SInt64 timestampUs
SInt64 timestampPts
SInt64 timestampDts
int timebaseNum
int timebaseDen
int width
int height
ByteRTCVideoRotation rotation
NSData* data

变量说明

codecType

@property (assign, nonatomic) ByteRTCVideoCodecType codecType;

视频编码类型。参看 ByteRTCVideoCodecType

pictureType

@property (assign, nonatomic) ByteRTCVideoPictureType pictureType;

编码视频帧类型。参看 ByteRTCVideoPictureType

timestampUs

@property (assign, nonatomic) SInt64 timestampUs;

视频采集时间戳,单位:微秒

timestampPts

@property (assign, nonatomic) SInt64 timestampPts;

视频渲染时间戳,单位:微秒

timestampDts

@property (assign, nonatomic) SInt64 timestampDts;

视频解码时间戳,单位:微秒

timebaseNum

@property (assign, nonatomic) int timebaseNum;

时间基分子

timebaseDen

@property (assign, nonatomic) int timebaseDen;

时间基分母

width

@property (assign, nonatomic) int width;

视频帧宽,单位:px

height

@property (assign, nonatomic) int height;

视频帧高,单位:px

rotation

@property (nonatomic, assign) ByteRTCVideoRotation rotation;

视频帧旋转角度。参看 ByteRTCVideoRotation

data

@property (strong, nonatomic) NSData * _Nonnull data;

视频帧数据指针地址

ByteRTCVideoCompositingRegion

@interface ByteRTCVideoCompositingRegion : NSObject

单个视频流在合流中的布局信息。
开启合流转推功能后,在多路视频流合流时,你可以设置其中一路视频流在合流中的预设布局信息。

成员变量

类型 名称
NSString* uid
CGFloat x
CGFloat y
CGFloat width
CGFloat height
NSInteger zOrder
BOOL localUser
CGFloat alpha
NSInteger contentControl
ByteRTCRenderMode renderMode

变量说明

uid

@property (copy, nonatomic) NSString * _Nonnull uid;

视频流发布用户的用户 ID 。

x

@property (assign, nonatomic) CGFloat x;

视频流对应区域左上角的横坐标相对整体画面的归一化比例,取值的范围为 [0.0, 1.0)。

y

@property (assign, nonatomic) CGFloat y;

视频流对应区域左上角的纵坐标相对整体画面的归一化比例,取值的范围为 [0.0, 1.0)。

width

@property (assign, nonatomic) CGFloat width;

视频流对应区域宽度相对整体画面的归一化比例,取值的范围为 (0.0, 1.0]。

height

@property (assign, nonatomic) CGFloat height;

视频流对应区域高度相对整体画面的归一化比例,取值的范围为 (0.0, 1.0]。

zOrder

@property (assign, nonatomic) NSInteger zOrder;

用户视频布局在画布中的层级。0为底层,值越大越上层,范围为[0 - 100]。

localUser

@property (assign, nonatomic) BOOL localUser;

是否为本地用户

alpha

@property (assign, nonatomic) CGFloat alpha;

透明度。范围为[0 - 255]。

contentControl

@property (assign, nonatomic) NSInteger contentControl;

合流内容控制。默认值为 0 ,取值范围及含义如下:

renderMode

@property (assign, nonatomic) ByteRTCRenderMode renderMode;

视频显示模式。详见 ByteRTCRenderMode 数据类型。

ByteRTCVideoCompositingLayout

@interface ByteRTCVideoCompositingLayout : NSObject

视频流合流整体布局信息。
开启合流转推功能后,你可以设置参与合流的每路视频流的预设布局信息和合流背景信息等。

成员变量

类型 名称
NSString* backgroundColor
NSArray* regions
NSString* appData

变量说明

backgroundColor

@property (copy, nonatomic) NSString *_Nonnull backgroundColor;

画布的背景颜色。格式为 RGB 定义下的 Hex 值,如 #FFB6C1 表示浅粉色。默认值 #000000,表示为黑色

regions

@property (copy, nonatomic) NSArray<ByteRTCVideoCompositingRegion *> * _Nonnull regions;

用户布局信息列表。每条流的具体布局详见 ByteRTCVideoCompositingRegion 数据类型。

appData

@property (copy, nonatomic) NSString *_Nonnull appData;

透传的 App 数据。

ByteRTCTranscodingVideoConfig

@interface ByteRTCTranscodingVideoConfig : NSObject

视频转码配置参数。

成员变量

类型 名称
NSString* codec
NSInteger width
NSInteger height
NSInteger fps
NSInteger gop
NSInteger kBitRate
BOOL lowLatency

变量说明

codec

@property (copy, nonatomic) NSString * _Nonnull codec;

视频编码格式。H264 编码格式或自定义编码格式

width

@property (assign, nonatomic) NSInteger width;

合流视频宽度。单位为 px,范围为 [2, 1920],必须是偶数。默认值为 640。

height

@property (assign, nonatomic) NSInteger height;

合流视频高度。单位为 px,范围为 [2, 1080],必须是偶数。默认值为 480。

fps

@property (assign, nonatomic) NSInteger fps;

合流视频帧率信息。

gop

@property (assign, nonatomic) NSInteger gop;

视频 I 帧间隔。

kBitRate

@property (assign, nonatomic) NSInteger kBitRate;

合流视频码率,单位为 kbps 。

lowLatency

@property (assign, nonatomic) BOOL lowLatency;

是否使用低延时特性。

ByteRTCAACProfile

typedef NS_ENUM(NSInteger, ByteRTCAACProfile)

AAC 编码类型。

枚举值

类型 值 说明
ByteRTCAACProfileLC 0 LC(默认)
ByteRTCAACProfileMain 1 MAIN
ByteRTCAACProfileHEv1 2 HEv1
ByteRTCAACProfileHEv2 3 HEv2

ByteRTCTranscodingAudioConfig

@interface ByteRTCTranscodingAudioConfig : NSObject

音频转码配置参数。

成员变量

类型 名称
NSString* codec
NSInteger sampleRate
NSInteger channels
NSInteger kBitRate
ByteRTCAACProfile profile

变量说明

codec

@property (copy, nonatomic) NSString * _Nonnull codec;

音频编码格式。使用 AAC 编码格式。

sampleRate

@property (assign, nonatomic) NSInteger sampleRate;

音频采样率。单位为 kHz。可选取值:16, 32, 44.1, 48。

channels

@property (assign, nonatomic) NSInteger channels;

声道数,可取 1 或 2。

kBitRate

@property (assign, nonatomic) NSInteger kBitRate;

音频码率。单位为 kbps。可选取值:16, 32, 64。

profile

@property (assign, nonatomic) ByteRTCAACProfile profile;

AAC 等级,详见 ByteRTCAACProfile

ByteRTCLiveTranscoding

@interface ByteRTCLiveTranscoding : NSObject

合流转推配置参数。

成员变量

类型 名称
ByteRTCStreamMixingType expectedMixingType
ByteRTCVideoCompositingLayout* layout
ByteRTCTranscodingVideoConfig* video
ByteRTCTranscodingAudioConfig* audio
NSString* url

静态函数

返回 名称
instancetype defaultTranscoding

变量说明

expectedMixingType

@property (assign, nonatomic) ByteRTCStreamMixingType expectedMixingType;

合流类型,详见 ByteRTCStreamMixingType 数据类型。

layout

@property (strong, nonatomic) ByteRTCVideoCompositingLayout * _Nonnull layout;

视频流合流整体布局信息。
开启合流转推功能后,你可以设置参与合流的每路视频流的预设布局信息和合流背景信息等。详见 ByteRTCVideoCompositingLayout 数据类型。

video

@property (strong, nonatomic) ByteRTCTranscodingVideoConfig * _Nonnull video;

视频转码配置参数。详见 ByteRTCTranscodingVideoConfig 数据类型。

audio

@property (strong, nonatomic) ByteRTCTranscodingAudioConfig * _Nonnull audio;

音频转码配置参数。详见 ByteRTCTranscodingAudioConfig 数据类型。

url

@property (copy, nonatomic) NSString * _Nullable url;

推流 CDN 地址。

函数说明

defaultTranscoding

+ (instancetype _Nonnull)defaultTranscoding;

获取默认合流参数。

ByteRTCUserInfo

@interface ByteRTCUserInfo : NSObject

用户信息。

成员变量

类型 名称
NSString* userId
NSString* extraInfo

变量说明

userId

@property (copy, nonatomic) NSString *_Nonnull userId;

用户 ID,长度在 128 字节以内的非空字符串。支持以下字符集范围: 1. 26 个大写字母 A ~ Z 2. 26 个小写字母 a ~ z 3. 10 个数字 0 ~ 9 4. 下划线 "_",at 符 "@",减 号 "-"

extraInfo

@property (copy, nonatomic) NSString *_Nonnull extraInfo;

用户需要透传的额外的信息,字符长度限制为 200 字节。会在 rtcEngine:onUserJoined:elapsed: 中回调给远端用户。

ByteRTCRoomStats

@interface ByteRTCRoomStats : NSObject

房间通话统计数据,统计周期为 2s 。
用户进房成功后,SDK 会周期性地通过 rtcEngine:onRoomStats: 通知用户当前房间内的汇总统计信息。此数据结构即为回调给用户的参数类型。

成员变量

类型 名称
NSInteger duration
NSInteger txBytes
NSInteger rxBytes
NSInteger txAudioKBitrate
NSInteger rxAudioKBitrate
NSInteger txVideoKBitrate
NSInteger rxVideoKBitrate
NSInteger userCount
float rxLostrate
float txLostrate
NSInteger rtt

变量说明

duration

@property (assign, nonatomic) NSInteger duration;

用户进房开始通话后的总时长,单位为 s ,累计值

txBytes

@property (assign, nonatomic) NSInteger txBytes;

本地用户的总发送字节数 (bytes),累计值

rxBytes

@property (assign, nonatomic) NSInteger rxBytes;

本地用户的总接收字节数 (bytes),累计值

txAudioKBitrate

@property (assign, nonatomic) NSInteger txAudioKBitrate;

本地用户的音频发送码率 (kbps),瞬时值

rxAudioKBitrate

@property (assign, nonatomic) NSInteger rxAudioKBitrate;

本地用户的音频接收码率 (kbps),瞬时值

txVideoKBitrate

@property (assign, nonatomic) NSInteger txVideoKBitrate;

本地用户的视频发送码率 (kbps),瞬时值

rxVideoKBitrate

@property (assign, nonatomic) NSInteger rxVideoKBitrate;

本地用户的视频接收码率 (kbps),瞬时值

userCount

@property (assign, nonatomic) NSInteger userCount;

当前房间内的用户人数,包括本地用户自身

rxLostrate

@property (assign, nonatomic) float rxLostrate;

App 现在的下行丢包率

txLostrate

@property (assign, nonatomic) float txLostrate;

App 现在的上行丢包率

rtt

@property (assign, nonatomic) NSInteger rtt;

客户端到服务端的往返时延

ByteRTCSysStats

@interface ByteRTCSysStats : NSObject

App 使用的 cpu 和 memory 信息
信息由 SDK 周期性(2s)地通过 rtcEngine:reportSysStats: 回调事件通知给用户。

成员变量

类型 名称
unsigned cpu_cores
double cpu_app_usage
double cpu_total_usage
double memory_usage
unsigned full_memory
unsigned total_memory_usage
unsigned free_memory
double memory_ratio
double total_memory_ratio

变量说明

cpu_cores

@property (assign, nonatomic) unsigned int cpu_cores;

当前系统 cpu 核数

cpu_app_usage

@property (assign, nonatomic) double cpu_app_usage;

当前应用的 CPU 使用率,取值范围为 [0, 1]。

cpu_total_usage

@property (assign, nonatomic) double cpu_total_usage;

当前系统的 CPU 使用率,取值范围为 [0, 1]。

memory_usage

@property (assign, nonatomic) double memory_usage;

当前App的内存使用(单位 MB)

full_memory

@property (assign, nonatomic) unsigned long long full_memory;

全量内存(单位字节)

total_memory_usage

@property (assign, nonatomic) unsigned long long total_memory_usage;

系统已使用内存(单位字节)

free_memory

@property (assign, nonatomic) unsigned long long free_memory;

空闲可分配内存(单位字节)

memory_ratio

@property (assign, nonatomic) double memory_ratio;

当前应用的内存使用率(单位 %)

total_memory_ratio

@property (assign, nonatomic) double total_memory_ratio;

系统内存使用率(单位 %)

ByteRTCLocalVideoStats

@interface ByteRTCLocalVideoStats : NSObject

本地视频流统计信息,统计周期为 2s 。
本地用户发布视频流成功后,SDK 会周期性地通过 rtcEngine:onLocalStreamStats: 通知本地用户发布的视频流在此次统计周期内的发送状况。此数据结构即为回调给本地用户的参数类型。

成员变量

类型 名称
float sentKBitrate
NSInteger inputFrameRate
NSInteger sentFrameRate
NSInteger encoderOutputFrameRate
NSInteger rendererOutputFrameRate
NSInteger sentTargetKBitrate
NSInteger sentTargetFrameRate
NSInteger statsInterval
float videoLossRate
NSInteger rtt
NSInteger encodedBitrate
NSInteger encodedFrameWidth
NSInteger encodedFrameHeight
NSInteger encodedFrameCount
ByteRTCVideoCodecType codecType
BOOL isScreen

变量说明

sentKBitrate

@property (assign, nonatomic) float sentKBitrate;

发送的码率。此次统计周期内的视频发送码率,单位为 kbps 。

inputFrameRate

@property (assign, nonatomic) NSInteger inputFrameRate;

采集帧率。此次统计周期内的视频采集帧率,单位为 fps 。

sentFrameRate

@property (assign, nonatomic) NSInteger sentFrameRate;

发送帧率。此次统计周期内的视频发送帧率,单位为 fps 。

encoderOutputFrameRate

@property (assign, nonatomic) NSInteger encoderOutputFrameRate;

编码器输出帧率。当前编码器在此次统计周期内的输出帧率,单位为 fps 。

rendererOutputFrameRate

@property (assign, nonatomic) NSInteger rendererOutputFrameRate;

本地渲染帧率。此次统计周期内的本地视频渲染帧率,单位为 fps 。

sentTargetKBitrate

@property (assign, nonatomic) NSInteger sentTargetKBitrate;

目标发送码率。此次统计周期内的视频目标发送码率,单位为 kbps 。

sentTargetFrameRate

@property (assign, nonatomic) NSInteger sentTargetFrameRate;

目标发送帧率。当前编码器在此次统计周期内的目标发送帧率,单位为 fps 。

statsInterval

@property (assign, nonatomic) NSInteger statsInterval;

统计间隔,单位为 ms 。

videoLossRate

@property (assign, nonatomic) float videoLossRate;

视频丢包率。统计周期内的视频上行丢包率,取值范围为 [0, 1] 。

rtt

@property (assign, nonatomic) NSInteger rtt;

往返时延。单位为 ms 。

encodedBitrate

@property(assign, nonatomic) NSInteger encodedBitrate;

视频编码码率。此次统计周期内的视频编码码率,单位为 kbps 。

encodedFrameWidth

@property(assign, nonatomic) NSInteger encodedFrameWidth;

视频编码宽度,单位为 px 。

encodedFrameHeight

@property(assign, nonatomic) NSInteger encodedFrameHeight;

视频编码高度,单位为 px 。

encodedFrameCount

@property(assign, nonatomic) NSInteger encodedFrameCount;

此次统计周期内发送的视频帧总数。

codecType

@property(nonatomic) ByteRTCVideoCodecType codecType;

编码类型。参看 ByteRTCVideoCodecType 类型。

isScreen

@property (assign, nonatomic) BOOL isScreen;

所属用户的媒体流是否为屏幕流。你可以知道当前统计数据来自主流还是屏幕流。

ByteRTCRemoteVideoStats

@interface ByteRTCRemoteVideoStats : NSObject

远端音频流统计信息,统计周期为 2s 。
本地用户订阅远端音频流成功后,SDK 会周期性地通过 rtcEngine:onRemoteStreamStats: 通知本地用户订阅的远端视频流在此次统计周期内的接收状况。此数据结构即为回调给本地用户的参数类型。

成员变量

类型 名称
NSInteger width
NSInteger height
float videoLossRate
float receivedKBitrate
NSInteger receivedFrameRate
NSInteger decoderOutputFrameRate
NSInteger renderOutputFrameRate
NSInteger stallCount
NSInteger stallDuration
NSInteger e2eDelay
BOOL isScreen
NSInteger statsInterval
NSInteger rtt
NSInteger frozenRate
NSInteger videoIndex

变量说明

width

@property (assign, nonatomic) NSInteger width;

远端视频宽度。

height

@property (assign, nonatomic) NSInteger height;

远端视频高度。

videoLossRate

@property (assign, nonatomic) float videoLossRate;

远端视频丢包率。统计周期内的视频下行丢包率,取值范围为 [0, 1] 。

receivedKBitrate

@property (assign, nonatomic) float receivedKBitrate;

接收码率。统计周期内的视频接收码率,单位为 kbps 。

receivedFrameRate

@property (assign, nonatomic) NSInteger receivedFrameRate;

远端视频接收帧率。

decoderOutputFrameRate

@property (assign, nonatomic) NSInteger decoderOutputFrameRate;

远端视频解码输出帧率。

renderOutputFrameRate

@property (assign, nonatomic) NSInteger renderOutputFrameRate;

远端视频渲染输出帧率。

stallCount

@property (assign, nonatomic) NSInteger stallCount;

远端视频卡顿次数。

stallDuration

@property (assign, nonatomic) NSInteger stallDuration;

远端视频卡顿时长,单位为 ms 。

e2eDelay

@property (assign, nonatomic) NSInteger e2eDelay;

用户体验级别的端到端延时。从发送端采集完成编码开始到接收端解码完成渲染开始的延时,单位为 ms 。

isScreen

@property (assign, nonatomic) BOOL isScreen;

远端视频流是否是屏幕共享流。你可以知道当前数据来自主流还是屏幕流。

statsInterval

@property (assign, nonatomic) NSInteger statsInterval;

统计间隔,此次统计周期的间隔,单位为 ms 。

rtt

@property (assign, nonatomic) NSInteger rtt;

往返时延。单位为 ms 。

frozenRate

@property(assign, nonatomic) NSInteger frozenRate;

远端用户在进房后发生视频卡顿的累计时长占视频总有效时长的百分比(%)。视频有效时长是指远端用户进房发布视频流后,除停止发送视频流和禁用视频模块之外的视频时长。

videoIndex

@property (assign, nonatomic) NSInteger videoIndex;

SDK 订阅的远端视频流的分辨率下标。

ByteRTCLocalAudioStats

@interface ByteRTCLocalAudioStats : NSObject

本地音频流统计信息,统计周期为 2s 。
本地用户发布音频流成功后,SDK 会周期性地通过 rtcEngine:onLocalStreamStats: 通知本地用户发布的音频流在此次统计周期内的发送状况。此数据结构即为回调给本地用户的参数类型。

成员变量

类型 名称
float audioLossRate
float sentKBitrate
NSInteger recordSampleRate
NSInteger statsInterval
NSInteger rtt
NSInteger numChannels
NSInteger sentSampleRate

变量说明

audioLossRate

@property (assign, nonatomic) float audioLossRate;

音频丢包率。此次统计周期内的音频上行丢包率,取值范围为 [0, 1] 。

sentKBitrate

@property (assign, nonatomic) float sentKBitrate;

发送的码率。此次统计周期内的音频发送码率,单位为 kbps 。

recordSampleRate

@property (assign, nonatomic) NSInteger recordSampleRate;

采集采样率。此次统计周期内的音频采集采样率信息,单位为 Hz 。

statsInterval

@property (assign, nonatomic) NSInteger statsInterval;

统计间隔。此次统计周期的间隔,单位为 ms 。

rtt

@property (assign, nonatomic) NSInteger rtt;

往返时延。单位为 ms 。

numChannels

@property(assign, nonatomic) NSInteger numChannels;

音频声道数。

sentSampleRate

@property(assign, nonatomic) NSInteger sentSampleRate;

音频发送采样率。此次统计周期内的音频发送采样率信息,单位为 Hz 。

ByteRTCRemoteAudioStats

@interface ByteRTCRemoteAudioStats : NSObject

远端音频流统计信息,统计周期为 2s 。
本地用户订阅远端音频流成功后,SDK 会周期性地通过 rtcEngine:onRemoteStreamStats: 通知本地用户订阅的音频流在此次统计周期内的接收状况。此数据结构即为回调给本地用户的参数类型。

成员变量

类型 名称
float audioLossRate
float receivedKBitrate
NSInteger stallCount
NSInteger stallDuration
NSInteger playoutSampleRate
NSInteger e2eDelay
NSInteger statsInterval
NSInteger rtt
NSInteger total_rtt
NSInteger quality
NSInteger jitterBufferDelay
NSInteger numChannels
NSInteger receivedSampleRate
NSInteger frozenRate
NSInteger concealedSamples
NSInteger concealmentEvent
NSInteger decSampleRate
NSInteger decDuration

变量说明

audioLossRate

@property (assign, nonatomic) float audioLossRate;

音频丢包率。统计周期内的音频下行丢包率,取值范围为 [0, 1] 。

receivedKBitrate

@property (assign, nonatomic) float receivedKBitrate;

接收码率。统计周期内的音频接收码率,单位为 kbps 。

stallCount

@property (assign, nonatomic) NSInteger stallCount;

音频卡顿次数。统计周期内的卡顿次数。

stallDuration

@property (assign, nonatomic) NSInteger stallDuration;

音频卡顿时长。统计周期内的卡顿时长,单位为 ms 。

playoutSampleRate

@property (assign, nonatomic) NSInteger playoutSampleRate;

播放采样率。统计周期内的音频播放采样率信息,单位为 Hz 。

e2eDelay

@property (assign, nonatomic) NSInteger e2eDelay;

用户体验级别的端到端延时。从发送端采集完成编码开始到接收端解码完成渲染开始的延时,单位为 ms 。

statsInterval

@property (assign, nonatomic) NSInteger statsInterval;

统计间隔。此次统计周期的间隔,单位为 ms 。

rtt

@property (assign, nonatomic) NSInteger rtt;

客户端到服务端数据传输的往返时延,单位为 ms。

total_rtt

@property (assign, nonatomic) NSInteger total_rtt;

发送端——服务端——接收端全链路数据传输往返时延。单位为 ms 。

quality

@property(assign, nonatomic) NSInteger quality;

远端用户发送的音频流质量。值含义参考 ByteRTCNetworkQuality 。

jitterBufferDelay

@property(assign, nonatomic) NSInteger jitterBufferDelay;

因引入 jitter buffer 机制导致的延时。单位为 ms 。

numChannels

@property(assign, nonatomic) NSInteger numChannels;

音频声道数。

receivedSampleRate

@property(assign, nonatomic) NSInteger receivedSampleRate;

音频接收采样率。统计周期内接收到的远端音频采样率信息,单位为 Hz 。

frozenRate

@property(assign, nonatomic) NSInteger frozenRate;

远端用户在加入房间后发生音频卡顿的累计时长占音频总有效时长的百分比。音频有效时长是指远端用户进房发布音频流后,除停止发送音频流和禁用音频模块之外的音频时长。

concealedSamples

@property(assign, nonatomic) NSInteger concealedSamples;

音频 PLC 样点总个数。

concealmentEvent

@property(assign, nonatomic) NSInteger concealmentEvent;

PLC 累计次数。

decSampleRate

@property(assign, nonatomic) NSInteger decSampleRate;

音频解码采样率。统计周期内的音频解码采样率信息,单位为 Hz 。

decDuration

@property(assign, nonatomic) NSInteger decDuration;

解码时长。对此次统计周期内接收的远端音频流进行解码的总耗时,单位为 s 。

ByteRTCAudioVolumeInfo

@interface ByteRTCAudioVolumeInfo : NSObject

音频流来源的用户 ID, 及对应的音量。

成员变量

类型 名称
NSString* uid
NSUInteger volume

变量说明

uid

@property (copy, nonatomic) NSString * _Nonnull uid;

音频流来源的用户 ID

volume

@property (assign, nonatomic) NSUInteger volume;

音量,取值范围为:[0,255]

ByteRTCSourceWantedData

@interface ByteRTCSourceWantedData : NSObject

性能回退相关数据

成员变量

类型 名称
NSInteger width
NSInteger height
NSInteger frameRate

变量说明

width

@property (nonatomic, assign) NSInteger width;

推荐视频输入宽

height

@property (nonatomic, assign) NSInteger height;

推荐视频输入高

frameRate

@property (nonatomic, assign) NSInteger frameRate;

推荐视频输入帧率

ByteRTCRemoteStreamSwitchEvent

@interface ByteRTCRemoteStreamSwitchEvent : NSObject

流切换信息。本地用户订阅的远端流触发回退策略时的流切换信息。

成员变量

类型 名称
NSString* uid
BOOL isScreen
NSInteger beforeVideoIndex
NSInteger afterVideoIndex
BOOL beforeVideoEnabled
BOOL afterVideoEnabled
ByteRTCFallbackOrRecoverReason reason

变量说明

uid

@property (nonatomic, copy) NSString * _Nonnull uid;

订阅的音视频流的发布者的用户 ID。

isScreen

@property (nonatomic, assign) BOOL isScreen;

流是否是屏幕流

beforeVideoIndex

@property (nonatomic, assign) NSInteger beforeVideoIndex;

流切换前订阅视频流的分辨率对应的索引

afterVideoIndex

@property (nonatomic, assign) NSInteger afterVideoIndex;

流切换后订阅视频流的分辨率对应的索引

beforeVideoEnabled

@property (nonatomic, assign) BOOL beforeVideoEnabled;

流切换前是否有视频流

afterVideoEnabled

@property (nonatomic, assign) BOOL afterVideoEnabled;

流切换后是否有视频流

reason

@property (nonatomic, assign) ByteRTCFallbackOrRecoverReason reason;

流切换原因,详见 ByteRTCFallbackOrRecoverReason。

ByteRTCStreamEx

@interface ByteRTCStreamEx : NSObject <ByteRTCStream>

流信息

成员变量

类型 名称
NSString* userId
BOOL isScreen
BOOL hasVideo
BOOL hasAudio
NSArray* videoStreamDescriptions

变量说明

userId

@property (nonatomic, copy, nullable) NSString *userId;

用户ID

isScreen

@property (nonatomic, assign) BOOL isScreen;

流是否为共享屏幕流。

hasVideo

@property (nonatomic, assign) BOOL hasVideo;

该路流中是否包含视频

hasAudio

@property (nonatomic, assign) BOOL hasAudio;

该路流中是否包含音频

videoStreamDescriptions

@property (nonatomic, copy, nullable) NSArray<ByteRTCVideoSolution *> *videoStreamDescriptions;

视频流的分辨率信息,详见 ByteRTCVideoSolution 类。 用户可以通过调用 setVideoProfilessetVideoProfiles: 方法在一路流中发布多个不同的视频分辨率。此参数即为流中所有分辨率的相关信息。

ByteRTCScreenCaptureParam

@interface ByteRTCScreenCaptureParam : NSObject

屏幕采集设置参数

成员变量

类型 名称
NSInteger width
NSInteger height
NSInteger frameRate
NSInteger bitrate
BOOL captureMouseCursor

变量说明

width

@property (nonatomic, assign) NSInteger width;

屏幕采集宽度

height

@property (nonatomic, assign) NSInteger height;

屏幕采集高度

frameRate

@property (nonatomic, assign) NSInteger frameRate;

屏幕采集帧率,单位 fps

bitrate

@property (nonatomic, assign) NSInteger bitrate;

发送屏幕采集码率,单位 kbps

captureMouseCursor

@property (nonatomic, assign) BOOL captureMouseCursor;

是否采集鼠标

ByteRTCScreenParam

@interface ByteRTCScreenParam : NSObject

屏幕采集设置参数

成员变量

类型 名称
NSInteger frameRate
NSInteger bitrate

变量说明

frameRate

@property (nonatomic, assign) NSInteger frameRate;

编码帧率,单位为 fps

bitrate

@property (nonatomic, assign) NSInteger bitrate;

编码码率,小于 0 时 SDK 会根据高宽自适应码率, 单位 kbps

ByteRTCUser

@interface ByteRTCUser : NSObject

用户信息

成员变量

类型 名称
NSString* userId
NSString* metaData

变量说明

userId

@property (nonatomic, copy, nullable) NSString *userId;

用户 ID

metaData

@property (nonatomic, copy, nullable) NSString *metaData;

元信息

ByteRTCLocalStreamStats

@interface ByteRTCLocalStreamStats : NSObject

本地音/视频流统计信息以及网络状况,统计周期为 2s 。
本地用户发布音/视频流成功后,SDK 会周期性地通过 rtcEngine:onLocalStreamStats: 通知本地用户发布的音/视频流在此次统计周期内的发送状况。此数据结构即为回调给用户的参数类型。

成员变量

类型 名称
ByteRTCLocalAudioStats* audio_stats
ByteRTCLocalVideoStats* video_stats
ByteRTCNetworkQuality tx_quality
ByteRTCNetworkQuality rx_quality
BOOL is_screen

变量说明

audio_stats

@property (strong, nonatomic) ByteRTCLocalAudioStats *_Nonnull audio_stats;

本地设备发送音频流的统计信息,详见 ByteRTCLocalAudioStats

video_stats

@property (strong, nonatomic) ByteRTCLocalVideoStats *_Nonnull video_stats;

本地设备发送视频流的统计信息,详见 ByteRTCLocalVideoStats

tx_quality

@property (assign, nonatomic) ByteRTCNetworkQuality tx_quality;

所属用户的媒体流上行网络质量,详见 ByteRTCNetworkQuality

rx_quality

@property (assign, nonatomic) ByteRTCNetworkQuality rx_quality;

所属用户的媒体流下行网络质量,详见 ByteRTCNetworkQuality

is_screen

@property (nonatomic, assign) BOOL is_screen;

所属用户的媒体流是否为屏幕流。你可以知道当前统计数据来自主流还是屏幕流。

ByteRTCRemoteStreamStats

@interface ByteRTCRemoteStreamStats : NSObject

用户订阅的远端音/视频流统计信息以及网络状况,统计周期为 2s 。
订阅远端用户发布音/视频流成功后,SDK 会周期性地通过 rtcEngine:onRemoteStreamStats: 通知本地用户订阅的远端音/视频流在此次统计周期内的接收状况。此数据结构即为回调给本地用户的参数类型。

成员变量

类型 名称
NSString* uid
ByteRTCRemoteAudioStats* audio_stats
ByteRTCRemoteVideoStats* video_stats
ByteRTCNetworkQuality tx_quality
ByteRTCNetworkQuality rx_quality
BOOL is_screen

变量说明

uid

@property (copy, nonatomic) NSString *_Nonnull uid;

用户 ID 。音频来源的用户 ID 。

audio_stats

@property (strong, nonatomic) ByteRTCRemoteAudioStats *_Nonnull audio_stats;

远端音频流的统计信息,详见 ByteRTCRemoteAudioStats

video_stats

@property (strong, nonatomic) ByteRTCRemoteVideoStats *_Nonnull video_stats;

远端视频流的统计信息,详见 ByteRTCRemoteVideoStats

tx_quality

@property (assign, nonatomic) ByteRTCNetworkQuality tx_quality;

所属用户的媒体流上行网络质量,详见 ByteRTCNetworkQuality

rx_quality

@property (assign, nonatomic) ByteRTCNetworkQuality rx_quality;

所属用户的媒体流下行网络质量,详见 ByteRTCNetworkQuality

is_screen

@property (nonatomic, assign) BOOL is_screen;

所属用户的媒体流是否为屏幕流。你可以知道当前统计数据来自主流还是屏幕流。

ByteRTCMuteState

typedef NS_ENUM(NSInteger, ByteRTCMuteState)

音视频流发送/接收状态。

枚举值

类型 值 说明
ByteRTCMuteStateOff 0 启动发送/接收音视频流的状态
ByteRTCMuteStateOn 1 停止发送/接收音视频流的状态

ByteRTCStreamIndex

typedef NS_ENUM(NSInteger, ByteRTCStreamIndex)

流属性

枚举值

类型 值 说明
ByteRTCStreamIndexMain 0 主流。

包括:

+ 通过默认摄像头/麦克风采集到的视频/音频;

+ 通过自定义设备采集到的视频/音频。
ByteRTCStreamIndexScreen 1 屏幕流。

屏幕共享时共享的视频流,或来自声卡的本地播放音频流。

ByteRTCMediaInputType

typedef NS_ENUM(NSInteger, ByteRTCMediaInputType)

视频输入类型

枚举值

类型 值 说明
ByteRTCMediaInputTypeExternal 0 自定义采集。

设置完成后方可直接向 SDK 推送视频帧。
ByteRTCMediaInputTypeInternal 1 内部 SDK 采集。

此设置仅切换至内部采集,你需继续调用 startVideoCapture 开启内部采集。

ByteRTCVideoSourceType

typedef NS_ENUM(NSInteger, ByteRTCVideoSourceType)

视频源类型

枚举值

类型 值 说明
ByteRTCVideoSourceTypeExternal 0 自定义采集视频源
ByteRTCVideoSourceTypeInternal 1 SDK 内部采集视频源

ByteRTCRemoteStreamKey

@interface ByteRTCRemoteStreamKey : NSObject

用户信息

成员变量

类型 名称
NSString* userId
NSString* roomId
ByteRTCStreamIndex streamIndex

变量说明

userId

@property (nonatomic, copy, nullable) NSString *userId;

用户 ID

roomId

@property (nonatomic, copy, nullable) NSString *roomId;

房间 ID

streamIndex

@property (nonatomic, assign) ByteRTCStreamIndex streamIndex;

流属性,包括主流、屏幕流。参看 ByteRTCStreamIndex:ByteRTCStreamIndex

ByteRTCAudioSampleRate

typedef NS_ENUM(NSInteger, ByteRTCAudioSampleRate)

音频采样率,单位为 Hz。

枚举值

类型 值 说明
ByteRTCAudioSampleRate8000 8000 8000 采样率
ByteRTCAudioSampleRate16000 16000 16000 采样率
ByteRTCAudioSampleRate32000 32000 32000 采样率
ByteRTCAudioSampleRate44100 44100 44100 采样率
ByteRTCAudioSampleRate48000 48000 48000 采样率

ByteRTCAudioChannel

typedef NS_ENUM(NSInteger, ByteRTCAudioChannel)

音频声道

枚举值

类型 值 说明
ByteRTCAudioChannelMono 1 单声道
ByteRTCAudioChannelStereo 2 双声道

ByteRTCAudioPlaybackDevice

typedef NS_ENUM(NSInteger, ByteRTCAudioPlaybackDevice)

音频播放设备类型。
SDK 通过 rtcEngine:onAudioPlaybackDeviceChanged: 回调当前音频设备播放类型。

枚举值

类型 值 说明
ByteRTCAudioPlaybackDeviceSpeakerphone 1 扬声器
ByteRTCAudioPlaybackDeviceEarpiece 2 听筒
ByteRTCAudioPlaybackDeviceHeadset 3 有线耳机
ByteRTCAudioPlaybackDeviceHeadsetBluetooth 4 蓝牙耳机

ByteRTCAudioFormat

@interface ByteRTCAudioFormat : NSObject

音频参数格式

成员变量

类型 名称
ByteRTCAudioSampleRate sampleRate
ByteRTCAudioChannel channel

变量说明

sampleRate

@property (nonatomic, assign) ByteRTCAudioSampleRate sampleRate;

音频采样率,详见 ByteRTCAudioSampleRate

channel

@property (nonatomic, assign) ByteRTCAudioChannel channel;

音频声道,详见 ByteRTCAudioChannel

ByteRTCAudioFrame

@interface ByteRTCAudioFrame : NSObject

音频帧

成员变量

类型 名称
NSData* buffer
int samples
ByteRTCAudioChannel channel
ByteRTCAudioSampleRate sampleRate

变量说明

buffer

@property (strong, nonatomic) NSData * _Nonnull buffer;

音频帧数据

samples

@property (assign, nonatomic) int samples;

音频采样点个数

channel

@property (assign, nonatomic) ByteRTCAudioChannel channel;

音频声道,详见 ByteRTCAudioChannel

sampleRate

@property (assign, nonatomic) ByteRTCAudioSampleRate sampleRate;

音频采样率,详见 ByteRTCAudioSampleRate

ByteRTCVideoFrameInfo

@interface ByteRTCVideoFrameInfo : NSObject

视频帧基础信息

成员变量

类型 名称
NSInteger width
NSInteger height
ByteRTCVideoRotation rotation

变量说明

width

@property (nonatomic, assign) NSInteger width;

视频帧的宽度(像素)

height

@property (nonatomic, assign) NSInteger height;

视频帧的高度(像素)

rotation

@property (nonatomic, assign) ByteRTCVideoRotation rotation;

视频帧顺时针旋转角度。参看 ByteRTCVideoRotation。

ByteRTCCameraID

typedef NS_ENUM(NSInteger, ByteRTCCameraID)

移动端摄像头

枚举值

类型 值 说明
ByteRTCCameraIDFront 0 前置摄像头
ByteRTCCameraIDBack 1 后置摄像头