ByteRtcRenderMode

typedef NS_ENUM(NSUInteger, ByteRtcRenderMode)

视频显示模式

枚举值

类型 值 说明
ByteRtc_Render_Hidden 1 视频尺寸等比缩放,优先保证窗口被填满。当视频尺寸与显示窗口尺寸不一致时,多出的视频将被截掉。
ByteRtc_Render_Fit 2 视频尺寸等比缩放,优先保证视频内容全部显示。当视频尺寸与显示窗口尺寸不一致时,会把窗口未被填满的区域填充成黑色。
ByteRtc_Render_Adaptive 3 视频尺寸非等比例缩放,把窗口充满。当视频尺寸与显示窗口尺寸不一致时,视频高或宽方向会被拉伸。

ByteRtcUserOfflineReason

typedef NS_ENUM(NSUInteger, ByteRtcUserOfflineReason)

用户离线原因。
房间内的远端用户离开房间时,本地用户会收到 rtcEngine:didOfflineOfUid:reason: 回调通知,此枚举类型为回调的用户离线原因。

枚举值

类型 值 说明
ByteRtc_UserOffline_Quit 0 用户主动离开。如远端用户调用 leaveChannel: 方法退出房间。
ByteRtc_UserOffline_Dropped 1 用户掉线。远端用户因为网络等原因掉线。

RtcStreamRemoveReason

typedef NS_ENUM(NSInteger, RtcStreamRemoveReason)

房间内远端流移除原因。
房间内远端音视频流移除时,SDK 会通过 rtcEngine:didStreamRemoved:stream:reason: 回调通知用户。此枚举类型即为通知的远端流移除的原因。

枚举值

类型 值 说明
RtcStreamRemoveUnpublish 0 远端用户停止发布流。
RtcStreamRemovePublishFailed 1 远端用户发布流失败。
RtcStreamRemoveKeepLiveFailed 2 保活失败。
RtcStreamRemoveClientDisconnected 3 远端用户断网。
RtcStreamRemoveRepublish 4 远端用户重新发布流。
RtcStreamRemoveOtherReason 5 其他原因。

ByteChannelProfile

typedef NS_ENUM(NSInteger, ByteChannelProfile)

房间模式。房间使用的场景模式。
通过设置房间模式,用户可以选择应用 SDK 针对不同房间模式场景的优化策略。设置房间模式参考 setChannelProfile: 方法。

枚举值

类型 值 说明
ByteChannelProfileCommunication 0 通信模式。通信模式下,无用户角色区分。适用于 IM 场景。
ByteChannelProfileLiveBroadcasting 1 直播模式。直播模式下,有用户角色区分(用户角色参考 ByteRtcClientRole)。适用于直播、教育大班课等场景。
ByteChannelProfileGame 2 游戏模式。游戏模式下,有用户角色区分。 SDK 会使用低延时设置。适用于游戏场景。
ByteChannelProfileCloudGame 3 云游戏模式。云游戏模式下,有用户角色区分。 SDK 会使用低延时设置。适用于云游戏场景。

ByteRtcClientRole

typedef NS_ENUM(NSInteger, ByteRtcClientRole)

用户角色。房间模式为直播、游戏、云游戏模式时的可选用户角色。
用户可通过设置用户角色控制:1.发布/取消发布音视频流;2.用户自身是否在房间中隐身。设置用户角色参考 setClientRole: 方法。

枚举值

类型 值 说明
ByteRtc_ClientRole_Broadcaster 1 主播角色。主播角色的用户既可以发布流到房间中,也可以从房间中订阅流,房间中的其他用户可以感知到该用户在房间中。
ByteRtc_ClientRole_Silent_Audience 4 静默观众角色。静默观众角色的用户只能从房间中订阅流,不能向房间中发布流,房间中的其他用户无法感知到该用户在房间中。该用户加入退出房间等行为不会通知给房间中的其他用户。

ByteRtcAudioScenarioType

typedef NS_ENUM(NSInteger, ByteRtcAudioScenarioType)

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

枚举值

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

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

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






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

此场景适用于对音乐表现力有要求的场景。
此场景可以兼顾外放/使用蓝牙耳机时的音频体验。

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






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

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

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

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

此场景下,无论客户端音频路由情况和发布订阅状态,全程使用媒体音量。
外放通话时,极易出现回声和啸叫。

ByteRtcConnectionState

typedef NS_ENUM(NSInteger, ByteRtcConnectionState)

SDK 与 RTC 服务器连接状态。

枚举值

类型 值 说明
ByteRtc_ConnectionState_Disconnected 1 连接断开。
ByteRtc_ConnectionState_Connecting 2 首次连接,正在连接中。
ByteRtc_ConnectionState_Connected 3 首次连接成功。
ByteRtc_ConnectionState_Reconnecting 4 连接断开后,重新连接中。
ByteRtc_ConnectionState_Reconnected 5 连接断开后,重连成功。
ByteRtc_ConnectionState_Lost 6 网络连接断开超过 10 秒。SDK 仍然会继续尝试重连。

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 只支持 ByteRtc_VideoStream_High 类型

