typedef NS_ENUM(NSUInteger, ByteRtcRenderMode)
视频显示模式
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRtc_Render_Hidden | 1 | 视频尺寸等比缩放,优先保证窗口被填满。当视频尺寸与显示窗口尺寸不一致时,多出的视频将被截掉。 |
| ByteRtc_Render_Fit | 2 | 视频尺寸等比缩放,优先保证视频内容全部显示。当视频尺寸与显示窗口尺寸不一致时,会把窗口未被填满的区域填充成黑色。 |
| ByteRtc_Render_Adaptive | 3 | 视频尺寸非等比例缩放,把窗口充满。当视频尺寸与显示窗口尺寸不一致时,视频高或宽方向会被拉伸。 |
typedef NS_ENUM(NSUInteger, ByteRtcUserOfflineReason)
用户离线原因。
房间内的远端用户离开房间时,本地用户会收到 rtcEngine:didOfflineOfUid:reason: 回调通知,此枚举类型为回调的用户离线原因。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRtc_UserOffline_Quit | 0 | 用户主动离开。如远端用户调用 leaveChannel: 方法退出房间。 |
| ByteRtc_UserOffline_Dropped | 1 | 用户掉线。远端用户因为网络等原因掉线。 |
typedef NS_ENUM(NSInteger, ByteChannelProfile)
房间模式。房间使用的场景模式。
通过设置房间模式,用户可以选择应用 SDK 针对不同房间模式场景的优化策略。设置房间模式参考 setChannelProfile: 方法。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteChannelProfileCommunication | 0 | 通信模式。通信模式下,无用户角色区分。适用于 IM 场景。 |
| ByteChannelProfileLiveBroadcasting | 1 | 直播模式。直播模式下,有用户角色区分(用户角色参考 ByteRtcClientRole)。适用于直播、教育大班课等场景。 |
| ByteChannelProfileGame | 2 | 游戏模式。游戏模式下,有用户角色区分。 SDK 会使用低延时设置。适用于游戏场景。 |
| ByteChannelProfileCloudGame | 3 | 云游戏模式。云游戏模式下,有用户角色区分。 SDK 会开启 DataChannel (详见 sendMessage:message: 方法)功能,并使用低延时设置。适用于云游戏场景。 |
typedef NS_ENUM(NSInteger, ByteRtcClientRole)
用户角色。房间模式为直播、游戏、云游戏模式时的可选用户角色。
用户可通过设置用户角色控制:1.发布/取消发布音视频流;2.用户自身是否在房间中隐身。设置用户角色参考 setClientRole: 方法。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRtc_ClientRole_Broadcaster | 1 | 主播角色。主播角色的用户既可以发布流到房间中,也可以从房间中订阅流,房间中的其他用户可以感知到该用户在房间中。 |
| ByteRtc_ClientRole_Audience | 2 | 观众角色。观众角色的用户只能从房间中订阅流,不能向房间中发布流,房间中的其他用户可以感知到该用户在房间中。 |
| ByteRtc_ClientRole_Silent_Audience | 4 | 静默观众角色。静默观众角色的用户只能从房间中订阅流,不能向房间中发布流,房间中的其他用户无法感知到该用户在房间中。该用户加入退出房间等行为不会通知给房间中的其他用户。 |
typedef NS_ENUM(NSInteger, ByteRtcConnectionState)
SDK 与信令服务器连接状态。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRtc_ConnectionState_Disconnected | 1 | 连接中断。 |
| ByteRtc_ConnectionState_Connecting | 2 | 连接建立中。 |
| ByteRtc_ConnectionState_Connected | 3 | 连接已建立。 |
| ByteRtc_ConnectionState_Reconnecting | 4 | 连接重连中。 |
| ByteRtc_ConnectionState_Reconnected | 5 | 连接已重连。 |
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 移动网络。 |
typedef NS_ENUM(NSInteger, ByteRtcVideoStreamType)
视频流类型 目前C++ SDK 只支持 ByteRtc_VideoStream_High 类型
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRtc_VideoStream_High | 0 | 高分辨率视频流 |
| ByteRtc_VideoStream_Low | 1 | 低分辨率视频 |
typedef NS_ENUM(NSUInteger, ByteNetworkQuality)
媒体流网络质量。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRtcNetworkQualityUnknown | 0 | 网络质量未知。 |
| ByteRtcNetworkQualityExcellent | 1 | 网络质量极好。 |
| ByteRtcNetworkQualityGood | 2 | 网络质量好。 |
| ByteRtcNetworkQualityPoor | 3 | 网络质量较差但不影响沟通。 |
| ByteRtcNetworkQualityBad | 4 | 网络质量差沟通不顺畅。 |
| ByteRtcNetworkQualityVBad | 5 | 网络质量非常差。 |
typedef NS_ENUM(NSUInteger, ByteVideoRemoteState)
远端视频流状态
| 类型 | 值 | 说明 |
|---|---|---|
| ByteVideoRemoteStateStopped | 0 | 远端视频流停止状态 |
| ByteVideoRemoteStateRunning | 1 | 远端视频流运行状态 |
| ByteVideoRemoteStateFrozen | 2 | 远端视频流冻结状态 |
typedef NS_ENUM(NSInteger, VideoStreamState)
设置本地视频属性的返回状态。
| 类型 | 值 | 说明 |
|---|---|---|
| VIDEO_STREAM_SUCCESS | 0 | 设置本地视频属性成功 |
| VIDEO_STREAM_INVALID | -2 | 本地视频属性参数不合法 |
typedef NS_ENUM(NSInteger, ByteVideoOutputOrientationMode)
视频输出方向模式
| 类型 | 值 | 说明 |
|---|---|---|
| ByteVideoOutputOrientationModeAdaptative | 0 | 自适应布局 |
| ByteVideoOutputOrientationModeFixedLandscape | 1 | 横屏布局 |
| ByteVideoOutputOrientationModeFixedPortrait | 2 | 竖屏布局 |
typedef NS_ENUM(NSUInteger, ByteVideoMirrorMode)
视频镜像模式。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteVideoMirrorModeEnabled | 1 | 开启本地视频镜像 |
| ByteVideoMirrorModeDisabled | 2 | 关闭本地视频镜像 |
typedef enum
日志类型。
| 类型 | 值 | 说明 |
|---|---|---|
| BYTE_RTC_LOG | 0 | 平台层日志。 |
| ORIGIN_RTC_LOG | 1 | Native 层日志。 |
typedef NS_ENUM(NSInteger, ByteAudioOutputRouting)
音频输出路由 音频路由变化时 SDK 通过 rtcEngine:didAudioRouteChanged: 回调该错误码
| 类型 | 值 | 说明 |
|---|---|---|
| ByteAudioOutputRoutingDefault | -1 | 默认输出路径 |
| ByteAudioOutputRoutingHeadset | 0 | 从耳机输出 |
| ByteAudioOutputRoutingEarpiece | 1 | 从听筒输出 |
| ByteAudioOutputRoutingSpeakerphone | 3 | 从扬声器输出 |
| ByteAudioOutputRoutingHeadsetBluetooth | 5 | 从蓝牙设备输出 |
typedef NS_ENUM(NSInteger, ByteVideoRotation)
视频旋转信息,枚举类型,定义了90度为间隔的四种旋转模式。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteVideoRotationNone | 0 | 视频不做旋转 |
| ByteVideoRotation90 | 1 | 视频旋转90度 |
| ByteVideoRotation180 | 2 | 视频旋转180度 |
| ByteVideoRotation270 | 3 | 视频旋转270度 |
typedef NS_ENUM(NSInteger, ByteVideoStreamScaleMode)
视频缩放模式
| 类型 | 值 | 说明 |
|---|---|---|
| ByteVideoStreamScaleModeAuto | 0 | 自动缩放模式,当前等价于 ByteVideoStreamScaleModeFitWithCropping |
| ByteVideoStreamScaleModeStretch | 1 | 缩放以适配宽高比 |
| ByteVideoStreamScaleModeFitWithCropping | 2 | 保持纵横比来缩放图像,裁剪长边 |
| ByteVideoStreamScaleModeFitWithFilling | 3 | 保持纵横比来缩放图像,填充短边 |
typedef NS_ENUM(NSInteger, ByteVideoCodecName)
视频编码算法
| 类型 | 值 | 说明 |
|---|---|---|
| ByteVideoCodecAuto | 0 | 自动选择 |
| ByteVideoCodecH264 | 1 | H264 |
| ByteVideoCodecByteVC1 | 2 | ByteVC1 |
typedef NS_ENUM(NSInteger, ByteVideoCodecMode)
视频编码模式
| 类型 | 值 | 说明 |
|---|---|---|
| ByteVideoCodecAutoMode | 0 | 自动选择 |
| ByteVideoCodecHardwareMode | 1 | 硬编码 |
| ByteVideoCodecSoftwareMode | 2 | 软编码 |
typedef NS_ENUM(NSInteger, ByteVideoEncoderPreference)
编码质量偏好
| 类型 | 值 | 说明 |
|---|---|---|
| ByteVideoEncoderPreferDisabled | 0 | 关闭 |
| ByteVideoEncoderPreferMaintainFramerate | 1 | 保持帧率 |
| ByteVideoEncoderPreferMaintainQuality | 2 | 保持画质 |
| ByteVideoEncoderPreferBalance | 3 | 平衡模式 |
typedef NS_ENUM(NSInteger, MessageCode)
消息发送结果。
| 类型 | 值 | 说明 |
|---|---|---|
| MESSAGE_SUCCESS | 0 | 成功。 |
| MESSAGE_ERROR_TIMEOUT | 1 | 失败,超时。 |
| MESSAGE_ERROR_BROKEN | 2 | 失败,连接中断。 |
| MESSAGE_ERROR_NO_RECEIVER | 3 | 失败,没有找到对应的接收者。 |
| MESSAGE_ERROR_NOT_JOIN | 100 | 失败,没有加入房间。 |
| MESSAGE_ERROR_INIT | 101 | 失败,连接未完成初始化。 |
| MESSAGE_ERROR_NO_CONNECTION | 102 | 失败,没有可用的连接。 |
| MESSAGE_ERROR_UNKNOWN | 1000 | 失败,未知错误。 |
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。 策略内容可以定制,联系销售咨询具体方案 |
typedef NS_ENUM(NSUInteger, BytePublishFallbackOption)
本地发布的音视频流回退选项
| 类型 | 值 | 说明 |
|---|---|---|
| BytePublishFallbackOptionDisabled | 0 | 上行网络较弱或性能不佳时,不对音视频流作回退处理,默认值 |
| BytePublishFallbackOptionVideoStreamLow | 1 | 上行网络较弱或性能不佳时,只发送视频小流。 |
typedef NS_ENUM(NSUInteger, ByteSubscribeFallbackOption)
订阅回退选项
| 类型 | 值 | 说明 |
|---|---|---|
| ByteSubscribeFallbackOptionDisabled | 0 | 下行网络较弱时,不对音视频流作回退处理,默认值 |
| ByteSubscribeFallbackOptionVideoStreamLow | 1 | 下行网络较弱时只接收视频小流 |
| ByteSubscribeFallbackOptionAudioOnly | 2 | 下行网络较弱时,先尝试只接收视频小流;如果网络环境无法显示视频,则再回退到只接收远端订阅的音频流 |
typedef NS_ENUM(NSUInteger, ByteUserPriority)
远端用户优先级,在性能不足需要回退时,会优先回退优先级低的用户的音视频流
| 类型 | 值 | 说明 |
|---|---|---|
| ByteUserPriorityLow | 0 | 用户优先级为低,默认值 |
| ByteUserPriorityMedium | 100 | 用户优先级为正常 |
| ByteUserPriorityHigh | 200 | 用户优先级为高 |
typedef NS_ENUM(NSInteger, ByteFallbackOrRecoverReason)
远端订阅流发生回退或恢复的原因
| 类型 | 值 | 说明 |
|---|---|---|
| ByteFallbackReasonUnknown | -1 | 其他原因,非带宽和性能原因引起的回退或恢复。默认值 |
| ByteSubscribeFallbackByBandwidth | 0 | 由带宽不足导致的订阅端音视频流回退。 |
| ByteSubscribeFallbackByPerformance | 1 | 由性能不足导致的订阅端音视频流回退。 |
| ByteSubscribeRecoverByBandwidth | 2 | 由带宽恢复导致的订阅端音视频流恢复。 |
| ByteSubscribeRecoverByPerformance | 3 | 由性能恢复导致的订阅端音视频流恢复。 |
| BytePublishFallbackByBandwidth | 4 | 由带宽不足导致的发布端音视频流回退。 |
| BytePublishFallbackByPerformance | 5 | 由性能不足导致的发布端音视频流回退。 |
| BytePublishRecoverByBandwidth | 6 | 由带宽恢复导致的发布端音视频流恢复。 |
| BytePublishRecoverByPerformance | 7 | 由性能恢复导致的发布端音视频流恢复。 |
typedef NS_ENUM(NSInteger, ByteLocalAudioStreamState)
本地音频流状态。 SDK 通过 rtcEngine:localAudioStateChanged:error: 回调本地音频流状态
| 类型 | 值 | 说明 |
|---|---|---|
| ByteLocalAudioStreamStateStopped | 0 | 本地音频默认初始状态。 麦克风停止工作时回调该状态,对应错误码 ByteLocalAudioStreamErrorOk |
| ByteLocalAudioStreamStateRecording | 1 | 本地音频录制设备启动成功。 采集到音频首帧时回调该状态,对应错误码 ByteLocalAudioStreamErrorOk |
| ByteLocalAudioStreamStateEncoding | 2 | 本地音频首帧编码成功。 音频首帧编码成功时回调该状态,对应错误码 ByteLocalAudioStreamErrorOk |
| ByteLocalAudioStreamStateFailed | 3 | 本地音频启动失败,在以下时机回调该状态: + 本地录音设备启动失败,对应错误码 ByteLocalAudioStreamErrorRecordFailure + 检测到没有录音设备权限,对应错误码 ByteLocalAudioStreamErrorDeviceNoPermission + 音频编码失败,对应错误码 ByteLocalAudioStreamErrorEncodeFailure |
typedef NS_ENUM(NSInteger, ByteLocalAudioStreamError)
本地音频流状态改变时的错误码 SDK 通过 rtcEngine:localAudioStateChanged:error: 回调该错误码
| 类型 | 值 | 说明 |
|---|---|---|
| ByteLocalAudioStreamErrorOk | 0 | 本地音频状态正常 |
| ByteLocalAudioStreamErrorFailure | 1 | 本地音频出错原因未知 |
| ByteLocalAudioStreamErrorDeviceNoPermission | 2 | 没有权限启动本地音频录制设备 |
| ByteLocalAudioStreamErrorDeviceBusy | 3 | 本地音频录制设备已经在使用中 |
| ByteLocalAudioStreamErrorRecordFailure | 4 | 本地音频录制失败,建议你检查录制设备是否正常工作 |
| ByteLocalAudioStreamErrorEncodeFailure | 5 | 本地音频编码失败 |
typedef NS_ENUM(NSInteger, ByteLocalVideoStreamState)
本地视频流状态
| 类型 | 值 | 说明 |
|---|---|---|
| ByteLocalVideoStreamStopped | 0 | 本地视频默认初始状态 摄像头停止工作时回调该状态,对应错误码 ByteLocalVideoStreamErrorOk |
| ByteLocalVideoStreamRecording | 1 | 本地视频录制设备启动成功 采集到视频首帧时回调该状态,对应错误码 ByteLocalVideoStreamErrorOk |
| ByteLocalVideoStreamEncoding | 2 | 本地视频首帧编码成功 本地视频首帧编码成功时回调该状态,对应错误码 ByteLocalVideoStreamErrorOk |
| ByteLocalVideoStreamFailed | 3 | 本地视频启动失败, 在以下时机回调该状态: + 本地采集设备启动失败,对应错误码 ByteLocalVideoStreamErrorRecordFailure + 检测到没有摄像头权限,对应错误码 ByteLocalVideoStreamErrorDeviceNoPermissionByteVideoStreamErrorDeviceNoPermission + 视频编码失败,对应错误码 ByteLocalVideoStreamErrorEncodeFailure |
typedef NS_ENUM(NSInteger, ByteLocalVideoStreamError)
本地视频状态改变时的错误码
| 类型 | 值 | 说明 |
|---|---|---|
| ByteLocalVideoStreamErrorOk | 0 | 本地视频状态正常 |
| ByteLocalVideoStreamErrorFailure | 1 | 视频流发布失败 |
| ByteLocalVideoStreamErrorDeviceNoPermission | 2 | 没有权限启动本地视频录制设备 |
| ByteLocalVideoStreamErrorDeviceBusy | 3 | 本地视频录制设备已经在使用中 |
| ByteLocalVideoStreamErrorRecordFailure | 4 | 本地视频录制失败,建议检查录制设备是否正常工作 |
| ByteLocalVideoStreamErrorEncodeFailure | 5 | 本地视频编码失败 |
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 | 远端音频流播放失败 |
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 | 远端用户离开房间 |
typedef NS_ENUM(NSInteger, ByteRemoteVideoState)
远端视频流状态
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRemoteVideoStateStopped | 0 | 远端视频流默认初始状态, 在以下时机回调该状态: + 本地用户停止接收远端视频流,对应错误码 ByteRemoteVideoReasonLocalMuted + 远端用户停止发送视频流,对应错误码 ByteRemoteVideoReasonRemoteMuted + 远端用户离开房间,对应错误码 ByteRemoteVideoReasonRemoteOffline |
| ByteRemoteVideoStateStarting | 1 | 本地用户已接收远端视频首包 收到远端视频首包时回调该状态,对应错误码 ByteRemoteVideoReasonLocalUnmuted |
| ByteRemoteVideoStateDecoding | 2 | 远端视频流正在解码,正常播放, 在以下时机回调该状态: + 成功解码远端视频首帧,对应错误码 ByteRemoteVideoReasonLocalUnmuted + 网络由阻塞恢复正常,对应错误码 ByteRemoteVideoReasonNetworkRecovery + 本地用户恢复接收远端视频流,对应错误码 ByteRemoteVideoReasonLocalUnmuted + 远端用户恢复发送视频流,对应错误码 ByteRemoteVideoReasonRemoteUnmuted |
| ByteRemoteVideoStateFrozen | 3 | 远端视频流卡顿 网络阻塞、丢包率等原因造成视频卡顿流时会回报该状态,对应错误码 ByteRemoteVideoReasonNetworkCongestion |
| ByteRemoteVideoStateFailed | 4 | 远端音频流播放失败 |
typedef NS_ENUM(NSInteger, ByteRemoteVideoReason)
远端视频流状态改变的原因
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRemoteVideoReasonInternal | 0 | 内部原因 |
| ByteRemoteVideoReasonNetworkCongestion | 1 | 网络阻塞 |
| ByteRemoteVideoReasonNetworkRecovery | 2 | 网络恢复正常 |
| ByteRemoteVideoReasonLocalMuted | 3 | 本地用户停止接收远端视频流或本地用户禁用视频模块 |
| ByteRemoteVideoReasonLocalUnmuted | 4 | 本地用户恢复接收远端视频流或本地用户启用视频模块 |
| ByteRemoteVideoReasonRemoteMuted | 5 | 远端用户停止发送视频流或远端用户禁用视频模块 |
| ByteRemoteVideoReasonRemoteUnmuted | 6 | 远端用户恢复发送视频流或远端用户启用视频模块 |
| ByteRemoteVideoReasonRemoteOffline | 7 | 远端用户离开频道 |
typedef NS_ENUM(NSInteger, ByteVideoCodecType)
编码类型
| 类型 | 值 | 说明 |
|---|---|---|
| kByteVideoCodecUnknown | 0 | 视频编码类型:未知类型 |
| kByteVideoCodecH264 | 1 | 视频编码类型:标准 H264 |
| kByteVideoCodecByteVC1 | 2 | 视频编码类型:标准 ByteVC1 |
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) | 回声噪音 |
typedef NS_ENUM(NSUInteger, BackgroundMode)
背景模式 开启背景替换功能时生效,详见 replaceBackground:withDivideModel:。
| 类型 | 值 | 说明 |
|---|---|---|
| BACKGROUND_A | 0 | 背景1 |
| BACKGROUND_B | 1 | 背景2 |
| BLUR | 2 | 虚化 |
| NONE | 3 | 无 |
typedef NS_ENUM(NSUInteger, DivideModel)
分割模型 开启背景替换功能时生效,详见 replaceBackground:withDivideModel:。
| 类型 | 值 | 说明 |
|---|---|---|
| EFFECT | 0 | effect |
| DEFAULT | 1 | 自研 |
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进行传输加密 |
@interface ByteRtcVideoCanvas : NSObject
视频渲染图层结构。app 通过该结构将要渲染的窗口和视频流进行绑定
| 类型 | 名称 |
|---|---|
| UIView* | view |
| ByteRtcRenderMode | renderMode |
| NSString* | roomId |
| NSString* | uid |
@property (strong, nonatomic) UIView* _Nullable view;
渲染窗口句柄
@property (assign, nonatomic) ByteRtcRenderMode renderMode;
设置渲染模式,暂时设置无效
@property (strong, nonatomic) NSString* _Nullable roomId;
房间ID
@property (strong, nonatomic) NSString* _Nullable uid;
设置渲染流的用户标识
@interface ByteRtcFrameExtendedData : NSObject
视频帧附加的数据,视频解码后获得的附加数据
| 类型 | 名称 |
|---|---|
| NSData* | extendedData |
| NSInteger | extendedDataLen |
@property (strong, nonatomic) NSData * _Nullable extendedData;
附加数据
@property (assign, nonatomic) NSInteger extendedDataLen;
附加数据长度
@interface VideoStreamDescription: NSObject
视频流描述
| 类型 | 名称 |
|---|---|
| CGSize | videoSize |
| NSInteger | frameRate |
| NSInteger | maxKbps |
| ByteVideoStreamScaleMode | mode |
| ByteVideoEncoderPreference | encoderPreference |
@property (nonatomic, assign) CGSize videoSize;
视频分辨率
@property (nonatomic, assign) NSInteger frameRate;
视频预设帧率
@property (nonatomic, assign) NSInteger maxKbps;
视频预设最大码率(Kbps)
@property (nonatomic, assign) ByteVideoStreamScaleMode mode;
视频拉伸模式,详见类型ByteVideoStreamScaleMode
@property (nonatomic, assign) ByteVideoEncoderPreference encoderPreference;
视频编码质量偏好,详见类型ByteVideoEncoderPreference
@protocol ByteStream <NSObject>
流属性。房间中的远端流的流属性。
用户加入房间成功后,房间中所有已发布和未来发布的流和流的相关属性,都会通过 rtcEngine:onStreamAdd: 回调时间通知用户。此数据结构即为回调给用户的参数类型。
| 类型 | 名称 |
|---|---|
| NSString* | streamId |
| NSString* | userId |
| BOOL | isScreen |
| BOOL | hasVideo |
| BOOL | hasAudio |
| NSArray |
videoStreamDescriptions |
@property (nonatomic, copy, readonly) NSString * streamId;
流ID 。远端流的唯一标识。
@property (nonatomic, copy, readonly) NSString * userId;
用户ID 。此流的发布用户的用户ID 。
@property (nonatomic, assign, readonly) BOOL isScreen;
此流是否为共享屏幕流。
@property (nonatomic, assign, readonly) BOOL hasVideo;
此流是否包括视频流。
@property (nonatomic, assign, readonly) BOOL hasAudio;
流是否包括音频流。
@property (nonatomic, copy, readonly) NSArray<VideoStreamDescription *> * videoStreamDescriptions;
视频流的分辨率信息。
用户可以通过调用 setVideoProfilessetVideoProfiles: 方法在一路流中发布多个不同分辨率的视频。此参数即为流中所有视频的分辨率等相关信息。视频流的分辨率信息,详见 VideoStreamDescription 类型。
@interface SubscribeConfig: NSObject
订阅流的参数配置。用户手动订阅一路音视频流所使用的订阅配置参数。
用户关闭自动订阅功能,使用手动订阅模式时,通过调用 subscribeStream:subscribeConfig: 方法订阅音视频流,调用时传入的参数即为此数据类型。
| 类型 | 名称 |
|---|---|
| BOOL | subscribeVideo |
| BOOL | subscribeAudio |
| NSInteger | videoIndex |
@property (nonatomic, assign) BOOL subscribeVideo;
是否订阅视频。
用户通过设置此参数,选择是否订阅远端流中的视频。 true 为订阅视频,false 为不订阅视频,默认值为 true 。
@property (nonatomic, assign) BOOL subscribeAudio;
是否订阅音频。
用户通过设置此参数,选择是否订阅远端流中的音频。true 为订阅音频,false 为不订阅音频,默认值为 true 。
@property (nonatomic, assign) NSInteger videoIndex;
订阅的视频流分辨率下标。
用户可以通过调用 setVideoProfilessetVideoProfiles: 方法在一路流中发布多个不同分辨率的视频。因此订阅流时,需要指定订阅的具体分辨率。此参数即用于指定需订阅的分辨率的下标,默认值为 0 。
@interface ByteAudioFrame : NSObject
音频帧
| 类型 | 名称 |
|---|---|
| NSData* | samples |
| int | numOfSamples |
| int | bytesPerSample |
| int | channels |
| int | samplesPerSec |
@property (strong, nonatomic) NSData * _Nonnull samples;
音频帧数据
@property (assign, nonatomic) int numOfSamples;
此音频帧描述的样点数
@property (assign, nonatomic) int bytesPerSample;
每个采样点占据的内存大小,s16 为 2 byte
@property (assign, nonatomic) int channels;
音频通道数
@property (assign, nonatomic) int samplesPerSec;
音频采样率
typedef NS_ENUM(NSInteger, VideoFrameType)
视频帧类型
| 类型 | 值 | 说明 |
|---|---|---|
| kFrameTypeRawMemory | 0 | 视频帧类型:内存数据 |
| kFrameTypePixelBuffer | 0 | 视频帧类型:CVPixelBuffer |
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 |
@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 |
@property (assign, nonatomic) NSInteger format;
视频帧类型,参考 VideoPixelFormat
@property (assign, nonatomic) CMTime time;
当前帧的时间戳信息
@property (assign, nonatomic) int strideInPixels;
每一行像素占用的字节数
@property (assign, nonatomic) int width;
视频帧宽度
@property (assign, nonatomic) int height;
视频帧高度
@property (assign, nonatomic) CVPixelBufferRef _Nullable textureBuf;
CVPixelBufferRef 类型的数据,当 format 为 kPixelFormatCVPixelBuffer 时有效
@property (strong, nonatomic) NSData * _Nullable dataBuf;
视频帧内存块首地址
@property (assign, nonatomic) int cropLeft;
视频帧左边裁剪的尺寸(像素)
@property (assign, nonatomic) int cropTop;
视频帧上部裁剪的尺寸(像素)
@property (assign, nonatomic) int cropRight;
视频帧右边裁剪的尺寸(像素)
@property (assign, nonatomic) int cropBottom;
视频帧底部裁剪的尺寸(像素)
@property (assign, nonatomic) ByteVideoRotation rotation;
视频帧旋转角度:0, 90, 180, 270
@property (strong, nonatomic) ByteRtcFrameExtendedData *extendedData;
视频帧附加的数据
@interface ByteRtcVideoCompositingRegion : NSObject
单个视频流在合流中的布局信息。
此数据类型为,开启直播推流转码功能,多路视频流合流时,其中一路视频流在合流中的预设布局信息。
| 类型 | 名称 |
|---|---|
| NSString* | uid |
| CGFloat | x |
| CGFloat | y |
| CGFloat | width |
| CGFloat | height |
| NSInteger | zOrder |
| CGFloat | alpha |
| NSInteger | contentControl |
| ByteRtcRenderMode | renderMode |
@property (copy, nonatomic) NSString * _Nonnull uid;
用户ID 。视频流发布用户的用户ID 。
@property (assign, nonatomic) CGFloat x;
用户视频布局相对画布左侧的偏移量。相对值,范围为[0.0 - 1.0]。
@property (assign, nonatomic) CGFloat y;
用户视频布局相对画布顶端的偏移量。相对值,范围为[0.0 - 1.0]。
@property (assign, nonatomic) CGFloat width;
用户视频宽度相对用户原始视频宽度的比例。相对值,范围为[0.0 - 1.0]。
@property (assign, nonatomic) CGFloat height;
用户视频高度相对用户原始视频高度的比例。相对值,范围为[0.0 - 1.0]。
@property (assign, nonatomic) NSInteger zOrder;
用户视频布局在画布中的层级。0为底层,值越大越上层,范围为[0 - 100]。
@property (assign, nonatomic) CGFloat alpha;
透明度。范围为[0 - 255]。
@property (assign, nonatomic) NSInteger contentControl;
合流内容控制。默认值为 0 ,取值范围及含义如下:
+ 0: 输出的混流包含音视频
+ 1: 只包含音频
+ 2: 表示只包含视频
@property (assign, nonatomic) ByteRtcRenderMode renderMode;
视频显示模式。详见 ByteRtcRenderMode 数据类型。
@interface ByteRtcVideoCompositingLayout : NSObject
视频流合流整体布局信息。
此数据类型为,开启直播推流转码功能,视频合流的完整信息。包括了参与合流的每路视频流的预设布局信息和合流背景信息等。
| 类型 | 名称 |
|---|---|
| NSString* | backgroundColor |
| NSArray |
regions |
| NSString* | appData |
@property (copy, nonatomic) NSString *_Nonnull backgroundColor;
画布的背景颜色。
@property (copy, nonatomic) NSArray<ByteRtcVideoCompositingRegion *> * _Nonnull regions;
用户布局信息列表。每条流的具体布局详见 ByteRtcVideoCompositingRegion 数据类型。
@property (copy, nonatomic) NSString *_Nonnull appData;
透传的 App 数据。
@interface ByteRtcTranscodingVideoConfig : NSObject
视频转码配置参数。
| 类型 | 名称 |
|---|---|
| NSString* | codec |
| NSInteger | width |
| NSInteger | height |
| NSInteger | fps |
| NSInteger | gop |
| NSInteger | kBitRate |
| BOOL | lowLatency |
@property (copy, nonatomic) NSString * _Nonnull codec;
视频编码格式。
@property (assign, nonatomic) NSInteger width;
合流视频宽度。
@property (assign, nonatomic) NSInteger height;
合流视频高度。
@property (assign, nonatomic) NSInteger fps;
合流视频帧率信息。
@property (assign, nonatomic) NSInteger gop;
视频I帧间隔。
@property (assign, nonatomic) NSInteger kBitRate;
合流视频码率,单位为 kbps 。
@property (assign, nonatomic) BOOL lowLatency;
是否使用低延时特性。
typedef NS_ENUM(NSInteger, ByteAACProfile)
AAC编码类型。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteAACProfileLC | 0 | LC(默认) |
| ByteAACProfileMain | 1 | MAIN |
| ByteAACProfileHEv1 | 2 | HEv1 |
| ByteAACProfileHEv2 | 3 | HEv2 |
@interface ByteRtcTranscodingAudioConfig : NSObject
音频转码配置参数。
| 类型 | 名称 |
|---|---|
| NSString* | codec |
| NSInteger | sampleRate |
| NSInteger | channels |
| NSInteger | kBitRate |
| ByteAACProfile | profile |
@property (copy, nonatomic) NSString * _Nonnull codec;
音频编码格式。
@property (assign, nonatomic) NSInteger sampleRate;
音频采样率。单位为 kHz。可选取值:16, 32, 44.1, 48。
@property (assign, nonatomic) NSInteger channels;
声道数。
@property (assign, nonatomic) NSInteger kBitRate;
音频码率。单位为 kbps。可选取值:16, 32, 64。
@property (assign, nonatomic) ByteAACProfile profile;
AAC 等级。
@interface ByteRtcLiveTranscoding : NSObject
直播推流转码配置参数。
用户调用 enableLiveTranscoding: 方法开启直播推流转码功能时,传入的合流转码配置参数。
| 类型 | 名称 |
|---|---|
| ByteRtcVideoCompositingLayout* | layout |
| ByteRtcTranscodingVideoConfig* | video |
| ByteRtcTranscodingAudioConfig* | audio |
| NSMutableDictionary* | advancedConfig |
| NSString* | url |
| 返回 | 名称 |
|---|---|
| instancetype | defaultTranscoding |
@property (strong, nonatomic) ByteRtcVideoCompositingLayout * _Nonnull layout;
视频合流布局信息。详见 ByteRtcVideoCompositingLayout 数据类型。
@property (strong, nonatomic) ByteRtcTranscodingVideoConfig * _Nonnull video;
视频转码参数。详见 ByteRtcTranscodingVideoConfig 数据类型。
@property (strong, nonatomic) ByteRtcTranscodingAudioConfig * _Nonnull audio;
音频转码参数。详见 ByteRtcTranscodingAudioConfig 数据类型。
@property (strong, nonatomic) NSMutableDictionary * _Nullable advancedConfig;
动态扩展自定义参数。
@property (copy, nonatomic) NSString * _Nullable url;
推流 CDN 地址。
+ (instancetype _Nonnull)defaultTranscoding;
获取默认合流参数。
@interface ByteRtcStats : NSObject
房间通话统计数据。
用户加入当前房间成功后,SDK 会周期性(2s)的通过rtcEngine:reportRtcStats:回调事件通知用户当前房间内的汇总统计信息。回调的统计信息即为此数据类型。
| 类型 | 名称 |
|---|---|
| NSInteger | duration |
| NSInteger | txBytes |
| NSInteger | rxBytes |
| NSInteger | txAudioKBitrate |
| NSInteger | rxAudioKBitrate |
| NSInteger | txVideoKBitrate |
| NSInteger | rxVideoKBitrate |
| NSInteger | userCount |
@property (assign, nonatomic) NSInteger duration;
用户在房间中的总时长。单位为 s 。
@property (assign, nonatomic) NSInteger txBytes;
用户在通话过程中发送媒体数据总量。单位为 bytes 。
@property (assign, nonatomic) NSInteger rxBytes;
用户在通话过程中接收媒体数据总量。单位为 bytes 。
@property (assign, nonatomic) NSInteger txAudioKBitrate;
发送音频码率。此次统计周期内总发送音频码率,单位为 kbps 。
@property (assign, nonatomic) NSInteger rxAudioKBitrate;
接收音频码率。此次统计周期内总接收音频码率,单位为 kbps 。
@property (assign, nonatomic) NSInteger txVideoKBitrate;
发送视频码率。此次统计周期内总发送视频码率,单位为 kbps 。
@property (assign, nonatomic) NSInteger rxVideoKBitrate;
接收视频码率。此次统计周期内总接收视频码率,单位为 kbps 。
@property (assign, nonatomic) NSInteger userCount;
当前房间内用户总数。回调时房间内的用户总数,包括本地用户自身。
@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 |
@property (assign, nonatomic) float sentKBitrate;
发送的码率。此次统计周期内的视频发送码率,单位为 kbps 。
@property (assign, nonatomic) NSInteger inputFrameRate;
输入帧率。此次统计周期内的本地视频输入帧率 。
@property (assign, nonatomic) NSInteger sentFrameRate;
发送帧率。此次统计周期内的本地视频发送帧率 。
@property (assign, nonatomic) NSInteger encoderOutputFrameRate;
本地视频目标编码帧率。
@property (assign, nonatomic) NSInteger rendererOutputFrameRate;
本地视频目标渲染输出帧率。
@property (assign, nonatomic) NSInteger sentTargetKBitrate;
本地视频目标发送码率。单位为 kbps 。
@property (assign, nonatomic) NSInteger sentTargetFrameRate;
本地视频目标发送帧率。
@property (assign, nonatomic) NSInteger statsInterval;
统计间隔。此次统计周期的间隔,单位为 ms 。
@property (assign, nonatomic) float videoLossRate;
音频丢包率。统计周期内的视频上行丢包率,取值范围为 [0, 1] 。
@property (assign, nonatomic) NSInteger rtt;
往返时延。单位为 ms 。
@property(assign, nonatomic) NSInteger encodedBitrate;
编码率。
@property(assign, nonatomic) NSInteger encodedFrameWidth;
编码帧宽度。
@property(assign, nonatomic) NSInteger encodedFrameHeight;
编码帧高度。
@property(assign, nonatomic) NSInteger encodedFrameCount;
编码帧数。此次统计周期内编码的帧数。
@property(nonatomic) ByteVideoCodecType codecType;
编码类型。详见 ByteVideoCodecType 类型。
@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 |
@property (copy, nonatomic) NSString * _Nonnull uid;
用户ID 。远端视频流发布用户的用户ID 。
@property (assign, nonatomic) NSInteger width;
远端视频宽度。
@property (assign, nonatomic) NSInteger height;
远端视频高度。
@property (assign, nonatomic) float videoLossRate;
远端视频丢包率。统计周期内的视频下行丢包率,取值范围为 [0, 1] 。
@property (assign, nonatomic) float receivedKBitrate;
接收码率。统计周期内的视频接收码率,单位为 kbps 。
@property (assign, nonatomic) NSInteger receivedFrameRate;
远端视频接收帧率。
@property (assign, nonatomic) NSInteger decoderOutputFrameRate;
远端视频解码输出帧率。
@property (assign, nonatomic) NSInteger renderOutputFrameRate;
远端视频渲染输出帧率。
@property (assign, nonatomic) NSInteger stallCount;
远端视频卡顿次数。
@property (assign, nonatomic) NSInteger stallDuration;
远端视频卡顿时长,单位为 ms 。
@property (assign, nonatomic) NSInteger e2eDelay;
用户体验级别的端到端延时。从发送端采集完成编码开始到接收端解码完成渲染开始的延时,单位为 ms 。
@property (assign, nonatomic) BOOL isScreen;
远端视频流是否是屏幕共享流。
@property (assign, nonatomic) NSInteger statsInterval;
统计间隔。此次统计周期的间隔,单位为 ms 。
@property (assign, nonatomic) NSInteger rtt;
往返时延。单位为 ms 。
@property(assign, nonatomic) NSInteger frozenRate;
远端用户在加入房间后发生视频卡顿的累计时长占音频总有效时长的百分比。
@property (assign, nonatomic) NSInteger videoIndex;
SDK 订阅的远端视频流的分辨率下标。
@interface ByteRtcLocalAudioStats : NSObject
本地音频流统计信息。
本地用户发布音频流成功后,SDK 会周期性(2s)的通过 rtcEngine:localAudioStats: 回调事件通知用户发布的音频流在此次统计周期内的状况。此数据结构即为回调给用户的参数类型。
| 类型 | 名称 |
|---|---|
| float | audioLossRate |
| float | sentKBitrate |
| NSInteger | recordSampleRate |
| NSInteger | statsInterval |
| NSInteger | rtt |
| NSInteger | numChannels |
| NSInteger | sentSampleRate |
@property (assign, nonatomic) float audioLossRate;
音频丢包率。此次统计周期内的音频上行丢包率,取值范围为 [0, 1] 。
@property (assign, nonatomic) float sentKBitrate;
发送的码率。此次统计周期内的音频发送码率,单位为 kbps 。
@property (assign, nonatomic) NSInteger recordSampleRate;
采集采样率。音频采集采样率信息,单位为 Hz 。
@property (assign, nonatomic) NSInteger statsInterval;
统计间隔。此次统计周期的间隔,单位为 ms 。
@property (assign, nonatomic) NSInteger rtt;
往返时延。单位为 ms 。
@property(assign, nonatomic) NSInteger numChannels;
音频声道数。
@property(assign, nonatomic) NSInteger sentSampleRate;
发送采样率。音频发送采样率信息,单位为 Hz 。
@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 |
@property (copy, nonatomic) NSString * _Nonnull uid;
用户ID 。远端音频流发布用户的用户ID 。
@property (assign, nonatomic) float audioLossRate;
音频丢包率。统计周期内的音频下行丢包率,取值范围为 [0, 1] 。
@property (assign, nonatomic) float receivedKBitrate;
接收码率。统计周期内的音频接收码率,单位为 kbps 。
@property (assign, nonatomic) NSInteger stallCount;
音频卡顿次数。统计周期内的卡顿次数。
@property (assign, nonatomic) NSInteger stallDuration;
音频卡顿时长。统计周期内的卡顿时长,单位为 ms 。
@property (assign, nonatomic) NSInteger playoutSampleRate;
播放采样率。统计周期内的音频播放采样率信息,单位为 Hz 。
@property (assign, nonatomic) NSInteger e2eDelay;
用户体验级别的端到端延时。从发送端采集完成编码开始到接收端解码完成渲染开始的延时,单位为 ms 。
@property (assign, nonatomic) NSInteger statsInterval;
统计间隔。此次统计周期的间隔,单位为 ms 。
@property (assign, nonatomic) NSInteger rtt;
往返时延。单位为 ms 。
@property(assign, nonatomic) NSInteger quality;
远端用户发送的音频流质量。值含义参考 ByteNetworkQuality 。
@property(assign, nonatomic) NSInteger jitterBufferDelay;
音频发送端到接收端的网络延迟。单位为 ms 。
@property(assign, nonatomic) NSInteger numChannels;
音频声道数。
@property(assign, nonatomic) NSInteger receivedSampleRate;
音频接收采样率。统计周期内接收到的远端音频采样率信息,单位为 Hz 。
@property(assign, nonatomic) NSInteger frozenRate;
远端用户在加入房间后发生音频卡顿的累计时长占音频总有效时长的百分比。
@property(assign, nonatomic) NSInteger concealedSamples;
音频 PLC 样点总个数。
@property(assign, nonatomic) NSInteger concealmentEvent;
PLC 累计次数。
@property(assign, nonatomic) NSInteger decSampleRate;
音频解码采样率。统计周期内的音频解码采样率信息,单位为 Hz 。
@property(assign, nonatomic) NSInteger decDuration;
解码时长。单位为 s 。
@interface ByteRtcAudioVolumeInfo : NSObject
音量信息
| 类型 | 名称 |
|---|---|
| NSString* | uid |
| NSUInteger | volume |
@property (copy, nonatomic) NSString * _Nonnull uid;
音量信息所属用户的用户ID
@property (assign, nonatomic) NSUInteger volume;
用户音量大小信息,音量取值范围为 [0, 255]
@interface ByteSourceWantedData : NSObject
性能回退相关数据
| 类型 | 名称 |
|---|---|
| NSInteger | width |
| NSInteger | height |
| NSInteger | frameRate |
@property (nonatomic, assign) NSInteger width;
推荐视频输入宽
@property (nonatomic, assign) NSInteger height;
推荐视频输入高
@property (nonatomic, assign) NSInteger frameRate;
推荐视频输入帧率
@interface ByteRtcStreamOC : NSObject <ByteStream>
流信息
| 类型 | 名称 |
|---|---|
| NSString* | streamId |
| NSString* | userId |
| BOOL | isScreen |
| BOOL | hasVideo |
| BOOL | hasAudio |
| NSArray |
videoStreamDescriptions |
@property (nonatomic, copy, nullable) NSString *streamId;
流ID
@property (nonatomic, copy, nullable) NSString *userId;
用户ID
@property (nonatomic, assign) BOOL isScreen;
流是否为共享屏幕流。
@property (nonatomic, assign) BOOL hasVideo;
该路流中是否包含视频
@property (nonatomic, assign) BOOL hasAudio;
该路流中是否包含音频
@property (nonatomic, copy, nullable) NSArray<VideoStreamDescription *> *videoStreamDescriptions/;
视频流的分辨率信息,详见 VideoStreamDescription 类。 用户可以通过调用 setVideoProfilessetVideoProfiles: 方法在一路流中发布多个不同的视频分辨率。此参数即为流中所有分辨率的相关信息。
@interface ScreenCaptureParam : NSObject
屏幕采集设置参数
| 类型 | 名称 |
|---|---|
| NSInteger | width |
| NSInteger | height |
| NSInteger | frameRate |
| NSInteger | bitrate |
| BOOL | captureMouseCursor |
@property (nonatomic, assign) NSInteger width;
屏幕采集宽度
@property (nonatomic, assign) NSInteger height;
屏幕采集高度
@property (nonatomic, assign) NSInteger frameRate;
屏幕采集帧率,单位 fps
@property (nonatomic, assign) NSInteger bitrate;
发送屏幕采集码率,单位 kbps
@property (nonatomic, assign) BOOL captureMouseCursor;
是否采集鼠标