枚举值

类型 值 说明
ByteRtc_VideoStream_High 0 高分辨率视频流
ByteRtc_VideoStream_Low 1 低分辨率视频

ByteNetworkQuality

typedef NS_ENUM(NSUInteger, ByteNetworkQuality)

媒体流网络质量。

枚举值

类型 值 说明
ByteRtcNetworkQualityUnknown 0 网络质量未知。
ByteRtcNetworkQualityExcellent 1 网络质量极好。
ByteRtcNetworkQualityGood 2 网络质量好。
ByteRtcNetworkQualityPoor 3 网络质量较差但不影响沟通。
ByteRtcNetworkQualityBad 4 网络质量差沟通不顺畅。
ByteRtcNetworkQualityVBad 5 网络质量非常差。

ByteVideoRemoteState

typedef NS_ENUM(NSUInteger, ByteVideoRemoteState)

远端视频流状态

枚举值

类型 值 说明
ByteVideoRemoteStateStopped 0 远端视频流停止状态
ByteVideoRemoteStateRunning 1 远端视频流运行状态
ByteVideoRemoteStateFrozen 2 远端视频流冻结状态

VideoStreamState

typedef NS_ENUM(NSInteger, VideoStreamState)

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

枚举值

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

ByteVideoOutputOrientationMode

typedef NS_ENUM(NSInteger, ByteVideoOutputOrientationMode)

视频输出方向模式

枚举值

类型 值 说明
ByteVideoOutputOrientationModeAdaptative 0 自适应布局
ByteVideoOutputOrientationModeFixedLandscape 1 横屏布局
ByteVideoOutputOrientationModeFixedPortrait 2 竖屏布局

ByteVideoMirrorMode

typedef NS_ENUM(NSUInteger, ByteVideoMirrorMode)

视频镜像模式。

枚举值

类型 值 说明
ByteVideoMirrorModeEnabled 1 开启本地视频镜像
ByteVideoMirrorModeDisabled 2 关闭本地视频镜像

RtcLogType

typedef enum

日志类型。

枚举值

类型 值 说明
BYTE_RTC_LOG 0 平台层日志。
ORIGIN_RTC_LOG 1 Native 层日志。

ByteAudioOutputRouting

typedef NS_ENUM(NSInteger, ByteAudioOutputRouting)

音频输出路由 音频路由变化时 SDK 通过 rtcEngine:didAudioRouteChanged: 回调该错误码

枚举值

类型 值 说明
ByteAudioOutputRoutingDefault -1 默认输出路径
ByteAudioOutputRoutingHeadset 0 从耳机输出
ByteAudioOutputRoutingEarpiece 1 从听筒输出
ByteAudioOutputRoutingSpeakerphone 3 从扬声器输出
ByteAudioOutputRoutingHeadsetBluetooth 5 从蓝牙设备输出

ByteVideoRotation

typedef NS_ENUM(NSInteger, ByteVideoRotation)

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

枚举值

类型 值 说明
ByteVideoRotationNone 0 视频不做旋转
ByteVideoRotation90 1 视频旋转90度
ByteVideoRotation180 2 视频旋转180度
ByteVideoRotation270 3 视频旋转270度

ByteVideoStreamScaleMode

typedef NS_ENUM(NSInteger, ByteVideoStreamScaleMode)

视频缩放模式

枚举值

类型 值 说明
ByteVideoStreamScaleModeAuto 0 自动缩放模式,当前等价于 ByteVideoStreamScaleModeFitWithCropping
ByteVideoStreamScaleModeStretch 1 缩放以适配宽高比
ByteVideoStreamScaleModeFitWithCropping 2 保持纵横比来缩放图像,裁剪长边
ByteVideoStreamScaleModeFitWithFilling 3 保持纵横比来缩放图像,填充短边

ByteVideoCodecName

typedef NS_ENUM(NSInteger, ByteVideoCodecName)

视频编码算法

枚举值

类型 值 说明
ByteVideoCodecAuto 0 自动选择
ByteVideoCodecH264 1 H264
ByteVideoCodecByteVC1 2 ByteVC1

ByteVideoCodecMode

typedef NS_ENUM(NSInteger, ByteVideoCodecMode)

视频编码模式

枚举值

类型 值 说明
ByteVideoCodecAutoMode 0 自动选择
ByteVideoCodecHardwareMode 1 硬编码
ByteVideoCodecSoftwareMode 2 软编码

ByteVideoEncoderPreference

typedef NS_ENUM(NSInteger, ByteVideoEncoderPreference)

编码质量偏好

枚举值

类型 值 说明
ByteVideoEncoderPreferDisabled 0 关闭
ByteVideoEncoderPreferMaintainFramerate 1 保持帧率
ByteVideoEncoderPreferMaintainQuality 2 保持画质
ByteVideoEncoderPreferBalance 3 平衡模式

UserMessageCode

typedef NS_ENUM(NSInteger, UserMessageCode)

消息发送结果。

枚举值

类型 值 说明
USER_MESSAGE_SUCCESS 0 成功。
USER_MESSAGE_ERROR_TIMEOUT 1 失败,超时。
USER_MESSAGE_ERROR_BROKEN 2 失败,连接中断。
USER_MESSAGE_ERROR_NO_RECEIVER 3 失败,没有找到对应的接收者。
USER_MESSAGE_ERROR_NO_REALY_PATH 4 失败,获取级联路径失败
USER_MESSAGE_ERROR_NOT_JOIN 100 失败,没有加入房间。
USER_MESSAGE_ERROR_INIT 101 失败,连接未完成初始化。
USER_MESSAGE_ERROR_NO_CONNECTION 102 失败,没有可用的连接。
USER_MESSAGE_ERROR_EXCEED_MAX_LENGTH 103 消息超过最大长度,当前为64KB
USER_MESSAGE_ERROR_EMPTY_USER 104 用户id为空
USER_MESSAGE_ERROR_UNKNOWN 1000 失败,未知错误。

RoomMessageCode

typedef NS_ENUM(NSInteger, RoomMessageCode)

消息发送结果。

枚举值

类型 值 说明
ROOM_MESSAGE_SUCCESS 200 成功。
ROOM_MESSAGE_ERROR_NOT_JOIN 100 失败,没有加入房间。
ROOM_MESSAGE_ERROR_INIT 101 失败,连接未完成初始化。
ROOM_MESSAGE_ERROR_NO_CONNECTION 102 失败,没有可用的连接。
ROOM_MESSAGE_ERROR_EXCEED_MAX_LENGTH 103 消息超过最大长度,当前为64KB
ROOM_MESSAGE_ERROR_UNKNOWN 1000 失败,未知错误。

AudioPerfProfile

typedef NS_ENUM(NSUInteger, AudioPerfProfile)

用户机型等级信息。 在部分应用场景下,需要关注用户机型的配置高低,根据不同的配置,选择不同复杂度的音频处理算法,在能耗、用户体验上进行折中。

枚举值

类型 值 说明
AUDIO_PERF_PROFILE_AUTO 0 自动策略,SDK 会在加入房间时上传机型信息。服务端根据机型信息判断性能级别,下发对应配置。
AUDIO_PERF_PROFILE_LOW 1 低配策略,关闭 AEC、ANS、AGC 算法,播放 sample rate 为 16000。
策略内容可以定制,联系销售咨询具体方案
AUDIO_PERF_PROFILE_MID 2 中配策略,开启 AEC、ANS、AGC 算法,播放 sample rate 为 16000。
策略内容可以定制,联系销售咨询具体方案
AUDIO_PERF_PROFILE_HIGH 3 高配策略,开启 AEC、ANS、AGC 算法,播放 sample rate 为 48000。
策略内容可以定制,联系销售咨询具体方案

BytePublishFallbackOption

typedef NS_ENUM(NSUInteger, BytePublishFallbackOption)

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

枚举值

类型 值 说明
BytePublishFallbackOptionDisabled 0 上行网络较弱或性能不佳时,不对音视频流作回退处理,默认值
BytePublishFallbackOptionVideoStreamLow 1 上行网络较弱或性能不佳时,只发送视频小流。

ByteSubscribeMode

typedef NS_ENUM(NSUInteger, ByteSubscribeMode)

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

枚举值

类型 值 说明
kByteAutoSubscribeMode 0 自动订阅模式。SDK 会自动为用户订阅房间中的每一路流。
kByteManualSubscribeMode 1 手动订阅模式。SDK 不为自动订阅流。用户需要自己手动调用 subscribeStream:subscribeConfig: 接口去订阅远端流。

ByteSubscribeFallbackOption

typedef NS_ENUM(NSUInteger, ByteSubscribeFallbackOption)

订阅回退选项

枚举值

类型 值 说明
ByteSubscribeFallbackOptionDisabled 0 下行网络较弱时,不对音视频流作回退处理,默认值
ByteSubscribeFallbackOptionVideoStreamLow 1 下行网络较弱时只接收视频小流
ByteSubscribeFallbackOptionAudioOnly 2 下行网络较弱时,先尝试只接收视频小流;如果网络环境无法显示视频,则再回退到只接收远端订阅的音频流

ByteUserPriority

typedef NS_ENUM(NSUInteger, ByteUserPriority)

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

枚举值

类型 值 说明
ByteUserPriorityLow 0 用户优先级为低,默认值
ByteUserPriorityMedium 100 用户优先级为正常
ByteUserPriorityHigh 200 用户优先级为高

ByteFallbackOrRecoverReason

typedef NS_ENUM(NSInteger, ByteFallbackOrRecoverReason)

远端订阅流发生回退或恢复的原因

枚举值

类型 值 说明
ByteFallbackReasonUnknown -1 其他原因,非带宽和性能原因引起的回退或恢复。默认值
ByteSubscribeFallbackByBandwidth 0 由带宽不足导致的订阅端音视频流回退。
ByteSubscribeFallbackByPerformance 1 由性能不足导致的订阅端音视频流回退。
ByteSubscribeRecoverByBandwidth 2 由带宽恢复导致的订阅端音视频流恢复。
ByteSubscribeRecoverByPerformance 3 由性能恢复导致的订阅端音视频流恢复。
BytePublishFallbackByBandwidth 4 由带宽不足导致的发布端音视频流回退。
BytePublishFallbackByPerformance 5 由性能不足导致的发布端音视频流回退。
BytePublishRecoverByBandwidth 6 由带宽恢复导致的发布端音视频流恢复。
BytePublishRecoverByPerformance 7 由性能恢复导致的发布端音视频流恢复。

ByteLocalAudioStreamState

typedef NS_ENUM(NSInteger, ByteLocalAudioStreamState)

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

枚举值

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

+ 本地录音设备启动失败,对应错误码 ByteLocalAudioStreamErrorRecordFailure

+ 检测到没有录音设备权限,对应错误码 ByteLocalAudioStreamErrorDeviceNoPermission

+ 音频编码失败,对应错误码 ByteLocalAudioStreamErrorEncodeFailure

ByteLocalAudioStreamError

typedef NS_ENUM(NSInteger, ByteLocalAudioStreamError)

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

枚举值

类型 值 说明
ByteLocalAudioStreamErrorOk 0 本地音频状态正常
ByteLocalAudioStreamErrorFailure 1 本地音频出错原因未知
ByteLocalAudioStreamErrorDeviceNoPermission 2 没有权限启动本地音频录制设备
ByteLocalAudioStreamErrorDeviceBusy 3 本地音频录制设备已经在使用中
ByteLocalAudioStreamErrorRecordFailure 4 本地音频录制失败,建议你检查录制设备是否正常工作
ByteLocalAudioStreamErrorEncodeFailure 5 本地音频编码失败

ByteLocalVideoStreamState

typedef NS_ENUM(NSInteger, ByteLocalVideoStreamState)

本地视频流状态

枚举值

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

+ 本地采集设备启动失败,对应错误码 ByteLocalVideoStreamErrorRecordFailure

+ 检测到没有摄像头权限,对应错误码 ByteLocalVideoStreamErrorDeviceNoPermissionByteVideoStreamErrorDeviceNoPermission

+ 视频编码失败,对应错误码 ByteLocalVideoStreamErrorEncodeFailure

ByteLocalVideoStreamError

typedef NS_ENUM(NSInteger, ByteLocalVideoStreamError)

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

枚举值

类型 值 说明
ByteLocalVideoStreamErrorOk 0 本地视频状态正常
ByteLocalVideoStreamErrorFailure 1 视频流发布失败
ByteLocalVideoStreamErrorDeviceNoPermission 2 没有权限启动本地视频录制设备
ByteLocalVideoStreamErrorDeviceBusy 3 本地视频录制设备已经在使用中
ByteLocalVideoStreamErrorRecordFailure 4 本地视频录制失败,建议检查录制设备是否正常工作
ByteLocalVideoStreamErrorEncodeFailure 5 本地视频编码失败

ByteRemoteAudioState

typedef NS_ENUM(NSInteger, ByteRemoteAudioState)

远端音频流状态 SDK 通过 rtcEngine:remoteAudioStateChanged:state:reason:elapsed: 回调该状态

枚举值

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

+ 本地用户停止接收远端音频流,对应错误码 ByteRemoteAudioReasonLocalMuted

+ 远端用户停止发送音频流,对应错误码 ByteRemoteAudioReasonRemoteMuted

+ 远端用户离开房间,对应错误码 ByteRemoteAudioReasonRemoteOffline
ByteRemoteAudioStateStarting 1 本地用户已接收远端音频首包。
收到远端音频首包时回调该状态,对应错误码 ByteRemoteAudioReasonLocalUnmuted
ByteRemoteAudioStateDecoding 2 远端音频流正在解码,正常播放,在以下时机回调该状态:

+ 成功解码远端音频首帧,对应错误码 ByteRemoteAudioReasonLocalUnmuted

+ 网络由阻塞恢复正常,对应错误码 ByteRemoteAudioReasonNetworkRecovery

+ 本地用户恢复接收远端音频流,对应错误码 ByteRemoteAudioReasonLocalUnmuted

+ 远端用户恢复发送音频流,对应错误码 ByteRemoteAudioReasonRemoteUnmuted
ByteRemoteAudioStateFrozen 3 远端音频流卡顿。
网络阻塞、丢包率大于40%时回调该状态,对应错误码 ByteRemoteAudioReasonNetworkCongestion
ByteRemoteAudioStateFailed 4 远端音频流播放失败

ByteRemoteAudioReason

typedef NS_ENUM(NSInteger, ByteRemoteAudioReason)

远端音频流状态改变的原因。 SDK 通过 rtcEngine:remoteAudioStateChanged:state:reason:elapsed: 回调该错误码

枚举值

类型 值 说明
ByteRemoteAudioReasonInternal 0 内部原因
ByteRemoteAudioReasonNetworkCongestion 1 网络阻塞
ByteRemoteAudioReasonNetworkRecovery 2 网络恢复正常
ByteRemoteAudioReasonLocalMuted 3 本地用户停止接收远端音频流
ByteRemoteAudioReasonLocalUnmuted 4 本地用户恢复接收远端音频流
ByteRemoteAudioReasonRemoteMuted 5 远端用户停止发送音频流
ByteRemoteAudioReasonRemoteUnmuted 6 远端用户恢复发送音频流
ByteRemoteAudioReasonRemoteOffline 7 远端用户离开房间

ByteRemoteVideoState

typedef NS_ENUM(NSInteger, ByteRemoteVideoState)

远端视频流状态

枚举值

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

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

+ 远端用户停止发送视频流,对应错误码 ByteRemoteVideoReasonRemoteMuted

+ 远端用户离开房间,对应错误码 ByteRemoteVideoReasonRemoteOffline
ByteRemoteVideoStateStarting 1 本地用户已接收远端视频首包
收到远端视频首包时回调该状态,对应错误码 ByteRemoteVideoReasonLocalUnmuted
ByteRemoteVideoStateDecoding 2 远端视频流正在解码,正常播放, 在以下时机回调该状态:

+ 成功解码远端视频首帧,对应错误码 ByteRemoteVideoReasonLocalUnmuted

+ 网络由阻塞恢复正常,对应错误码 ByteRemoteVideoReasonNetworkRecovery

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

+ 远端用户恢复发送视频流,对应错误码 ByteRemoteVideoReasonRemoteUnmuted
ByteRemoteVideoStateFrozen 3 远端视频流卡顿
网络阻塞、丢包率等原因造成视频卡顿流时会回报该状态,对应错误码 ByteRemoteVideoReasonNetworkCongestion
ByteRemoteVideoStateFailed 4 远端音频流播放失败

ByteRemoteVideoReason

typedef NS_ENUM(NSInteger, ByteRemoteVideoReason)

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

枚举值

类型 值 说明
ByteRemoteVideoReasonInternal 0 内部原因
ByteRemoteVideoReasonNetworkCongestion 1 网络阻塞
ByteRemoteVideoReasonNetworkRecovery 2 网络恢复正常
ByteRemoteVideoReasonLocalMuted 3 本地用户停止接收远端视频流或本地用户禁用视频模块
ByteRemoteVideoReasonLocalUnmuted 4 本地用户恢复接收远端视频流或本地用户启用视频模块
ByteRemoteVideoReasonRemoteMuted 5 远端用户停止发送视频流或远端用户禁用视频模块
ByteRemoteVideoReasonRemoteUnmuted 6 远端用户恢复发送视频流或远端用户启用视频模块
ByteRemoteVideoReasonRemoteOffline 7 远端用户离开频道

ByteVideoCodecType

typedef NS_ENUM(NSInteger, ByteVideoCodecType)

编码类型

枚举值

类型 值 说明
kByteVideoCodecUnknown 0 视频编码类型:未知类型
kByteVideoCodecH264 1 视频编码类型:标准 H264
kByteVideoCodecByteVC1 2 视频编码类型:标准 ByteVC1

ByteMediaDeviceType

typedef NS_ENUM(NSInteger, ByteMediaDeviceType)

设备类型

枚举值

类型 值 说明
kByteAudioPlayoutDevice 0 音频播放设备类型
kByteAudioRecordingDevice 1 音频录制设备类型
kByteVideoRenderDevice 2 视频渲染设备类型,该类型暂无使用
kByteVideoCaptureDevice 3 视频采集设备类型

ByteMediaDeviceState

typedef NS_ENUM(NSInteger, ByteMediaDeviceState)

设备状态

枚举值

类型 值 说明
kByteMediaDeviceStateStarted 0 设备已开启
kByteMediaDeviceStateStartFailed 1 设备开启失败
kByteMediaDeviceStateStopped 2 设备已停止
kByteMediaDeviceStateStopFailed 3 设备停止失败

ProblemFeedback

typedef NS_OPTIONS(NSUInteger, ProblemFeedback)

音视频质量反馈问题类型

枚举值

类型 值 说明
PROBLEM_NONE 0 没有问题
PROBLEM_OTHER_MSG (1 << 0) 其他问题
PROBLEM_AUDIO_NOT_CLEAR (1 << 1) 声音不清晰
PROBLEM_VIDEO_NOT_CLEAR (1 << 2) 视频不清晰
PROBLEM_SYNC (1 << 3) 音视频不同步
PROBLEM_AUDIO_LAGGING (1 << 4) 音频卡顿
PROBLEM_VIDEO_LAGGING (1 << 5) 视频卡顿
PROBLEM_CONNECT_FAILED (1 << 6) 无法连接
PROBLEM_AUDIO_DELAY (1 << 7) 音频延迟
PROBLEM_VIDEO_DELAY (1 << 8) 视频延迟
PROBLEM_DISCONNECT (1 << 9) 连接断开
PROBLEM_NO_AUDIO (1 << 10) 无声音
PROBLEM_NO_VIDEO (1 << 11) 无画面
PROBLEM_AUDIO_STRENGTH (1 << 12) 声音过大或过小
PROBLEM_ECHO (1 << 13) 回声噪音

BackgroundMode

typedef NS_ENUM(NSUInteger, BackgroundMode)

背景模式 开启背景替换功能时生效,详见 replaceBackground:withDivideModel:。

枚举值

类型 值 说明
BACKGROUND_A 0 背景1
BACKGROUND_B 1 背景2
BLUR 2 虚化
NONE 3 无

DivideModel

typedef NS_ENUM(NSUInteger, DivideModel)

分割模型 开启背景替换功能时生效,详见 replaceBackground:withDivideModel:。

枚举值

类型 值 说明
EFFECT 0 effect
DEFAULT 1 自研

FirstFrameSendState

typedef NS_ENUM(NSUInteger, FirstFrameSendState)

首帧发送状态

枚举值

类型 值 说明
kFirstFrameSendStateSending 0
kFirstFrameSendStateSent 1
kFirstFrameSendStateEnd 2

FirstFramePlayState

typedef NS_ENUM(NSUInteger, FirstFramePlayState)

首帧播放状态

枚举值

类型 值 说明
kFirstFramePlayStatePlaying 0
kFirstFramePlayStatePlay 1
kFirstFramePlayStateEnd 2

ByteEncryptType

typedef NS_OPTIONS(NSUInteger, ByteEncryptType)

加密类型

枚举值

类型 值 说明
ByteEncryptTypeAES128CBC 1 使用AES-128-CBC进行传输加密
ByteEncryptTypeAES256CBC 2 使用AES-256-CBC进行传输加密
ByteEncryptTypeAES128ECB 3 使用AES-128-ECB进行传输加密
ByteEncryptTypeAES256ECB 4 使用AES-256-ECB进行传输加密

ByteRtcVideoCanvas

@interface ByteRtcVideoCanvas : NSObject

视频渲染图层结构。app 通过该结构将要渲染的窗口和视频流进行绑定

成员变量

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

变量说明

view

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

渲染窗口句柄

renderMode

@property (assign, nonatomic) ByteRtcRenderMode renderMode;

设置渲染模式,暂时设置无效

roomId

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

房间ID

uid

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

设置渲染流的用户标识

ByteRtcFrameExtendedData

@interface ByteRtcFrameExtendedData : NSObject

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

成员变量

类型 名称
NSData* extendedData
NSInteger extendedDataLen

变量说明

extendedData

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

附加数据

extendedDataLen

@property (assign, nonatomic) NSInteger extendedDataLen;

附加数据长度

VideoStreamDescription

@interface VideoStreamDescription: NSObject

视频流描述

成员变量

类型 名称
CGSize videoSize
NSInteger frameRate
NSInteger maxKbps
ByteVideoStreamScaleMode mode
ByteVideoEncoderPreference encoderPreference

变量说明

videoSize

@property (nonatomic, assign) CGSize videoSize;

视频分辨率

frameRate

@property (nonatomic, assign) NSInteger frameRate;

视频预设帧率

maxKbps

@property (nonatomic, assign) NSInteger maxKbps;

视频预设最大码率(Kbps)

mode

@property (nonatomic, assign) ByteVideoStreamScaleMode mode;

视频拉伸模式,详见类型ByteVideoStreamScaleMode

encoderPreference

@property (nonatomic, assign) ByteVideoEncoderPreference encoderPreference;

视频编码质量偏好,详见类型ByteVideoEncoderPreference

ByteStream

@protocol ByteStream <NSObject>

流属性。房间中的远端流的流属性。
用户加入房间成功后,房间中所有已发布和未来发布的流和流的相关属性,都会通过 rtcEngine:onStreamAdd: 回调时间通知用户。此数据结构即为回调给用户的参数类型。

成员变量

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

变量说明

userId

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

用户ID 。此流的发布用户的用户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<VideoStreamDescription *> * videoStreamDescriptions;

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

SubscribeConfig

@interface SubscribeConfig: 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 。

ByteAudioFrame

@interface ByteAudioFrame : NSObject

音频帧

成员变量

类型 名称
NSData* samples
int numOfSamples
int bytesPerSample
int channels
int samplesPerSec

变量说明

samples

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

音频帧数据

numOfSamples

@property (assign, nonatomic) int numOfSamples;

此音频帧描述的样点数

bytesPerSample

@property (assign, nonatomic) int bytesPerSample;

每个采样点占据的内存大小,s16 为 2 byte

channels

@property (assign, nonatomic) int channels;

音频通道数

samplesPerSec

@property (assign, nonatomic) int samplesPerSec;

音频采样率

VideoFrameType

typedef NS_ENUM(NSInteger, VideoFrameType)

视频帧类型

枚举值

类型 值 说明
kFrameTypeRawMemory 0 视频帧类型:内存数据
kFrameTypePixelBuffer 0 视频帧类型:CVPixelBuffer

VideoPixelFormat

typedef NS_ENUM(NSInteger, VideoPixelFormat)

视频帧格式

枚举值

类型 值 说明
kPixelFormatUnknown 0 未知格式
kPixelFormatI420 1 I420
kPixelFormatBGRA 2 BGRA
kPixelFormatNV21 3 NV21
kPixelFormatRGBA 4 RGBA
kPixelFormatIMC2 5 IMC2
kPixelFormatARGB 7 ARGB
kPixelFormatNV12 8 NV12
kPixelFormatGLTexture2D 10 Opengl Texture2D纹理
kPixelFormatGLTextureOES 11 Opengl OES纹理
kPixelFormatCVPixelBuffer 12 CVPixelBuffer

ByteVideoFrame

@interface ByteVideoFrame : NSObject

成员变量

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

变量说明

format

@property (assign, nonatomic) NSInteger format;

视频帧类型,参考 VideoPixelFormat

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) ByteVideoRotation rotation;

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

extendedData

@property (strong, nonatomic) ByteRtcFrameExtendedData *extendedData;

视频帧附加的数据

ByteRtcVideoCompositingRegion

@interface ByteRtcVideoCompositingRegion : NSObject

单个视频流在合流中的布局信息。
此数据类型为,开启直播推流转码功能,多路视频流合流时,其中一路视频流在合流中的预设布局信息。

成员变量

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

变量说明

uid

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

用户ID 。视频流发布用户的用户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]。

alpha

@property (assign, nonatomic) CGFloat alpha;

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

contentControl

@property (assign, nonatomic) NSInteger contentControl;

合流内容控制。默认值为 0 ,取值范围及含义如下:
+ 0: 输出的混流包含音视频
+ 1: 只包含音频
+ 2: 表示只包含视频

renderMode

@property (assign, nonatomic) ByteRtcRenderMode renderMode;

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

ByteRtcVideoCompositingLayout

@interface ByteRtcVideoCompositingLayout : NSObject

视频流合流整体布局信息。
此数据类型为,开启直播推流转码功能,视频合流的完整信息。包括了参与合流的每路视频流的预设布局信息和合流背景信息等。

成员变量

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

变量说明

backgroundColor

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

画布的背景颜色。

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;

视频编码格式。

width

@property (assign, nonatomic) NSInteger width;

合流视频宽度。

height

@property (assign, nonatomic) NSInteger height;

合流视频高度。

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;

是否使用低延时特性。

ByteAACProfile

typedef NS_ENUM(NSInteger, ByteAACProfile)

AAC编码类型。

枚举值

类型 值 说明
ByteAACProfileLC 0 LC(默认)
ByteAACProfileMain 1 MAIN
ByteAACProfileHEv1 2 HEv1
ByteAACProfileHEv2 3 HEv2

ByteRtcTranscodingAudioConfig

@interface ByteRtcTranscodingAudioConfig : NSObject

音频转码配置参数。

成员变量

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

变量说明

codec

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

音频编码格式。

sampleRate

@property (assign, nonatomic) NSInteger sampleRate;

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

channels

@property (assign, nonatomic) NSInteger channels;

声道数。

kBitRate

@property (assign, nonatomic) NSInteger kBitRate;

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

profile

@property (assign, nonatomic) ByteAACProfile profile;

AAC 等级。

ByteRtcLiveTranscoding

@interface ByteRtcLiveTranscoding : NSObject

直播推流转码配置参数。
用户调用 enableLiveTranscoding: 方法开启直播推流转码功能时,传入的合流转码配置参数。

成员变量

类型 名称
ByteRtcVideoCompositingLayout* layout
ByteRtcTranscodingVideoConfig* video
ByteRtcTranscodingAudioConfig* audio
NSMutableDictionary* advancedConfig
NSString* url

静态函数

返回 名称
instancetype defaultTranscoding

变量说明

layout

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

视频合流布局信息。详见 ByteRtcVideoCompositingLayout 数据类型。

video

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

视频转码参数。详见 ByteRtcTranscodingVideoConfig 数据类型。

audio

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

音频转码参数。详见 ByteRtcTranscodingAudioConfig 数据类型。

advancedConfig

@property (strong, nonatomic) NSMutableDictionary *  _Nullable advancedConfig;

动态扩展自定义参数。

url

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

推流 CDN 地址。

函数说明

defaultTranscoding

+ (instancetype _Nonnull)defaultTranscoding;

获取默认合流参数。

ByteRtcStats

@interface ByteRtcStats : NSObject

房间通话统计数据。
用户加入当前房间成功后,SDK 会周期性(2s)的通过rtcEngine:reportRtcStats:回调事件通知用户当前房间内的汇总统计信息。回调的统计信息即为此数据类型。

成员变量

类型 名称
NSInteger duration
NSInteger txBytes
NSInteger rxBytes
NSInteger txAudioKBitrate
NSInteger rxAudioKBitrate
NSInteger txVideoKBitrate
NSInteger rxVideoKBitrate
NSInteger userCount

变量说明

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;

当前房间内用户总数。回调时房间内的用户总数,包括本地用户自身。

ByteRtcSysStats

@interface ByteRtcSysStats : NSObject

App使用的cpu和memory信息
SDK 周期性(2s)的通过rtcEngine:reportSysStats:回调事件通知用户当前App的cpu与memory使用信息。回调的统计信息即为此数据类型。

成员变量

类型 名称
double cpu_app_usage
double cpu_total_usage
double memory_usage

变量说明

cpu_app_usage

@property (assign, nonatomic) double cpu_app_usage;

当前App的CPU 使用率

cpu_total_usage

@property (assign, nonatomic) double cpu_total_usage;

当前设备的总CPU使用率

memory_usage

@property (assign, nonatomic) double memory_usage;

当前App的CPU使用率

ByteRtcLocalVideoStats

@interface ByteRtcLocalVideoStats : NSObject

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

成员变量

类型 名称
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
ByteVideoCodecType codecType
BOOL isScreen

变量说明

sentKBitrate

@property (assign, nonatomic) float sentKBitrate;

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

inputFrameRate

@property (assign, nonatomic) NSInteger inputFrameRate;

输入帧率。此次统计周期内的本地视频输入帧率 。

sentFrameRate

@property (assign, nonatomic) NSInteger sentFrameRate;

发送帧率。此次统计周期内的本地视频发送帧率 。

encoderOutputFrameRate

@property (assign, nonatomic) NSInteger encoderOutputFrameRate;

本地视频目标编码帧率。

rendererOutputFrameRate

@property (assign, nonatomic) NSInteger rendererOutputFrameRate;

本地视频目标渲染输出帧率。

sentTargetKBitrate

@property (assign, nonatomic) NSInteger sentTargetKBitrate;

本地视频目标发送码率。单位为 kbps 。

sentTargetFrameRate

@property (assign, nonatomic) NSInteger sentTargetFrameRate;

本地视频目标发送帧率。

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;

编码率。

encodedFrameWidth

@property(assign, nonatomic) NSInteger encodedFrameWidth;

编码帧宽度。

encodedFrameHeight

@property(assign, nonatomic) NSInteger encodedFrameHeight;

编码帧高度。

encodedFrameCount

@property(assign, nonatomic) NSInteger encodedFrameCount;

编码帧数。此次统计周期内编码的帧数。

codecType

@property(nonatomic) ByteVideoCodecType codecType;

编码类型。详见 ByteVideoCodecType 类型。

isScreen

@property (assign, nonatomic) BOOL isScreen;

是否是屏幕流。

ByteRtcRemoteVideoStats

@interface ByteRtcRemoteVideoStats : NSObject

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

成员变量

类型 名称
NSString* uid
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

变量说明

uid

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

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

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

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

成员变量

类型 名称
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

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

成员变量

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

变量说明

uid

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

用户ID 。远端音频流发布用户的用户ID 。

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 。

quality

@property(assign, nonatomic) NSInteger quality;

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

jitterBufferDelay

@property(assign, nonatomic) NSInteger jitterBufferDelay;

音频发送端到接收端的网络延迟。单位为 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

音量信息

成员变量

类型 名称
NSString* uid
NSUInteger volume

变量说明

uid

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

音量信息所属用户的用户ID

volume

@property (assign, nonatomic) NSUInteger volume;

用户音量大小信息,音量取值范围为 [0, 255]

ByteSourceWantedData

@interface ByteSourceWantedData : 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;

推荐视频输入帧率

ByteRtcStreamOC

@interface ByteRtcStreamOC : NSObject <ByteStream>

流信息

成员变量

类型 名称
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<VideoStreamDescription *> *videoStreamDescriptions/;

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

ScreenCaptureParam

@interface ScreenCaptureParam : 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;

是否采集鼠标

ScreenParam

@interface ScreenParam : 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;

元信息