typedef NS_ENUM(NSInteger, ByteRTCAudioScenarioType)
objectivec音频场景类型。
选择音频场景后,SDK 会根据操作系统和开麦、闭麦状态,应用通话音量或媒体音量。参看通话音量与媒体音量了解更多相关信息。
如果以下音频场景类型无法满足你的业务需要,请联系技术支持人员。
| 类型 | 值 | 说明 | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ByteRTCAudioScenarioMusic | 0 | (默认)音乐场景。 此场景适用于对音乐表现力有要求的场景,如音乐直播等。 注意:在此场景下,使用内置扬声器/听筒时,开关麦可能发生音量突变。 不同音频设备,开麦和闭麦状态下的使用的音量类型:
| |||||||||||||||
| ByteRTCAudioScenarioHighqualityCommunication | 1 | 高质量通话场景。兼顾外放/蓝牙耳机时的音频体验。 注意:在此场景下,使用内置扬声器/听筒时,开关麦可能发生音量突变。使用 ByteRTCAudioScenarioHighqualityChat 可以避免此种情况。不同音频设备,开麦和闭麦状态下的使用的音量类型:
| |||||||||||||||
| ByteRTCAudioScenarioCommunication | 2 | 纯通话音量场景。 可以最大程度地消除回声,使通话清晰度达到最优。全程使用通话音量,不会有音量突变的听感。 适用于需要频繁上下麦的通话或会议场景。 但是,此场景会压低使用媒体音量进行播放的其他音频的音量,且音质会变差。 | |||||||||||||||
| ByteRTCAudioScenarioMedia | 3 | 媒体场景。 全程使用媒体音量,不会有音量突变的听感。 外放通话时,可能出现回声和啸叫,请联系技术支持人员。 | |||||||||||||||
| ByteRTCAudioScenarioGameStreaming | 4 | 游戏媒体场景。 若外放通话且无游戏音效消除优化时音质不理想,请联系技术支持人员。 不同音频设备,开麦和闭麦状态下的使用的音量类型:
| |||||||||||||||
| ByteRTCAudioScenarioHighqualityChat | 5 | 高质量畅聊场景。 此场景和 ByteRTCAudioScenarioHighqualityCommunication 高度类似,唯一的差异在于:此场景下,在使用设备自带的麦克风和扬声器/听筒进行通话时,开关麦始终采用通话音量,不会引起音量类型突变。 不同音频设备,开麦和闭麦状态下的使用的音量类型:
|
typedef NS_ENUM(NSInteger, ByteRTCVoiceChangerType)
objectivec变声特效类型。如需更多类型,联系技术支持。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCVoiceChangerOriginal | 0 | 原声,不含特效 |
| ByteRTCVoiceChangerGiant | 1 | 巨人 |
| ByteRTCVoiceChangerChipmunk | 2 | 花栗鼠 |
| ByteRTCVoiceChangerMinionst | 3 | 小黄人 |
| ByteRTCVoiceChangerVibrato | 4 | 颤音 |
| ByteRTCVoiceChangerRobot | 5 | 机器人 |
typedef NS_ENUM(NSInteger, ByteRTCVoiceReverbType)
objectivec混响特效类型
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCVoiceReverbOriginal | 0 | 原声,不含特效 |
| ByteRTCVoiceReverbEcho | 1 | 回声 |
| ByteRTCVoiceReverbConcert | 2 | 演唱会 |
| ByteRTCVoiceReverbEthereal | 3 | 空灵 |
| ByteRTCVoiceReverbKTV | 4 | KTV |
| ByteRTCVoiceReverbStudio | 5 | 录音棚 |
| ByteRTCVoiceReverbVirtualStereo | 6 | 虚拟立体声 |
| ByteRTCVoiceReverbSpacious | 7 | 空旷 |
| ByteRTCVoiceReverb3D | 8 | 3D人声 |
typedef NS_ENUM(NSInteger, ByteRTCBandFrequency)
objectivec音频均衡效果。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCBandFrequency31 | 0 | 中心频率为 31Hz 的频带。 |
| ByteRTCBandFrequency62 | 1 | 中心频率为 62Hz 的频带。 |
| ByteRTCBandFrequency125 | 2 | 中心频率为 125Hz 的频带。 |
| ByteRTCBandFrequency250 | 3 | 中心频率为 250Hz 的频带。 |
| ByteRTCBandFrequency500 | 4 | 中心频率为 500Hz 的频带。 |
| ByteRTCBandFrequency1k | 5 | 中心频率为 1kHz 的频带。 |
| ByteRTCBandFrequency2k | 6 | 中心频率为 2kHz 的频带。 |
| ByteRTCBandFrequency4k | 7 | 中心频率为 4kHz 的频带。 |
| ByteRTCBandFrequency8k | 8 | 中心频率为 8kHz 的频带。 |
| ByteRTCBandFrequency16k | 9 | 中心频率为 16kHz 的频带。 |
@interface ByteRTCVoiceEqualizationConfig : NSObject
objectivec语音均衡效果。
| 类型 | 名称 |
|---|---|
| ByteRTCBandFrequency | frequency |
| int | gain |
@property(assign, nonatomic) ByteRTCBandFrequency frequency;
objectivec频带。参看 ByteRTCBandFrequency。
@property(assign, nonatomic) int gain;
objectivec频带增益(dB)。取值范围是 [-15, 15]。
@interface ByteRTCVoiceReverbConfig : NSObject
objectivec音频混响效果。
| 类型 | 名称 |
|---|---|
| float | roomSize |
| float | decayTime |
| float | damping |
| float | wetGain |
| float | dryGain |
| float | preDelay |
@property(assign, nonatomic) float roomSize;
objectivec混响模拟的房间大小,取值范围 [0.0, 100.0]。默认值为 50.0f。房间越大,混响越强。
@property(assign, nonatomic) float decayTime;
objectivec混响的拖尾长度,取值范围 [0.0, 100.0]。默认值为 50.0f。
@property(assign, nonatomic) float damping;
objectivec混响的衰减阻尼大小,取值范围 [0.0, 100.0]。默认值为 50.0f。
@property(assign, nonatomic) float wetGain;
objectivec早期反射信号强度。取值范围 [-20.0, 10.0],单位为 dB。默认值为 0.0f。
@property(assign, nonatomic) float dryGain;
objectivec原始信号强度。取值范围 [-20.0, 10.0],单位为 dB。默认值为 0.0f。
@property(assign, nonatomic) float preDelay;
objectivec早期反射信号的延迟。取值范围 [0.0, 200.0],单位为 ms。默认值为 0.0f。
typedef NS_ENUM(NSInteger, ByteRTCAudioProfileType)
objectivec音质档位
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCAudioProfileDefault | 0 | 默认音质 服务器下发或客户端已设置的 ByteRTCRoomProfile 的音质配置 |
| ByteRTCAudioProfileFluent | 1 | 流畅 单声道,采样率为 16 kHz,编码码率为 32 Kbps。 流畅优先、低功耗、低流量消耗,适用于大部分游戏场景,如小队语音、组队语音、国战语音等。 |
| ByteRTCAudioProfileStandard | 2 | 单声道标准音质。 采样率为 24 kHz,编码码率为 48 Kbps。 适用于对音质有一定要求的场景,同时延时、功耗和流量消耗相对适中,适合教育场景和狼人杀等游戏。 |
| ByteRTCAudioProfileHD | 3 | 双声道音乐音质 采样率为 48 kHz,编码码率为 128 kbps。 超高音质,同时延时、功耗和流量消耗相对较大,适用于连麦 PK 等音乐场景。 游戏场景不建议使用。 |
| ByteRTCAudioProfileStandardStereo | 4 | 双声道标准音质。采样率为 48 KHz,编码码率最大值为 80 Kbps |
| ByteRTCAudioProfileHDMono | 5 | 单声道音乐音质。采样率为 48 kHz,编码码率最大值为 64 Kbps |
typedef NS_ENUM(NSInteger, ByteRTCAnsMode)
objectivec降噪模式。降噪算法受调用 joinRoom:userInfo:roomConfig: 时设置的房间模式影响。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCAnsModeDisable | 0 | 关闭所有音频降噪能力。 |
| ByteRTCAnsModeLow | 1 | 适用于微弱降噪。 |
| ByteRTCAnsModeMedium | 2 | 适用于抑制中度平稳噪声,如空调声和风扇声。 |
| ByteRTCAnsModeHigh | 3 | 适用于抑制嘈杂非平稳噪声,如键盘声、敲击声、碰撞声、动物叫声。 |
| ByteRTCAnsModeAutomatic | 4 | 启用音频降噪能力。具体的降噪算法由 RTC 智能决策。 |
typedef NS_ENUM(NSInteger, ByteRTCAudioDeviceType)
objectivec当前音频设备类型
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCAudioDeviceTypeUnknown | -1 | 未知音频设备 |
| ByteRTCAudioDeviceTypeRenderDevice | 0 | 音频渲染设备 |
| ByteRTCAudioDeviceTypeCaptureDevice | 1 | 音频采集设备 |
| ByteRTCAudioDeviceTypeScreenCaptureDevice | 2 | 屏幕流音频设备 |
typedef NS_ENUM(NSInteger, ByteRTCAudioSampleRate)
objectivec音频采样率,单位为 Hz。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCAudioSampleRateAuto | -1 | 默认设置。48000Hz。 |
| ByteRTCAudioSampleRate8000 | 8000 | 8000Hz |
| ByteRTCAudioSampleRate16000 | 16000 | 16000Hz |
| ByteRTCAudioSampleRate32000 | 32000 | 32000Hz |
| ByteRTCAudioSampleRate44100 | 44100 | 44100Hz |
| ByteRTCAudioSampleRate48000 | 48000 | 48000Hz |
typedef NS_ENUM(NSInteger, ByteRTCAudioChannel)
objectivec音频声道。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCAudioChannelAuto | -1 | 默认设置。默认值为 2。 |
| ByteRTCAudioChannelMono | 1 | 单声道 |
| ByteRTCAudioChannelStereo | 2 | 双声道 |
typedef NS_ENUM(NSInteger, ByteRTCTranscodingAudioCodec)
objectivec音频编码类型。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCTranscodingAudioCodecAAC | 0 | AAC 格式。 |
typedef NS_ENUM(NSInteger, ByteRTCMixedStreamAudioCodecType)
objectivec音频编码类型。(新)
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCMixedStreamAudioCodecTypeAAC | 0 | AAC 格式。 |
typedef NS_ENUM(NSInteger, ByteRTCMixedStreamAudioProfile)
objectivecAAC 编码规格。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCMixedStreamAudioProfileLC | 0 | AAC-LC 规格,默认值。 |
| ByteRTCMixedStreamAudioProfileHEv1 | 1 | HE-AAC v1 规格。 |
| ByteRTCMixedStreamAudioProfileHEv2 | 2 | HE-AAC v2 规格。 |
typedef NS_ENUM(NSInteger, ByteRTCAACProfile)
objectivecAAC 编码规格。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCAACProfileLC | 0 | AAC-LC 规格,默认值。 |
| ByteRTCAACProfileHEv1 | 1 | HE-AAC v1 规格。 |
| ByteRTCAACProfileHEv2 | 2 | HE-AAC v2 规格。 |
typedef NS_ENUM(NSInteger, ByteRTCAudioRoute)
objectivec音频播放路由
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCAudioRouteDefault | -1 | 默认设备。通过 setDefaultAudioRoute: 设置的音频路由。 |
| ByteRTCAudioRouteHeadset | 1 | 有线耳机 |
| ByteRTCAudioRouteEarpiece | 2 | 听筒。设备自带的,一般用于通话的播放硬件。 |
| ByteRTCAudioRouteSpeakerphone | 3 | 扬声器。设备自带的,一般用于免提播放的硬件。 |
| ByteRTCAudioRouteHeadsetBluetooth | 4 | 蓝牙耳机 |
| ByteRTCAudioRouteHeadsetUSB | 5 | USB设备 |
typedef NS_ENUM(NSInteger, ByteRTCAudioPlaybackDevice)
objectivec音频播放设备
音频设备变化时 SDK 通过 rtcEngine:onAudioPlaybackDeviceChanged: 回调当前音频播放设备。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCAudioPlaybackDeviceHeadset | 1 | 有线耳机 |
| ByteRTCAudioPlaybackDeviceEarpiece | 2 | 听筒 |
| ByteRTCAudioPlaybackDeviceSpeakerphone | 3 | 扬声器 |
| ByteRTCAudioPlaybackDeviceHeadsetBluetooth | 4 | 蓝牙耳机 |
| ByteRTCAudioPlaybackDeviceHeadsetUSB | 5 | USB设备 |
typedef NS_ENUM(NSInteger, ByteRTCASRAuthorizationType)
objectivec语音识别服务鉴权方式,详情请咨询语音识别服务相关人员
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCASRAuthorizationTypeToken | 0 | 使用 token 不设置加密形式。 |
| ByteRTCASRAuthorizationTypeSignature | 1 | 带有 token 额外使用 signature 加密,此种加密形式需要额外传递 secret token 。 |
typedef NS_ENUM(NSInteger, ByteRTCASRErrorCode)
objectivec语音识别服务错误码。
除网络原因导致的错误,语音识别服务内部会自行重试之外,其他错误都会停止服务,此时建议再次调用 startASR:handler: 重启语音识别功能。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCASRErrorNetworkInterrupted | -1 | 网络连接中断,服务不可用,内部会进行重连 |
| ByteRTCASRErrorAlreadyStarted | -2 | 用户已经调用过 startASR:handler:。 开启语音识别服务后,你需要先调用 stopASR 停止语音识别服务,才能二次调用 startASR:handler: 再次开启服务。 |
| ByteRTCASRErrorTokenEmpty | -3 | 语音识别服务所需 token 为空 |
| ByteRTCErrorSignatureKeyEmpty | -4 | Signature 鉴权模式下 secretKey 为空 |
| ByteRTCASRErrorUserIdNull | -5 | 用户 ID 为空 |
| ByteRTCASRErrorAPPIDNull | -6 | 应用 ID 为空 |
| ByteRTCASRErrorClusterNull | -7 | 语音识别服务 cluster 为空 |
| ByteRTCASRErrorOperationDenied | -8 | 语音识别服务连接失败,该版本没有语音识别功能,请联系 RTC 技术支持。 |
typedef NS_ENUM(NSInteger, ByteRTCAudioMixingType)
objectivec混音播放类型
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCAudioMixingTypePlayout | 0 | 仅本地播放 |
| ByteRTCAudioMixingTypePublish | 1 | 仅远端播放 |
| ByteRTCAudioMixingTypePlayoutAndPublish | 2 | 本地和远端同时播放 |
typedef NS_ENUM(NSInteger, ByteRTCAudioMixingDualMonoMode)
objectivec混音播放声道类型
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCAudioMixingDualMonoModeAuto | 0 | 和音频文件一致 |
| ByteRTCAudioMixingDualMonoModeL | 1 | 只能听到音频文件中左声道的音频 |
| ByteRTCAudioMixingDualMonoModeR | 2 | 只能听到音频文件中右声道的音频 |
| ByteRTCAudioMixingDualMonoModeMix | 3 | 能同时听到音频文件中左右声道的音频 |
typedef NS_ENUM(NSInteger, ByteRTCAudioMixingState)
objectivec音频混音文件播放状态。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCAudioMixingStatePreloaded | 0 | 混音已加载 |
| ByteRTCAudioMixingStatePlaying | 1 | 混音正在播放 |
| ByteRTCAudioMixingStatePaused | 2 | 混音暂停 |
| ByteRTCAudioMixingStateStopped | 3 | 混音停止 |
| ByteRTCAudioMixingStateFailed | 4 | 混音播放失败 |
| ByteRTCAudioMixingStateFinished | 5 | 混音播放结束 |
| ByteRTCAudioMixingStatePCMEnabled | 6 | 准备PCM混音 |
| ByteRTCAudioMixingStatePCMDisabled | 7 | PCM混音播放结束 |
typedef NS_ENUM(NSInteger, ByteRTCAudioMixingError)
objectivec混音错误码。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCAudioMixingErrorOk | 0 | 正常 |
| ByteRTCAudioMixingErrorPreloadFailed | 1 | 预加载失败,找不到混音文件或者文件长度超出 20s |
| ByteRTCAudioMixingErrorStartFailed | 2 | 混音开启失败,找不到混音文件或者混音文件打开失败 |
| ByteRTCAudioMixingErrorIdNotFound | 3 | 混音 ID 异常 |
| ByteRTCAudioMixingErrorSetPositionFailed | 4 | 设置混音文件的播放位置出错 |
| ByteRTCAudioMixingErrorInValidVolume | 5 | 音量参数不合法,仅支持设置的音量值为[0, 400] |
| ByteRTCAudioMixingErrorLoadConflict | 6 | 播放的文件与预加载的文件不一致。请先使用 unloadAudioMixing: 卸载此前的文件。 |
| ByteRTCAudioMixingErrorIdTypeNotMatch | 7 | 不支持此混音类型。 |
| ByteRTCAudioMixingErrorInValidPitch | 8 | 设置混音文件的音调不合法 |
| ByteRTCAudioMixingErrorInValidAudioTrack | 9 | 设置混音文件的音轨不合法 |
| ByteRTCAudioMixingErrorIsStarting | 10 | 混音文件正在启动中 |
| ByteRTCAudioMixingErrorInValidPlaybackSpeed | 11 | 设置混音文件的播放速度不合法 |
typedef NS_ENUM(NSInteger, ByteRTCMediaPlayerCustomSourceMode)
objectivec自定义音频源模式
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCMediaPlayerCustomSourceModePush | 0 | 当播放来自本地的 PCM 数据时,使用此选项。 |
| ByteRTCMediaPlayerCustomSourceModePull | 1 | 当播放来自内存的音频数据时,使用此选项。 |
typedef NS_ENUM(NSInteger, ByteRTCMediaPlayerCustomSourceStreamType)
objectivec自定义音频流类型
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCMediaPlayerCustomSourceStreamTypeRaw | 0 | 当播放来自本地的 PCM 数据时,使用此选项。 |
| ByteRTCMediaPlayerCustomSourceStreamTypeEncoded | 1 | 当播放来自内存的音频数据时,使用此选项。 |
typedef NS_ENUM(NSInteger, ByteRTCMediaPlayerCustomSourceSeekWhence)
objectivec音频数据的起始读取位置。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCMediaPlayerCustomSourceSeekWhenceSet | 0 | 从音频数据的头开始读取,读取后的位置为参数 offset 的值。 |
| ByteRTCMediaPlayerCustomSourceSeekWhenceCur | 1 | 从音频数据的某一位置开始读取,读取后的位置为音频数据当前的读取位置加上参数 offset 的值。 |
| ByteRTCMediaPlayerCustomSourceSeekWhenceEnd | 2 | 从音频数据的尾开始读取,读取后的位置为用户传入的音频数据大小加上参数 offset 的值。 |
| ByteRTCMediaPlayerCustomSourceSeekWhenceSize | 3 | 返回音频数据的大小。 |
typedef NS_ENUM(NSInteger, ByteRTCPlayerState)
objectivec播放状态。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCPlayerStateIdle | 0 | 播放未启动 |
| ByteRTCPlayerStatePreloaded | 1 | 已加载 |
| ByteRTCPlayerStateOpened | 2 | 已打开 |
| ByteRTCPlayerStatePlaying | 3 | 正在播放 |
| ByteRTCPlayerStatePaused | 4 | 播放已暂停 |
| ByteRTCPlayerStateStopped | 5 | 播放已停止/或结束 |
| ByteRTCPlayerStateFailed | 6 | 播放失败 |
typedef NS_ENUM(NSInteger, ByteRTCPlayerError)
objectivec播放错误码。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCPlayerErrorOK | 0 | 正常 |
| ByteRTCPlayerErrorFormatNotSupport | 1 | 不支持此类型 |
| ByteRTCPlayerErrorInvalidPath | 2 | 无效的播放路径 |
| ByteRTCPlayerErrorInvalidState | 3 | 未满足前序接口调用的要求。请查看具体接口文档。 |
| ByteRTCPlayerErrorInvalidPosition | 4 | 设置播放位置出错。 |
| ByteRTCPlayerErrorInvalidVolume | 5 | 音量参数不合法。 |
| ByteRTCPlayerErrorInvalidPitch | 6 | 音调参数设置不合法。 |
| ByteRTCPlayerErrorInvalidAudioTrackIndex | 7 | 音轨参数设置不合法。 |
| ByteRTCPlayerErrorInvalidPlaybackSpeed | 8 | 播放速度参数设置不合法 |
| ByteRTCPlayerErrorInvalidEffectId | 9 | 音效 ID 异常。还未加载或播放文件,就调用其他 API。 |
typedef NS_ENUM(NSInteger, ByteRTCAudioSourceType)
objectivec音频输入源类型
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCAudioSourceTypeExternal | 0 | 自定义采集音频源 |
| ByteRTCAudioSourceTypeInternal | 1 | RTC SDK 内部采集音频源 |
typedef NS_ENUM(NSInteger, ByteRTCAudioRenderType)
objectivec音频输出源类型
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCAudioRenderTypeExternal | 0 | 自定义渲染音频 |
| ByteRTCAudioRenderTypeInternal | 1 | RTC SDK 内部渲染音频 |
typedef NS_ENUM(NSInteger, ByteRTCEarMonitorMode)
objectivec开启/关闭耳返功能。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCEarMonitorModeOff | 0 | 关闭耳返功能。 |
| ByteRTCEarMonitorModeOn | 1 | 开启耳返功能。 |
typedef NS_ENUM(NSInteger, ByteRTCAudioFrameCallbackMethod)
objectivec音频回调方法
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCAudioFrameCallbackRecord | 0 | 本地麦克风录制的音频数据回调 |
| ByteRTCAudioFrameCallbackPlayback | 1 | 订阅的远端所有用户混音后的音频数据回调 |
| ByteRTCAudioFrameCallbackMixed | 2 | 本地麦克风录制和订阅的远端所有用户混音后的音频数据回调 |
| ByteRTCAudioFrameCallbackRemoteUser | 3 | 订阅的远端每个用户混音前的音频数据回调 |
typedef NS_ENUM(NSInteger, ByteRTCAudioFrameMethod)
objectivec返回给音频处理器的音频类型。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCAudioFrameProcessorRecord | 0 | 本地采集的音频。 |
| ByteRTCAudioFrameProcessorPlayback | 1 | 远端音频流的混音音频。 |
| ByteRTCAudioFrameProcessorRemoteUser | 2 | 各个远端音频流。 |
| ByteRTCAudioFrameProcessorEarMonitor | 3 | 软件耳返音频。 |
| ByteRTCAudioFrameProcessorScreen | 4 | 屏幕共享音频。 |
typedef NS_ENUM(NSInteger, ByteRTCAudioReportMode)
objectivec音量回调模式。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCAudioReportModeNormal | 0 | 默认始终开启音量回调。 |
| ByteRTCAudioReportModeDisconnect | 1 | 可见用户进房并停止推流后,关闭音量回调。 |
| ByteRTCAudioReportModeReset | 2 | 可见用户进房并停止推流后,开启音量回调,回调值重置为0。 |
typedef NS_ENUM(NSInteger, ByteRTCAudioPropertiesMode)
objectivecrtcEngine:onLocalAudioPropertiesReport: 中包含的音频信息的范围。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCAudioPropertiesModeMicrohone | 0 | 仅包含本地麦克风采集的音频数据和本地屏幕音频采集数据。 |
| ByteRTCAudioPropertiesModeAudioMixing | 1 | 包含以下信息: + 本地麦克风采集的音频数据和本地屏幕音频采集数据; + 本地混音的音频数据。 |
@interface ByteRTCAudioVolumeInfo : NSObject
objectivec音频流来源的用户 ID, 及对应的音量。
| 类型 | 名称 |
|---|---|
| NSString* | uid |
| NSUInteger | linearVolume |
| NSUInteger | nonlinearVolume |
@property(copy, nonatomic) NSString * _Nonnull uid;
objectivec音频流来源的用户 ID
@property(assign, nonatomic) NSUInteger linearVolume;
objectivec线性音量,取值范围为:[0,255]
@property(assign, nonatomic) NSUInteger nonlinearVolume;
objectivec非线性音量,取值范围为:[-127,0]
@interface ByteRTCAudioFormat : NSObject
objectivec音频参数格式
| 类型 | 名称 |
|---|---|
| ByteRTCAudioSampleRate | sampleRate |
| ByteRTCAudioChannel | channel |
| int | samplesPerCall |
@property(nonatomic, assign) ByteRTCAudioSampleRate sampleRate;
objectivec音频采样率,详见 ByteRTCAudioSampleRate
@property(nonatomic, assign) ByteRTCAudioChannel channel;
objectivec音频声道,详见 ByteRTCAudioChannel
@property(nonatomic, assign) int samplesPerCall;
objectivec单次回调的音频帧中包含的采样点数。默认值为 0,此时,采样点数取最小值。
最小值为回调间隔是 0.01s 时的值,即 sampleRate 最大值是 2048`。超出取值范围时,采样点数取默认值。
该参数仅在设置读写回调时生效,调用 enableAudioFrameCallback:format: 开启只读模式回调时设置该参数不生效。
@interface ByteRTCAudioFrame : NSObject
objectivecPCM 音频帧
| 类型 | 名称 |
|---|---|
| NSData* | buffer |
| int | samples |
| ByteRTCAudioChannel | channel |
| ByteRTCAudioSampleRate | sampleRate |
@property(strong, nonatomic) NSData * _Nonnull buffer;
objectivecPCM 数据
@property(assign, nonatomic) int samples;
objectivec采样点个数
@property(assign, nonatomic) ByteRTCAudioChannel channel;
objectivec音频声道,参看 ByteRTCAudioChannel。
双声道的情况下,左右声道的音频帧数据以 LRLRLR 形式排布。
@property(assign, nonatomic) ByteRTCAudioSampleRate sampleRate;
objectivec采样率,参看 ByteRTCAudioSampleRate。
@interface ByteRTCASRConfig : NSObject
objectivec使用自动语音识别服务所需校验信息
| 类型 | 名称 |
|---|---|
| NSString* | appId |
| NSString* | userId |
| NSString* | accessToken |
| NSString* | secretKey |
| NSString* | cluster |
| ByteRTCASRAuthorizationType | authorizationType |
@property(copy, nonatomic) NSString *_Nonnull appId;
objectivec应用 ID
@property(copy, nonatomic) NSString *_Nonnull userId;
objectivec用户 ID
@property(copy, nonatomic) NSString *_Nonnull accessToken;
objectivec访问令牌
@property(copy, nonatomic) NSString *_Nonnull secretKey;
objectivec私钥。Signature 鉴权模式下不能为空,token 鉴权模式下为空。参看关于鉴权
@property(copy, nonatomic) NSString *_Nonnull cluster;
objectivec场景信息,参看业务集群
@property(assign, nonatomic) ByteRTCASRAuthorizationType authorizationType;
objectivec鉴权模式,参看 ByteRTCASRAuthorizationType
@interface ByteRTCAudioMixingConfig : NSObject
objectivec混音配置
| 类型 | 名称 |
|---|---|
| ByteRTCAudioMixingType | type |
| NSInteger | playCount |
| NSInteger | position |
| NSInteger | callbackOnProgressInterval |
| BOOL | syncProgressToRecordFrame |
@property(assign, nonatomic) ByteRTCAudioMixingType type;
objectivec混音播放类型,详见 ByteRTCAudioMixingType
@property(assign, nonatomic) NSInteger playCount;
objectivec混音播放次数
@property(assign, nonatomic) NSInteger position;
objectivec混音时音频文件播放的起始位置。参数为整数,单位为毫秒。
@property(assign, nonatomic) NSInteger callbackOnProgressInterval;
objectivec设置音频文件播放进度回调的时间间隔,参数为为大于 0 的 10 的倍数,单位为毫秒,设置后 SDK 将按照设置的值触发 rtcEngine:onAudioMixingPlayingProgress:progress: 回调,默认不回调。
@property(assign, nonatomic) BOOL syncProgressToRecordFrame;
objectivec在采集音频数据时,附带本地混音文件播放进度的时间戳。启用此功能会提升远端人声和音频文件混音播放时的同步效果。
true 时开启此功能,false 时关闭此功能,默认为关闭。@interface ByteRTCAudioEffectPlayerConfig : NSObject
objectivec混音配置
| 类型 | 名称 |
|---|---|
| ByteRTCAudioMixingType | type |
| NSInteger | pitch |
| NSInteger | playCount |
| NSInteger | startPos |
@property(assign, nonatomic) ByteRTCAudioMixingType type;
objectivec混音播放类型,详见 ByteRTCAudioMixingType
@property(assign, nonatomic) NSInteger pitch;
objectivec与音乐文件原始音调相比的升高/降低值,取值范围为 [-12,12],默认值为 0。每相邻两个值的音高距离相差半音,正值表示升调,负值表示降调。
@property(assign, nonatomic) NSInteger playCount;
objectivec混音播放次数
@property(assign, nonatomic) NSInteger startPos;
objectivec混音起始位置。默认值为 0,单位为毫秒。
@interface ByteRTCMediaPlayerConfig : NSObject
objectivec混音配置
| 类型 | 名称 |
|---|---|
| ByteRTCAudioMixingType | type |
| NSInteger | playCount |
| NSInteger | startPos |
| NSInteger | callbackOnProgressInterval |
| BOOL | syncProgressToRecordFrame |
| BOOL | autoPlay |
@property(assign, nonatomic) ByteRTCAudioMixingType type;
objectivec混音播放类型,详见 ByteRTCAudioMixingType
@property(assign, nonatomic) NSInteger playCount;
objectivec混音播放次数
@property(assign, nonatomic) NSInteger startPos;
objectivec混音起始位置。默认值为 0,单位为毫秒。
@property(assign, nonatomic) NSInteger callbackOnProgressInterval;
objectivec设置音频文件混音时,收到 onMediaPlayerPlayingProgress:progress: 的间隔。单位毫秒。
52,实际间隔为 60 ms。@property(assign, nonatomic) BOOL syncProgressToRecordFrame;
objectivec在采集音频数据时,附带本地混音文件播放进度的时间戳。启用此功能会提升远端人声和音频文件混音播放时的同步效果。
true 时开启此功能,false 时关闭此功能,默认为关闭。@property(assign, nonatomic) BOOL autoPlay;
objectivec是否自动播放。如果不自动播放,调用 start 播放音乐文件。默认为 True。
@interface ByteRTCMediaPlayerCustomSource : NSObject
objectivec音频源
| 类型 | 名称 |
|---|---|
| id | provider |
| ByteRTCMediaPlayerCustomSourceMode | mode |
| ByteRTCMediaPlayerCustomSourceStreamType | type |
@property(weak, nonatomic) id<ByteRTCMediaPlayerCustomSourceProvider> _Nullable provider;
objectivec仅在使用内存播放时,传入对应的 ByteRTCMediaPlayerCustomSourceProvider 实例。
@property(assign, nonatomic) ByteRTCMediaPlayerCustomSourceMode mode;
objectivec数据源模式,详见 ByteRTCMediaPlayerCustomSourceMode。默认为 push。
@property(assign, nonatomic) ByteRTCMediaPlayerCustomSourceStreamType type;
objectivec数据源类型,详见 ByteRTCMediaPlayerCustomSourceStreamType。默认为 raw。
@interface ByteRTCAudioPropertiesConfig : NSObject
objectivec音频属性信息提示的相关配置。
| 类型 | 名称 |
|---|---|
| NSInteger | interval |
| BOOL | enableSpectrum |
| BOOL | enableVad |
| ByteRTCAudioReportMode | localMainReportMode |
| float | smooth |
| ByteRTCAudioPropertiesMode | audioReportMode |
| BOOL | enableVoicePitch |
@property(assign, nonatomic) NSInteger interval;
objectivec信息提示间隔,单位:ms
<= 0: 关闭信息提示 (0,100]: 开启信息提示,不合法的 interval 值,SDK 自动设置为 100ms > 100: 开启信息提示,并将信息提示间隔设置为此值 @property(assign, nonatomic) BOOL enableSpectrum;
objectivec是否开启音频频谱检测。
@property(assign, nonatomic) BOOL enableVad;
objectivec是否开启人声检测 (VAD)。
@property(assign, nonatomic) ByteRTCAudioReportMode localMainReportMode;
objectivec音量回调模式。详见 ByteRTCAudioReportMode。
@property(nonatomic, assign) float smooth;
objectivec适用于音频属性信息提示的平滑系数。取值范围是 (0.0, 1.0]。
默认值为 1.0,不开启平滑效果;值越小,提示音量平滑效果越明显。如果要开启平滑效果,可以设置为 0.3。
@property(assign, nonatomic) ByteRTCAudioPropertiesMode audioReportMode;
objectivecrtcEngine:onLocalAudioPropertiesReport: 中包含音频数据的范围。参看 ByteRTCAudioPropertiesMode。
默认仅包含本地麦克风采集的音频数据和本地屏幕音频采集数据。
@property(assign, nonatomic) BOOL enableVoicePitch;
objectivec是否回调本地用户的人声基频。
@interface ByteRTCAudioPropertiesInfo : NSObject
objectivec音频属性信息
| 类型 | 名称 |
|---|---|
| NSInteger | linearVolume |
| NSInteger | nonlinearVolume |
| NSInteger | vad |
| NSArray<NSNumber>** | spectrum |
| NSInteger | voicePitch |
@property(assign, nonatomic) NSInteger linearVolume;
objectivec线性音量,与原始音量呈线性关系,数值越大,音量越大。取值范围是:[0,255]。
@property(assign, nonatomic) NSInteger nonlinearVolume;
objectivec非线性音量。由原始音量的对数值转化而来,因此在中低音量时更灵敏,可以用作 Active Speaker(房间内最活跃用户)的识别。取值范围是:[-127,0],单位 dB。
@property(assign, nonatomic) NSInteger vad;
objectivec人声检测(VAD)结果
@property(copy, nonatomic) NSArray<NSNumber*> * _Nonnull spectrum;
objectivec频谱数组。默认长度为 257。
@property(assign, nonatomic) NSInteger voicePitch;
objectivec本地用户的人声基频,单位为赫兹。
同时满足以下两个条件时,返回的值为本地用户的人声基频:
true。 0。@interface ByteRTCLocalAudioPropertiesInfo : NSObject
objectivec本地音频属性信息
| 类型 | 名称 |
|---|---|
| ByteRTCStreamIndex | streamIndex |
| ByteRTCAudioPropertiesInfo* | audioPropertiesInfo |
@property(assign, nonatomic) ByteRTCStreamIndex streamIndex;
objectivec流属性,包括主流、屏幕流。参看 ByteRTCStreamIndex
@property(strong, nonatomic) ByteRTCAudioPropertiesInfo *_Nonnull audioPropertiesInfo;
objectivec音频属性信息,详见 ByteRTCAudioPropertiesInfo
@interface ByteRTCRemoteAudioPropertiesInfo : NSObject
objectivec远端音频属性信息
| 类型 | 名称 |
|---|---|
| ByteRTCRemoteStreamKey* | streamKey |
| ByteRTCAudioPropertiesInfo* | audioPropertiesInfo |
@property(strong, nonatomic) ByteRTCRemoteStreamKey *_Nonnull streamKey;
objectivec远端流信息,详见 ByteRTCRemoteStreamKey
@property(strong, nonatomic) ByteRTCAudioPropertiesInfo *_Nonnull audioPropertiesInfo;
objectivec音频属性信息,详见 ByteRTCAudioPropertiesInfo
@interface ByteRTCPosition : NSObject
objectivec本地用户在房间内的位置坐标,需自行建立空间直角坐标系
| 类型 | 名称 |
|---|---|
| float | x |
| float | y |
| float | z |
@property(nonatomic, assign) float x;
objectivecx 坐标
@property(nonatomic, assign) float y;
objectivecy 坐标
@property(nonatomic, assign) float z;
objectivecz 坐标
@interface ByteRTCOrientation : NSObject
objectivec方向朝向信息
| 类型 | 名称 |
|---|---|
| float | x |
| float | y |
| float | z |
@property(nonatomic, assign) float x;
objectivecx 坐标
@property(nonatomic, assign) float y;
objectivecy 坐标
@property(nonatomic, assign) float z;
objectivecz 坐标
@interface ByteRTCHumanOrientation : NSObject
objectivec三维朝向信息,三个向量需要两两垂直。参看 ByteRTCOrientation。
| 类型 | 名称 |
|---|---|
| ByteRTCOrientation* | forward |
| ByteRTCOrientation* | right |
| ByteRTCOrientation* | up |
@property(nonatomic, strong) ByteRTCOrientation* _Nonnull forward;
objectivec正前方朝向,默认值为 {1,0,0},即正前方朝向 x 轴正方向
@property(nonatomic, strong) ByteRTCOrientation* _Nonnull right;
objectivec正右方朝向,默认值为 {0,1,0},即右手朝向 y 轴正方向
@property(nonatomic, strong) ByteRTCOrientation* _Nonnull up;
objectivec正上方朝向,默认值为 {0,0,1},即头顶朝向 z 轴正方向
typedef NS_ENUM(NSInteger, ByteRTCMulDimSingScoringMode)
objectivecK 歌打分维度。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCMulDimSingScoringModeNote | 0 | 按照音高进行评分。 |
typedef NS_ENUM(NSInteger, ByteRTCAudioAlignmentMode)
objectivec远端音频流精准对齐模式
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCAudioAlignmentModeOff | 0 | 不对齐 |
| ByteRTCAudioAlignmentModeAudioMixing | 1 | 远端音频流都对齐伴奏进度同步播放 |
@interface ByteRTCSingScoringRealtimeInfo : NSObject
objectivec实时评分信息。
| 类型 | 名称 |
|---|---|
| int | currentPosition |
| int | userPitch |
| int | standardPitch |
| int | sentenceIndex |
| int | sentenceScore |
| int | totalScore |
| int | averageScore |
@property(nonatomic, assign) int currentPosition;
objectivec当前的播放进度。
@property(nonatomic, assign) int userPitch;
objectivec演唱者的音高。
@property(nonatomic, assign) int standardPitch;
objectivec标准音高。
@property(nonatomic, assign) int sentenceIndex;
objectivec歌词分句索引。
@property(nonatomic, assign) int sentenceScore;
objectivec上一句歌词的评分。
@property(nonatomic, assign) int totalScore;
objectivec当前演唱的累计分数。
@property(nonatomic, assign) int averageScore;
objectivec当前演唱的平均分数。
@interface ByteRTCStandardPitchInfo : NSObject
objectivec标准音高数据组。
| 类型 | 名称 |
|---|---|
| int | startTime |
| int | duration |
| int | pitch |
@property(nonatomic, assign) int startTime;
objectivec开始时间,单位 ms。
@property(nonatomic, assign) int duration;
objectivec持续时间,单位 ms。
@property(nonatomic, assign) int pitch;
objectivec音高。
@interface ByteRTCSingScoringConfig : NSObject
objectivecK 歌评分配置。
| 类型 | 名称 |
|---|---|
| ByteRTCMulDimSingScoringMode | mode |
| ByteRTCAudioSampleRate | sampleRate |
| NSString* | lyricsFilepath |
| NSString* | midiFilepath |
@property(nonatomic, assign) ByteRTCMulDimSingScoringMode mode;
objectivec打分维度,详见 ByteRTCMulDimSingScoringMode。
@property(nonatomic, assign) ByteRTCAudioSampleRate sampleRate;
objectivec音频采样率。仅支持 44100 Hz、48000 Hz。
@property(nonatomic, copy) NSString *_Nonnull lyricsFilepath;
objectivec歌词文件路径。打分功能仅支持 KRC 歌词文件。
@property(nonatomic, copy) NSString *_Nonnull midiFilepath;
objectivec歌曲 midi 文件路径。
typedef NS_ENUM(NSInteger, ByteRTCAudioFrameSource)
objectivec音频文件录制内容来源。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCAudioFrameSourceTypeMic | 0 | 本地麦克风采集的音频数据。 |
| ByteRTCAudioFrameSourceTypePlayback | 1 | 远端所有用户混音后的数据 |
| ByteRTCAudioFrameSourceTypeMixed | 2 | 本地麦克风和所有远端用户音频流的混音后的数据 |
typedef NS_ENUM(NSInteger, ByteRTCAudioQuality)
objectivec音频质量
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCAudioQualityLow | 0 | 低音质 |
| ByteRTCAudioQualityMedium | 1 | 中音质 |
| ByteRTCAudioQualityHigh | 2 | 高音质 |
| ByteRTCAudioQualityUltraHigh | 3 | 超高音质 |
@interface ByteRTCAudioRecordingConfig : NSObject
objectivec音频录制配置
| 类型 | 名称 |
|---|---|
| NSString* | absoluteFileName |
| ByteRTCAudioFrameSource | frameSource |
| ByteRTCAudioSampleRate | sampleRate |
| ByteRTCAudioChannel | channel |
| ByteRTCAudioQuality | quality |
@property(nonatomic, copy) NSString* _Nonnull absoluteFileName;
objectivec录制文件路径。一个有读写权限的绝对路径,包含文件名和文件后缀。
注意:
录制文件的格式仅支持 .aac 和 .wav。
录制文件的格式仅支持 .aac 和 .wav。
@property(nonatomic, assign) ByteRTCAudioFrameSource frameSource;
objectivec录音内容来源,参看 ByteRTCAudioFrameSource。
默认为 ByteRTCAudioFrameSourceTypeMixed = 2。
@property(nonatomic, assign) ByteRTCAudioSampleRate sampleRate;
objectivec录音采样率。参看 ByteRTCAudioSampleRate。
@property(nonatomic, assign) ByteRTCAudioChannel channel;
objectivec录音音频声道。参看 ByteRTCAudioChannel。
如果录制时设置的的音频声道数与采集时的音频声道数不同:
@property(nonatomic, assign) ByteRTCAudioQuality quality;
objectivec录音音质。仅在录制文件格式为 .aac 时可以设置。参看 ByteRTCAudioQuality。
采样率为 32kHz 时,不同音质录制文件(时长为 10min)的大小分别是:
typedef NS_ENUM(NSInteger, ByteRTCAudioRecordingState)
objectivec录音配置
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCAudioRecordingStateError | 0 | 录制异常 |
| ByteRTCAudioRecordingStateProcessing | 1 | 录制进行中 |
| ByteRTCAudioRecordingStateSuccess | 2 | 已结束录制,并且录制文件保存成功。 |
@interface ByteRTCAudioEnhancementConfig: NSObject
objectivec蜂窝网络辅助增强应用的媒体模式
| 类型 | 名称 |
|---|---|
| BOOL | enhanceSignaling |
| BOOL | enhanceAudio |
@property (assign, nonatomic) BOOL enhanceSignaling;
objectivec对信令消息,是否启用蜂窝网络辅助增强。默认不启用。
@property (assign, nonatomic) BOOL enhanceAudio;
objectivec对音频,是否启用蜂窝网络辅助增强。默认不启用。
@interface ByteRTCPositionInfo : NSObject
objectivec用户在空间音频坐标系里的位置信息。
| 类型 | 名称 |
|---|---|
| ByteRTCPosition* | position |
| ByteRTCHumanOrientation* | orientation |
@property(strong, nonatomic) ByteRTCPosition *_Nonnull position;
objectivec用户在空间音频坐标系里的位置,需自行建立空间直角坐标系。参看 ByteRTCPosition。
@property(strong, nonatomic) ByteRTCHumanOrientation *_Nonnull orientation;
objectivec用户在空间音频坐标系里的三维朝向信息。三个向量需要两两垂直。参看 ByteRTCHumanOrientation。
typedef NS_ENUM(NSInteger, ByteRTCReturnStatus)
objectivec方法调用结果。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCReturnStatusSuccess | 0 | 成功。 |
| ByteRTCReturnStatusFailure | -1 | 失败。 |
| ByteRTCReturnStatusParameterErr | -2 | 参数错误。 |
| ByteRTCReturnStatusWrongState | -3 | 接口状态错误。 |
| ByteRTCReturnStatusHasInRoom | -4 | 失败,用户已在房间内。 |
| ByteRTCReturnStatusHasInLogin | -5 | 失败,用户已登录。 |
| ByteRTCReturnStatusHasInEchoTest | -6 | 失败,用户已经在进行通话回路测试中。 |
| ByteRTCReturnStatusNeitherVideoNorAudio | -7 | 失败,音视频均未采集。 |
| ByteRTCReturnStatusRoomIdInUse | -8 | 失败,该 roomId 已被使用。 |
| ByteRTCReturnStatusScreenNotSupport | -9 | 失败,屏幕流不支持。 |
| ByteRTCReturnStatusNotSupport | -10 | 失败,不支持该操作。 |
| ByteRTCReturnStatusResourceOverflow | -11 | 失败,资源已占用。 |
| ByteRTCReturnStatusAudioNoFrame | -101 | 失败,没有音频帧。 |
| ByteRTCReturnStatusAudioNotImplemented | -102 | 失败,未实现。 |
| ByteRTCReturnStatusAudioNoPermission | -103 | 失败,采集设备无麦克风权限,尝试初始化设备失败。 |
| ByteRTCReturnStatusAudioDeviceNotExists | -104 | 失败,设备不存在。当前没有设备或设备被移除时返回该值。 |
| ByteRTCReturnStatusAudioDeviceFormatNotSupport | -105 | 失败,设备音频格式不支持。 |
| ByteRTCReturnStatusAudioDeviceNoDevice | -106 | 失败,系统无可用设备。 |
| ByteRTCReturnStatusAudioDeviceCannotUse | -107 | 失败,当前设备不可用,需更换设备。 |
| ByteRTCReturnStatusAudioDeviceInitFailed | -108 | 系统错误,设备初始化失败。 |
| ByteRTCReturnStatusAudioDeviceStartFailed | -109 | 系统错误,设备开启失败。 |
| ByteRTCReturnStatusNativeInValid | -201 | 失败。底层未初始化,engine 无效。 |
typedef NS_ENUM(NSInteger, ByteRTCStreamRemoveReason)
objectivec房间内远端流移除原因。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCStreamRemoveReasonUnpublish | 0 | 远端用户停止发布流。 |
| ByteRTCStreamRemoveReasonPublishFailed | 1 | 远端用户发布流失败。 |
| ByteRTCStreamRemoveReasonKeepLiveFailed | 2 | 媒体服务器 10s 没收到客户端的媒体数据。 |
| ByteRTCStreamRemoveReasonClientDisconnected | 3 | 远端用户断网。 |
| ByteRTCStreamRemoveReasonRepublish | 4 | 远端用户重新发布流。 |
| ByteRTCStreamRemoveReasonOther | 5 | 其他原因。 |
| ByteRTCStreamRemoveReasonPublishPrivilegeExpired | 6 | 远端用户 Token 发布权限过期。 |
typedef NS_ENUM(NSInteger, ByteRTCRoomProfile)
objectivec房间模式
根据所需场景,选择合适的房间模式,应用不同的音视频算法、视频参数和网络配置
调用 setAudioProfile 改变音频参数配置
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCRoomProfileCommunication | 0 | 默认场景,通用模式 与 ByteRTCRoomProfileMeeting = 16 配置相同。你可以联系技术支持更换默认配置参数。 |
| ByteRTCRoomProfileGame | 2 | 游戏语音模式,低功耗、低流量消耗。 低端机在此模式下运行时,进行了额外的性能优化: + 部分低端机型配置编码帧长 40/60 + 部分低端机型关闭软件 3A 音频处理 增强对 iOS 其他屏幕录制进行的兼容性,避免音频录制被 RTC 打断。 |
| ByteRTCRoomProfileCloudGame | 3 | 云游戏模式。 如果你的游戏场景需要低延迟的配置,使用此设置。 此设置下,弱网抗性较差。 |
| ByteRTCRoomProfileLowLatency | 4 | 云渲染模式。超低延时配置。 如果你的应用并非游戏但又对延时要求较高时,选用此模式 该模式下,音视频通话延时会明显降低,但同时弱网抗性、通话音质等均会受到一定影响。 |
| ByteRTCRoomProfileChat | 5 | 适用于 1 vs 1 音视频通话 |
| ByteRTCRoomProfileChatRoom | 6 | 适用于 3 人及以上纯语音通话。 通话中,闭麦时为是媒体模式,上麦后切换为通话模式。 |
| ByteRTCRoomProfileLwTogether | 7 | 实现多端同步播放音视频,适用于 “一起看” 或 “一起听” 场景。 该场景中,使用 RTC 信令同步播放进度,共享的音频内容不通过 RTC 进行传输。 |
| ByteRTCRoomProfileGameHD | 8 | 适用于对音质要求较高的游戏场景,优化音频 3A 策略,只通过媒体模式播放音频 |
| ByteRTCRoomProfileCoHost | 9 | 适用于直播中主播之间连麦的业务场景。 该场景中,直播时通过 CDN,发起连麦 PK 时使用 RTC。 |
| ByteRTCRoomProfileInteractivePodcast | 10 | 适用于单主播和观众进行音视频互动的直播。通话模式,上下麦不会有模式切换,避免音量突变现象 |
| ByteRTCRoomProfileKTV | 11 | 线上 KTV 场景,音乐音质,低延迟 使用 RTC 传输伴奏音乐,混音后的歌声,适合独唱或单通合唱 |
| ByteRTCRoomProfileChorus | 12 | 适合在线实时合唱场景,高音质,超低延迟。使用本配置前请联系技术支持进行协助完成其他配置。 |
| ByteRTCRoomProfileVRChat | 13 | 适用于 VR 场景。支持最高 192 KHz 音频采样率,可开启球形立体声。345之后支持 |
| ByteRTCRoomProfileGameStreaming | 14 | 适用于 1 vs 1 游戏串流,支持公网或局域网。 |
| ByteRTCRoomProfileLanLiveStreaming | 15 | 适用于局域网的 1 对多视频直播,最高支持 8K, 60 帧/秒, 100 Mbps 码率 需要在局域网配置私有化部署媒体服务器。 |
| ByteRTCRoomProfileMeeting | 16 | 适用于云端会议中的个人设备 |
| ByteRTCRoomProfileMeetingRoom | 17 | 适用于云端会议中的会议室终端设备,例如 Rooms,投屏盒子等。 |
| ByteRTCRoomProfileClassroom | 18 | 适用于课堂互动,房间内所有成员都可以进行音视频互动 当你的场景中需要同时互动的成员超过 10人时使用此模式 |
| [deprecated] ByteRTCRoomProfileLiveBroadcasting | 1 | 直播模式。 当你对音视频通话的音质和画质要求较高时,应使用此设置。 此设置下,当用户使用蓝牙耳机收听时,蓝牙耳机使用媒体模式。 |
typedef NS_ENUM(NSInteger, ByteRTCUserVisibilityChangeError)
objectivec用户可见性状态改变错误码。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCUserVisibilityChangeErrorOk | 0 | 成功。 |
| ByteRTCUserVisibilityChangeErrorUnknown | 1 | 未知错误。 |
| ByteRTCUserVisibilityChangeErrorTooManyVisibleUser | 2 | 房间内可见用户达到上限。 |
typedef NS_ENUM(NSInteger, ByteRTCDataMessageSourceType)
objectivec数据消息来源
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCDataMessageSourceTypeDefault | 0 | 通过客户端或服务端的插入的自定义消息。 |
| ByteRTCDataMessageSourceTypeSystem | 1 | 系统数据,包含音量指示信息。 |
typedef NS_ENUM(NSInteger, ByteRTCSEICountPerFrame)
objectivecSEI 发送模式。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCSEICountPerFrameSingle | 0 | 单发模式。即在 1 帧间隔内多次发送 SEI 数据时,多个 SEI 按队列逐帧发送。 |
| ByteRTCSEICountPerFrameMulti | 1 | 多发模式。即在 1 帧间隔内多次发送 SEI 数据时,多个 SEI 随下个视频帧同时发送。 |
typedef NS_ENUM(NSInteger, ByteRTCSubscribeState)
objectivec订阅媒体流状态
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCSubscribeStateSuccess | 0 | 订阅/取消订阅流成功 |
| ByteRTCSubscribeStateFailedNotInRoom | 1 | 订阅/取消订阅流失败,本地用户未在房间中 |
| ByteRTCSubscribeStateFailedStreamNotFound | 2 | 订阅/取消订阅流失败,房间内未找到指定的音视频流 |
| ByteRTCSubscribeStateFailedOverLimit | 3 | 超过订阅流数上限 |
typedef NS_ENUM(NSInteger, ByteRTCPerformanceAlarmReason)
objectivec性能相关告警的原因
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCPerformanceAlarmReasonBandwidthFallback | 0 | 网络原因差,造成了发送性能回退。仅在开启发送性能回退时,会收到此原因。 |
| ByteRTCPerformanceAlarmReasonBandwidthResumed | 1 | 网络性能恢复,发送性能回退恢复。仅在开启发送性能回退时,会收到此原因。 |
| ByteRTCPerformanceAlarmReasonFallback | 2 | 如果未开启发送性能回退,收到此告警时,意味着性能不足; 如果开启了发送性能回退,收到此告警时,意味着性能不足,且已发生发送性能回退。 |
| ByteRTCPerformanceAlarmReasonResumed | 3 | 如果未开启发送性能回退,收到此告警时,意味着性能不足已恢复; 如果开启了发送性能回退,收到此告警时,意味着性能不足已恢复,且已发生发送性能回退恢复。 |
typedef NS_ENUM(NSInteger, ByteRTCPerformanceAlarmMode)
objectivec性能回退的模式
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCPerformanceAlarmModeNormal | 0 | 未开启发布性能回退 |
| ByteRTCPerformanceAlarmModeSimulcast | 1 | 已开启发布性能回退 |
typedef NS_ENUM(NSUInteger, ByteRTCPublishFallbackOption)
objectivec发布端音视频流回退选项
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCPublishFallbackOptionDisabled | 0 | 上行网络不佳或设备性能不足时,不对音视频流作回退处理。默认设置。 |
| ByteRTCPublishFallbackOptionSimulcast | 1 | 上行网络不佳或设备性能不足时,发布的视频流会从大流到小流依次降级,直到与当前网络性能匹配,具体降级规则参看性能回退文档。 |
typedef NS_ENUM(NSUInteger, ByteRTCSubscribeFallbackOption)
objectivec订阅端音视频流回退选项。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCSubscribeFallbackOptionDisabled | 0 | 下行网络不佳或设备性能不足时,不对音视频流作回退处理。默认设置。 |
| ByteRTCSubscribeFallbackOptionVideoStreamLow | 1 | 下行网络不佳或设备性能不足时,对视频流做降级处理,具体降级规则参看音视频流回退。 该设置仅对发布端调用 enableSimulcastMode: 开启发送多路流功能的情况生效。 |
| ByteRTCSubscribeFallbackOptionAudioOnly | 2 | 下行网络不佳或设备性能不足时,先对视频流做回退处理。当网络状况不满足接收弱流时,则自动取消接收视频,仅接收音频。 该设置仅对发布端调用 enableSimulcastMode: 开启发送多路流功能的情况生效。 |
typedef NS_ENUM(NSUInteger, ByteRTCRemoteUserPriority)
objectivec远端用户优先级。在性能不足需要回退时,会先回退优先级低的用户的音视频流
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCRemoteUserPriorityLow | 0 | 用户优先级为低,默认值 |
| ByteRTCRemoteUserPriorityMedium | 100 | 用户优先级为正常 |
| ByteRTCRemoteUserPriorityHigh | 200 | 用户优先级为高 |
typedef NS_ENUM(NSInteger, ByteRTCFallbackOrRecoverReason)
objectivec本地用户订阅的远端流触发回退策略的原因。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCFallbackOrRecoverReasonUnknown | -1 | 其他原因,非带宽和性能原因引起的回退或恢复。默认值 |
| ByteRTCFallbackOrRecoverReasonSubscribeFallbackByBandwidth | 0 | 由带宽不足导致的订阅端音视频流回退。 |
| ByteRTCFallbackOrRecoverReasonSubscribeFallbackByPerformance | 1 | 由性能不足导致的订阅端音视频流回退。 |
| ByteRTCFallbackOrRecoverReasonSubscribeRecoverByBandwidth | 2 | 由带宽恢复导致的订阅端音视频流恢复。 |
| ByteRTCFallbackOrRecoverReasonSubscribeRecoverByPerformance | 3 | 由性能恢复导致的订阅端音视频流恢复。 |
| ByteRTCFallbackOrRecoverReasonPublishFallbackByBandwidth | 4 | 由带宽不足导致的发布端音视频流回退。 |
| ByteRTCFallbackOrRecoverReasonPublishFallbackByPerformance | 5 | 由性能不足导致的发布端音视频流回退。 |
| ByteRTCFallbackOrRecoverReasonPublishRecoverByBandwidth | 6 | 由带宽恢复导致的发布端音视频流恢复。 |
| ByteRTCFallbackOrRecoverReasonPublishRecoverByPerformance | 7 | 由性能恢复导致的发布端音视频流恢复。 |
typedef NS_ENUM(NSInteger, ByteRTCLocalAudioStreamState)
objectivec本地音频流状态。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCLocalAudioStreamStateStopped | 0 | 本地音频默认初始状态。 麦克风停止工作时回调该状态,对应错误码 ByteRTCLocalAudioStreamError 中的 ByteRTCLocalAudioStreamErrorOk |
| ByteRTCLocalAudioStreamStateRecording | 1 | 本地音频录制设备启动成功。 采集到音频首帧时回调该状态,对应错误码 ByteRTCLocalAudioStreamError 中的 ByteRTCLocalAudioStreamErrorOk |
| ByteRTCLocalAudioStreamStateEncoding | 2 | 本地音频首帧编码成功。 音频首帧编码成功时回调该状态,对应错误码 ByteRTCLocalAudioStreamError 中的 ByteRTCLocalAudioStreamErrorOk |
| ByteRTCLocalAudioStreamStateFailed | 3 | 本地音频启动失败,在以下时机回调该状态: + 本地录音设备启动失败,对应错误码 ByteRTCLocalAudioStreamError 中的 ByteRTCLocalAudioStreamErrorRecordFailure + 检测到没有录音设备权限,对应错误码 ByteRTCLocalAudioStreamError 中的 ByteRTCLocalAudioStreamErrorDeviceNoPermission + 音频编码失败,对应错误码 ByteRTCLocalAudioStreamError 中的 ByteRTCLocalAudioStreamError |
typedef NS_ENUM(NSInteger, ByteRTCLocalAudioStreamError)
objectivec本地音频流状态改变时的错误码。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCLocalAudioStreamErrorOk | 0 | 本地音频状态正常 |
| ByteRTCLocalAudioStreamErrorFailure | 1 | 本地音频出错原因未知 |
| ByteRTCLocalAudioStreamErrorDeviceNoPermission | 2 | 没有权限启动本地音频录制设备 |
| ByteRTCLocalAudioStreamErrorRecordFailure | 4 | 本地音频录制失败,建议你检查录制设备是否正常工作 |
| ByteRTCLocalAudioStreamErrorEncodeFailure | 5 | 本地音频编码失败 |
| ByteRTCLocalAudioStreamErrorNoRecordingDevice | 6 | 没有可用的音频录制设备 |
typedef NS_ENUM(NSInteger, ByteRTCLocalVideoStreamState)
objectivec本地视频流状态
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCLocalVideoStreamStateStopped | 0 | 本地视频默认初始状态 摄像头停止工作时回调该状态,对应错误码 ByteRTCLocalVideoStreamError 中的 ByteRTCLocalVideoStreamErrorOk |
| ByteRTCLocalVideoStreamStateRecording | 1 | 本地视频录制设备启动成功 采集到视频首帧时回调该状态,对应错误码 ByteRTCLocalVideoStreamError 中的 ByteRTCLocalVideoStreamErrorOk |
| ByteRTCLocalVideoStreamStateEncoding | 2 | 本地视频首帧编码成功 本地视频首帧编码成功时回调该状态,对应错误码 ByteRTCLocalVideoStreamError 中的 ByteRTCLocalVideoStreamErrorOk |
| ByteRTCLocalVideoStreamStateFailed | 3 | 本地视频启动失败, 在以下时机回调该状态: + 本地采集设备启动失败,对应错误码 ByteRTCLocalVideoStreamError 中的 ByteRTCLocalVideoStreamErrorCaptureFailure + 检测到没有摄像头权限,对应错误码 ByteRTCLocalVideoStreamError 中的 ByteRTCLocalVideoStreamErrorDeviceNoPermission + 视频编码失败,对应错误码 ByteRTCLocalVideoStreamError 中的 ByteRTCLocalVideoStreamErrorEncodeFailure |
typedef NS_ENUM(NSInteger, ByteRTCLocalVideoStreamError)
objectivec本地视频状态改变时的错误码
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCLocalVideoStreamErrorOk | 0 | 本地视频状态正常(本地视频状态改变正常时默认返回值) |
| ByteRTCLocalVideoStreamErrorFailure | 1 | 本地视频流发布失败 |
| ByteRTCLocalVideoStreamErrorDeviceNoPermission | 2 | 没有权限启动本地视频采集设备 |
| ByteRTCLocalVideoStreamErrorDeviceBusy | 3 | 本地视频采集设备已被占用 |
| ByteRTCLocalVideoStreamErrorDeviceNotFound | 4 | 本地视频采集设备不存在或已移除 |
| ByteRTCLocalVideoStreamErrorCaptureFailure | 5 | 本地视频采集失败,建议检查采集设备是否正常工作 |
| ByteRTCLocalVideoStreamErrorEncodeFailure | 6 | 本地视频编码失败 |
| ByteRTCLocalVideoStreamErrorDeviceDisconnected | 7 | 通话过程中本地视频采集设备被其他程序抢占,导致设备连接中断 |
typedef NS_ENUM(NSInteger, ByteRTCRemoteAudioState)
objectivec用户订阅的远端音频流状态。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCRemoteAudioStateStopped | 0 | 远端音频流默认初始状态,在以下时机回调该状态: + 本地用户停止接收远端音频流,对应原因是 ByteRTCRemoteAudioStateChangeReason 中的 ByteRTCRemoteAudioStateChangeReasonLocalMuted + 远端用户停止发送音频流,对应原因是 ByteRTCRemoteAudioStateChangeReason 中的 ByteRTCRemoteAudioStateChangeReasonRemoteMuted + 远端用户离开房间,对应原因是 ByteRTCRemoteAudioStateChangeReason 中的 ByteRTCRemoteAudioStateChangeReasonRemoteOffline |
| ByteRTCRemoteAudioStateStarting | 1 | 开始接收远端音频流首包。 |
| ByteRTCRemoteAudioStateDecoding | 2 | 远端音频流正在解码,正常播放,在以下时机回调该状态: + 成功解码远端音频首帧,对应原因是 ByteRTCRemoteAudioStateChangeReason 中的 ByteRTCRemoteAudioStateChangeReasonLocalUnmuted + 网络由阻塞恢复正常,对应原因是 ByteRTCRemoteAudioStateChangeReason 中的 ByteRTCRemoteAudioStateChangeReasonNetworkRecovery + 本地用户恢复接收远端音频流,对应原因是 ByteRTCRemoteAudioStateChangeReason 中的 ByteRTCRemoteAudioStateChangeReasonLocalUnmuted + 远端用户恢复发送音频流,对应原因是 ByteRTCRemoteAudioStateChangeReason 中的 ByteRTCRemoteAudioStateChangeReasonRemoteUnmuted |
| ByteRTCRemoteAudioStateFrozen | 3 | 远端音频流卡顿。 |
typedef NS_ENUM(NSInteger, ByteRTCRemoteAudioStateChangeReason)
objectivec接收远端音频流状态改变的原因。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCRemoteAudioStateChangeReasonInternal | 0 | 内部原因 |
| ByteRTCRemoteAudioStateChangeReasonNetworkCongestion | 1 | 网络阻塞 |
| ByteRTCRemoteAudioStateChangeReasonNetworkRecovery | 2 | 网络恢复正常 |
| ByteRTCRemoteAudioStateChangeReasonLocalMuted | 3 | 本地用户停止接收远端音频流 |
| ByteRTCRemoteAudioStateChangeReasonLocalUnmuted | 4 | 本地用户恢复接收远端音频流 |
| ByteRTCRemoteAudioStateChangeReasonRemoteMuted | 5 | 远端用户停止发送音频流 |
| ByteRTCRemoteAudioStateChangeReasonRemoteUnmuted | 6 | 远端用户恢复发送音频流 |
| ByteRTCRemoteAudioStateChangeReasonRemoteOffline | 7 | 远端用户离开房间 |
typedef NS_ENUM(NSInteger, ByteRTCRemoteVideoState)
objectivec远端视频流状态
| 类型 | 值 | 说明 |
|---|---|---|
| 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 中的 ByteRTCRemoteVideoStateChangeReasonInternal |
typedef NS_ENUM(NSInteger, ByteRTCRemoteVideoStateChangeReason)
objectivec远端视频流状态改变的原因
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCRemoteVideoStateChangeReasonInternal | 0 | 内部原因 |
| ByteRTCRemoteVideoStateChangeReasonNetworkCongestion | 1 | 网络阻塞 |
| ByteRTCRemoteVideoStateChangeReasonNetworkRecovery | 2 | 网络恢复正常 |
| ByteRTCRemoteVideoStateChangeReasonLocalMuted | 3 | 本地用户停止接收远端视频流或本地用户禁用视频模块 |
| ByteRTCRemoteVideoStateChangeReasonLocalUnmuted | 4 | 本地用户恢复接收远端视频流或本地用户启用视频模块 |
| ByteRTCRemoteVideoStateChangeReasonRemoteMuted | 5 | 远端用户停止发送视频流或远端用户禁用视频模块 |
| ByteRTCRemoteVideoStateChangeReasonRemoteUnmuted | 6 | 远端用户恢复发送视频流或远端用户启用视频模块 |
| ByteRTCRemoteVideoStateChangeReasonRemoteOffline | 7 | 远端用户离开房间 |
typedef NS_ENUM(NSInteger, ByteRTCMediaDeviceType)
objectivec当前媒体设备类型
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCMediaDeviceTypeAudioUnknown | -1 | 未知音频设备 |
| ByteRTCMediaDeviceTypeAudioRenderDevice | 0 | 音频渲染设备类型 |
| ByteRTCMediaDeviceTypeAudioCaptureDevice | 1 | 音频采集设备类型 |
| ByteRTCMediaDeviceTypeVideoCaptureDevice | 3 | 视频采集设备类型 |
| ByteRTCMediaDeviceTypeScreenVideoCaptureDevice | 4 | 屏幕流视频设备 |
| ByteRTCMediaDeviceTypeScreenAudioCaptureDevice | 5 | 屏幕流音频设备 |
typedef NS_ENUM(NSInteger, ByteRTCMediaDeviceState)
objectivec媒体设备状态
通过 rtcEngine:onAudioDeviceStateChanged:device_type:device_state:device_error: 或 rtcEngine:onVideoDeviceStateChanged:device_type:device_state:device_error: 回调设备状态。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCMediaDeviceStateStarted | 1 | 设备已开启 |
| ByteRTCMediaDeviceStateStopped | 2 | 设备已停止 |
| ByteRTCMediaDeviceStateRuntimeError | 3 | 设备运行时错误 例如,当媒体设备的预期行为是正常采集,但没有收到采集数据时,将回调该状态。 |
| ByteRTCMediaDeviceStateAdded | 10 | 设备已插入 你可以调用获取设备接口更新设备列表。 |
| ByteRTCMediaDeviceStateRemoved | 11 | 设备被移除 你可以调用获取设备接口更新设备列表。 |
| ByteRTCMediaDeviceStateInterruptionBegan | 12 | 系统通话,锁屏或第三方应用打断了音视频通话。将在通话结束或第三方应用结束占用后自动恢复。 |
| ByteRTCMediaDeviceStateInterruptionEnded | 13 | 音视频通话已从系统电话或第三方应用打断中恢复 |
typedef NS_ENUM(NSInteger, ByteRTCMediaDeviceError)
objectivec媒体设备错误类型
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCMediaDeviceErrorOK | 0 | 媒体设备正常 |
| ByteRTCMediaDeviceErrorDeviceNoPermission | 1 | 没有权限启动媒体设备 |
| ByteRTCMediaDeviceErrorDeviceBusy | 2 | 媒体设备已经在使用中 |
| ByteRTCMediaDeviceErrorDeviceFailure | 3 | 媒体设备错误 |
| ByteRTCMediaDeviceErrorDeviceNotFound | 4 | 未找到指定的媒体设备 |
| ByteRTCMediaDeviceErrorDeviceDisconnected | 5 | 媒体设备被移除 |
| ByteRTCMediaDeviceErrorDeviceNoCallback | 6 | 无采集数据。当媒体设备的预期行为是正常采集,但没有收到采集数据时,将收到该错误。 |
| ByteRTCMediaDeviceErrorUNSupportFormat | 7 | 设备采样率不支持 |
| ByteRTCMediaDeviceErrorNotFindGroupId | 8 | iOS 屏幕采集没有 group Id 参数 |
| ByteRTCMediaDeviceErrorNotAvailableInBackground | 9 | 视频采集中断:因用户使用系统相机,应用切换到后台运行,导致采集中断。 |
| ByteRTCMediaDeviceErrorVideoInUseByAnotherClient | 10 | 视频采集中断:可能由于其他应用占用系统相机,导致视频设备暂时不可用,从而造成采集中断。 |
| ByteRTCMediaDeviceErrorNotAvailableWithMultipleForegroundApps | 11 | 视频采集中断:当前应用处于侧拉、分屏或者画中画模式时,导致采集中断。 |
| ByteRTCMediaDeviceErrorNotAvailableDueToSystemPressure | 12 | 视频采集中断:由于系统性能不足导致中断,比如设备过热。 |
typedef NS_ENUM(NSInteger, ByteRTCMediaDeviceWarning)
objectivec媒体设备警告
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCMediaDeviceWarningOK | 0 | 无警告 |
| ByteRTCMediaDeviceWarningOperationDenied | 1 | 非法设备操作。在使用外部设备时,调用了 SDK 内部设备 API。 |
| ByteRTCMediaDeviceWarningCaptureSilence | 2 | 采集到的数据为静音帧。 |
| ByteRTCMediaDeviceWarningDetectLeakEcho | 11 | 通话中出现回声现象。 当 ByteRTCRoomProfile 为 ByteRTCRoomProfileMeeting 和 ByteRTCRoomProfileMeetingRoom ,且 AEC 关闭时,SDK 自动启动回声检测,如果检测到回声问题,将通过 rtcEngine:onAudioDeviceWarning:deviceType:deviceWarning: 返回本枚举值。 |
| ByteRTCMediaDeviceWarningCaptureDetectHowling | 16 | 啸叫。触发该回调的情况如下:1)不支持啸叫抑制的房间模式下,检测到啸叫;2)支持啸叫抑制的房间模式下,检测到未被抑制的啸叫。 仅 ByteRTCRoomProfileCommunication、ByteRTCRoomProfileMeeting、ByteRTCRoomProfileMeetingRoom 三种房间模式支持啸叫抑制。 建议提醒用户检查客户端的距离或将麦克风和扬声器调至静音。 |
| ByteRTCMediaDeviceWarningSetAudioRouteInvalidScenario | 20 | 当前 AudioScenario 不支持更改音频路由,设置音频路由失败 |
| ByteRTCMediaDeviceWarningSetAudioRouteNotExists | 21 | 音频设备不存在,设置音频路由失败 |
| ByteRTCMediaDeviceWarningSetAudioRouteFailedByPriority | 22 | 音频路由被系统或其他应用占用,设置音频路由失败 |
| ByteRTCMediaDeviceWarningSetAudioRouteNotVoipMode | 23 | 当前非通话模式 ByteRTCAudioScenarioCommunication,不支持设置音频路由 |
| ByteRTCMediaDeviceWarningSetAudioRouteDeviceNotStart | 24 | 音频设备未启动,设置音频路由失败 |
| ByteRTCMediaDeviceWarningSetBluetoothModeScenarioUnsupport | 25 | 非纯媒体音频场景,此时不支持切换蓝牙传输协议。待切换至纯媒体音频场景后生效。 |
| ByteRTCMediaDeviceWarningSetBluetoothModeUnsupport | 26 | 当前不支持设置 HFP。 |
typedef NS_OPTIONS(uint64_t, ByteRTCProblemFeedbackOption)
objectivec音视频质量反馈问题类型
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCProblemFeedbackOptionNone | 0 | 没有问题 |
| ByteRTCProblemFeedbackOptionOtherMessage | (1ULL << 0) | 其他问题 |
| ByteRTCProblemFeedbackOptionDisconnected | (1ULL << 1) | 连接失败 |
| ByteRTCProblemFeedbackOptionEarBackDelay | (1ULL << 2) | 耳返延迟大 |
| ByteRTCProblemFeedbackOptionLocalNoise | (1ULL << 10) | 本端有杂音 |
| ByteRTCProblemFeedbackOptionLocalAudioLagging | (1ULL << 11) | 本端声音卡顿 |
| ByteRTCProblemFeedbackOptionLocalNoAudio | (1ULL << 12) | 本端无声音 |
| ByteRTCProblemFeedbackOptionLocalAudioStrength | (1ULL << 13) | 本端声音大/小 |
| ByteRTCProblemFeedbackOptionLocalEcho | (1ULL << 14) | 本端有回声 |
| ByteRTCProblemFeedbackOptionLocalVideoFuzzy | (1ULL << 24) | 本端视频模糊 |
| ByteRTCProblemFeedbackOptionLocalNotSync | (1ULL << 25) | 本端音视频不同步 |
| ByteRTCProblemFeedbackOptionLocalVideoLagging | (1ULL << 26) | 本端视频卡顿 |
| ByteRTCProblemFeedbackOptionLocalNoVideo | (1ULL << 27) | 本端无画面 |
| ByteRTCProblemFeedbackOptionRemoteNoise | (1ULL << 37) | 远端有杂音 |
| ByteRTCProblemFeedbackOptionRemoteAudioLagging | (1ULL << 38) | 远端声音卡顿 |
| ByteRTCProblemFeedbackOptionRemoteNoAudio | (1ULL << 39) | 远端无声音 |
| ByteRTCProblemFeedbackOptionRemoteAudioStrength | (1ULL << 40) | 远端声音大/小 |
| ByteRTCProblemFeedbackOptionRemoteEcho | (1ULL << 41) | 远端有回声 |
| ByteRTCProblemFeedbackOptionRemoteVideoFuzzy | (1ULL << 51) | 远端视频模糊 |
| ByteRTCProblemFeedbackOptionRemoteNotSync | (1ULL << 52) | 远端音视频不同步 |
| ByteRTCProblemFeedbackOptionRemoteVideoLagging | (1ULL << 53) | 远端视频卡顿 |
| ByteRTCProblemFeedbackOptionRemoteNoVideo | (1ULL << 54) | 远端无画面 |
@interface ByteRTCProblemFeedbackRoomInfo: NSObject
objectivec通话质量反馈房间信息
| 类型 | 名称 |
|---|---|
| NSString* | roomId |
| NSString* | userId |
@property(nonatomic, copy) NSString * _Nonnull roomId;
objectivec通话质量反馈的房间ID
@property(nonatomic, copy) NSString * _Nonnull userId;
objectivec通话质量反馈的用户ID
@interface ByteRTCProblemFeedbackInfo: NSObject
objectivec通话质量反馈信息
| 类型 | 名称 |
|---|---|
| NSString* | problemDesc |
| NSArray<ByteRTCProblemFeedbackRoomInfo>** | roomInfo |
@property(nonatomic, copy) NSString * _Nonnull problemDesc;
objectivec通话质量反馈的文字描述
@property(nonatomic, strong) NSArray<ByteRTCProblemFeedbackRoomInfo *> * _Nullable roomInfo;
objectivec通话质量反馈的房间信息。参看 ByteRTCProblemFeedbackRoomInfo。
typedef NS_ENUM(NSUInteger, ByteRTCFirstFrameSendState)
objectivec首帧发送状态
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCFirstFrameSendStateSending | 0 | 发送中 |
| ByteRTCFirstFrameSendStateSent | 1 | 发送成功 |
| ByteRTCFirstFrameSendStateEnd | 2 | 发送失败 |
typedef NS_ENUM(NSUInteger, ByteRTCFirstFramePlayState)
objectivec首帧播放状态
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCFirstFramePlayStatePlaying | 0 | 播放中 |
| ByteRTCFirstFramePlayStatePlay | 1 | 播放成功 |
| ByteRTCFirstFramePlayStateEnd | 2 | 播放失败 |
typedef NS_OPTIONS(NSUInteger, ByteRTCEncryptType)
objectivec自定义加密类型
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCEncryptTypeCustomize | 0 | 不使用内置加密。默认值。 |
| ByteRTCEncryptTypeAES128CBC | 1 | AES-128-CBC 加密算法 |
| ByteRTCEncryptTypeAES256CBC | 2 | AES-256-CBC 加密算法 |
| ByteRTCEncryptTypeAES128ECB | 3 | AES-128-ECB 加密算法 |
| ByteRTCEncryptTypeAES256ECB | 4 | AES-256-ECB 加密算法 |
typedef NS_ENUM(NSInteger, ByteRTCVideoCodecType)
objectivec视频编码类型
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCVideoCodecTypeUnknown | 0 | 未知类型 |
| ByteRTCVideoCodecTypeH264 | 1 | 标准 H264 编码格式 |
| ByteRTCVideoCodecTypeByteVC1 | 2 | ByteVC1 编码器 |
typedef NS_ENUM(NSInteger, ByteRTCVideoSuperResolutionMode)
objectivec超分模式。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCVideoSuperResolutionModeOff | 0 | 关闭超分。 |
| ByteRTCVideoSuperResolutionModeOn | 1 | 开启超分。 |
typedef NS_ENUM(NSInteger, ByteRTCVideoDenoiseMode)
objectivec视频降噪模式。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCVideoDenoiseModeOff | 0 | 视频降噪关闭。 |
| ByteRTCVideoDenoiseModeAuto | 1 | 视频降噪开启,由 ByteRTC 后台配置视频降噪算法。 |
typedef NS_ENUM(NSInteger, ByteRTCMuteState)
objectivec音视频流的发送/播放状态
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCMuteStateOff | 0 | 发送 |
| ByteRTCMuteStateOn | 1 | 停止发送 |
typedef NS_ENUM(NSInteger, ByteRTCSEIStreamEventType)
objectivec黑帧视频流状态
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCSEIStreamEventTypeStreamAdd | 0 | 远端用户发布黑帧视频流。 纯语音通话场景下,远端用户调用 sendSEIMessage:andMessage:andRepeatCount:andCountPerFrame: 发送 SEI 数据时,SDK 会自动发布一路黑帧视频流,并触发该回调。 |
| ByteRTCSEIStreamEventTypeStreamRemove | 1 | 远端黑帧视频流移除。该回调的触发时机包括: + 远端用户开启摄像头采集,由语音通话切换至视频通话,黑帧视频流停止发布; + 远端用户调用 sendSEIMessage:andMessage:andRepeatCount:andCountPerFrame: 后 1min 内未有 SEI 数据发送,黑帧视频流停止发布; + 远端用户调用 setVideoSourceType:WithStreamIndex: 切换至自定义视频采集时,黑帧视频流停止发布。 |
typedef NS_ENUM(NSInteger, ByteRTCStreamIndex)
objectivec流属性
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCStreamIndexMain | 0 | 主流。包括: + 由摄像头/麦克风通过内部采集机制,采集到的视频/音频; + 通过自定义采集,采集到的视频/音频。 |
| ByteRTCStreamIndexScreen | 1 | 屏幕流。屏幕共享时共享的视频流,或来自声卡的本地播放音频流。 |
typedef NS_ENUM(NSInteger, ByteRTCAggregationOption)
objectivec流聚合策略
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCAggregationOptionMin | 0 | 流聚合向下取值 (默认策略) |
| ByteRTCAggregationOptionMax | 1 | 流聚合向上取值 |
| ByteRTCAggregationOptionMajority | 2 | 流聚合按比例取值,比例相同时,向下取值 |
typedef NS_ENUM(NSInteger, ByteRTCSyncInfoStreamType)
objectivec媒体流信息同步的流类型
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCSyncInfoStreamTypeAudio | 0 | 音频流 |
typedef NS_ENUM(NSInteger, ByteRTCColorSpace)
objectivec颜色空间
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCColorSpaceUnknown | 0 | |
| ByteRTCColorSpaceYCbCrBT601LimitedRange | 1 | BT.601数字编码标准,颜色空间[16-235] |
| ByteRTCColorSpaceYCbCrBT601FullRange | 2 | BT.601数字编码标准,颜色空间[0-255] |
| ByteRTCColorSpaceYCbCrBT709LimitedRange | 3 | BT.7091数字编码标准,颜色空间[16-235] |
| ByteRTCColorSpaceYCbCrBT709FullRange | 4 | BT.7091数字编码标准,颜色空间[0-255] |
typedef NS_ENUM(NSInteger, ByteRTCForwardStreamState)
objectivec媒体流跨房间转发状态
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCForwardStreamStateIdle | 0 | 空闲状态 + 成功调用 stopForwardStreamToRooms 后,所有目标房间为空闲状态。+ 成功调用 updateForwardStreamToRooms 减少目标房间后,本次减少的目标房间为空闲状态。 |
| ByteRTCForwardStreamStateSuccess | 1 | 开始转发 + 调用 startForwardStreamToRooms 成功向所有房间开始转发媒体流后,返回此状态。+ 调用 updateForwardStreamToRooms 后,成功向新增目标房间开始转发媒体流后,返回此状态。 |
| ByteRTCForwardStreamStateFailure | 2 | 转发失败,失败详情参考 ByteRTCForwardStreamError 调用 startForwardStreamToRooms 或 updateForwardStreamToRooms 后,如遇转发失败,返回此状态。 |
typedef NS_ENUM(NSInteger, ByteRTCForwardStreamError)
objectivec媒体流跨房间转发过程中抛出的错误码
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCForwardStreamErrorOK | 0 | 正常 |
| ByteRTCForwardStreamErrorInvalidArgument | 1201 | 参数异常 |
| ByteRTCForwardStreamErrorInvalidToken | 1202 | Token 错误 |
| ByteRTCForwardStreamErrorResponse | 1203 | 服务端异常 |
| ByteRTCForwardStreamErrorRemoteKicked | 1204 | 目标房间有相同 user id 的用户加入,转发中断 |
| ByteRTCForwardStreamErrorNotSupport | 1205 | 服务端不支持转发功能 |
typedef NS_ENUM(NSInteger, ByteRTCForwardStreamEvent)
objectivec媒体流跨房间转发事件
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCForwardStreamEventDisconnected | 0 | 本端与服务器网络连接断开,暂停转发。 |
| ByteRTCForwardStreamEventConnected | 1 | 本端与服务器网络连接恢复,转发服务连接成功。 |
| ByteRTCForwardStreamEventInterrupt | 2 | 转发中断。转发过程中,如果相同 user_id 的用户进入目标房间,转发中断。 |
| ByteRTCForwardStreamEventDstRoomUpdated | 3 | 目标房间已更新,由 updateForwardStreamToRooms 触发。 |
| ByteRTCForwardStreamEventUnExpectAPICall | 4 | API 调用时序错误。例如,在调用 startForwardStreamToRooms 之前调用 updateForwardStreamToRooms 。 |
typedef NS_ENUM(NSInteger, ByteRTCRecordingState)
objectivec本地录制的状态
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCRecordingStateError | 0 | 录制异常 |
| ByteRTCRecordingStateProcessing | 1 | 录制进行中 |
| ByteRTCRecordingStateSuccess | 2 | 录制文件保存成功,调用 stopFileRecording: 结束录制之后才会收到该状态码。 |
typedef NS_ENUM(NSInteger, ByteRTCRecordingErrorCode)
objectivec本地录制错误码
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCRecordingErrorCodeOk | 0 | 录制正常 |
| ByteRTCRecordingErrorCodeNoPermission | -1 | 没有文件写权限 |
| ByteRTCRecordingErrorCodeNotSupport | -2 | 当前版本 SDK 不支持本地录制功能,请联系技术支持人员 |
| ByteRTCRecordingErrorCodeOther | -3 | 其他异常 |
typedef NS_ENUM(NSInteger, ByteRTCRecordingFileType)
objectivec本地录制文件的存储格式
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCRecordingFileTypeAAC | 0 | aac 格式文件 |
| ByteRTCRecordingFileTypeMP4 | 1 | mp4 格式文件 |
typedef NS_ENUM(NSInteger, ByteRTCAVSyncState)
objectivec音视频同步状态
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCAVSyncStateAVStreamSyncBegin | 0 | 音视频开始同步 |
| ByteRTCAVSyncStateAudioStreamRemove | 1 | 音视频同步过程中音频移除,但不影响当前的同步关系 |
| ByteRTCAVSyncStateVideoStreamRemove | 2 | 音视频同步过程中视频移除,但不影响当前的同步关系 |
typedef NS_ENUM(NSInteger, ByteRTCEchoTestResult)
objectivec音视频回路测试结果
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCEchoTestResultSuccess | 0 | 接收到采集的音视频的回放,通话回路检测成功 |
| ByteRTCEchoTestResultTimeout | 1 | 测试超过 60s 仍未完成,已自动停止 |
| ByteRTCEchoTestResultIntervalShort | 2 | 上一次测试结束和下一次测试开始之间的时间间隔少于 5s |
| ByteRTCEchoTestResultAudioDeviceError | 3 | 音频采集异常 |
| ByteRTCEchoTestResultVideoDeviceError | 4 | 视频采集异常 |
| ByteRTCEchoTestResultAudioReceiveError | 5 | 音频接收异常 |
| ByteRTCEchoTestResultVideoReceiveError | 6 | 视频接收异常 |
| ByteRTCEchoTestResultInternalError | 7 | 内部错误,不可恢复 |
typedef NS_ENUM(NSInteger, ByteRTCBluetoothMode)
objectivec蓝牙传输协议。
| 类型 | 值 | 说明 | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| ByteRTCBluetoothModeAuto | 0 | 默认采用 auto 模式,具体如下:
| |||||||||
| ByteRTCBluetoothModeA2DP | 1 | 高级音频分配配置文件(A2DP)。立体声、高音质。采用 iOS 设备进行音频采集,蓝牙设备进行播放。 | |||||||||
| ByteRTCBluetoothModeHFP | 2 | 免提配置文件(HFP)。单声道、普通音质。音频采集和播放设备都使用蓝牙设备。 |
@interface ByteRTCEchoTestConfig : NSObject
objectivec音视频回路测试参数
| 类型 | 名称 |
|---|---|
| ByteRTCView* | view |
| NSString* | roomId |
| NSString* | userId |
| NSString* | token |
| BOOL | enableAudio |
| BOOL | enableVideo |
| NSInteger | audioReportInterval |
@property(strong, nonatomic) ByteRTCView* _Nullable view;
objectivec用于渲染接收到的视频的视图
@property(copy, nonatomic) NSString *_Nonnull roomId;
objectivec测试用户加入的房间 ID。
@property(copy, nonatomic) NSString *_Nonnull userId;
objectivec进行音视频通话回路测试的用户 ID
@property(copy, nonatomic) NSString *_Nonnull token;
objectivec对用户进房时进行鉴权验证的动态密钥,用于保证音视频通话回路测试的安全性。
@property(assign, nonatomic) BOOL enableAudio;
objectivec是否检测音频。检测设备为系统默认音频设备。
onLocalAudioPropertiesReport 回调,你可以根据该回调判断麦克风的工作状态 @property(assign, nonatomic) BOOL enableVideo;
objectivec是否检测视频。PC 端默认检测列表中第一个视频设备。
@property(assign, nonatomic) NSInteger audioReportInterval;
objectivec音量信息提示间隔,单位:ms,默认为 100ms
<= 0: 关闭信息提示 (0,100]: 开启信息提示,不合法的 interval 值,SDK 自动设置为 100ms > 100: 开启信息提示,并将信息提示间隔设置为此值 @interface ByteRTCUserInfo : NSObject
objectivec用户信息。
| 类型 | 名称 |
|---|---|
| NSString* | userId |
| NSString* | extraInfo |
@property(copy, nonatomic) NSString *_Nonnull userId;
objectivec用户 ID。该字符串符合正则表达式:[a-zA-Z0-9_@\-\.]{1,128}。
@property(copy, nonatomic) NSString *_Nonnull extraInfo;
objectivec用户需要透传的额外的信息,字符长度限制为 200 字节。会在 rtcEngine:onUserJoined:elapsed: 中回调给远端用户。
@interface ByteRTCRoomStats : NSObject
objectivec房间通话统计数据,统计周期为 2s 。
用户进房成功后,SDK 会周期性地通过 onRoomStats 回调通知用户当前房间内的汇总统计信息。此数据结构即为回调给用户的参数类型。
| 类型 | 名称 |
|---|---|
| NSInteger | duration |
| NSInteger | txBytes |
| NSInteger | rxBytes |
| NSInteger | txKbitrate |
| NSInteger | rxKbitrate |
| NSInteger | txAudioKBitrate |
| NSInteger | rxAudioKBitrate |
| NSInteger | txVideoKBitrate |
| NSInteger | rxVideoKBitrate |
| NSInteger | txScreenKBitrate |
| NSInteger | rxScreenKBitrate |
| NSInteger | userCount |
| float | rxLostrate |
| float | txLostrate |
| NSInteger | rtt |
| NSInteger | txCellularKBitrate |
| NSInteger | rxCellularKBitrate |
@property(assign, nonatomic) NSInteger duration;
objectivec用户进房开始通话后的总时长,单位为 s ,累计值
@property(assign, nonatomic) NSInteger txBytes;
objectivec本地用户的总发送字节数 (bytes),累计值
@property(assign, nonatomic) NSInteger rxBytes;
objectivec本地用户的总接收字节数 (bytes),累计值
@property(assign, nonatomic) NSInteger txKbitrate;
objectivec发送码率(kbps),获取该数据时的瞬时值
@property(assign, nonatomic) NSInteger rxKbitrate;
objectivec接收码率(kbps),获取该数据时的瞬时值
@property(assign, nonatomic) NSInteger txAudioKBitrate;
objectivec本地用户的音频发送码率 (kbps),瞬时值
@property(assign, nonatomic) NSInteger rxAudioKBitrate;
objectivec本地用户的音频接收码率 (kbps),瞬时值
@property(assign, nonatomic) NSInteger txVideoKBitrate;
objectivec本地用户的视频发送码率 (kbps),瞬时值
@property(assign, nonatomic) NSInteger rxVideoKBitrate;
objectivec本地用户的视频接收码率 (kbps),瞬时值
@property(assign, nonatomic) NSInteger txScreenKBitrate;
objectivec屏幕接收码率,获取该数据时的瞬时值,单位为 Kbps
@property(assign, nonatomic) NSInteger rxScreenKBitrate;
objectivec屏幕发送码率,获取该数据时的瞬时值,单位为 Kbps
@property(assign, nonatomic) NSInteger userCount;
objectivec当前房间内的可见用户人数,包括本地用户自身
@property(assign, nonatomic) float rxLostrate;
objectivecApp 现在的下行丢包率
@property(assign, nonatomic) float txLostrate;
objectivecApp 现在的上行丢包率
@property(assign, nonatomic) NSInteger rtt;
objectivec客户端到服务端的往返时延
@property(assign, nonatomic) NSInteger txCellularKBitrate;
objectivec蜂窝路径发送的码率 (kbps),为获取该数据时的瞬时值
@property(assign, nonatomic) NSInteger rxCellularKBitrate;
objectivec蜂窝路径接收码率 (kbps),为获取该数据时的瞬时值
@interface ByteRTCLocalVideoStats : NSObject
objectivec本地视频流统计信息,统计周期为 2s 。
本地用户发布视频流成功后,SDK 会周期性地通过 onLocalStreamStats
通知本地用户发布的视频流在此次统计周期内的发送状况。此数据结构即为回调给本地用户的参数类型。
| 类型 | 名称 |
|---|---|
| float | sentKBitrate |
| NSInteger | inputFrameRate |
| NSInteger | sentFrameRate |
| NSInteger | encoderOutputFrameRate |
| NSInteger | rendererOutputFrameRate |
| NSInteger | statsInterval |
| float | videoLossRate |
| NSInteger | rtt |
| NSInteger | encodedBitrate |
| NSInteger | encodedFrameWidth |
| NSInteger | encodedFrameHeight |
| NSInteger | encodedFrameCount |
| ByteRTCVideoCodecType | codecType |
| BOOL | isScreen |
| NSInteger | jitter |
| ByteRTCVideoDenoiseMode | videoDenoiseMode |
@property(assign, nonatomic) float sentKBitrate;
objectivec发送码率。此次统计周期内实际发送的分辨率最大的视频流的发送码率,单位为 Kbps
@property(assign, nonatomic) NSInteger inputFrameRate;
objectivec采集帧率。此次统计周期内的视频采集帧率,单位为 fps 。
@property(assign, nonatomic) NSInteger sentFrameRate;
objectivec发送帧率。此次统计周期内实际发送的分辨率最大的视频流的视频发送帧率,单位为 fps 。
@property(assign, nonatomic) NSInteger encoderOutputFrameRate;
objectivec编码器输出帧率。当前编码器在此次统计周期内实际发送的分辨率最大的视频流的输出帧率,单位为 fps 。
@property(assign, nonatomic) NSInteger rendererOutputFrameRate;
objectivec本地渲染帧率。此次统计周期内的本地视频渲染帧率,单位为 fps 。
@property(assign, nonatomic) NSInteger statsInterval;
objectivec统计间隔,单位为 ms 。
此字段用于设置回调的统计周期,默认设置为 2s 。
@property(assign, nonatomic) float videoLossRate;
objectivec视频丢包率。统计周期内的视频上行丢包率,取值范围为 [0, 1] 。
@property(assign, nonatomic) NSInteger rtt;
objectivec往返时延。单位为 ms 。
@property(assign, nonatomic) NSInteger encodedBitrate;
objectivec视频编码码率。此次统计周期内的实际发送的分辨率最大的视频流视频编码码率,单位为 Kbps 。
@property(assign, nonatomic) NSInteger encodedFrameWidth;
objectivec实际发送的分辨率最大的视频流的视频编码宽度,单位为 px 。
@property(assign, nonatomic) NSInteger encodedFrameHeight;
objectivec实际发送的分辨率最大的视频流的视频编码高度,单位为 px 。
@property(assign, nonatomic) NSInteger encodedFrameCount;
objectivec此次统计周期内实际发送的分辨率最大的视频流的发送的视频帧总数。
@property(nonatomic) ByteRTCVideoCodecType codecType;
objectivec编码类型。参看 ByteRTCVideoCodecType 类型。
@property(assign, nonatomic) BOOL isScreen;
objectivec所属用户的媒体流是否为屏幕流。你可以知道当前统计数据来自主流还是屏幕流。
@property(assign, nonatomic) NSInteger jitter;
objectivec视频上行网络抖动,单位为 ms。
@property(assign, nonatomic) ByteRTCVideoDenoiseMode videoDenoiseMode;
objectivec视频降噪模式。具体参看 ByteRTCVideoDenoiseMode 。
@interface ByteRTCRemoteVideoStats : NSObject
objectivec远端视频流统计信息,统计周期为 2s 。
本地用户订阅远端视频流成功后,SDK 会周期性地通过 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 |
| ByteRTCVideoCodecType | codecType |
| NSInteger | videoIndex |
| NSInteger | jitter |
| ByteRTCVideoSuperResolutionMode | superResolutionMode |
@property(assign, nonatomic) NSInteger width;
objectivec远端视频宽度。
@property(assign, nonatomic) NSInteger height;
objectivec远端视频高度。
@property(assign, nonatomic) float videoLossRate;
objectivec远端视频丢包率。统计周期内的视频下行丢包率,取值范围为 [0, 1] 。
@property(assign, nonatomic) float receivedKBitrate;
objectivec接收码率。统计周期内的视频接收码率,单位为 kbps 。
@property(assign, nonatomic) NSInteger receivedFrameRate;
objectivec远端视频接收帧率。
@property(assign, nonatomic) NSInteger decoderOutputFrameRate;
objectivec远端视频解码输出帧率。
@property(assign, nonatomic) NSInteger renderOutputFrameRate;
objectivec远端视频渲染输出帧率。
@property(assign, nonatomic) NSInteger stallCount;
objectivec远端视频卡顿次数。
@property(assign, nonatomic) NSInteger stallDuration;
objectivec远端视频卡顿时长,单位为 ms 。
@property(assign, nonatomic) NSInteger e2eDelay;
objectivec用户体验级别的端到端延时。从发送端采集完成编码开始到接收端解码完成渲染开始的延时,单位为 ms 。
@property(assign, nonatomic) BOOL isScreen;
objectivec远端视频流是否是屏幕共享流。你可以知道当前数据来自主流还是屏幕流。
@property(assign, nonatomic) NSInteger statsInterval;
objectivec统计间隔,此次统计周期的间隔,单位为 ms 。
此字段用于设置回调的统计周期,目前设置为 2s 。
@property(assign, nonatomic) NSInteger rtt;
objectivec往返时延。单位为 ms 。
@property(assign, nonatomic) NSInteger frozenRate;
objectivec远端用户在进房后发生视频卡顿的累计时长占视频总有效时长的百分比(%)。视频有效时长是指远端用户进房发布视频流后,除停止发送视频流和禁用视频模块之外的视频时长。
@property(nonatomic) ByteRTCVideoCodecType codecType;
objectivec编码类型。参看 ByteRTCVideoCodecType 类型。
@property(assign, nonatomic) NSInteger videoIndex;
objectivecSDK 订阅的远端视频流的分辨率下标。
@property(assign, nonatomic) NSInteger jitter;
objectivec视频下行网络抖动,单位为 ms。
@property(assign, nonatomic) ByteRTCVideoSuperResolutionMode superResolutionMode;
objectivec远端视频超分模式,参看 ByteRTCVideoSuperResolutionMode。
@interface ByteRTCLocalAudioStats : NSObject
objectivec本地音频流统计信息,统计周期为 2s 。
本地用户发布音频流成功后,SDK 会周期性地通过 onLocalStreamStats
通知本地用户发布的音频流在此次统计周期内的发送状况。此数据结构即为回调给本地用户的参数类型。
| 类型 | 名称 |
|---|---|
| float | audioLossRate |
| float | sentKBitrate |
| NSInteger | recordSampleRate |
| NSInteger | statsInterval |
| NSInteger | rtt |
| NSInteger | numChannels |
| NSInteger | sentSampleRate |
| NSInteger | jitter |
@property(assign, nonatomic) float audioLossRate;
objectivec音频丢包率。此次统计周期内的音频上行丢包率,取值范围为 [0, 1] 。
@property(assign, nonatomic) float sentKBitrate;
objectivec发送的码率。此次统计周期内的音频发送码率,单位为 kbps 。
@property(assign, nonatomic) NSInteger recordSampleRate;
objectivec采集采样率。此次统计周期内的音频采集采样率信息,单位为 Hz 。
@property(assign, nonatomic) NSInteger statsInterval;
objectivec统计间隔。此次统计周期的间隔,单位为 ms 。
此字段用于设置回调的统计周期,默认设置为 2s 。
@property(assign, nonatomic) NSInteger rtt;
objectivec往返时延。单位为 ms 。
@property(assign, nonatomic) NSInteger numChannels;
objectivec音频声道数。
@property(assign, nonatomic) NSInteger sentSampleRate;
objectivec音频发送采样率。此次统计周期内的音频发送采样率信息,单位为 Hz 。
@property(assign, nonatomic) NSInteger jitter;
objectivec音频上行网络抖动,单位为 ms。
@interface ByteRTCRemoteAudioStats : NSObject
objectivec远端音频流统计信息,统计周期为 2s 。
本地用户订阅远端音频流成功后,SDK 会周期性地通过 onRemoteStreamStats
通知本地用户订阅的音频流在此次统计周期内的接收状况。此数据结构即为回调给本地用户的参数类型。
| 类型 | 名称 |
|---|---|
| float | audioLossRate |
| float | receivedKBitrate |
| NSInteger | stallCount |
| NSInteger | stallDuration |
| NSInteger | playoutSampleRate |
| NSInteger | e2eDelay |
| NSInteger | statsInterval |
| NSInteger | rtt |
| NSInteger | totalRtt |
| NSInteger | quality |
| NSInteger | jitterBufferDelay |
| NSInteger | numChannels |
| NSInteger | receivedSampleRate |
| NSInteger | frozenRate |
| NSInteger | concealedSamples |
| NSInteger | concealmentEvent |
| NSInteger | decSampleRate |
| NSInteger | decDuration |
| NSInteger | jitter |
@property(assign, nonatomic) float audioLossRate;
objectivec音频丢包率。统计周期内的音频下行丢包率,取值范围为 [0, 1] 。
@property(assign, nonatomic) float receivedKBitrate;
objectivec接收码率。统计周期内的音频接收码率,单位为 kbps 。
@property(assign, nonatomic) NSInteger stallCount;
objectivec音频卡顿次数。统计周期内的卡顿次数。
@property(assign, nonatomic) NSInteger stallDuration;
objectivec音频卡顿时长。统计周期内的卡顿时长,单位为 ms 。
@property(assign, nonatomic) NSInteger playoutSampleRate;
objectivec播放采样率。统计周期内的音频播放采样率信息,单位为 Hz 。
@property(assign, nonatomic) NSInteger e2eDelay;
objectivec用户体验级别的端到端延时。从发送端采集完成编码开始到接收端解码完成渲染开始的延时,单位为 ms 。
@property(assign, nonatomic) NSInteger statsInterval;
objectivec统计间隔。此次统计周期的间隔,单位为 ms 。
@property(assign, nonatomic) NSInteger rtt;
objectivec客户端到服务端数据传输的往返时延,单位为 ms。
@property(assign, nonatomic) NSInteger totalRtt;
objectivec发送端——服务端——接收端全链路数据传输往返时延。单位为 ms 。
@property(assign, nonatomic) NSInteger quality;
objectivec远端用户发送的音频流质量。值含义参考 ByteRTCNetworkQuality 。
@property(assign, nonatomic) NSInteger jitterBufferDelay;
objectivec因引入 jitter buffer 机制导致的延时。单位为 ms 。
@property(assign, nonatomic) NSInteger numChannels;
objectivec音频声道数。
@property(assign, nonatomic) NSInteger receivedSampleRate;
objectivec音频接收采样率。统计周期内接收到的远端音频采样率信息,单位为 Hz 。
@property(assign, nonatomic) NSInteger frozenRate;
objectivec远端用户在加入房间后发生音频卡顿的累计时长占音频总有效时长的百分比。音频有效时长是指远端用户进房发布音频流后,除停止发送音频流和禁用音频模块之外的音频时长。
@property(assign, nonatomic) NSInteger concealedSamples;
objectivec音频 PLC 样点总个数。
@property(assign, nonatomic) NSInteger concealmentEvent;
objectivec音频丢包补偿(PLC) 累计次数。
@property(assign, nonatomic) NSInteger decSampleRate;
objectivec音频解码采样率。统计周期内的音频解码采样率信息,单位为 Hz 。
@property(assign, nonatomic) NSInteger decDuration;
objectivec此次订阅中,对远端音频流进行解码的累计耗时。单位为 s。
@property(assign, nonatomic) NSInteger jitter;
objectivec视频下行网络抖动,单位为 ms。
@interface ByteRTCLocalStreamStats : NSObject
objectivec本地音/视频流统计信息以及网络状况,统计周期为 2s 。
本地用户发布音/视频流成功后,SDK 会周期性地通过 onLocalStreamStats
通知本地用户发布的音/视频流在此次统计周期内的发送状况。此数据结构即为回调给用户的参数类型。
| 类型 | 名称 |
|---|---|
| ByteRTCLocalAudioStats* | audioStats |
| ByteRTCLocalVideoStats* | videoStats |
| BOOL | isScreen |
| ByteRTCNetworkQuality | [deprecated] txQuality |
| ByteRTCNetworkQuality | [deprecated] rxQuality |
@property(strong, nonatomic) ByteRTCLocalAudioStats *_Nonnull audioStats;
objectivec本地设备发送音频流的统计信息,详见 ByteRTCLocalAudioStats
@property(strong, nonatomic) ByteRTCLocalVideoStats *_Nonnull videoStats;
objectivec本地设备发送视频流的统计信息,详见 ByteRTCLocalVideoStats
@property(assign, nonatomic) ByteRTCNetworkQuality txQuality;
objectivec所属用户的媒体流上行网络质量,详见 ByteRTCNetworkQuality
Deprecated since 3.36 and will be deleted in 3.51, use rtcRoom:onNetworkQuality:remoteQualities: instead
@property(assign, nonatomic) ByteRTCNetworkQuality rxQuality;
objectivec所属用户的媒体流下行网络质量,详见 ByteRTCNetworkQuality
Deprecated since 3.36 and will be deleted in 3.51, use rtcRoom:onNetworkQuality:remoteQualities: instead
@property(nonatomic, assign) BOOL isScreen;
objectivec所属用户的媒体流是否为屏幕流。你可以知道当前统计数据来自主流还是屏幕流。
@interface ByteRTCRemoteStreamStats : NSObject
objectivec用户订阅的远端音/视频流统计信息以及网络状况,统计周期为 2s 。
订阅远端用户发布音/视频流成功后,SDK 会周期性地通过 onRemoteStreamStats
通知本地用户订阅的远端音/视频流在此次统计周期内的接收状况。此数据结构即为回调给本地用户的参数类型。
| 类型 | 名称 |
|---|---|
| NSString* | uid |
| ByteRTCRemoteAudioStats* | audioStats |
| ByteRTCRemoteVideoStats* | videoStats |
| BOOL | isScreen |
| ByteRTCNetworkQuality | [deprecated] txQuality |
| ByteRTCNetworkQuality | [deprecated] rxQuality |
@property(copy, nonatomic) NSString *_Nonnull uid;
objectivec用户 ID 。音频来源的用户 ID 。
@property(strong, nonatomic) ByteRTCRemoteAudioStats *_Nonnull audioStats;
objectivec远端音频流的统计信息,详见 ByteRTCRemoteAudioStats
@property(strong, nonatomic) ByteRTCRemoteVideoStats *_Nonnull videoStats;
objectivec远端视频流的统计信息,详见 ByteRTCRemoteVideoStats
@property(assign, nonatomic) ByteRTCNetworkQuality txQuality;
objectivec所属用户的媒体流上行网络质量,详见 ByteRTCNetworkQuality
Deprecated since 3.36 and will be deleted in 3.51, use rtcRoom:onNetworkQuality:remoteQualities: instead
@property(assign, nonatomic) ByteRTCNetworkQuality rxQuality;
objectivec所属用户的媒体流下行网络质量,详见 ByteRTCNetworkQuality
Deprecated since 3.36 and will be deleted in 3.51, use rtcRoom:onNetworkQuality:remoteQualities: instead
@property(nonatomic, assign) BOOL isScreen;
objectivec所属用户的媒体流是否为屏幕流。你可以知道当前统计数据来自主流还是屏幕流。
@interface ByteRTCUser : NSObject
objectivec用户信息
| 类型 | 名称 |
|---|---|
| NSString* | userId |
| NSString* | metaData |
@property(nonatomic, copy, nullable) NSString *userId;
objectivec用户 ID
@property(nonatomic, copy, nullable) NSString *metaData;
objectivec元信息
@interface ByteRTCRemoteStreamKey : NSObject
objectivec用户信息
| 类型 | 名称 |
|---|---|
| NSString* | userId |
| NSString* | roomId |
| ByteRTCStreamIndex | streamIndex |
@property(nonatomic, copy, nullable) NSString *userId;
objectivec用户 ID
@property(nonatomic, copy, nullable) NSString *roomId;
objectivec房间 ID
@property(nonatomic, assign) ByteRTCStreamIndex streamIndex;
objectivec流属性,包括主流、屏幕流。参看 ByteRTCStreamIndex
@interface ByteRTCRecordingConfig : NSObject
objectivec本地录制参数配置
| 类型 | 名称 |
|---|---|
| NSString* | dirPath |
| ByteRTCRecordingFileType | recordingFileType |
@property(strong, nonatomic) NSString* _Nullable dirPath;
objectivec录制文件保存的绝对路径,需精确到文件夹,文件名由 RTC 自动生成。你需要确保对该路径具有读写权限。
@property(assign, nonatomic) ByteRTCRecordingFileType recordingFileType;
objectivec录制存储文件格式,参看 ByteRTCRecordingFileType
@interface ByteRTCRecordingProgress : NSObject
objectivec本地录制进度
| 类型 | 名称 |
|---|---|
| unsigned | duration |
| unsigned | fileSize |
@property(assign, nonatomic) unsigned long long duration;
objectivec当前文件的累计录制时长,单位:毫秒
@property(assign, nonatomic) unsigned long long fileSize;
objectivec当前录制文件的大小,单位:byte
@interface ByteRTCRecordingInfo : NSObject
objectivec本地录制的详细信息
| 类型 | 名称 |
|---|---|
| NSString* | filePath |
| ByteRTCVideoCodecType | codecType |
| NSInteger | width |
| NSInteger | height |
@property(strong, nonatomic) NSString* _Nullable filePath;
objectivec录制文件的绝对路径,包含文件名和文件后缀
@property(assign, nonatomic) ByteRTCVideoCodecType codecType;
objectivec录制文件的视频编码类型,参看 ByteRTCVideoCodecType
@property(nonatomic, assign) NSInteger width;
objectivec录制视频的宽,单位:像素。纯音频录制请忽略该字段
@property(nonatomic, assign) NSInteger height;
objectivec录制视频的高,单位:像素。纯音频录制请忽略该字段
@interface ByteRTCStreamSycnInfoConfig : NSObject
objectivec媒体流信息同步的相关配置
| 类型 | 名称 |
|---|---|
| ByteRTCStreamIndex | streamIndex |
| int | repeatCount |
| ByteRTCSyncInfoStreamType | streamType |
@property(assign, nonatomic) ByteRTCStreamIndex streamIndex;
objectivec流属性,主流或屏幕流。见 ByteRTCStreamIndex 。
@property(assign, nonatomic) int repeatCount;
objectivec消息发送的重复次数,取值范围是 [0,25],建议设置为 [3,5]。
@property(assign, nonatomic) ByteRTCSyncInfoStreamType streamType;
objectivec媒体流信息同步的流类型,见 ByteRTCSyncInfoStreamType 。
@interface ByteRTCForwardStreamConfiguration: NSObject
objectivec媒体流跨房间转发的目标房间的相关信息
| 类型 | 名称 |
|---|---|
| NSString* | roomId |
| NSString* | token |
@property(strong, nonatomic) NSString* _Nullable roomId;
objectivec跨房间转发媒体流过程中目标房间 ID
@property(strong, nonatomic) NSString* _Nullable token;
objectivec使用转发目标房间 RoomID 和 UserID 生成 Token。
测试时可使用控制台生成临时 Token,正式上线需要使用密钥 SDK 在你的服务端生成并下发 Token。
如果 Token 无效,转发失败。
@interface ByteRTCForwardStreamStateInfo: NSObject
objectivec跨房间转发媒体流过程中的不同目标房间的状态和错误信息
| 类型 | 名称 |
|---|---|
| NSString* | roomId |
| ByteRTCForwardStreamState | state |
| ByteRTCForwardStreamError | error |
@property(strong, nonatomic) NSString* _Nullable roomId;
objectivec跨房间转发媒体流过程中目标房间 ID
空字符串代表所有目标房间
@property(assign, nonatomic) ByteRTCForwardStreamState state;
objectivec跨房间转发媒体流过程中该目标房间的状态,参看 ByteRTCForwardStreamState
@property(assign, nonatomic) ByteRTCForwardStreamError error;
objectivec跨房间转发媒体流过程中该目标房间抛出的错误码,参看 ByteRTCForwardStreamError
@interface ByteRTCForwardStreamEventInfo: NSObject
objectivec跨房间转发媒体流过程中的不同目标房间发生的事件
| 类型 | 名称 |
|---|---|
| NSString* | roomId |
| ByteRTCForwardStreamEvent | event |
@property(strong, nonatomic) NSString* _Nullable roomId;
objectivec跨房间转发媒体流过程中的发生该事件的目标房间 ID
空字符串代表所有目标房间
@property(assign, nonatomic) ByteRTCForwardStreamEvent event;
objectivec跨房间转发媒体流过程中该目标房间发生的事件,参看 ByteRTCForwardStreamEvent
@interface ByteRTCNetworkQualityStats: NSObject
objectivec上行/下行网络质量
| 类型 | 名称 |
|---|---|
| NSString* | uid |
| double | lossRatio |
| int | rtt |
| int | totalBandwidth |
| ByteRTCNetworkQuality | txQuality |
| ByteRTCNetworkQuality | rxQuality |
@property(strong, nonatomic) NSString* _Nonnull uid;
objectivec用户 ID
@property(assign, nonatomic) double lossRatio;
objectivec本端的上行/下行的丢包率,范围 [0.0,1.0]
当 uid 为本地用户时,代表发布流的上行丢包率。
当 uid 为远端用户时,代表接收所有订阅流的下行丢包率。
@property(assign, nonatomic) int rtt;
objectivec当 uid 为本地用户时有效,客户端到服务端的往返延时(RTT),单位:ms
@property(assign, nonatomic) int totalBandwidth;
objectivec本端的音视频 RTP 包 2 秒内的平均传输速率,单位:bps
当 uid 为本地用户时,代表发送速率。
当 uid 为远端用户时,代表所有订阅流的接收速率。
@property(assign, nonatomic) ByteRTCNetworkQuality txQuality;
objectivec上行网络质量评分,详见 ByteRTCNetworkQuality。
@property(assign, nonatomic) ByteRTCNetworkQuality rxQuality;
objectivec下行网络质量评分,详见 ByteRTCNetworkQuality。
@interface ByteRTCNetworkTimeInfo: NSObject
objectivec网络时间信息
| 类型 | 名称 |
|---|---|
| int64_t | timestamp |
@property(assign, nonatomic) int64_t timestamp;
objectivec网络时间,单位:ms
typedef NS_ENUM(NSInteger, ByteRTCAudioDumpStatus)
objectivec音频dump状态。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCAudioDumpStartFailure | 0 | 音频dump启动失败 |
| ByteRTCAudioDumpStartSuccess | 1 | 音频dump启动成功 |
| ByteRTCAudioDumpStopFailure | 2 | 音频dump停止失败 |
| ByteRTCAudioDumpStopSuccess | 3 | 音频dump停止成功 |
| ByteRTCAudioDumpRunningFailure | 4 | 音频dump运行失败 |
| ByteRTCAudioDumpRunningSuccess | 5 | 音频dump运行成功 |
typedef NS_ENUM(NSUInteger, ByteRTCNetworkDetectionStopReason)
objectivec通话前探测的停止原因rtcEngine:onNetworkDetectionStopped: 回调的参数类型
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCNetworkDetectionStopReasonUser | 0 | 用户主动停止。 |
| ByteRTCNetworkDetectionStopReasonTimeout | 1 | 探测超过三分钟。 |
| ByteRTCNetworkDetectionStopReasonConnectionLost | 2 | 探测网络连接断开。 当超过 12s 没有收到回复,SDK 将断开网络连接,并且不再尝试重连。 |
| ByteRTCNetworkDetectionStopReasonStreaming | 3 | 本地开始推拉流,停止探测。 |
| ByteRTCNetworkDetectionStopReasonInnerErr | 4 | 网络探测失败,内部异常 |
typedef NS_ENUM(NSUInteger, ByteRTCNetworkDetectionLinkType)
objectivec通话前探测链接的类型rtcEngine:onNetworkDetectionResult:quality:rtt:lostRate:bitrate:jitter: 回调的参数类型
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCNetworkDetectionLinkTypeUp | 0 | 上行网络探测。 |
| ByteRTCNetworkDetectionLinkTypeDown | 1 | 下行网络探测。 |
typedef NS_ENUM(NSUInteger, ByteRTCHardwareEchoDetectionResult)
objectivec通话前回声检测结果
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCHardwareEchoDetectionCanceled | 0 | 主动调用 stopHardwareEchoDetection 结束流程时,未有回声检测结果。 |
| ByteRTCHardwareEchoDetectionUnknown | 1 | 未检测出结果。建议重试,如果仍然失败请联系技术支持协助排查。 |
| ByteRTCHardwareEchoDetectionNormal | 2 | 无回声 |
| ByteRTCHardwareEchoDetectionPoor | 3 | 有回声。可通过 UI 建议用户使用耳机设备入会。 |
typedef NS_ENUM(NSUInteger, ByteRTCAudioSelectionPriority)
objectivec音频选路优先级设置
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCAudioSelectionPriorityNormal | 0 | 正常,参加音频选路 |
| ByteRTCAudioSelectionPriorityHigh | 1 | 高优先级,跳过音频选路 |
typedef NS_ENUM(NSInteger,ByteRTCSetRoomExtraInfoResult)
objectivec设置房间附加消息结果。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCSetRoomExtraInfoResultSuccess | 0 | 设置房间附加信息成功 |
| ByteRTCSetRoomExtraInfoResultNotJoinRoom | -1 | 设置失败,尚未加入房间 |
| ByteRTCSetRoomExtraInfoResultKeyIsNull | -2 | 设置失败,key 指针为空 |
| ByteRTCSetRoomExtraInfoResultValueIsNull | -3 | 设置失败,value 指针为空 |
| ByteRTCSetRoomExtraInfoResultUnknow | -99 | 设置失败,未知错误 |
| ByteRTCSetRoomExtraInfoResultKeyIsEmpty | -400 | 设置失败,key 长度为 0 |
| ByteRTCSetRoomExtraInfoResultTooOften | -406 | 调用 setRoomExtraInfo 过于频繁,建议不超过 10 次/秒。 |
| ByteRTCSetRoomExtraInfoResultSilentUser | -412 | 设置失败,用户已调用 setUserVisibility 将自身设为隐身状态。 |
| ByteRTCSetRoomExtraInfoResultKeyTooLong | -413 | 设置失败,Key 长度超过 10 字节 |
| ByteRTCSetRoomExtraInfoResultValueTooLong | -414 | 设置失败,value 长度超过 128 字节 |
| ByteRTCSetRoomExtraInfoResultServerError | -500 | 设置失败,服务器错误 |
typedef NS_ENUM(NSInteger, ByteRTCSubtitleState)
objectivec字幕任务状态。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCSubtitleStateStarted | 0 | 开启字幕。 |
| ByteRTCSubtitleStateStoped | 1 | 关闭字幕。 |
| ByteRTCSubtitleStateError | 2 | 字幕任务出现错误。 |
typedef NS_ENUM(NSInteger, ByteRTCSubtitleMode)
objectivec字幕模式。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCSubtitleModeRecognition | 0 | 识别模式。在此模式下,房间内用户语音会被转为文字。 |
| ByteRTCSubtitleModeTranslation | 1 | 翻译模式。在此模式下,房间内用户语音会先被转为文字,再被翻译为目标语言。 |
@interface ByteRTCSubtitleConfig : NSObject
objectivec字幕配置信息。
| 类型 | 名称 |
|---|---|
| ByteRTCSubtitleMode | mode |
| NSString* | targetLanguage |
@property(assign, nonatomic) ByteRTCSubtitleMode mode;
objectivec字幕模式。可以根据需要选择识别和翻译两种模式。开启识别模式,会将识别后的用户语音转化成文字;开启翻译模式,会在语音识别后进行翻译。参看 ByteRTCSubtitleMode。
@property(copy, nonatomic) NSString *_Nonnull targetLanguage;
objectivec目标翻译语言。可点击 语言支持 查看翻译服务最新支持的语种信息。
@interface ByteRTCSubtitleMessage : NSObject
objectivec字幕具体内容。
| 类型 | 名称 |
|---|---|
| NSString* | userId |
| NSString* | text |
| NSString* | language |
| NSInteger | mode |
| NSInteger | sequence |
| BOOL | definite |
@property(copy, nonatomic) NSString *_Nonnull userId;
objectivec说话者的用户ID。
@property(copy, nonatomic) NSString *_Nonnull text;
objectivec语音识别或翻译后的文本, 采用 UTF-8 编码。
@property(copy, nonatomic) NSString *_Nonnull language;
objectivec字幕语种,根据字幕模式为原文或译文对应的语种。
@property(assign, nonatomic) NSInteger mode;
objectivec字幕模式,参看 ByteRTCSubtitleMode。
@property(assign, nonatomic) NSInteger sequence;
objectivec语音识别或翻译后形成的文本的序列号,同一发言人的完整发言和不完整发言会按递增顺序单独分别编号。
@property(assign, nonatomic) BOOL definite;
objectivec语音识别出的文本是否为一段完整的一句话。 True 代表是, False 代表不是。
typedef NS_OPTIONS(NSUInteger, ByteRTCMusicFilterType)
objectivec歌曲过滤方式。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCMusicFilterTypeNone | 0 | 不过滤。 |
| ByteRTCMusicFilterTypeWithoutLyric | 1 << 0 | 过滤没有歌词的歌曲。 |
| ByteRTCMusicFilterTypeUnsupportedScore | 1 << 1 | 过滤不支持打分的歌曲。 |
| ByteRTCMusicFilterTypeUnsupportedAccopmay | 1 << 2 | 过滤不支持伴唱切换的歌曲。 |
| ByteRTCMusicFilterTypeUnsupportedClimx | 1 << 3 | 过滤没有高潮片段的歌曲。 |
typedef NS_OPTIONS(NSUInteger, ByteRTCMusicHotType)
objectivec榜单类别。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCMusicHotTypeContentCenter | 1 << 0 | 火山内容中心热歌榜。 |
| ByteRTCMusicHotTypeProject | 1 << 1 | 项目热歌榜。 |
typedef NS_ENUM(NSInteger, ByteRTCPlayState)
objectivec音乐播放状态。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCPlayStatePlaying | 1 | 播放中。 |
| ByteRTCPlayStatePaused | 2 | 暂停中。 |
| ByteRTCPlayStateStoped | 3 | 已停止。 |
| ByteRTCPlayStateFailed | 4 | 播放失败。 |
| ByteRTCPlayStateFinished | 5 | 播放结束。 |
typedef NS_ENUM(NSInteger, ByteRTCAudioTrackType)
objectivec原唱伴唱类型。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCAudioTrackTypeOriginal | 1 | 播放原唱。 |
| ByteRTCAudioTrackTypeAccompy | 2 | 播放伴唱。 |
typedef NS_ENUM(NSInteger, ByteRTCAudioPlayType)
objectivec音乐播放类型。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCAudioPlayTypeLocal | 0 | 仅本地播放。 |
| ByteRTCAudioPlayTypeRemote | 1 | 仅远端播放。 |
| ByteRTCAudioPlayTypeLocalAndRemote | 2 | 本地、远端同时播放。 |
typedef NS_ENUM(NSInteger, ByteRTCLyricStatus)
objectivec歌词格式类型。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCLyricStatusNone | 0 | 无歌词。 |
| ByteRTCLyricStatusKRC | 1 | KRC 歌词。 |
| ByteRTCLyricStatusLRC | 2 | LRC 歌词。 |
| ByteRTCLyricStatusKRCAndLRC | 3 | KRC 歌词和 LRC 歌词均有。 |
typedef NS_ENUM(NSInteger, ByteRTCDownloadFileType)
objectivec下载文件类型。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCDownloadFileTypeMusic | 1 | 音频文件。 |
| ByteRTCDownloadFileTypeKRC | 2 | KRC 歌词文件。 |
| ByteRTCDownloadFileTypeLRC | 3 | LRC 歌词文件。 |
| ByteRTCDownloadFileTypeMIDI | 4 | MIDI 文件。 |
typedef NS_ENUM(NSInteger, ByteRTCDownloadLyricType)
objectivec歌词文件类型。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCDownloadLyricTypeKRC | 0 | KRC 歌词文件。 |
| ByteRTCDownloadLyricTypeLRC | 1 | LRC 歌词文件。 |
typedef NS_ENUM(NSInteger, ByteRTCKTVPlayerErrorCode)
objectivecKTV 播放器错误码。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCKTVPlayerErrorCodeOK | 0 | 成功。 |
| ByteRTCKTVPlayerErrorCodeFileNotExist | -3020 | 播放错误,请下载后播放。 |
| ByteRTCKTVPlayerErrorCodeFileError | -3021 | 播放错误,请确认文件播放格式。 |
| ByteRTCKTVPlayerErrorCodeNotJoinRoom | -3022 | 播放错误,未进入房间。 |
| ByteRTCKTVPlayerErrorCodeParam | -3023 | 参数错误。 |
| ByteRTCKTVPlayerErrorCodeStartError | -3024 | 播放失败,找不到文件或文件打开失败。 |
| ByteRTCKTVPlayerErrorCodeMixIdError | -3025 | 混音 ID 异常。 |
| ByteRTCKTVPlayerErrorCodePositionError | -3026 | 设置播放位置出错。 |
| ByteRTCKTVPlayerErrorCodeAudioVolumeError | -3027 | 音量参数不合法,可设置的取值范围为 [0,400]。 |
| ByteRTCKTVPlayerErrorCodeTypeError | -3028 | 不支持此混音类型。 |
| ByteRTCKTVPlayerErrorCodePitchError | -3029 | 音调文件不合法。 |
| ByteRTCKTVPlayerErrorCodeAudioTrackError | -3030 | 音轨不合法。 |
| ByteRTCKTVPlayerErrorCodeStartingError | -3031 | 混音启动中。 |
@interface ByteRTCMusicInfo : NSObject
objectivec歌曲数据。
| 类型 | 名称 |
|---|---|
| NSString* | musicId |
| NSString* | musicName |
| NSString* | singer |
| NSString* | vendorId |
| NSString* | vendorName |
| int64_t | updateTimestamp |
| NSString* | posterUrl |
| ByteRTCLyricStatus | lyricStatus |
| int | duration |
| BOOL | enableScore |
| int | climaxStartTime |
| int | climaxEndTime |
@property (nonatomic, copy) NSString * _Nonnull musicId;
objectivec音乐 ID。
@property (nonatomic, copy) NSString * _Nonnull musicName;
objectivec音乐名称。
@property (nonatomic, copy) NSString * _Nonnull singer;
objectivec歌手。
@property (nonatomic, copy) NSString * _Nonnull vendorId;
objectivec版权商 ID。
@property (nonatomic, copy) NSString * _Nonnull vendorName;
objectivec版权商名称。
@property (nonatomic, assign) int64_t updateTimestamp;
objectivec最新更新时间戳,单位为毫秒。
@property (nonatomic, copy) NSString * _Nonnull posterUrl;
objectivec封面地址。
@property (nonatomic, assign) ByteRTCLyricStatus lyricStatus;
objectivec歌词格式类型,参看 ByteRTCLyricStatus。
@property (nonatomic, assign) int duration;
objectivec歌曲长度,单位为毫秒。
@property (nonatomic, assign) BOOL enableScore;
objectivec歌曲是否支持打分。
@property (nonatomic, assign) int climaxStartTime;
objectivec歌曲高潮片段开始时间,单位为毫秒。
@property (nonatomic, assign) int climaxEndTime;
objectivec歌曲高潮片段停止时间,单位为毫秒。
@interface ByteRTCHotMusicInfo : NSObject
objectivec热榜歌曲数据。
| 类型 | 名称 |
|---|---|
| ByteRTCMusicHotType | hotType |
| NSString* | hotName |
| NSArray<ByteRTCMusicInfo>** | musics |
@property (nonatomic, assign) ByteRTCMusicHotType hotType;
objectivec榜单类别,参看 ByteRTCMusicHotType。
@property (nonatomic, copy) NSString * _Nullable hotName;
objectivec热榜名称。
@property (nonatomic, copy) NSArray<ByteRTCMusicInfo *> * _Nullable musics;
objectivec歌曲数据,参看 ByteRTCMusicInfo。
@interface ByteRTCDownloadResult : NSObject
objectivec歌曲下载信息。
| 类型 | 名称 |
|---|---|
| NSString* | musicId |
| ByteRTCDownloadFileType | fileType |
| NSString* | filePath |
@property (nonatomic, copy) NSString * _Nonnull musicId;
objectivec音乐 ID。
@property (nonatomic, assign) ByteRTCDownloadFileType fileType;
objectivec下载文件类型,参看 ByteRTCDownloadFileType。
@property (nonatomic, copy) NSString * _Nullable filePath;
objectivec文件存放路径。
typedef NS_ENUM(NSInteger, ByteRTCAttenuationType)
objectivec空间音频音量随距离衰减模式
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCAttenuationTypeNone | 0 | 不随距离衰减 |
| ByteRTCAttenuationTypeLinear | 1 | 线性衰减,音量随距离增大而线性减小 |
| ByteRTCAttenuationTypeExponential | 2 | 指数型衰减,音量随距离增大进行指数衰减 |
@interface ByteRTCReceiveRange : NSObject
objectivec本地用户能收听到、且具有衰减效果的音频接收范围
| 类型 | 名称 |
|---|---|
| int | min |
| int | max |
@property(nonatomic, assign) int min;
objectivec能够接收语音、并且具有衰减效果的最小距离值,该值须 ≥ 0,但 ≤ max。
小于该值的范围内没有范围语音效果,即收听到的音频音量相同。
@property(nonatomic, assign) int max;
objectivec能够收听语音的最大距离值,该值须 > 0 且 ≥ min。
当收听者和声源距离处于 [min, max) 之间时,收听到的音量根据距离呈衰减效果。
超出该值范围的音频将无法收听到。
typedef NS_ENUM(NSUInteger, ByteRTCUserOfflineReason)
objectivec远端用户离开房间的原因。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCUserOfflineReasonQuit | 0 | 远端用户调用 leaveRoom 方法主动退出房间。 |
| ByteRTCUserOfflineReasonDropped | 1 | 远端用户因网络等原因掉线。 |
| ByteRTCUserOfflineReasonSwitchToInvisible | 2 | 远端用户切换至隐身状态。 |
| ByteRTCUserOfflineReasonKickedByAdmin | 3 | 远端用户被踢出出房间。 因调用踢出用户的 OpenAPI,远端用户被踢出房间。 |
typedef NS_ENUM(NSInteger, ByteRTCConnectionState)
objectivecSDK 与信令服务器连接状态。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCConnectionStateDisconnected | 1 | 连接断开超过 12s,此时 SDK 会尝试自动重连。 |
| ByteRTCConnectionStateConnecting | 2 | 首次请求建立连接,正在连接中。 |
| ByteRTCConnectionStateConnected | 3 | 首次连接成功。 |
| ByteRTCConnectionStateReconnecting | 4 | 涵盖了以下情况: + 首次连接时,10秒连接不成功; + 连接成功后,断连 10 秒。自动重连中。 |
| ByteRTCConnectionStateReconnected | 5 | 连接断开后,重连成功。 |
| ByteRTCConnectionStateLost | 6 | 处于 ByteRTCConnectionStateDisconnected 状态超过 10 秒,且期间重连未成功。SDK 仍将继续尝试重连。 |
| ByteRTCConnectionStateFailed | 7 | 连接失败,服务端状态异常。SDK 不会自动重连,请重新进房,或联系技术支持。 |
typedef NS_ENUM(NSInteger, ByteRTCNetworkType)
objectivecSDK 网络连接类型。
| 类型 | 值 | 说明 |
|---|---|---|
| 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(NSUInteger, ByteRTCNetworkQuality)
objectivec媒体流网络质量。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCNetworkQualityUnknown | 0 | 网络质量未知。 |
| ByteRTCNetworkQualityExcellent | 1 | 网络质量极好。 |
| ByteRTCNetworkQualityGood | 2 | 主观感觉和 kNetworkQualityExcellent 差不多,但码率可能略低。 |
| ByteRTCNetworkQualityPoor | 3 | 主观感受有瑕疵但不影响沟通。 |
| ByteRTCNetworkQualityBad | 4 | 勉强能沟通但不顺畅。 |
| ByteRTCNetworkQualityVeryBad | 5 | 网络质量非常差,基本不能沟通。 |
| ByteRTCNetworkQualityDown | 6 | 网络连接断开,无法通话。网络可能由于 12s 内无应答、开启飞行模式、拔掉网线等原因断开。 更多网络状态信息参见 连接状态提示。 |
typedef NS_ENUM(NSUInteger, ByteRTCLogLevel)
objectivec日志级别。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCLogLevelTrace | 0 | 打印 trace 级别及以上级别信息。 |
| ByteRTCLogLevelDebug | 1 | 打印 debug 级别及以上级别信息。 |
| ByteRTCLogLevelInfo | 2 | 打印 info 级别及以上级别信息。 |
| ByteRTCLogLevelWarning | 3 | 打印 warning 级别及以上级别信息。 |
| ByteRTCLogLevelError | 4 | 打印 error 级别信息。 |
typedef NS_ENUM(NSUInteger, ByteRTCLogoutReason)
objectivec用户登出的原因
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCLogoutReasonLogout | 0 | 用户主动退出 用户调用 logout 接口登出,或者销毁引擎登出。 |
| ByteRTCLogoutReasonDuplicateLogin | 1 | 用户被动退出 另一个用户以相同 UserId 进行了 login,导致本端用户被踢出。 |
typedef NS_ENUM(NSInteger, ByteRTCMessageConfig)
objectivec发送消息的可靠有序类型
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCMessageConfigReliableOrdered | 0 | 低延时可靠有序消息 |
| ByteRTCMessageConfigUnreliableOrdered | 1 | 超低延时有序消息 |
| ByteRTCMessageConfigUnreliableUnordered | 2 | 超低延时无序消息 |
typedef NS_ENUM(NSInteger, ByteRTCUserOnlineStatus)
objectivec用户在线状态
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCUserOnlineStatusOffline | 0 | 对端用户离线 对端用户已经调用 logout,或者没有调用 login:uid: 进行登录 |
| ByteRTCUserOnlineStatusOnline | 1 | 对端用户在线 对端用户调用 login:uid: 登录,并且连接状态正常 |
| ByteRTCUserOnlineStatusUnreachable | 2 | 无法获取对端用户在线状态 发生级联错误、对端用户在线状态异常时返回 |
typedef NS_ENUM(NSUInteger, ByteRTCLocalLogLevel)
objectivec本地日志输出等级。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCLocalLogLevelInfo | 0 | 信息级别。 |
| ByteRTCLocalLogLevelWarning | 1 | (默认值)警告级别。 |
| ByteRTCLocalLogLevelError | 2 | 错误级别。 |
| ByteRTCLocalLogLevelNone | 3 | 关闭日志。 |
@interface ByteRTCSysStats : NSObject
objectivecApp 使用的 cpu 和 memory 信息
信息由 SDK 周期性(2s)地通过 reportSysStats 回调事件通知给用户。
| 类型 | 名称 |
|---|---|
| unsigned | cpuCores |
| double | cpuAppUsage |
| double | memoryUsage |
| unsigned | fullMemory |
| unsigned | totalMemoryUsage |
| unsigned | freeMemory |
| double | memoryRatio |
| double | totalMemoryRatio |
@property(assign, nonatomic) unsigned int cpuCores;
objectivec当前系统 cpu 核数
@property(assign, nonatomic) double cpuAppUsage;
objectivec当前应用的 CPU 使用率,取值范围为 [0, 1]。
@property(assign, nonatomic) double memoryUsage;
objectivec当前App的内存使用(单位 MB)
@property(assign, nonatomic) unsigned long long fullMemory;
objectivec全量内存(单位MB)
@property(assign, nonatomic) unsigned long long totalMemoryUsage;
objectivec系统已使用内存(单位MB)
@property(assign, nonatomic) unsigned long long freeMemory;
objectivec空闲可分配内存(单位MB)
@property(assign, nonatomic) double memoryRatio;
objectivec当前应用的内存使用率(单位 %)
@property(assign, nonatomic) double totalMemoryRatio;
objectivec系统内存使用率(单位 %)
@interface ByteRTCLogConfig : NSObject
objectivec本地日志参数。
| 类型 | 名称 |
|---|---|
| NSString* | logPath |
| ByteRTCLocalLogLevel | logLevel |
| int | logFileSize |
| NSString* | logFilenamePrefix |
@property(copy, nonatomic) NSString *_Nonnull logPath;
objectivec日志存储路径,必填。
@property(assign, nonatomic) ByteRTCLocalLogLevel logLevel;
objectivec日志等级,参看 ByteRTCLocalLogLevel,默认为警告级别,选填。
@property(assign, nonatomic) int logFileSize;
objectivec日志文件最大占用的总空间,单位为 MB,选填。取值范围为 1~100 MB,默认值为 10 MB。
若 logFileSize < 1,取 1 MB。若 logFileSize > 100,取 100 MB。
其中,单个日志文件最大为 2 MB:
logFileSize ≤ 2,则会生成一个日志文件。logFileSize > 2,假设 logFileSize/2 的整数部分为 N,则前 N 个文件,每个文件会写满 2 MB,第 N+1 个文件大小不超过 logFileSize mod 2,否则会删除最老的文件,以此类推。@property(copy, nonatomic) NSString *_Nonnull logFilenamePrefix;
objectivec日志文件名前缀,选填。该字符串必须符合正则表达式:[a-zA-Z0-9_@-.]{1,128}。
最终的日志文件名为前缀 + "_" + 文件创建时间 + "_rtclog".log,如 logPrefix_2023-05-25_172324_rtclog.log。
@interface ByteRTCCloudProxyInfo: NSObject
objectivec云代理信息
| 类型 | 名称 |
|---|---|
| NSString* | cloudProxyIp |
| int | cloudProxyPort |
@property(strong, nonatomic) NSString* _Nonnull cloudProxyIp;
objectivec云代理服务器 IP
@property(assign, nonatomic) int cloudProxyPort;
objectivec云代理服务器端口
typedef NS_ENUM(NSUInteger, ByteRTCLocalProxyType)
objectivec本地代理的类型。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCLocalProxyTypeSocks5 | 1 | Socks5 代理。选用此代理服务器,需满足 Socks5 协议标准文档的要求。 |
| ByteRTCLocalProxyTypeHttpTunnel | 2 | Http 隧道代理。 |
@interface ByteRTCLocalProxyInfo : NSObject
objectivec本地代理配置详细信息。
| 类型 | 名称 |
|---|---|
| ByteRTCLocalProxyType | localProxyType |
| NSString* | localProxyIp |
| int | localProxyPort |
| NSString* | localProxyUsername |
| NSString* | localProxyPassword |
@property(assign, nonatomic) ByteRTCLocalProxyType localProxyType;
objectivec本地代理的类型,参看 ByteRTCLocalProxyType。
@property(copy, nonatomic) NSString * _Nullable localProxyIp;
objectivec本地代理服务器 IP。
@property(assign, nonatomic) int localProxyPort;
objectivec本地代理服务器端口。
@property(copy, nonatomic) NSString * _Nullable localProxyUsername;
objectivec本地代理用户名。
@property(copy, nonatomic) NSString * _Nullable localProxyPassword;
objectivec本地代理密码。
typedef NS_ENUM(NSUInteger, ByteRTCLocalProxyState)
objectivec本地代理连接状态。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCLocalProxyStateInited | 0 | TCP 代理服务器连接成功。 |
| ByteRTCLocalProxyStateConnected | 1 | 本地代理连接成功。 |
| ByteRTCLocalProxyStateError | 2 | 本地代理连接出现错误。 |
typedef NS_ENUM(NSUInteger, ByteRTCLocalProxyError)
objectivec本地代理错误。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCLocalProxyErrorOK | 0 | 本地代理服务器无错误。 |
| ByteRTCLocalProxyErrorSocks5VersionError | 1 | 代理服务器回复的版本号不符合 Socks5 协议标准文档的规定,导致 Socks5 代理连接失败。请检查代理服务器是否存在异常。 |
| ByteRTCLocalProxyErrorSocks5FormatError | 2 | 代理服务器回复的格式错误不符合 Socks5 协议标准文档的规定,导致 Socks5 代理连接失败。请检查代理服务器是否存在异常。 |
| ByteRTCLocalProxyErrorSocks5InvalidValue | 3 | 代理服务器回复的字段值不符合 Socks5 协议标准文档的规定,导致 Socks5 代理连接失败。请检查代理服务器是否存在异常。 |
| ByteRTCLocalProxyErrorSocks5UserPassNotGiven | 4 | 未提供代理服务器的用户名及密码,导致 Socks5 代理连接失败。请重新调用 setLocalProxy,在设置本地代理时填入用户名和密码。 |
| ByteRTCLocalProxyErrorSocks5TcpClosed | 5 | TCP 关闭,导致 Socks5 代理连接失败。请检查网络或者代理服务器是否存在异常。 |
| ByteRTCLocalProxyErrorHttpTunnelFailed | 6 | Http 隧道代理错误。请检查 Http 隧道代理服务器或者网络是否存在异常。 |
@interface ByteRtcScreenCapturerExt : NSObject
objectivec屏幕采集相关扩展实例,仅适用于 SDK 内部采集。
用户创建 extesion 后生成的 SampleHandler 需通过此实例实现屏幕共享相关能力。
| 类型 | 名称 |
|---|---|
| ByteRtcScreenCapturerExt* | shared |
| NSObject | delegate |
| 返回 | 名称 |
|---|---|
| void | startWithDelegate:groupId: |
| void | stop |
| void | processSampleBuffer:withType: |
@property (readonly, class) ByteRtcScreenCapturerExt *shared;
objectivec@property (nonatomic, weak, nullable) NSObject<ByteRtcScreenCapturerExtDelegate> *delegate;
objectivec- (void)startWithDelegate:(NSObject<ByteRtcScreenCapturerExtDelegate> *)delegate groupId:(NSString *)groupId;
objectivec开始屏幕采集
Extension 启动后,系统将自动调用该方法开启屏幕采集。
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| delegate | NSObject | 回调代理,参看 ByteRtcScreenCapturerExtDelegate |
| groupId | NSString* | App groups 中配置的 group ID |
- (void)stop;
objectivec结束屏幕采集
Extension 关闭后,系统将自动调用该方法停止屏幕采集。
- (void)processSampleBuffer:(CMSampleBufferRef)sampleBuffer withType:(RPSampleBufferType)sampleBufferType API_AVAILABLE(ios(10));
objectivec推送 Extension 采集的数据
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| sampleBuffer | CMSampleBufferRef | 采集到的数据 |
| sampleBufferType | RPSampleBufferType | 数据类型 |
typedef NS_ENUM(NSUInteger, ByteRTCRenderMode)
objectivec图片或视频流的缩放模式。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCRenderModeHidden | 1 | 视窗填满优先,默认值。 视频尺寸等比缩放,直至视窗被填满。当视频尺寸与显示窗口尺寸不一致时,多出的视频将被截掉。 |
| ByteRTCRenderModeFit | 2 | 视频帧内容全部显示优先。 视频尺寸等比缩放,优先保证视频内容全部显示。当视频尺寸与显示窗口尺寸不一致时,会把窗口未被填满的区域填充成背景颜色。 |
| ByteRTCRenderModeFill | 3 | 视频帧自适应画布。 视频尺寸非等比例缩放,把窗口充满。在此过程中,视频帧的长宽比例可能会发生变化。 |
typedef NS_ENUM(NSUInteger, ByteRTCTranscoderContentControlType)
objectivec合流输出内容类型
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCTranscoderContentControlTypeHasAudioAndVideo | 0 | 输出的混流包含音频和视频 |
| ByteRTCTranscoderContentControlTypeHasAudioOnly | 1 | 输出的混流只包含音频 |
| ByteRTCTranscoderContentControlTypeHasVideoOnly | 2 | 输出的混流只包含视频 |
typedef NS_ENUM(NSUInteger, ByteRTCTranscoderLayoutRegionType)
objectivec合流布局区域类型。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCTranscoderLayoutRegionTypeVideoStream | 0 | 合流布局区域类型为视频。 |
| ByteRTCTranscoderLayoutRegionTypeImage | 1 | 合流布局区域类型为图片。 |
typedef NS_ENUM(NSInteger, ByteRTCVideoStreamType)
objectivec视频流类型
目前C++ SDK 只支持 ByteRTCVideoStreamTypeHigh 类型
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCVideoStreamTypeHigh | 0 | 高分辨率视频流 |
| ByteRTCVideoStreamTypeLow | 1 | 低分辨率视频 |
typedef NS_ENUM(NSInteger, ByteRTCVideoStreamState)
objectivec设置本地视频属性的返回状态。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCVideoStreamStateSuccess | 0 | 设置本地视频属性成功 |
| ByteRTCVideoStreamStateInvalid | -2 | 本地视频属性参数不合法 |
typedef NS_ENUM(NSInteger, ByteRTCVideoOutputOrientationMode)
objectivec视频输出方向模式
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCVideoOutputOrientationModeAdaptative | 0 | 自适应布局 |
| ByteRTCVideoOutputOrientationModeFixedLandscape | 1 | 横屏布局 |
| ByteRTCVideoOutputOrientationModeFixedPortrait | 2 | 竖屏布局 |
typedef NS_ENUM(NSUInteger, ByteRTCVideoOrientation)
objectivec视频帧朝向
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCVideoOrientationAdaptive | 0 | (默认)使用相机输出的原始视频帧的角度,不对视频帧进行额外旋转。 |
| ByteRTCVideoOrientationPortrait | 1 | 固定为竖屏,将相机采集到的视频帧转换为竖屏,在整个 RTC 链路中传递竖屏帧。 |
| ByteRTCVideoOrientationLandscape | 2 | 固定为横屏,将相机采集到的视频帧转换为横屏,在整个 RTC 链路中传递横屏帧。 |
typedef NS_ENUM(NSUInteger, ByteRTCMirrorType)
objectivec镜像类型
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCMirrorTypeNone | 0 | 本地预览和编码传输时均无镜像效果 |
| ByteRTCMirrorTypeRender | 1 | 本地预览时有镜像效果,编码传输时无镜像效果 |
| ByteRTCMirrorTypeRenderAndEncoder | 3 | 本地预览和编码传输时均有镜像效果 |
typedef NS_ENUM(NSUInteger, ByteRTCRemoteMirrorType)
objectivec远端流的镜像类型。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCRemoteMirrorTypeNone | 0 | (默认值)远端视频渲染无镜像效果。 |
| ByteRTCRemoteMirrorTypeRender | 1 | 远端视频渲染有镜像效果。 |
typedef NS_ENUM(NSUInteger, ByteRTCEffectBeautyMode)
objectivec基础美颜模式。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCEffectBeautyModeWhite | 0 | 美白。 |
| ByteRTCEffectBeautyModeSmooth | 1 | 磨皮。 |
| ByteRTCEffectBeautyModeSharpen | 2 | 锐化。 |
| ByteRTCEffectBeautyModeClear | 3 | 清晰,需集成 v4.4.2+ 版本的特效 SDK。 |
typedef NS_ENUM(NSInteger, ByteRTCVideoRotation)
objectivec视频帧旋转信息
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCVideoRotation0 | 0 | 不旋转 |
| ByteRTCVideoRotation90 | 90 | 顺时针旋转 90 度 |
| ByteRTCVideoRotation180 | 180 | 顺时针旋转 180 度 |
| ByteRTCVideoRotation270 | 270 | 顺时针旋转 270 度 |
typedef NS_ENUM(NSInteger, ByteRTCVideoContentType)
objectivec视频内容类型
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCVideoContentTypeNormalFrame | 0 | 普通视频 |
| ByteRTCVideoContentTypeBlackFrame | 1 | 黑帧视频 |
typedef NS_ENUM(NSInteger, ByteRTCVideoStreamScaleMode)
objectivec视频帧缩放模式
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCVideoStreamScaleModeAuto | 0 | 自动缩放模式,默认设置为 ByteRTCVideoStreamScaleModeFitWithCropping。 |
| ByteRTCVideoStreamScaleModeStretch | 1 | 对视频帧进行缩放,直至充满和视窗分辨率一致为止。这一过程不保证等比缩放。 |
| ByteRTCVideoStreamScaleModeFitWithCropping | 2 | 视窗填满优先。 视频帧等比缩放,直至视窗被视频填满。如果视频帧长宽比例与视窗不同,视频帧的多出部分将无法显示。 缩放完成后,视频帧的一边长和视窗的对应边长一致,另一边长大于等于视窗对应边长。 |
| ByteRTCVideoStreamScaleModeFitWithFilling | 3 | 视频帧内容全部显示优先。 视频帧等比缩放,直至视频帧能够在视窗上全部显示。如果视频帧长宽比例与视窗不同,视窗上未被视频帧填满区域将被涂黑。 缩放完成后,视频帧的一边长和视窗的对应边长一致,另一边长小于等于视窗对应边长。保持纵横比来缩放图像,填充短边 |
typedef NS_ENUM(NSInteger, ByteRTCVideoPictureType)
objectivec编码帧类型
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCVideoPictureTypeUnknown | 0 | 未知类型 |
| ByteRTCVideoPictureTypeI | 1 | I帧,关键帧,编解码不需要参考其他视频帧 |
| ByteRTCVideoPictureTypeP | 2 | P帧,向前参考帧,编解码需要参考前一帧视频帧 |
| ByteRTCVideoPictureTypeB | 3 | B帧,前后参考帧,编解码需要参考前后两帧视频帧 |
typedef NS_ENUM(NSInteger, ByteRTCVideoEncoderPreference)
objectivec编码策略偏好。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCVideoEncoderPreferenceDisabled | 0 | 无偏好。不降低帧率和分辨率。 |
| ByteRTCVideoEncoderPreferenceMaintainFramerate | 1 | (默认值)帧率优先。分辨率不变。 |
| ByteRTCVideoEncoderPreferenceMaintainQuality | 2 | 分辨率优先。 |
| ByteRTCVideoEncoderPreferenceBalance | 3 | 平衡帧率与分辨率。 |
typedef NS_ENUM(NSInteger, ByteRTCScreenVideoEncoderPreference)
objectivec屏幕流编码模式,默认采用清晰模式。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCScreenVideoEncodePreferenceFramerate | 1 | 流畅模式,优先保障帧率。适用于共享游戏、视频等动态画面。 |
| ByteRTCScreenVideoEncodePreferenceQuality | 2 | 清晰模式,优先保障分辨率。适用于共享PPT、文档、图片等静态画面。 |
typedef NS_ENUM(NSUInteger, ByteRTCDataFrameType)
objectivec数据类型
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCDataFrameTypeSei | 0 | SEI 数据 |
| ByteRTCDataFrameTypeRoi | 1 | 人脸识别数据 |
| ByteRTCDataFrameTypeOther | 2 | 其他数据帧类型 |
typedef NS_ENUM(NSInteger, ByteRTCVideoCapturePreference)
objectivec视频采集模式
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCVideoCapturePreferenceAuto | 0 | (默认)自动设置采集参数。 SDK在开启采集时根据服务端下发的采集配置结合编码参数设置最佳采集参数。 |
| ByteRTCVideoCapturePreferenceMannal | 1 | 手动设置采集参数,包括采集分辨率、帧率。 |
| ByteRTCVideoCapturePreferenceAutoPerformance | 2 | 采集参数与编码参数一致 |
typedef NS_ENUM(NSInteger, ByteRTCVideoFrameType)
objectivec视频帧类型
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCVideoFrameTypeRawMemory | 0 | 视频帧类型:内存数据 |
| ByteRTCVideoFrameTypePixelBuffer | 1 | 视频帧类型:CVPixelBuffer |
typedef NS_ENUM(NSInteger, ByteRTCVideoPixelFormat)
objectivec视频帧格式
| 类型 | 值 | 说明 |
|---|---|---|
| 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 |
typedef NS_ENUM(NSInteger, ByteRTCLocalVideoRenderPosition)
objectivec本地视频帧回调位置。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCLocalVideoRenderPositionAfterCapture | 0 | 采集后。 |
| ByteRTCLocalVideoRenderPositionAfterPreprocess | 1 | (默认值)前处理后。 |
typedef NS_ENUM(NSInteger, ByteRTCRemoteVideoRenderPosition)
objectivec远端视频帧回调位置。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCRemoteVideoRenderPositionAfterPostprocess | 1 | (默认值)后处理后。 |
typedef NS_ENUM(NSInteger, ByteRTCVideoSinkPixelFormat)
objectivec视频帧编码格式
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCVideoSinkPixelFormatOriginal | 0 | 原始视频帧格式 |
| ByteRTCVideoSinkPixelFormatI420 | 1 | YUV I420 格式 |
| ByteRTCVideoSinkPixelFormatBGRA | 2 | BGRA 格式 |
| ByteRTCVideoSinkPixelFormatRGBA | 5 | RGBA 格式, 字节序为 R8 G8 B8 A8 |
| ByteRTCVideoSinkPixelFormatNV12 | 8 | YUV NV12 格式 |
typedef NS_ENUM(NSInteger, ByteRTCVideoApplyRotation)
objectivec是否将视频帧自动转正。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCVideoApplyRotationDefault | -1 | (默认值)不旋转。 |
| ByteRTCVideoApplyRotation0 | 0 | 自动转正视频,即根据视频帧的旋转角信息将视频帧旋转到 0 度。 |
typedef NS_ENUM(NSInteger, ByteRTCVideoRenderMirrorType)
objectivec是否将视频帧镜像。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCVideoRenderMirrorTypeOn | 1 | 开启镜像。 |
| ByteRTCVideoRenderMirrorTypeOff | 2 | (默认值)不开启镜像。 |
typedef NS_ENUM(NSInteger, ByteRTCVideoSuperResolutionModeChangedReason)
objectivec超分状态改变原因。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCVideoSuperResolutionModeChangedReasonAPIOff | 0 | 调用 setRemoteVideoSuperResolution:withMode: 成功关闭超分。 |
| ByteRTCVideoSuperResolutionModeChangedReasonAPIOn | 1 | 调用 setRemoteVideoSuperResolution:withMode: 成功开启超分。 |
| ByteRTCVideoSuperResolutionModeChangedReasonResolutionExceed | 2 | 开启超分失败,远端视频流的原始视频分辨率超过 640 × 360 px。 |
| ByteRTCVideoSuperResolutionModeChangedReasonOverUse | 3 | 开启超分失败,已对一路远端流开启超分。 |
| ByteRTCVideoSuperResolutionModeChangedReasonDeviceNotSupport | 4 | 设备不支持使用超分辨率。 |
| ByteRTCVideoSuperResolutionModeChangedReasonDynamicClose | 5 | 当前设备性能存在风险,已动态关闭 |
| ByteRTCVideoSuperResolutionModeChangedReasonOtherSettingDisabled | 6 | 超分因其他原因关闭。 |
| ByteRTCVideoSuperResolutionModeChangedReasonOtherSettingEnabled | 7 | 超分因其他原因开启。 |
| ByteRTCVideoSuperResolutionModeChangedReasonNoComponent | 8 | SDK 没有编译超分组件。 |
| ByteRTCVideoSuperResolutionModeChangedReasonStreamNotExist | 9 | 远端流不存在。房间 ID 或用户 ID 无效,或对方没有发布流。 |
typedef NS_ENUM(NSInteger, ByteRTCVideoDenoiseModeChangedReason)
objectivec视频降噪模式状态改变原因。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCVideoDenoiseModeChangedReasonNull | -1 | 未知原因导致视频降噪状态改变。 |
| ByteRTCVideoDenoiseModeChangedReasonApiOff | 0 | 通过调用 setVideoDenoiser: 成功关闭视频降噪。 |
| ByteRTCVideoDenoiseModeChangedReasonApiOn | 1 | 通过调用 setVideoDenoiser: 成功开启视频降噪。 |
| ByteRTCVideoDenoiseModeChangedReasonConfigDisabled | 2 | 后台未配置视频降噪,视频降噪开启失败,请联系技术人员解决。 |
| ByteRTCVideoDenoiseModeChangedReasonConfigEnabled | 3 | 后台配置开启了视频降噪。 |
| ByteRTCVideoDenoiseModeChangedReasonInternalException | 4 | 由于内部发生了异常,视频降噪关闭。 |
| ByteRTCVideoDenoiseModeChangedReasonDynamicClose | 5 | 当前设备性能过载,已动态关闭视频降噪。 |
| ByteRTCVideoDenoiseModeChangedReasonDynamicOpen | 6 | 当前设备性能裕量充足,已动态开启视频降噪。 |
| ByteRTCVideoDenoiseModeChangedReasonResolution | 7 | 分辨率导致视频降噪状态发生改变。分辨率过高会导致性能消耗过大,从而导致视频降噪关闭。如若希望继续使用视频降噪,可选择降低分辨率。 |
typedef NS_ENUM(NSUInteger, ByteRTCStreamMixingType)
objectivec合流方式
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCStreamMixingTypeByServer | 0 | 服务端合流 |
| ByteRTCStreamMixingTypeByClient | 1 | 端云一体合流。SDK 智能决策在客户端或服务端完成合流。 |
typedef NS_ENUM(NSUInteger, ByteRTCStreamMixingEvent)
objectivec转推直播事件
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCStreamMixingEventStart | 1 | 请求发起转推直播任务 |
| ByteRTCStreamMixingEventStartSuccess | 2 | 发起转推直播任务成功 |
| ByteRTCStreamMixingEventStartFailed | 3 | 发起转推直播任务失败 |
| ByteRTCStreamMixingEventUpdate | 4 | 请求更新转推直播任务配置 |
| ByteRTCStreamMixingEventUpdateSuccess | 5 | 成功更新转推直播任务配置 |
| ByteRTCStreamMixingEventUpdateFailed | 6 | 更新转推直播任务配置失败 |
| ByteRTCStreamMixingEventStop | 7 | 请求结束转推直播任务 |
| ByteRTCStreamMixingEventStopSuccess | 8 | 结束转推直播任务成功 |
| ByteRTCStreamMixingEventStopFailed | 9 | 结束转推直播任务失败 |
| ByteRTCStreamMixingEventChangeMixType | 10 | 更新转推直播任务配置的请求超时 |
| ByteRTCStreamMixingEventFirstAudioFrameByClientMixer | 11 | 得到客户端合流音频首帧 |
| ByteRTCStreamMixingEventFirstVideoFrameByClientMixer | 12 | 收到客户端合流视频首帧 |
| ByteRTCStreamMixingEventUpdateTimeout | 13 | 更新转推直播任务配置超时 |
| ByteRTCStreamMixingEventStartTimeout | 14 | 发起转推直播任务配置超时 |
| ByteRTCStreamMixingEventRequestParamError | 15 | 合流布局参数错误 |
| ByteRTCStreamMixingEventMixImage | 16 | 合流加图片 |
typedef NS_ENUM(NSUInteger, ByteRTCMixedStreamType)
objectivec合流方式。(新)
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCMixedStreamByServer | 0 | 通过服务端合流 |
| ByteRTCMixedStreamByClient | 1 | 端云一体合流。SDK 智能决策在客户端或服务端完成合流。 使用前,请联系技术支持同学开通,否则不生效。 |
typedef NS_ENUM(NSUInteger, ByteRTCMixedStreamClientMixVideoFormat)
objectivec客户端合流回调视频格式。(新)
设置为系统不支持的格式时,自动回调系统默认格式。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCMixedStreamClientMixVideoFormatI420 | 0 | YUV I420。Android、Windows 默认回调格式。支持系统:Android、Windows。 |
| ByteRTCMixedStreamClientMixVideoFormatTexture2D | 1 | OpenGL GL_TEXTURE_2D 格式纹理。支持系统:安卓。 |
| ByteRTCMixedStreamClientMixVideoFormatCVPixelBufferBGRA | 2 | CVPixelBuffer BGRA。iOS 默认回调格式。支持系统: iOS。 |
| ByteRTCMixedStreamClientMixVideoFormatNV12 | 3 | YUV NV12。macOS 默认回调格式。支持系统: macOS。 |
typedef NS_ENUM(NSUInteger, ByteRTCMixedStreamVideoCodecType)
objectivec视频编码格式。(新)
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCMixedStreamVideoCodecTypeH264 | 0 | H.264 格式,默认值。 |
| ByteRTCMixedStreamVideoCodecTypeByteVC1 | 1 | ByteVC1 格式。 |
typedef NS_ENUM(NSUInteger, ByteRTCMixedStreamMediaType)
objectivec合流输出内容类型。(新)
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCMixedStreamMediaTypeAudioAndVideo | 0 | 输出的混流包含音频和视频 |
| ByteRTCMixedStreamMediaTypeAudioOnly | 1 | 输出的混流只包含音频 |
| ByteRTCMixedStreamMediaTypeVideoOnly | 2 | 输出的混流只包含视频 |
typedef NS_ENUM(NSUInteger, ByteRTCMixedStreamRenderMode)
objectivec图片或视频流的缩放模式。(新)
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCMixedStreamRenderModeHidden | 1 | 视窗填满优先,默认值。 视频尺寸等比缩放,直至视窗被填满。当视频尺寸与显示窗口尺寸不一致时,多出的视频将被截掉。 |
| ByteRTCMixedStreamRenderModeFit | 2 | 视频帧内容全部显示优先。 视频尺寸等比缩放,优先保证视频内容全部显示。当视频尺寸与显示窗口尺寸不一致时,会把窗口未被填满的区域填充成背景颜色。 |
| ByteRTCMixedStreamRenderModeAdaptive | 3 | 视频帧自适应画布。 视频尺寸非等比例缩放,把窗口充满。在此过程中,视频帧的长宽比例可能会发生变化。 |
typedef NS_ENUM(NSUInteger, ByteRTCMixedStreamLayoutRegionType)
objectivec合流布局区域类型。(新)
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCMixedStreamLayoutRegionTypeVideoStream | 0 | 合流布局区域类型为视频。 |
| ByteRTCMixedStreamLayoutRegionTypeImage | 1 | 合流布局区域类型为图片。 |
typedef NS_ENUM(NSUInteger, ByteRTCMixedStreamSyncStrategy)
objectivec合流同步策略
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCMixedStreamSyncStrategyNoSync | 0 | 不使用同步策略 |
| ByteRTCMixedStreamSyncStrategyAudioPreciseSync | 1 | 使用音频精准同步策略 |
| ByteRTCMixedStreamSyncStrategySimplexModeSync | 2 | 使用单通模式同步策略 |
typedef NS_ENUM(NSUInteger, ByteRTCMixedStreamVideoType)
objectivecregion 中流的类型属性
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCMixedStreamVideoTypeMain | 0 | 主流。包括: + 由摄像头/麦克风通过内部采集机制,采集到的流 + 通过自定义采集,采集到的流。 |
| ByteRTCMixedStreamVideoTypeScreen | 1 | 屏幕流。 |
typedef NS_ENUM(NSUInteger, ByteRTCClientMixVideoFormat)
objectivec客户端合流回调视频格式。设置为系统不支持的格式时,自动回调系统默认格式。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCClientMixVideoFormatI420 | 0 | YUV I420。Android、Windows 默认回调格式。支持系统:Android、Windows。 |
| ByteRTCClientMixVideoFormatTexture2D | 1 | OpenGL GL_TEXTURE_2D 格式纹理。支持系统:安卓。 |
| ByteRTCClientMixVideoFormatCVPixelBufferBGRA | 2 | CVPixelBuffer BGRA。iOS 默认回调格式。支持系统: iOS。 |
| ByteRTCClientMixVideoFormatNV12 | 3 | YUV NV12。macOS 默认回调格式。支持系统: macOS。 |
typedef NS_ENUM(NSUInteger, ByteRTCTranscodingVideoCodec)
objectivec视频编码格式。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCTranscodingVideoCodecH264 | 0 | H.264 格式,默认值。 |
| ByteRTCTranscodingVideoCodecH265 | 1 | ByteVC1 格式。 |
typedef NS_ENUM(NSInteger, ByteRTCMixedStreamSEIContentMode)
objectivec服务端合流转推 SEI 内容。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCMixedStreamSEIContentModeDefault | 0 | 视频流中包含全部的 SEI 信息。默认设置。 |
| ByteRTCMixedStreamSEIContentModeEnableVolumeIndication | 1 | 随非关键帧传输的 SEI 数据中仅包含音量信息。 当设置 ByteRTCMixedStreamServerControlConfig.enableVolumeIndication 为 True 时,此参数设置生效。 |
typedef NS_ENUM(NSInteger, ByteRTCMixedStreamPushMode)
objectivec服务端合流转推发起模式。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCMixedStreamPushModeOnStream | 0 | 无用户发布媒体流时,发起合流任务无效。默认设置。 当有用户发布媒体流时,才能发起合流任务。 |
| ByteRTCMixedStreamPushModeOnStartRequest | 1 | 无用户发布媒体流时,可以使用占位图发起合流任务。 占位图设置参看 alternateImageUrl 和 alternateImageFillMode |
typedef NS_ENUM(NSInteger, ByteRTCMixedStreamAlternateImageFillMode)
objectivec服务端合流占位图填充模式。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCMixedStreamAlternateImageFillModeFit | 0 | 占位图跟随用户原始视频帧相同的比例缩放。默认设置。 |
| ByteRTCMixedStreamAlternateImageFillModeFill | 1 | 占位图不跟随用户原始视频帧相同的比例缩放,保持图片原有比例。 |
typedef NS_ENUM(NSInteger, ByteRTCSubscribeMediaType)
objectivec订阅媒体的类型
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCSubscribeMediaTypeNone | 0 | 既不订阅音频,也不订阅视频 |
| ByteRTCSubscribeMediaTypeAudioOnly | 1 | 只订阅音频,不订阅视频 |
| ByteRTCSubscribeMediaTypeVideoOnly | 2 | 只订阅视频,不订阅音频 |
| ByteRTCSubscribeMediaTypeAudioAndVideo | 3 | 同时订阅音频和视频 |
typedef NS_ENUM(NSInteger, ByteRTCPauseResumControlMediaType)
objectivec暂停/恢复接收远端的媒体流类型。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCControlMediaTypeAudio | 0 | 只控制音频,不影响视频 |
| ByteRtcControlMediaTypeVideo | 1 | 只控制视频,不影响音频 |
| ByteRtcControlMediaTypeAudioAndVideo | 2 | 同时控制音频和视频 |
typedef NS_ENUM(NSInteger, ByteRTCVideoSourceType)
objectivec视频输入源类型
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCVideoSourceTypeExternal | 0 | 自定义采集视频源 |
| ByteRTCVideoSourceTypeInternal | 1 | 内部采集视频源 |
| ByteRTCVideoSourceTypeEncodedAutoSimulcast | 2 | 自定义编码视频源。 你仅需推送分辨率最大的一路编码后视频流,SDK 将自动转码生成多路小流 |
| ByteRTCVideoSourceTypeEncodedManualSimulcast | 3 | 自定义编码视频源。 SDK 不会自动生成多路流,你需要自行生成并推送多路流 |
typedef NS_ENUM(NSInteger, ByteRTCZoomConfigType)
objectivec数码变焦参数类型
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCZoomConfigTypeFocusOffset | 0 | 设置缩放系数 |
| ByteRTCZoomConfigTypeMoveOffset | 1 | 设置移动步长 |
typedef NS_ENUM(NSInteger, ByteRTCZoomDirectionType)
objectivec数字变焦操作类型
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCZoomDirectionTypeMoveLeft | 0 | 相机向左移动 |
| ByteRTCZoomDirectionTypeMoveRight | 1 | 相机向右移动 |
| ByteRTCZoomDirectionTypeMoveUp | 2 | 相机向上移动 |
| ByteRTCZoomDirectionTypeMoveDown | 3 | 相机向下移动 |
| ByteRTCZoomDirectionTypeZoomOut | 4 | 相机缩小焦距 |
| ByteRTCZoomDirectionTypeZoomIn | 5 | 相机放大焦距 |
| ByteRTCZoomDirectionTypeReset | 6 | 恢复到原始画面 |
typedef NS_ENUM(NSInteger, ByteRTCVideoDecoderConfig)
objectivec视频解码方式
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCVideoDecoderConfigRaw | 0 | 开启 SDK 内部解码,只回调解码后的数据。回调为renderPixelBuffer:rotation:contentType:extendedData: |
| ByteRTCVideoDecoderConfigEncode | 1 | 开启自定义解码,只回调解码前数据。回调为onRemoteEncodedVideoFrame:withEncodedVideoFrame:。 |
| ByteRTCVideoDecoderConfigBoth | 2 | 开启 SDK 内部解码,同时回调解码前和解码后的数据 |
typedef NS_ENUM(NSInteger, ByteRTCVirtualBackgroundSourceType)
objectivec虚拟背景类型。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCVirtualBackgroundSourceTypeColor | 0 | 使用纯色背景替换视频原有背景。 |
| ByteRTCVirtualBackgroundSourceTypeImage | 1 | 使用自定义图片替换视频原有背景。 |
typedef NS_ENUM(NSInteger, ByteRTCCameraID)
objectivec摄像头类型
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCCameraIDFront | 0 | 前置摄像头 |
| ByteRTCCameraIDBack | 1 | 后置摄像头 |
| ByteRTCCameraIDInvalid | 3 | 无效值 |
typedef NS_ENUM(NSInteger, ByteRTCRecordingType)
objectivec本地录制的媒体类型
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCRecordingTypeAudioOnly | 0 | 只录制音频 |
| ByteRTCRecordingTypeVideoOnly | 1 | 只录制视频 |
| ByteRTCRecordingTypeVideoAndAudio | 2 | 同时录制音频和视频 |
typedef NS_ENUM(NSInteger, ByteRTCScreenMediaType)
objectivec屏幕采集媒体类型
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCScreenMediaTypeVideoOnly | 0 | 只采集视频数据 |
| ByteRTCScreenMediaTypeAudioOnly | 1 | 只采集音频数据 |
| ByteRTCScreenMediaTypeVideoAndAudio | 2 | 音视频数据都采集 |
typedef NS_ENUM(NSUInteger, ByteRTCScreenCaptureSourceType)
objectivec屏幕采集对象的类型
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCScreenCaptureSourceTypeUnknown | 0 | 类型未知 |
| ByteRTCScreenCaptureSourceTypeWindow | 1 | 应用程序的窗口 |
| ByteRTCScreenCaptureSourceTypeScreen | 2 | 桌面 |
typedef NS_ENUM(NSUInteger, ByteRTCMouseCursorCaptureState)
objectivec内部采集屏幕视频流时,是否采集鼠标信息。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCMouseCursorCaptureStateOn | 0 | 采集鼠标信息。 |
| ByteRTCMouseCursorCaptureStateOff | 1 | 不采集鼠标信息。 |
@interface ByteRTCHighlightConfig: NSObject
objectivec屏幕共享时的边框高亮设置。
| 类型 | 名称 |
|---|---|
| BOOL | enableHighlight |
| uint32_t | borderColor |
| int | borderWidth |
@property (assign, nonatomic) BOOL enableHighlight;
objectivec是否显示高亮边框,默认显示。
@property (assign, nonatomic) uint32_t borderColor;
objectivec边框的颜色, 颜色格式为十六进制 ARGB: 0xAARRGGB。
@property (assign, nonatomic) int borderWidth;
objectivec边框的宽度,单位:像素。
typedef NS_ENUM(NSInteger, ByteRTCTorchState)
objectivec相机补光灯状态
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCTorchStateOff | 0 | 相机补光灯关闭 |
| ByteRTCTorchStateOn | 1 | 相机补光灯打开 |
typedef NS_ENUM(NSInteger, ByteRTCVideoDeviceType)
objectivec当前视频设备类型
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCVideoDeviceTypeUnknown | -1 | 未知视频设备 |
| ByteRTCVideoDeviceTypeRenderDevice | 0 | 视频渲染设备类型 |
| ByteRTCVideoDeviceTypeCaptureDevice | 1 | 视频采集设备类型 |
| ByteRTCVideoDeviceTypeScreenCaptureDevice | 2 | 屏幕流视频设备 |
typedef NS_OPTIONS(NSUInteger, ByteRTCMediaStreamType)
objectivec媒体流类型
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCMediaStreamTypeAudio | (1 << 0) | 只控制音频 |
| ByteRTCMediaStreamTypeVideo | (1 << 1) | 只控制视频 |
| ByteRTCMediaStreamTypeBoth | ByteRTCMediaStreamTypeAudio | ByteRTCMediaStreamTypeVideo | 同时控制音频和视频 |
typedef NS_ENUM(NSUInteger, ByteRTCFrameRateRatio)
objectivec占发布端原始帧率的比例
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCFrameRateRatioOrigin | 0 | 100% |
| ByteRTCFrameRateRatioHalf | 1 | 50% |
| ByteRTCFrameRateRatioQuater | 2 | 25% |
typedef NS_ENUM(NSUInteger, ByteRTCVideoRotationMode)
objectivec视频旋转模式
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCVideoRotationModeFollowApp | 0 | App 方向 |
| ByteRTCVideoRotationModeFollowGSensor | 1 | 重力方向 |
typedef NS_ENUM(NSUInteger, ByteRTCVideoEnhancementMode)
objectivec弱光适应类型
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCVideoEnhancementModeDisabled | 0 | 关闭弱光适应 |
| ByteRTCVideoEnhancementModeAuto | 1 | 开启弱光适应 |
@interface ByteRTCExpressionDetectConfig : NSObject
objectivec人像属性检测参数
| 类型 | 名称 |
|---|---|
| BOOL | enableAgeDetect |
| BOOL | enableGenderDetect |
| BOOL | enableEmotionDetect |
| BOOL | enableAttractivenessDetect |
| BOOL | enableHappinessDetect |
@property (assign, nonatomic) BOOL enableAgeDetect;
objectivec是否开启年龄检测。
@property (assign, nonatomic) BOOL enableGenderDetect;
objectivec是否开启性别检测。
@property (assign, nonatomic) BOOL enableEmotionDetect;
objectivec是否开启表情检测。
@property (assign, nonatomic) BOOL enableAttractivenessDetect;
objectivec是否开启吸引力检测。
@property (assign, nonatomic) BOOL enableHappinessDetect;
objectivec是否开启开心程度检测。
@interface ByteRTCExpressionDetectInfo : NSObject
objectivec人像属性检测信息
| 类型 | 名称 |
|---|---|
| float | age |
| float | boyProb |
| float | attractive |
| float | happyScore |
| float | sadScore |
| float | angryScore |
| float | surpriseScore |
| float | arousal |
| float | valence |
@property (assign, nonatomic) float age;
objectivec预测年龄,取值范围 (0, 100)。
@property (assign, nonatomic) float boyProb;
objectivec预测为男性的概率,取值范围 (0.0, 1.0)。
@property (assign, nonatomic) float attractive;
objectivec预测的吸引力分数,取值范围 (0, 100)。
@property (assign, nonatomic) float happyScore;
objectivec预测的微笑程度,取值范围 (0, 100)。
@property (assign, nonatomic) float sadScore;
objectivec预测的伤心程度,取值范围 (0, 100)。
@property (assign, nonatomic) float angryScore;
objectivec预测的生气程度,取值范围 (0, 100)。
@property (assign, nonatomic) float surpriseScore;
objectivec预测的吃惊程度,取值范围 (0, 100)。
@property (assign, nonatomic) float arousal;
objectivec预测的情绪激动程度,取值范围 (0, 100)。
@property (assign, nonatomic) float valence;
objectivec预测的情绪正负程度,取值范围 (-100, 100)。
@interface ByteRTCExpressionDetectResult : NSObject
objectivec人像属性检测结果
| 类型 | 名称 |
|---|---|
| int | detectResult |
| int | faceCount |
| NSArray<ByteRTCExpressionDetectInfo>** | detectInfo |
@property (assign, nonatomic) int detectResult;
objectivec特征识别结果
@property (assign, nonatomic) int faceCount;
objectivec识别到的人脸数量。
@property (nonatomic, copy) NSArray<ByteRTCExpressionDetectInfo *> * _Nonnull detectInfo;
objectivec特征识别信息。数组的长度和检测到的人脸数量一致。参看 ByteRTCExpressionDetectInfo。
@interface ByteRTCRectangle : NSObject
objectivec矩形区域,用于指定屏幕区域。
| 类型 | 名称 |
|---|---|
| int | x |
| int | y |
| int | width |
| int | height |
@property(assign, nonatomic) int x;
objectivec矩形区域左上角的 x 坐标。
@property(assign, nonatomic) int y;
objectivec矩形区域左上角的 y 坐标。
@property(assign, nonatomic) int width;
objectivec矩形宽度,单位:px。
@property(assign, nonatomic) int height;
objectivec矩形高度,单位:px。
@interface ByteRTCFaceDetectionResult : NSObject
objectivec人脸检测结果
| 类型 | 名称 |
|---|---|
| int | detectResult |
| int | imageWidth |
| int | imageHeight |
| NSArray<ByteRTCRectangle>** | faces |
| CMTime | frameTimestamp |
@property(assign, nonatomic) int detectResult;
objectivec人脸检测结果
@property(assign, nonatomic) int imageWidth;
objectivec原始图片宽度(px)
@property(assign, nonatomic) int imageHeight;
objectivec原始图片高度(px)
@property(nonatomic, copy) NSArray<ByteRTCRectangle *> * _Nullable faces;
objectivec识别到人脸的矩形框。数组的长度和检测到的人脸数量一致。参看 ByteRTCRectangle。
@property(assign, nonatomic) CMTime frameTimestamp;
objectivec进行人脸识别的视频帧的时间戳。
@interface ByteRTCVideoCanvas : NSObject
objectivec视频帧渲染设置
| 类型 | 名称 |
|---|---|
| ByteRTCView* | view |
| ByteRTCRenderMode | renderMode |
| NSInteger | backgroundColor |
| ByteRTCVideoRotation | renderRotation |
@property(strong, nonatomic) ByteRTCView* _Nullable view;
objectivec本地视图句柄
@property(assign, nonatomic) ByteRTCRenderMode renderMode;
objectivec渲染模式,参看 ByteRTCRenderMode
@property(assign, nonatomic) NSInteger backgroundColor;
objectivec用于填充画布空白部分的背景颜色。取值范围是 [0x00000000, 0xFFFFFFFF],格式为 BGR。默认值是 0x00000000。其中,透明度设置无效。
@property(assign, nonatomic) ByteRTCVideoRotation renderRotation;
objectivec视频帧旋转角度。参看 ByteRTCVideoRotation。默认为 0 度,即不做旋转处理。
该设置仅对远端视频有效,对本地视频设置不生效。
@interface ByteRTCRemoteVideoRenderConfig : NSObject
objectivec远端视频帧渲染设置
| 类型 | 名称 |
|---|---|
| ByteRTCRenderMode | renderMode |
| NSInteger | backgroundColor |
| ByteRTCVideoRotation | renderRotation |
@property(assign, nonatomic) ByteRTCRenderMode renderMode;
objectivec渲染模式,参看 ByteRTCRenderMode
@property(assign, nonatomic) NSInteger backgroundColor;
objectivec用于填充画布空白部分的背景颜色。取值范围是 [0x00000000, 0xFFFFFFFF],格式为 BGR。默认值是 0x00000000。其中,透明度设置无效。
@property(assign, nonatomic) ByteRTCVideoRotation renderRotation;
objectivec视频帧旋转角度。参看 ByteRTCVideoRotation。默认为 0 度,即不做旋转处理。
@interface ByteRTCFrameExtendedData : NSObject
objectivec视频帧附加的数据,视频解码后获得的附加数据
| 类型 | 名称 |
|---|---|
| ByteRTCDataFrameType | frameType |
| NSData* | extendedData |
| NSInteger | extendedDataLen |
@property(assign, nonatomic) ByteRTCDataFrameType frameType;
objectivec数据类型,详见 ByteRTCDataFrameType。
@property(strong, nonatomic) NSData * _Nullable extendedData;
objectivec附加数据
@property(assign, nonatomic) NSInteger extendedDataLen;
objectivec附加数据长度
@interface ByteRTCVideoSolution: NSObject
objectivec视频流参数
| 类型 | 名称 |
|---|---|
| CGSize | videoSize |
| NSInteger | frameRate |
| NSInteger | maxKbps |
| NSInteger | minKbps |
| ByteRTCVideoEncoderPreference | encoderPreference |
@property(nonatomic, assign) CGSize videoSize;
objectivec视频分辨率
@property(nonatomic, assign) NSInteger frameRate;
objectivec视频预设帧率
@property(nonatomic, assign) NSInteger maxKbps;
objectivec最高编码码率(千比特每秒)。建议使用 -1,SDK 会自动根据分辨率和帧率适配合适的码率。
@property(nonatomic, assign) NSInteger minKbps;
objectivec最低编码码率(千比特每秒)
@property(nonatomic, assign) ByteRTCVideoEncoderPreference encoderPreference;
objectivec视频编码质量策略,参见 ByteRTCVideoEncoderPreference
@interface ByteRTCVideoCaptureConfig: NSObject
objectivec视频采集参数
| 类型 | 名称 |
|---|---|
| ByteRTCVideoCapturePreference | preference |
| CGSize | videoSize |
| NSInteger | frameRate |
@property(nonatomic, assign) ByteRTCVideoCapturePreference preference;
objectivec视频采集模式,参看 ByteRTCVideoCapturePreference
@property(nonatomic, assign) CGSize videoSize;
objectivec视频采集分辨率
@property(nonatomic, assign) NSInteger frameRate;
objectivec视频采集帧率,单位:fps。
@protocol ByteRTCStream <NSObject>
objectivec流属性。
| 类型 | 名称 |
|---|---|
| NSString* | userId |
| BOOL | isScreen |
| BOOL | hasVideo |
| BOOL | hasAudio |
| NSArray<ByteRTCVideoSolution>** | videoStreamDescriptions |
| ByteRTCVideoSolution* | maxVideoStreamDescription |
@property(nonatomic, copy, readonly) NSString * userId;
objectivec发布此流的用户 ID 。
@property(nonatomic, assign, readonly) BOOL isScreen;
objectivec此流是否为共享屏幕流。
@property(nonatomic, assign, readonly) BOOL hasVideo;
objectivec此流是否包括视频流。
@property(nonatomic, assign, readonly) BOOL hasAudio;
objectivec流是否包括音频流。
@property(nonatomic, copy, readonly) NSArray<ByteRTCVideoSolution *> * videoStreamDescriptions;
objectivec视频流的分辨率信息。
当远端用户调用 setVideoEncoderConfig: 方法发布多个配置的视频流时,此处会包含该用户发布的所有视频流的属性信息。
参看 ByteRTCVideoSolution。
@property(nonatomic, retain, readonly) ByteRTCVideoSolution *maxVideoStreamDescription;
objectivec视频流最大分辨率,在开启多分辨率发布订阅时,回调发布端能支持的最大发布分辨率。
@interface ByteRTCStreamEx : NSObject <ByteRTCStream>
objectivec流信息
| 类型 | 名称 |
|---|---|
| NSString* | userId |
| BOOL | isScreen |
| BOOL | hasVideo |
| BOOL | hasAudio |
| NSArray<ByteRTCVideoSolution>** | videoStreamDescriptions |
| ByteRTCVideoSolution* | maxVideoStreamDescription |
@property(nonatomic, copy, nullable) NSString *userId;
objectivec用户ID
@property(nonatomic, assign) BOOL isScreen;
objectivec流是否为共享屏幕流。
@property(nonatomic, assign) BOOL hasVideo;
objectivec该路流中是否包含视频
@property(nonatomic, assign) BOOL hasAudio;
objectivec该路流中是否包含音频
@property(nonatomic, copy, nullable) NSArray<ByteRTCVideoSolution *> *videoStreamDescriptions;
objectivec视频流的分辨率信息,详见 ByteRTCVideoSolution 类。
用户可以通过调用 setVideoEncoderConfig: 方法在一路流中发布多个不同的视频分辨率。此参数即为流中所有分辨率的相关信息。
@property(nonatomic, retain, nullable) ByteRTCVideoSolution *maxVideoStreamDescription;
objectivec视频流最大分辨率,在开启多分辨率发布订阅时,回调发布端能支持的最大发布分辨率。
@interface ByteRTCSubscribeConfig: NSObject
objectivec订阅流的参数配置。用户手动订阅一路音视频流所使用的订阅配置参数。
用户关闭自动订阅功能,使用手动订阅模式时,通过调用 subscribeStream 方法订阅音视频流,调用时传入的参数即为此数据类型。
| 类型 | 名称 |
|---|---|
| BOOL | isScreen |
| BOOL | subscribeVideo |
| BOOL | subscribeAudio |
| NSInteger | videoIndex |
| NSInteger | svcLayer |
| NSInteger | width |
| NSInteger | height |
| NSInteger | framerate |
@property(nonatomic, assign) BOOL isScreen;
objectivec是否是屏幕流。
用户通过设置此参数,订阅该远端用户发布的屏幕共享流或非屏幕共享流。 YES 为订阅屏幕共享流,NO 为订阅非屏幕共享流,默认值为 YES 。
@property(nonatomic, assign) BOOL subscribeVideo;
objectivec是否订阅视频。
用户通过设置此参数,选择是否订阅远端流中的视频。 YES 为订阅视频,NO 为不订阅视频,默认值为 YES 。
@property(nonatomic, assign) BOOL subscribeAudio;
objectivec是否订阅音频。
用户通过设置此参数,选择是否订阅远端流中的音频。YES 为订阅音频,NO 为不订阅音频,默认值为 YES 。
@property(nonatomic, assign) NSInteger videoIndex;
objectivec订阅的视频流分辨率下标。
用户可以通过调用 setVideoEncoderConfig: 方法发布多个不同分辨率的视频。因此订阅流时,需要指定订阅的具体分辨率。此参数即用于指定需订阅的分辨率的下标,默认值为 0 。
@property(nonatomic, assign) NSInteger svcLayer;
objectivec订阅的视频流时域分层,默认值为 0。
@property(nonatomic, assign) NSInteger width;
objectivec订阅的宽度信息,单位:px,默认值为 0。
@property(nonatomic, assign) NSInteger height;
objectivec订阅的高度信息,单位:px, 默认值为0。
@property (nonatomic, assign) NSInteger framerate;
objectivec期望订阅的最高帧率,单位:fps,默认值为 0,设为大于 0 的值时开始生效。
当发布端帧率低于设定帧率,或订阅端开启性能回退后下行弱网,则帧率会相应下降。
仅码流支持 SVC 分级编码特性时方可生效。
@interface ByteRTCVideoFrame : NSObject
objectivec待 SDK 编码的视频数据
| 类型 | 名称 |
|---|---|
| int | format |
| ByteRTCVideoContentType | contentType |
| CMTime | time |
| int | strideInPixels |
| int | width |
| int | height |
| CVPixelBufferRef | textureBuf |
| NSData* | dataBuf |
| ByteRTCVideoRotation | rotation |
| ByteRTCColorSpace | colorSpace |
| ByteRTCCameraID | cameraId |
| NSData* | extendedData |
| NSData* | supplementaryInfo |
| int | numberOfPlanes |
| NSArray* | planeDatas |
| NSArray* | planeStrides |
| int | [deprecated] stride |
@property(assign, nonatomic) int format;
objectivec视频帧格式,参考 ByteRTCVideoPixelFormat
@property(assign, nonatomic) ByteRTCVideoContentType contentType;
objectivec获取视频内容类型,参看 ByteRTCVideoContentType
@property(assign, nonatomic) CMTime time;
objectivec当前帧的时间戳信息
@property(assign, nonatomic) int stride;
objectivecDeprecated since 3.45 and will be deleted in 3.51, use strideInPixels instead.
@property(assign, nonatomic) int strideInPixels;
objectivec每一行像素占用的字节数
@property(assign, nonatomic) int width;
objectivec视频帧宽度
@property(assign, nonatomic) int height;
objectivec视频帧高度
@property(assign, nonatomic) CVPixelBufferRef _Nullable textureBuf;
objectivecCVPixelBufferRef 类型的数据,当 format 为 kPixelFormatCVPixelBuffer 时有效
@property(strong, nonatomic) NSData * _Nullable dataBuf;
objectivec视频帧内存块首地址
@property(assign, nonatomic) ByteRTCVideoRotation rotation;
objectivec视频帧旋转角度:0, 90, 180, 270
@property(assign, nonatomic) ByteRTCColorSpace colorSpace;
objectivec颜色空间
@property(assign, nonatomic) ByteRTCCameraID cameraId;
objectivec视频帧的摄像头信息,参考 ByteRTCCameraID
@property(strong, nonatomic) NSData * _Nullable extendedData;
objectivec视频帧附加的sei数据
@property(strong, nonatomic) NSData * _Nonnull supplementaryInfo;
objectivec视频帧附加的roi数据
@property (assign, nonatomic) int numberOfPlanes;
objectivec视频帧颜色 plane 数量; 当 textureBuf 有值时, 该值无意义。
yuv 数据存储格式分为打包(packed)存储格式和平面(planar)存储格式,planar 格式中 Y、U、V 分平面存储,packed 格式中 Y、U、V 交叉存储
@property (strong, nonatomic) NSArray * _Nullable planeDatas;
objectivec获取 plane 数据指针, 数组长度与 numberOfPlanes 一致, 元素类型为 NSData*; 当 textureBuf 有值时, 该值无意义
@property (strong, nonatomic) NSArray * _Nullable planeStrides;
objectivec获取 plane 中数据行的长度, 数组长度与 numberOfPlanes 一致, 元素类型为 NSNumber*; 当 textureBuf 有值时, 该值无意义
@interface ByteRTCEncodedVideoFrame : NSObject
objectivec视频帧信息
| 类型 | 名称 |
|---|---|
| ByteRTCVideoCodecType | codecType |
| ByteRTCVideoPictureType | pictureType |
| SInt64 | timestampUs |
| SInt64 | timestampDtsUs |
| int | width |
| int | height |
| ByteRTCVideoRotation | rotation |
| NSData* | data |
@property(assign, nonatomic) ByteRTCVideoCodecType codecType;
objectivec视频编码类型。参看 ByteRTCVideoCodecType
@property(assign, nonatomic) ByteRTCVideoPictureType pictureType;
objectivec视频帧类型。参看 ByteRTCVideoPictureType
@property(assign, nonatomic) SInt64 timestampUs;
objectivec视频采集时间戳,单位:微秒
@property(assign, nonatomic) SInt64 timestampDtsUs;
objectivec视频编码时间戳,单位:微秒
@property(assign, nonatomic) int width;
objectivec视频帧宽,单位:px
@property(assign, nonatomic) int height;
objectivec视频帧高,单位:px
@property(nonatomic, assign) ByteRTCVideoRotation rotation;
objectivec视频帧旋转角度。参看 ByteRTCVideoRotation
@property(strong, nonatomic) NSData * _Nonnull data;
objectivec视频帧数据指针地址
@interface ByteRTCTranscoderLayoutRegionDataParam : NSObject
objectivec图片合流相关参数
| 类型 | 名称 |
|---|---|
| NSInteger | imageWidth |
| NSInteger | imageHeight |
@property (assign, nonatomic) NSInteger imageWidth;
objectivec原始图片的宽度,单位为 px。
@property (assign, nonatomic) NSInteger imageHeight;
objectivec原始图片的高度,单位为 px。
@interface ByteRTCVideoCompositingRegion : NSObject
objectivec单个图片或视频流在合流中的布局信息。
开启转推直播功能后,在多路图片或视频流合流时,你可以设置其中一路流在合流中的预设布局信息。
| 类型 | 名称 |
|---|---|
| NSString* | uid |
| NSString* | roomId |
| CGFloat | x |
| CGFloat | y |
| CGFloat | width |
| CGFloat | height |
| NSInteger | zOrder |
| BOOL | localUser |
| BOOL | screenStream |
| CGFloat | alpha |
| CGFloat | cornerRadius |
| ByteRTCTranscoderContentControlType | contentControl |
| ByteRTCRenderMode | renderMode |
| ByteRTCTranscoderLayoutRegionType | type |
| NSData* | data |
| ByteRTCTranscoderLayoutRegionDataParam* | dataParam |
| ByteRTCPosition* | spatialPosition |
| BOOL | applySpatialAudio |
@property(copy, nonatomic) NSString * _Nonnull uid;
objectivec视频流发布用户的用户 ID 。必填。
@property(copy, nonatomic) NSString * _Nonnull roomId;
objectivec图片或视频流所在房间的房间 ID。必填。
如果此图片或视频流是通过 startForwardStreamToRooms: 转发到你所在房间的媒体流时,你应将房间 ID 设置为你所在的房间 ID。
@property(assign, nonatomic) CGFloat x;
objectivec视频流对应区域左上角的横坐标相对整体画面的归一化比例,取值的范围为 [0.0, 1.0)。默认值为 0.0。
@property(assign, nonatomic) CGFloat y;
objectivec视频流对应区域左上角的纵坐标相对整体画面的归一化比例,取值的范围为 [0.0, 1.0)。默认值为 0.0。
@property(assign, nonatomic) CGFloat width;
objectivec视频流对应区域宽度相对整体画面的归一化比例,取值的范围为 [0.0, 1.0]。默认值为 1.0。
@property(assign, nonatomic) CGFloat height;
objectivec视频流对应区域高度相对整体画面的归一化比例,取值的范围为 [0.0, 1.0]。默认值为 1.0。
@property(assign, nonatomic) NSInteger zOrder;
objectivec用户视频布局在画布中的层级。取值范围为 [0 - 100],0 为底层,值越大越上层。默认值为 0。
@property(assign, nonatomic) BOOL localUser;
objectivec是否为本地用户
@property(assign, nonatomic) BOOL screenStream;
objectivec(仅服务端合流支持合屏幕流)是否为屏幕流,默认为 NO
@property(assign, nonatomic) CGFloat alpha;
objectivec(仅服务端合流支持设置)透明度,可选范围为 (0.0, 1.0],0.0 为全透明。默认值为 1.0。
@property(assign, nonatomic) CGFloat cornerRadius;
objectivec(仅服务端合流支持设置)圆角半径相对画布宽度的比例。默认值为 0.0。
做范围判定时,首先根据画布的宽高,将 width,height,和 cornerRadius 分别转换为像素值:width_px,height_px,和 cornerRadius_px。然后判定是否满足 cornerRadius_px < min(width_px/2, height_px/2):若满足,则设置成功;若不满足,则将 cornerRadius_px 设定为 min(width_px/2, height_px/2),然后将 cornerRadius 设定为 cornerRadius_px 相对画布宽度的比例值。
@property (assign, nonatomic) ByteRTCTranscoderContentControlType contentControl;
objectivec(仅服务端合流支持设置)合流内容控制。默认值为 ByteRTCTranscoderContentControlTypeHasAudioAndVideo,参看 ByteRTCTranscoderContentControlType 。
@property(assign, nonatomic) ByteRTCRenderMode renderMode;
objectivec图片或视频流的缩放模式,参看 ByteRTCRenderMode。默认值为 1。
@property (assign, nonatomic) ByteRTCTranscoderLayoutRegionType type;
objectivec合流布局区域类型。参看 ByteRTCTranscoderLayoutRegionType。
@property (strong, nonatomic) NSData * _Nullable data;
objectivec图片合流布局区域类型对应的数据。类型为图片时传入图片 RGBA 数据,当类型为视频流时传空。
@property (strong, nonatomic) ByteRTCTranscoderLayoutRegionDataParam * _Nullable dataParam;
objectivec合流布局区域数据的对应参数。当类型为视频流时传空,类型为图片时传入对应图片的参数,参看 ByteRTCTranscoderLayoutRegionDataParam。
@property (strong, nonatomic) ByteRTCPosition * _Nullable spatialPosition;
objectivec空间位置。参看 ByteRTCPosition。
@property(assign, nonatomic) BOOL applySpatialAudio;
objectivec设置某用户是否应用空间音频效果:
@interface ByteRTCVideoCompositingLayout : NSObject
objectivec视频流合流整体布局信息。
开启转推直播功能后,你可以设置参与合流的每路视频流的预设布局信息和合流背景信息等。
| 类型 | 名称 |
|---|---|
| NSString* | backgroundColor |
| NSArray<ByteRTCVideoCompositingRegion>** | regions |
| NSString* | appData |
@property(copy, nonatomic) NSString *_Nonnull backgroundColor;
objectivec合流背景颜色,用十六进制颜色码(HEX)表示。例如,#FFFFFF 表示纯白,#000000 表示纯黑。默认值为 #000000。
值不合法或未设置时,自动使用默认值。
@property(copy, nonatomic) NSArray<ByteRTCVideoCompositingRegion *> * _Nonnull regions;
objectivec用户布局信息列表。每条流的具体布局参看 ByteRTCVideoCompositingRegion。
值不合法或未设置时,自动使用默认值。
@property(copy, nonatomic) NSString *_Nonnull appData;
objectivec透传的 App 数据,长度不超过 4KB。
@interface ByteRTCTranscodingVideoConfig : NSObject
objectivec视频转码配置参数。值不合法或未设置时,自动使用默认值。
| 类型 | 名称 |
|---|---|
| ByteRTCTranscodingVideoCodec | codec |
| NSInteger | width |
| NSInteger | height |
| NSInteger | fps |
| NSInteger | gop |
| NSInteger | kBitRate |
| BOOL | bFrame |
| BOOL | [deprecated] lowLatency |
@property(assign, nonatomic) ByteRTCTranscodingVideoCodec codec;
objectivec视频编码格式,参看 ByteRTCTranscodingVideoCodec。默认值为 0。
本参数不支持过程中更新。
@property(assign, nonatomic) NSInteger width;
objectivec合流视频宽度。单位为 px,范围为 [2, 1920],必须是偶数。默认值为 640 px。
设置值为非偶数时,自动向上取偶数。
@property(assign, nonatomic) NSInteger height;
objectivec合流视频高度。单位为 px,范围为 [2, 1920],必须是偶数。默认值为 360 px。
设置值为非偶数时,自动向上取偶数。
@property(assign, nonatomic) NSInteger fps;
objectivec合流视频帧率。单位为 FPS,取值范围为 [1,60],默认值为 15 FPS。
@property(assign, nonatomic) NSInteger gop;
objectivec视频 I 帧时间间隔。单位为秒,取值范围为 [1, 5],默认值为 2 秒。
本参数不支持过程中更新。
@property(assign, nonatomic) NSInteger kBitRate;
objectivec合流视频码率。单位为 Kbps,取值范围为 [1,10000],默认值为自适应模式。
@property(assign, nonatomic) BOOL lowLatency;
objectivec是否使用低延时特性。
Deprecated since 3.45 and will be deleted in 3.51.
@property(assign, nonatomic) BOOL bFrame;
objectivec是否在合流中开启B帧,仅服务端合流支持.
@interface ByteRTCTranscodingAudioConfig : NSObject
objectivec音频转码配置参数。值不合法或未设置时,自动使用默认值。
本参数不支持过程中更新。
| 类型 | 名称 |
|---|---|
| ByteRTCTranscodingAudioCodec | codec |
| NSInteger | sampleRate |
| NSInteger | channels |
| NSInteger | kBitRate |
| ByteRTCAACProfile | profile |
| 返回 | 名称 |
|---|---|
| NSString* | [deprecated] toStringWithProfile: |
@property(assign, nonatomic) ByteRTCTranscodingAudioCodec codec;
objectivec音频编码格式。
@property(assign, nonatomic) NSInteger sampleRate;
objectivec音频采样率,单位 Hz。可取 32000 Hz、44100 Hz、48000 Hz,默认值为 48000 Hz。
@property(assign, nonatomic) NSInteger channels;
objectivec音频声道数。可取 1(单声道)、2(双声道),默认值为 2。
@property(assign, nonatomic) NSInteger kBitRate;
objectivec音频码率,单位 Kbps。可取范围 [32, 192],默认值为 64 Kbps。
@property(assign, nonatomic) ByteRTCAACProfile profile;
objectivecAAC 编码规格,参看 ByteRTCAACProfile。默认值为 0。
+ (NSString* _Nonnull) toStringWithProfile:(ByteRTCAACProfile) aacProfile;objectivec
Deprecated since 3.45 and will be deleted in 3.51.
@interface ByteRTCTranscodingSpatialConfig : NSObject
objectivec推流 CDN 的空间音频参数。
| 类型 | 名称 |
|---|---|
| BOOL | enableSpatialRender |
| ByteRTCPosition* | audienceSpatialPosition |
| ByteRTCHumanOrientation* | audienceSpatialOrientation |
@property(assign, nonatomic) BOOL enableSpatialRender;
objectivec是否开启推流 CDN 时的空间音频效果。
当你启用此效果时,你需要设定推流中各个 ByteRTCTranscodingSpatialConfig 的 spatialPosition 值,实现空间音频效果。
@property (strong, nonatomic) ByteRTCPosition * _Nullable audienceSpatialPosition;
objectivec听众的空间位置。参看 ByteRTCPosition。
听众指收听来自 CDN 的音频流的用户。
@property(strong, nonatomic) ByteRTCHumanOrientation * _Nullable audienceSpatialOrientation;
objectivec听众的空间朝向。参看 ByteRTCHumanOrientation。
听众指收听来自 CDN 的音频流的用户。
@interface ByteRTCTranscodingClientMixParam : NSObject
objectivec客户端合流参数。
| 类型 | 名称 |
|---|---|
| BOOL | clientMixUseOriginalFrame |
| BOOL | clientMixUseAudioMixer |
| ByteRTCClientMixVideoFormat | clientMixVideoFormat |
@property(assign, nonatomic) BOOL clientMixUseOriginalFrame;
objectivec是否使用原始视频帧。默认为 False。
@property(assign, nonatomic) BOOL clientMixUseAudioMixer;
objectivec客户端合流是否使用音频混音,默认为 true。
@property(assign, nonatomic) ByteRTCClientMixVideoFormat clientMixVideoFormat;
objectivec客户端合流回调视频格式,参看 ByteRTCClientMixVideoFormat。
@interface ByteRTCLiveTranscoding : NSObject
objectivec转推直播配置参数。
| 类型 | 名称 |
|---|---|
| ByteRTCStreamMixingType | expectedMixingType |
| ByteRTCVideoCompositingLayout* | layout |
| ByteRTCTranscodingVideoConfig* | video |
| ByteRTCTranscodingAudioConfig* | audio |
| ByteRTCTranscodingClientMixParam* | clientMixParam |
| ByteRTCTranscodingSpatialConfig* | spatialConfig |
| NSString* | url |
| NSString* | roomId |
| NSString* | userId |
| 返回 | 名称 |
|---|---|
| instancetype | defaultTranscoding |
@property(assign, nonatomic) ByteRTCStreamMixingType expectedMixingType;
objectivec合流类型,详见 ByteRTCStreamMixingType 数据类型。
本参数不支持过程中更新。
@property(strong, nonatomic) ByteRTCVideoCompositingLayout * _Nonnull layout;
objectivec视频流合流整体布局信息。
开启转推直播功能后,你可以设置参与合流的每路视频流的预设布局信息和合流背景信息等。详见 ByteRTCVideoCompositingLayout 数据类型。
@property(strong, nonatomic) ByteRTCTranscodingVideoConfig * _Nonnull video;
objectivec视频转码配置参数。详见 ByteRTCTranscodingVideoConfig 数据类型。
@property(strong, nonatomic) ByteRTCTranscodingAudioConfig * _Nonnull audio;
objectivec音频转码配置参数,参看 ByteRTCTranscodingAudioConfig。
@property(strong, nonatomic) ByteRTCTranscodingClientMixParam * _Nullable clientMixParam;
objectivec客户端合流配置。详见 ByteRTCTranscodingClientMixParam 。
@property(strong, nonatomic) ByteRTCTranscodingSpatialConfig * _Nonnull spatialConfig;
objectivec转推 CDN 空间音频配置。详见 ByteRTCTranscodingSpatialConfig 。
@property(copy, nonatomic) NSString * _Nullable url;
objectivec推流 CDN 地址。仅支持 RTMP 协议,Url 必须满足正则 /^rtmps?:\/\//。
本参数不支持过程中更新。
@property(copy, nonatomic) NSString * _Nonnull roomId;
objectivec推流房间 ID。roomId 和 userId 长度相加不得超过 126 字节。
本参数不支持过程中更新。
@property(copy, nonatomic) NSString * _Nonnull userId;
objectivec推流用户 ID。roomId 和 userId 长度相加不得超过 126 字节。
本参数不支持过程中更新。
+ (instancetype _Nonnull)defaultTranscoding;
objectivec获取默认转推直播配置参数。
返回值
转推直播配置参数,参看 ByteRTCLiveTranscoding。
@interface ByteRTCMixedStreamLayoutRegionImageWaterMarkConfig : NSObject
objectivec图片合流相关参数。(新)
| 类型 | 名称 |
|---|---|
| NSInteger | imageWidth |
| NSInteger | imageHeight |
@property (assign, nonatomic) NSInteger imageWidth;
objectivec原始图片的宽度,单位为 px。
@property (assign, nonatomic) NSInteger imageHeight;
objectivec原始图片的高度,单位为 px。
@interface ByteRTCMixedStreamLayoutRegionConfig : NSObject
objectivec单个图片或视频流在合流中的布局信息。(新)
开启合流功能后,在多路图片或视频流合流时,你可以设置其中一路流在合流中的预设布局信息。
| 类型 | 名称 |
|---|---|
| NSString* | userID |
| NSString* | roomID |
| NSInteger | locationX |
| NSInteger | locationY |
| NSInteger | width |
| NSInteger | height |
| NSInteger | zOrder |
| BOOL | isLocalUser |
| ByteRTCMixedStreamVideoType | streamType |
| CGFloat | alpha |
| CGFloat | cornerRadius |
| ByteRTCMixedStreamMediaType | mediaType |
| ByteRTCMixedStreamRenderMode | renderMode |
| ByteRTCMixedStreamLayoutRegionType | regionContentType |
| NSData* | imageWaterMark |
| ByteRTCMixedStreamLayoutRegionImageWaterMarkConfig* | imageWaterMarkConfig |
| ByteRTCPosition* | spatialPosition |
| BOOL | applySpatialAudio |
| ByteRTCMixedStreamAlternateImageFillMode | alternateImageFillMode |
| NSString* | alternateImageUrl |
@property(copy, nonatomic) NSString * _Nonnull userID;
objectivec视频流发布用户的用户 ID 。建议设置。
@property(copy, nonatomic) NSString * _Nonnull roomID;
objectivec图片或视频流所在房间的房间 ID。建议设置。
如果此图片或视频流是通过 startForwardStreamToRooms: 转发到你所在房间的媒体流时,你应将房间 ID 设置为你所在的房间 ID。
@property(assign, nonatomic) NSInteger locationX;
objectivec单个用户画面左上角在整个画布坐标系中的 X 坐标(pixel),即以画布左上角为原点,用户画面左上角相对于原点的横向位移。
取值范围为 [0, 整体画布宽度)。默认值为 0。
@property(assign, nonatomic) NSInteger locationY;
objectivec单个用户画面左上角在整个画布坐标系中的 Y 坐标(pixel),即以画布左上角为原点,用户画面左上角相对于原点的纵向位移。
取值范围为 [0, 整体画布高度)。默认值为 0。
@property(assign, nonatomic) NSInteger width;
objectivec单个用户画面的宽度。取值范围为 [0, 整体画布宽度],默认值为 360。
@property(assign, nonatomic) NSInteger height;
objectivec单个用户画面的高度。取值范围为 [0, 整体画布高度],默认值为 640。
@property(assign, nonatomic) NSInteger zOrder;
objectivec用户视频布局在画布中的层级。取值范围为 [0 - 100],0 为底层,值越大越上层。默认值为 0。建议设置。
@property(assign, nonatomic) BOOL isLocalUser;
objectivec是否为本地用户
@property(assign, nonatomic) ByteRTCMixedStreamVideoType streamType;
objectivec流类型,默认为主流
@property(assign, nonatomic) CGFloat alpha;
objectivec透明度,可选范围为 (0.0, 1.0],0.0 为全透明。默认值为 1.0。
@property(assign, nonatomic) CGFloat cornerRadius;
objectivec圆角半径相对画布宽度的比例。默认值为 0.0。
做范围判定时,首先根据画布的宽高,将 width,height,和 cornerRadius 分别转换为像素值:width_px,height_px,和 cornerRadius_px。然后判定是否满足 cornerRadius_px < min(width_px/2, height_px/2):若满足,则设置成功;若不满足,则将 cornerRadius_px 设定为 min(width_px/2, height_px/2),然后将 cornerRadius 设定为 cornerRadius_px 相对画布宽度的比例值。
@property (assign, nonatomic) ByteRTCMixedStreamMediaType mediaType;
objectivec合流内容控制。默认值为 ByteRTCTranscoderContentControlTypeHasAudioAndVideo,参看 ByteRTCMixedStreamMediaType 。
@property(assign, nonatomic) ByteRTCMixedStreamRenderMode renderMode;
objectivec图片或视频流的缩放模式,参看 ByteRTCMixedStreamRenderMode。默认值为 1。建议设置。
@property (assign, nonatomic) ByteRTCMixedStreamLayoutRegionType regionContentType;
objectivec合流布局区域类型。参看 ByteRTCMixedStreamLayoutRegionType。
@property (strong, nonatomic) NSData * _Nullable imageWaterMark;
objectivec图片合流布局区域类型对应的数据。类型为图片时传入图片 RGBA 数据,当类型为视频流时传空。
@property (strong, nonatomic) ByteRTCMixedStreamLayoutRegionImageWaterMarkConfig * _Nullable imageWaterMarkConfig;
objectivec合流布局区域数据的对应参数。当类型为视频流时传空,类型为图片时传入对应图片的参数,参看 ByteRTCMixedStreamLayoutRegionImageWaterMarkConfig。
@property (strong, nonatomic) ByteRTCPosition * _Nullable spatialPosition;
objectivec空间位置。参看 ByteRTCPosition。
@property(assign, nonatomic) BOOL applySpatialAudio;
objectivec设置某用户是否应用空间音频效果:
@property (assign, nonatomic)ByteRTCMixedStreamAlternateImageFillMode alternateImageFillMode;
objectivec设置占位图的填充模式。
该参数用来控制当用户停止发布视频流,画面恢复为占位图后,此时占位图的填充模式。参看 ByteRTCMixedStreamAlternateImageFillMode。
@property(copy, nonatomic)NSString * alternateImageUrl;
objectivec设置占位图的 URL,长度小于 1024 字符.
@interface ByteRTCMixedStreamLayoutConfig : NSObject
objectivec视频流合流整体布局信息。(新)
开启转推直播功能后,你可以设置参与合流的每路视频流的预设布局信息和合流背景信息等。
| 类型 | 名称 |
|---|---|
| NSString* | backgroundColor |
| NSArray<ByteRTCMixedStreamLayoutRegionConfig>** | regions |
| NSString* | userConfigExtraInfo |
| NSString* | backgroundImageUrl |
@property(copy, nonatomic) NSString *_Nonnull backgroundColor;
objectivec合流背景颜色,用十六进制颜色码(HEX)表示。例如,#FFFFFF 表示纯白,#000000 表示纯黑。默认值为 #000000。建议设置。
值不合法或未设置时,自动使用默认值。
@property(copy, nonatomic) NSArray<ByteRTCMixedStreamLayoutRegionConfig *> * _Nonnull regions;
objectivec用户布局信息列表。每条流的具体布局参看 ByteRTCMixedStreamLayoutRegionConfig。建议设置。
值不合法或未设置时,自动使用默认值。
@property(copy, nonatomic) NSString *_Nonnull userConfigExtraInfo;
objectivec用户透传的额外数据。
@property(copy, nonatomic) NSString *_Nonnull backgroundImageUrl;
objectivec设置合流后整体画布的背景图片 URL,长度最大为 1024 bytes。
支持的图片格式包括:JPG, JPEG, PNG。如果背景图片的宽高和整体屏幕的宽高不一致,背景图片会缩放到铺满屏幕。
@interface ByteRTCMixedStreamVideoConfig : NSObject
objectivec视频转码配置参数。(新)
值不合法或未设置时,自动使用默认值。
| 类型 | 名称 |
|---|---|
| ByteRTCMixedStreamVideoCodecType | videoCodec |
| NSInteger | width |
| NSInteger | height |
| NSInteger | fps |
| NSInteger | gop |
| NSInteger | bitrate |
| BOOL | enableBFrame |
@property(assign, nonatomic) ByteRTCMixedStreamVideoCodecType videoCodec;
objectivec视频编码格式,参看 ByteRTCMixedStreamVideoCodecType。默认值为 0。建议设置。
本参数不支持过程中更新。
@property(assign, nonatomic) NSInteger width;
objectivec合流视频宽度。单位为 px,范围为 [2, 1920],必须是偶数。默认值为 640 px。建议设置。
设置值为非偶数时,自动向上取偶数。
@property(assign, nonatomic) NSInteger height;
objectivec合流视频高度。单位为 px,范围为 [2, 1920],必须是偶数。默认值为 360 px。建议设置。
设置值为非偶数时,自动向上取偶数。
@property(assign, nonatomic) NSInteger fps;
objectivec合流视频帧率。单位为 FPS,取值范围为 [1,60],默认值为 15 FPS。建议设置。
@property(assign, nonatomic) NSInteger gop;
objectivec视频 I 帧时间间隔。单位为秒,取值范围为 [1, 5],默认值为 2 秒。建议设置。
本参数不支持过程中更新。
@property(assign, nonatomic) NSInteger bitrate;
objectivec合流视频码率。单位为 Kbps,取值范围为 [1,10000],默认值为自适应模式。建议设置。
@property(assign, nonatomic) BOOL enableBFrame;
objectivec是否在合流中开启B帧,仅服务端合流支持.
@interface ByteRTCMixedStreamAudioConfig : NSObject
objectivec音频转码配置参数。(新)
值不合法或未设置时,自动使用默认值。
本参数不支持过程中更新。
| 类型 | 名称 |
|---|---|
| ByteRTCMixedStreamAudioCodecType | audioCodec |
| NSInteger | sampleRate |
| NSInteger | channels |
| NSInteger | bitrate |
| ByteRTCMixedStreamAudioProfile | audioProfile |
@property(assign, nonatomic) ByteRTCMixedStreamAudioCodecType audioCodec;
objectivec音频编码格式。建议设置。
@property(assign, nonatomic) NSInteger sampleRate;
objectivec音频采样率,单位 Hz。可取 32000 Hz、44100 Hz、48000 Hz,默认值为 48000 Hz。建议设置。
@property(assign, nonatomic) NSInteger channels;
objectivec音频声道数。可取 1(单声道)、2(双声道),默认值为 2。建议设置。
@property(assign, nonatomic) NSInteger bitrate;
objectivec音频码率,单位 Kbps。可取范围 [32, 192],默认值为 64 Kbps。建议设置。
@property(assign, nonatomic) ByteRTCMixedStreamAudioProfile audioProfile;
objectivecAAC 编码规格,参看 ByteRTCMixedStreamAudioProfile。默认值为 0。建议设置。
@interface ByteRTCMixedStreamSpatialAudioConfig : NSObject
objectivec推流 CDN 的空间音频参数。(新)
| 类型 | 名称 |
|---|---|
| BOOL | enableSpatialRender |
| ByteRTCPosition* | audienceSpatialPosition |
| ByteRTCHumanOrientation* | audienceSpatialOrientation |
@property(assign, nonatomic) BOOL enableSpatialRender;
objectivec是否开启推流 CDN 时的空间音频效果。
当你启用此效果时,你需要设定推流中各个 ByteRTCMixedStreamLayoutRegionConfig 的 spatialPosition 值,实现空间音频效果。
@property (strong, nonatomic) ByteRTCPosition * _Nullable audienceSpatialPosition;
objectivec听众的空间位置。参看 ByteRTCPosition。
听众指收听来自 CDN 的音频流的用户。
@property(strong, nonatomic) ByteRTCHumanOrientation * _Nullable audienceSpatialOrientation;
objectivec听众的空间朝向。参看 ByteRTCHumanOrientation。
听众指收听来自 CDN 的音频流的用户。
@interface ByteRTCMixedStreamClientMixConfig : NSObject
objectivec客户端合流参数。(新)
| 类型 | 名称 |
|---|---|
| BOOL | useAudioMixer |
| ByteRTCMixedStreamClientMixVideoFormat | videoFormat |
@property(assign, nonatomic) BOOL useAudioMixer;
objectivec客户端合流是否使用混音,默认为 true。
@property(assign, nonatomic) ByteRTCMixedStreamClientMixVideoFormat videoFormat;
objectivec客户端合流回调视频格式,参看 ByteRTCMixedStreamClientMixVideoFormat。
@interface ByteRTCMixedStreamServerControlConfig : NSObject
objectivec服务端合流控制参数
| 类型 | 名称 |
|---|---|
| BOOL | enableVolumeIndication |
| CGFloat | volumeIndicationInterval |
| NSInteger | talkVolume |
| BOOL | isAddVolumeValue |
| ByteRTCMixedStreamSEIContentMode | seiContentMode |
| NSInteger | seiPayloadType |
| NSString* | seiPayloadUUID |
| ByteRTCMixedStreamMediaType | mediaType |
| ByteRTCMixedStreamPushMode | pushStreamMode |
@property(assign, nonatomic) BOOL enableVolumeIndication;
objectivec是否开启单独发送声音提示 SEI 的功能:
ByteRTCMixedStreamServerControlConfig.seiContentMode 控制 SEI 的内容是否只携带声音信息。@property(assign, nonatomic) CGFloat volumeIndicationInterval;
objectivec声音提示间隔,单位为秒,取值范围为 [0.3,+∞),默认值为 2。
此值仅取整百毫秒。若传入两位及以上小数,则四舍五入取第一位小数的值。例如,若传入 0.36,则取 0.4。
@property(assign, nonatomic) NSInteger talkVolume;
objectivec有效音量大小,取值范围为 [0, 255],默认值为 0。
超出取值范围则自动调整为默认值,即 0。
@property(assign, nonatomic) BOOL isAddVolumeValue;
objectivec声音信息 SEI 是否包含音量值:
@property(assign, nonatomic) ByteRTCMixedStreamSEIContentMode seiContentMode;
objectivec设置 SEI 内容。参看 ByteRTCMixedStreamSEIContentMode。
@property(assign, nonatomic) NSInteger seiPayloadType;
objectivecSEI 信息的 payload type。
默认值为 100,只支持设置 5 和 100。
在转推直播的过程中,该参数不支持变更。
@property(copy, nonatomic) NSString *seiPayloadUUID;
objectivecSEI 信息的 payload UUID。
注意:
PayloadType 为 5 时,必须填写 PayloadUUID,否则会收到错误回调,错误码为1091。 PayloadType 不是 5 时,不需要填写 PayloadUUID,如果填写会被后端忽略。
该参数长度需为32位,否则会收到错误码为1091的回调。
该参数每个字符的范围需为 [0, 9] [a, f] [A, F]
该参数不应带有-字符,如系统自动生成的 UUID 中带有-,则应删去。
在转推直播的过程中,该参数不支持变更。
PayloadType 为 5 时,必须填写 PayloadUUID,否则会收到错误回调,错误码为1091。 PayloadType 不是 5 时,不需要填写 PayloadUUID,如果填写会被后端忽略。
该参数长度需为32位,否则会收到错误码为1091的回调。
该参数每个字符的范围需为 [0, 9] [a, f] [A, F]
该参数不应带有-字符,如系统自动生成的 UUID 中带有-,则应删去。
在转推直播的过程中,该参数不支持变更。
@property(assign, nonatomic) ByteRTCMixedStreamMediaType mediaType;
objectivec设置合流推到 CDN 时输出的媒体流类型。参看 ByteRTCMixedStreamMediaType。
默认输出音视频流。支持输出纯音频流,但暂不支持输出纯视频流。
@property(assign, nonatomic) ByteRTCMixedStreamPushMode pushStreamMode;
objectivec设置是否在没有用户发布流的情况下发起转推直播。具体参看 ByteRTCMixedStreamPushMode。
该参数在发起合流任务后的转推直播过程中不支持动态变更。
@interface ByteRTCMixedStreamConfig : NSObject
objectivec转推直播配置参数。(新)
| 类型 | 名称 |
|---|---|
| ByteRTCMixedStreamType | expectedMixingType |
| ByteRTCMixedStreamLayoutConfig* | layoutConfig |
| ByteRTCMixedStreamVideoConfig* | videoConfig |
| ByteRTCMixedStreamAudioConfig* | audioConfig |
| ByteRTCMixedStreamClientMixConfig* | clientMixConfig |
| ByteRTCMixedStreamSpatialAudioConfig* | spatialAudioConfig |
| ByteRTCMixedStreamServerControlConfig* | serverControlConfig |
| NSString* | pushURL |
| NSString* | roomID |
| NSString* | userID |
| 返回 | 名称 |
|---|---|
| instancetype | defaultMixedStreamConfig |
@property(assign, nonatomic) ByteRTCMixedStreamType expectedMixingType;
objectivec合流类型,详见 ByteRTCMixedStreamType 数据类型。建议设置。
@property(strong, nonatomic) ByteRTCMixedStreamLayoutConfig * _Nonnull layoutConfig;
objectivec视频流合流整体布局信息。建议设置。
开启转推直播功能后,你可以设置参与合流的每路视频流的预设布局信息和合流背景信息等。详见 ByteRTCMixedStreamLayoutConfig 数据类型。
@property(strong, nonatomic) ByteRTCMixedStreamVideoConfig * _Nonnull videoConfig;
objectivec视频转码配置参数。详见 ByteRTCMixedStreamVideoConfig 数据类型。建议设置。
@property(strong, nonatomic) ByteRTCMixedStreamAudioConfig * _Nonnull audioConfig;
objectivec音频合流配置参数,参看 ByteRTCMixedStreamAudioConfig。建议设置。
@property(strong, nonatomic) ByteRTCMixedStreamClientMixConfig * _Nullable clientMixConfig;
objectivec客户端合流配置。详见 ByteRTCMixedStreamClientMixConfig 。
@property(strong, nonatomic) ByteRTCMixedStreamSpatialAudioConfig * _Nonnull spatialAudioConfig;
objectivec转推 CDN 空间音频配置。详见 ByteRTCMixedStreamSpatialAudioConfig 。
@property(strong, nonatomic) ByteRTCMixedStreamServerControlConfig * _Nonnull serverControlConfig;
objectivec服务端合流控制参数。详见 ByteRTCMixedStreamServerControlConfig 。
@property(copy, nonatomic) NSString * _Nullable pushURL;
objectivec推流 CDN 地址。仅支持 RTMP 协议,Url 必须满足正则 /^rtmps?:\/\//。建议设置。
本参数不支持过程中更新。
@property(copy, nonatomic) NSString * _Nonnull roomID;
objectivec推流房间 ID。roomID 和 userID 长度相加不得超过 126 字节。建议设置。
本参数不支持过程中更新。
@property(copy, nonatomic) NSString * _Nonnull userID;
objectivec推流用户 ID。roomID 和 userID 长度相加不得超过 126 字节。建议设置。
本参数不支持过程中更新。
+ (instancetype _Nonnull)defaultMixedStreamConfig;
objectivec获取默认转推直播配置参数。
返回值
转推直播配置参数,参看 ByteRTCMixedStreamConfig。
@interface ByteRTCPushSingleStreamParam : NSObject
objectivec单流转推直播配置参数。
| 类型 | 名称 |
|---|---|
| NSString* | url |
| NSString* | roomId |
| NSString* | userId |
| BOOL | isScreen |
@property(copy, nonatomic) NSString * _Nullable url;
objectivec推流 CDN 地址。仅支持 RTMP 协议,Url 必须满足正则 /^rtmps?:\/\//。
本参数不支持过程中更新。
@property(copy, nonatomic) NSString * _Nonnull roomId;
objectivec媒体流所在的房间 ID
@property(copy, nonatomic) NSString * _Nullable userId;
objectivec媒体流所属的用户 ID
@property(nonatomic, assign) BOOL isScreen;
objectivec媒体流是否为屏幕流。
@interface ByteRTCSubscribeVideoConfig : NSObject
objectivec视频订阅配置信息
| 类型 | 名称 |
|---|---|
| NSInteger | videoIndex |
| NSInteger | priority |
@property(assign, nonatomic) NSInteger videoIndex;
objectivec订阅的视频流分辨率下标。
当远端用户通过调用 enableSimulcastMode: 方法启动发布多路不同分辨率的视频流时,本地用户需通过此参数指定希望订阅的流。
默认值为 0,即订阅第一路流。
如果不想更改之前的设置,可以输入 -1。
@property(assign, nonatomic) NSInteger priority;
objectivec远端用户优先级,参看 ByteRTCRemoteUserPriority,默认值为 0。
@interface ByteRTCSourceWantedData : NSObject
objectivec性能回退相关数据
| 类型 | 名称 |
|---|---|
| NSInteger | width |
| NSInteger | height |
| NSInteger | frameRate |
@property(nonatomic, assign) NSInteger width;
objectivec推荐视频输入宽
@property(nonatomic, assign) NSInteger height;
objectivec推荐视频输入高
@property(nonatomic, assign) NSInteger frameRate;
objectivec推荐视频输入帧率
@interface ByteRTCRemoteStreamSwitchEvent : NSObject
objectivec流切换信息。本地用户订阅的远端流触发回退策略时的流切换信息。
| 类型 | 名称 |
|---|---|
| NSString* | uid |
| BOOL | isScreen |
| NSInteger | beforeVideoIndex |
| NSInteger | afterVideoIndex |
| BOOL | beforeVideoEnabled |
| BOOL | afterVideoEnabled |
| ByteRTCFallbackOrRecoverReason | reason |
@property(nonatomic, copy) NSString * _Nonnull uid;
objectivec订阅的音视频流的发布者的用户 ID。
@property(nonatomic, assign) BOOL isScreen;
objectivec流是否是屏幕流
@property(nonatomic, assign) NSInteger beforeVideoIndex;
objectivec流切换前订阅视频流的分辨率对应的索引
@property(nonatomic, assign) NSInteger afterVideoIndex;
objectivec流切换后订阅视频流的分辨率对应的索引
@property(nonatomic, assign) BOOL beforeVideoEnabled;
objectivec流切换前是否有视频流
@property(nonatomic, assign) BOOL afterVideoEnabled;
objectivec流切换后是否有视频流
@property(nonatomic, assign) ByteRTCFallbackOrRecoverReason reason;
objectivec流切换原因,详见 ByteRTCFallbackOrRecoverReason。
@protocol ByteRTCVideoSinkDelegate <NSObject>
objectivec自定义视频渲染器
| 返回 | 名称 |
|---|---|
| void | onFrame: |
| void | [deprecated] renderPixelBuffer:rotation:contentType:extendedData: |
- (void)renderPixelBuffer:(CVPixelBufferRef _Nonnull)pixelBuffer rotation:(ByteRTCVideoRotation)rotation contentType:(ByteRTCVideoContentType)contentType extendedData:(NSData * _Nullable)extendedData;
objectivecDeprecated since 3.54, use onFrame: instead
输出视频的 PixelBuffer
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| pixelBuffer | CVPixelBufferRef | 视频的 PixelBuffer |
| rotation | ByteRTCVideoRotation | 视频旋转角度,参看 ByteRTCVideoRotation |
| contentType | ByteRTCVideoContentType | 视频内部类型 参看 ByteRTCVideoContentType |
| extendedData | NSData* | 视频解码后获得的附加数据 |
- (void)onFrame:(ByteRTCVideoFrame * _Nonnull)videoFrame;
objectivec输出视频的 PixelBuffer
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| videoFrame | ByteRTCVideoFrame* | 视频帧 |
@interface ByteRTCLocalVideoSinkConfig : NSObject
objectivec本地视频帧回调配置。
| 类型 | 名称 |
|---|---|
| ByteRTCLocalVideoRenderPosition | position |
| ByteRTCVideoSinkPixelFormat | requiredPixelFormat |
@property(nonatomic, assign) ByteRTCLocalVideoRenderPosition position;
objectivec本地视频帧回调位置,参看 ByteRTCLocalVideoRenderPosition,默认回调前处理后的视频帧。
@property(nonatomic, assign) ByteRTCVideoSinkPixelFormat requiredPixelFormat;
objectivec本地视频帧回调格式,参看 ByteRTCVideoSinkPixelFormat,默认值为 0。
@interface ByteRTCRemoteVideoSinkConfig : NSObject
objectivec远端视频帧回调配置。
| 类型 | 名称 |
|---|---|
| ByteRTCRemoteVideoRenderPosition | position |
| ByteRTCVideoSinkPixelFormat | requiredPixelFormat |
| ByteRTCVideoApplyRotation | applyRotation |
| ByteRTCVideoRenderMirrorType | mirrorType |
@property(nonatomic, assign) ByteRTCRemoteVideoRenderPosition position;
objectivec远端视频帧回调位置,参看 ByteRTCRemoteVideoRenderPosition,默认回调后处理后的视频帧。
@property(nonatomic, assign) ByteRTCVideoSinkPixelFormat requiredPixelFormat;
objectivec远端视频帧回调格式,参看 ByteRTCVideoSinkPixelFormat,默认值为 0。
@property(nonatomic, assign) ByteRTCVideoApplyRotation applyRotation;
objectivec是否将视频帧自动转正,参看 ByteRTCVideoApplyRotation,默认为不旋转。
@property(nonatomic, assign) ByteRTCVideoRenderMirrorType mirrorType;
objectivec是否将视频帧镜像。参看 ByteRTCVideoRenderMirrorType,默认为不镜像。
本设置与 setRemoteVideoMirrorType:withMirrorType: (适用于内部渲染)相互独立。
@interface ByteRTCVideoPreprocessorConfig : NSObject
objectivec视频处理配置参数
| 类型 | 名称 |
|---|---|
| ByteRTCVideoPixelFormat | requiredPixelFormat |
@property(nonatomic, assign) ByteRTCVideoPixelFormat requiredPixelFormat;
objectivec视频帧的像素格式,参看 ByteRTCVideoPixelFormat。
当前仅支持 ByteRTCVideoPixelFormatI420 和 ByteRTCVideoPixelFormatUnknown 格式。
@interface ByteRTCScreenCaptureParam : NSObject
objectivec屏幕采集设置参数
| 类型 | 名称 |
|---|---|
| NSInteger | width |
| NSInteger | height |
| NSInteger | frameRate |
| NSInteger | bitrate |
| NSInteger | minBitrate |
| CGRect | regionRect |
| ByteRTCMouseCursorCaptureState | mouseCursorCaptureState |
| NSArray<NSNumber>** | excludedWindowList |
| ByteRTCHighlightConfig* | highlightConfig |
@property(nonatomic, assign) NSInteger width;
objectivec屏幕采集宽度
@property(nonatomic, assign) NSInteger height;
objectivec屏幕采集高度
@property(nonatomic, assign) NSInteger frameRate;
objectivec屏幕采集帧率,单位 fps
@property(nonatomic, assign) NSInteger bitrate;
objectivec发送屏幕采集码率,单位 kbps
@property(nonatomic, assign) NSInteger minBitrate;
objectivec视频最小编码码率, 单位 kbps。编码码率不会低于 minBitrate。
默认值为 0。
范围:[0, bitrate),当 bitrate < minBitrate 时,为适配码率模式。
以下情况,设置本参数无效:
bitrate 为 0 时,不对视频流进行编码发送。bitrate < 0 时,适配码率模式。@property(nonatomic, assign) CGRect regionRect;
objectivec采集区域
@property(nonatomic, assign) ByteRTCMouseCursorCaptureState mouseCursorCaptureState;
objectivec是否采集鼠标
@property (strong, nonatomic) NSArray<NSNumber *> * _Nullable excludedWindowList;
objectivec屏幕过滤设置
@property (strong, nonatomic) ByteRTCHighlightConfig * _Nonnull highlightConfig;
objectivec采集区域的边框高亮设置,参看 ByteRTCHighlightConfig。
@interface ByteRTCScreenCaptureSourceInfo : NSObject
objectivec屏幕采集对象的具体信息
| 类型 | 名称 |
|---|---|
| ByteRTCScreenCaptureSourceType | sourceType |
| intptr_t | sourceId |
| NSString* | sourceName |
| NSString* | application |
| int | pid |
| BOOL | primaryMonitor |
| CGRect | regionRect |
@property (assign, nonatomic) ByteRTCScreenCaptureSourceType sourceType;
objectivec屏幕分享时,共享对象的类型,参看 ByteRTCScreenCaptureSourceType
@property (assign, nonatomic) intptr_t sourceId;
objectivec屏幕分享时,共享对象的 ID。
@property (copy, nonatomic) NSString * _Nullable sourceName;
objectivec屏幕分享时共享对象的名称。
@property (copy, nonatomic) NSString * _Nullable application;
objectivec共享的应用窗体所属应用的名称
当共享对象为应用窗体时有效
@property (assign, nonatomic) int pid;
objectivec共享的应用窗体所属应用进程的 pid
当共享对象为应用窗体时有效
@property (assign, nonatomic) BOOL primaryMonitor;
objectivec共享的屏幕是否为主屏。
当共享对象为屏幕时有效
@property (assign, nonatomic) CGRect regionRect;
objectivec屏幕共享对象的坐标。多显示器的场景下,屏幕坐标系统以主屏左上角为原点 (0, 0),向右向下扩展。
@interface ByteRTCScreenParam : NSObject
objectivec屏幕采集设置参数
| 类型 | 名称 |
|---|---|
| NSInteger | frameRate |
| NSInteger | bitrate |
@property(nonatomic, assign) NSInteger frameRate;
objectivec编码帧率,单位为 fps
@property(nonatomic, assign) NSInteger bitrate;
objectivec编码码率,小于 0 时 SDK 会根据高宽自适应码率, 单位 kbps
@interface ByteRTCVirtualBackgroundSource: NSObject
objectivec虚拟背景对象。
| 类型 | 名称 |
|---|---|
| ByteRTCVirtualBackgroundSourceType | sourceType |
| int | sourceColor |
| NSString* | sourcePath |
@property(nonatomic, assign) ByteRTCVirtualBackgroundSourceType sourceType;
objectivec虚拟背景类型,详见 ByteRTCVirtualBackgroundSourceType 。
@property int sourceColor;
objectivec纯色背景使用的颜色。
格式为 0xAARRGGBB 。
@property(nonatomic) NSString* _Nullable sourcePath;
objectivec自定义背景图片的绝对路径。
@interface ByteRTCVideoFrameInfo : NSObject
objectivec视频帧基础信息
| 类型 | 名称 |
|---|---|
| NSInteger | width |
| NSInteger | height |
| ByteRTCVideoRotation | rotation |
@property(nonatomic, assign) NSInteger width;
objectivec视频帧的宽度(像素)
@property(nonatomic, assign) NSInteger height;
objectivec视频帧的高度(像素)
@property(nonatomic, assign) ByteRTCVideoRotation rotation;
objectivec视频帧顺时针旋转角度。参看 ByteRTCVideoRotation。
@interface ByteRTCVideoEncoderConfig: NSObject
objectivec视频编码配置。参考 设置视频发布参数
| 类型 | 名称 |
|---|---|
| NSInteger | width |
| NSInteger | height |
| NSInteger | frameRate |
| NSInteger | maxBitrate |
| NSInteger | minBitrate |
| ByteRTCVideoEncoderPreference | encoderPreference |
@property(nonatomic, assign) NSInteger width;
objectivec视频宽度,单位:px
@property(nonatomic, assign) NSInteger height;
objectivec视频高度,单位:px
@property(nonatomic, assign) NSInteger frameRate;
objectivec视频帧率,单位:fps
@property(nonatomic, assign) NSInteger maxBitrate;
objectivec最大编码码率,使用 SDK 内部采集时可选设置,自定义采集时必须设置,单位:kbps。
设为 -1 即适配码率模式,系统将根据输入的分辨率和帧率自动计算适用的码率。
设为 0 则不对视频流进行编码发送。
344 及以上版本,内部采集时默认值为 -1,344 以前版本无默认值,需手动设置。
@property(nonatomic, assign) NSInteger minBitrate;
objectivec视频最小编码码率, 单位 kbps。编码码率不会低于 minBitrate。
默认值为 0。
范围:[0, maxBitrate),当 maxBitrate < minBitrate 时,为适配码率模式。
以下情况,设置本参数无效:
maxBitrate 为 0 时,不对视频流进行编码发送。maxBitrate < 0 时,适配码率模式。@property(nonatomic, assign) ByteRTCVideoEncoderPreference encoderPreference;
objectivec编码策略偏好,默认为帧率优先。参看 ByteRTCVideoEncoderPreference。
@interface ByteRTCScreenVideoEncoderConfig: NSObject
objectivec屏幕流编码配置。参考 设置视频发布参数。
| 类型 | 名称 |
|---|---|
| NSInteger | width |
| NSInteger | height |
| NSInteger | frameRate |
| NSInteger | maxBitrate |
| NSInteger | minBitrate |
| ByteRTCScreenVideoEncoderPreference | encoderPreference |
@property(nonatomic, assign) NSInteger width;
objectivec屏幕帧宽度,单位:px。
@property(nonatomic, assign) NSInteger height;
objectivec屏幕帧高度,单位:px。
@property(nonatomic, assign) NSInteger frameRate;
objectivec屏幕流帧率,单位:fps。
@property(nonatomic, assign) NSInteger maxBitrate;
objectivec最大编码码率,使用 SDK 内部采集时可选设置,自定义采集时必须设置,单位:kbps。
设为 -1 即适配码率模式,系统将根据输入的分辨率和帧率自动计算适用的码率。
设为 0 则不对视频流进行编码发送。
3.44 及以上版本,内部采集时默认值为 -1,3.44 以前版本无默认值,需手动设置。
@property(nonatomic, assign) NSInteger minBitrate;
objectivec最小编码码率,使用 SDK 内部采集时可选设置,自定义采集时必须设置,单位:kbps。
最小编码码率必须小于或等于最大编码,否则不对视频流进行编码发送。
@property(nonatomic, assign) ByteRTCScreenVideoEncoderPreference encoderPreference;
objectivec屏幕流编码模式。参见 ByteRTCScreenVideoEncoderPreference。
@interface ByteRTCRemoteVideoConfig : NSObject
objectivec远端视频帧信息
| 类型 | 名称 |
|---|---|
| int | framerate |
| int | width |
| int | height |
@property (nonatomic, assign) int framerate;
objectivec期望订阅的最高帧率,单位:fps,默认值为 0 即满帧订阅,设为大于 0 的值时开始生效。
当发布端帧率低于设定帧率,或订阅端开启性能回退后下行弱网,则帧率会相应下降。
仅码流支持 SVC 分级编码特性时方可生效。
@property(nonatomic, assign) int width;
objectivec视频宽度,单位:px
@property(nonatomic, assign) int height;
objectivec视频高度,单位:px
@interface ByteRTCRoomConfig : NSObject
objectivec房间参数配置
| 类型 | 名称 |
|---|---|
| ByteRTCRoomProfile | profile |
| BOOL | isAutoPublish |
| BOOL | isAutoSubscribeAudio |
| BOOL | isAutoSubscribeVideo |
| ByteRTCRemoteVideoConfig* | remoteVideoConfig |
@property(nonatomic) ByteRTCRoomProfile profile;
objectivec房间模式,参看 ByteRTCRoomProfile,默认为普通音视频通话模式,进房后不可更改。
@property(assign, nonatomic) BOOL isAutoPublish;
objectivec是否自动发布音视频流,默认为自动发布。
创建和加入多房间时,只能将其中一个房间设置为自动发布。若每个房间均不做设置,则默认在第一个加入的房间内自动发布流。
若调用 setUserVisibility: 将自身可见性设为 false,无论是默认的自动发布流还是手动设置的自动发布流都不会进行发布,你需要将自身可见性设为 true 后方可发布。
@property(assign, nonatomic) BOOL isAutoSubscribeAudio;
objectivec是否自动订阅音频流,默认为自动订阅。
包含主流和屏幕流。
@property(assign, nonatomic) BOOL isAutoSubscribeVideo;
objectivec是否自动订阅主视频流,默认为自动订阅。
包含主流和屏幕流。
@property(nonatomic, strong) ByteRTCRemoteVideoConfig * _Nonnull remoteVideoConfig;
objectivec远端视频流参数,参看 ByteRTCRemoteVideoConfig
@interface ByteRTCSourceCropInfo : NSObject
objectivec公共流裁剪信息
| 类型 | 名称 |
|---|---|
| CGFloat | locationX |
| CGFloat | locationY |
| CGFloat | widthProportion |
| CGFloat | heightProportion |
@property(assign, nonatomic) CGFloat locationX;
objectivec裁剪后得到的视频帧左上角横坐标相对于裁剪前整体画面的比例,取值范围[0.0, 1.0)
@property(assign, nonatomic) CGFloat locationY;
objectivec裁剪后得到的视频帧左上角纵坐标相对于裁剪前整体画面的比例,取值范围[0.0, 1.0)
@property(assign, nonatomic) CGFloat widthProportion;
objectivec裁剪后得到的视频帧宽度相对于裁剪前整体画面的比例,取值范围(0.0, 1.0]
@property(assign, nonatomic) CGFloat heightProportion;
objectivec裁剪后得到的视频帧高度相对于裁剪前整体画面的比例,取值范围(0.0, 1.0]
@interface ByteRTCPublicStreamRegion : NSObject
objectivec合成公共流的每条流的布局信息
| 类型 | 名称 |
|---|---|
| NSString* | userId |
| NSString* | roomId |
| NSString* | alternateImage |
| CGFloat | x |
| CGFloat | y |
| CGFloat | width |
| CGFloat | height |
| NSInteger | zOrder |
| CGFloat | alpha |
| NSInteger | mediaType |
| NSInteger | streamType |
| ByteRTCRenderMode | renderMode |
| ByteRTCSourceCropInfo* | sourceCrop |
@property(copy, nonatomic) NSString * _Nonnull userId;
objectivec用户 ID。必填。
服务端将通过用户 ID 和 房间 ID,找到需要合成到公共流中的媒体流。
@property(copy, nonatomic) NSString * _Nonnull roomId;
objectivec房间 ID。必填。
服务端将通过用户 ID 和 房间 ID,找到需要合成到公共流中的媒体流。
@property(copy, nonatomic) NSString * _Nonnull alternateImage;
objectivec背景图片地址
@property(assign, nonatomic) CGFloat x;
objectivec用户视频布局相对画布左侧的偏移量, 相对值。范围[0.0 - 1.0]
@property(assign, nonatomic) CGFloat y;
objectivec用户视频布局相对画布顶端的偏移量, 相对值。范围[0.0 - 1.0]
@property(assign, nonatomic) CGFloat width;
objectivec用户视频宽度相对用户原始视频宽度的比例,相对值。范围[0.0 - 1.0]
@property(assign, nonatomic) CGFloat height;
objectivec用户视频高度相对用户原始视频高度的比例,相对值。范围[0.0 - 1.0]
@property(assign, nonatomic) NSInteger zOrder;
objectivec用户视频布局在画布中的层级,0为底层,值越大越上层。范围[0 - 100]
@property(assign, nonatomic) CGFloat alpha;
objectivec透明度,必填。可选范围为 [0.0, 1.0]。
@property(assign, nonatomic) NSInteger mediaType;
objectivec推流内容控制。默认为0。
0: 输出的混流包含音视频
1: 只包含音频
2: 表示只包含视频
@property(assign, nonatomic) NSInteger streamType;
objectivec推流媒体类型
0:普通音视频流
1: 屏幕流
@property(assign, nonatomic) ByteRTCRenderMode renderMode;
objectivec视频显示模式。详见 ByteRTCRenderMode 数据类型。
@property(strong, nonatomic) ByteRTCSourceCropInfo * _Nonnull sourceCrop;
objectivec视频裁剪信息。 详见 ByteRTCSourceCropInfo。
@interface ByteRTCPublicStreamLayout : NSObject
objectivec公共流的合流布局。必填
| 类型 | 名称 |
|---|---|
| NSInteger | layoutMode |
| NSInteger | interpolationMode |
| NSString* | backgroundColor |
| NSString* | backgroundImage |
| NSArray<ByteRTCPublicStreamRegion>** | regions |
@property(assign, nonatomic) NSInteger layoutMode;
objectivec布局模式。可选:
0: 自动布局。默认值 2: 自定义布局。@property(assign, nonatomic) NSInteger interpolationMode;
objectivec插帧模式。
0: 补最后一帧1: 补背景图片,如果没有设置背景图片则补黑帧@property(copy, nonatomic) NSString *_Nonnull backgroundColor;
objectivec画布的背景颜色。格式为 RGB 定义下的 Hex 值,如 #FFB6C1 表示浅粉色。默认值 #000000,表示为黑色
@property(copy, nonatomic) NSString *_Nonnull backgroundImage;
objectivec背景图片地址
@property(copy, nonatomic) NSArray<ByteRTCPublicStreamRegion *> * _Nonnull regions;
objectivec用户布局信息列表。每一个该类型对象为一路单独的视频流的布局信息。
@interface ByteRTCPublicStreamVideoConfig : NSObject
objectivec公共流的视频编码参数
| 类型 | 名称 |
|---|---|
| NSInteger | width |
| NSInteger | height |
| NSInteger | fps |
| NSInteger | bitrate |
@property(assign, nonatomic) NSInteger width;
objectivec公共流视频宽度,必填。单位为 px,范围为 [2, 1920],必须是偶数。
@property(assign, nonatomic) NSInteger height;
objectivec公共流视频高度,必填。单位为 px,范围为 [16, 1280],必须是偶数。
@property(assign, nonatomic) NSInteger fps;
objectivec公共流视频帧率。必填
范围:[1, 60]
@property(assign, nonatomic) NSInteger bitrate;
objectivec视频码率,必填
范围:[1,10000000]
单位为 bps
@interface ByteRTCVideoByteWatermark: NSObject
objectivec水印图片相对视频流的位置和大小。
| 类型 | 名称 |
|---|---|
| float | x |
| float | y |
| float | width |
| float | height |
@property(assign, nonatomic) float x;
objectivec水印图片相对视频流左上角的横向偏移与视频流宽度的比值,取值范围为 [0,1)。
@property(assign, nonatomic) float y;
objectivec水印图片相对视频流左上角的纵向偏移与视频流高度的比值,取值范围为 [0,1)。
@property(assign, nonatomic) float width;
objectivec水印图片宽度与视频流宽度的比值,取值范围 [0,1)。
@property(assign, nonatomic) float height;
objectivec水印图片高度与视频流高度的比值,取值范围为 [0,1)。
@interface ByteRTCVideoWatermarkConfig: NSObject
objectivec水印参数
| 类型 | 名称 |
|---|---|
| BOOL | visibleInPreview |
| ByteRTCVideoByteWatermark* | positionInLandscapeMode |
| ByteRTCVideoByteWatermark* | positionInPortraitMode |
@property(nonatomic, assign) BOOL visibleInPreview;
objectivec水印是否在视频预览中可见,默认可见。
@property(strong, nonatomic) ByteRTCVideoByteWatermark * _Nonnull positionInLandscapeMode;
objectivec横屏时的水印位置和大小,参看 ByteRTCVideoByteWatermark。
@property(strong, nonatomic) ByteRTCVideoByteWatermark * _Nonnull positionInPortraitMode;
objectivec竖屏时的水印位置和大小,参看 ByteRTCVideoByteWatermark。
@interface ByteRTCPublicStreaming : NSObject
objectivec公共流参数
| 类型 | 名称 |
|---|---|
| ByteRTCPublicStreamLayout* | layout |
| ByteRTCPublicStreamVideoConfig* | video |
| 返回 | 名称 |
|---|---|
| instancetype | defaultPublicStreaming |
@property(strong, nonatomic) ByteRTCPublicStreamLayout * _Nonnull layout;
objectivec视频流公共流整体布局参数,必填。详见 ByteRTCPublicStreamLayout
@property(strong, nonatomic) ByteRTCPublicStreamVideoConfig * _Nonnull video;
objectivec公共流视频编码参数。详见 ByteRTCPublicStreamVideoConfig。
+ (instancetype _Nonnull)defaultPublicStreaming;
objectivec获取默认的公共流转码配置属性。
返回值
包含默认配置的 ByteRTCPublicStreaming 结构体
@interface ByteRTCFrameUpdateInfo : NSObject
objectivecRTC 智能决策后得到的帧率和分辨率积(宽*高)。
| 类型 | 名称 |
|---|---|
| int | pixel |
| int | framerate |
@property(assign, nonatomic) int pixel;
objectivec分辨率积(宽*高)。
@property(assign, nonatomic) int framerate;
objectivec帧率。
@interface ByteRTCMediaTypeEnhancementConfig: NSObject
objectivec蜂窝网络辅助增强应用的媒体模式
| 类型 | 名称 |
|---|---|
| BOOL | enhanceSignaling |
| BOOL | enhanceAudio |
| BOOL | enhanceVideo |
| BOOL | enhanceScreenAudio |
| BOOL | enhanceScreenVideo |
@property (assign, nonatomic) BOOL enhanceSignaling;
objectivec对信令消息,是否启用蜂窝网络辅助增强。默认不启用。
@property (assign, nonatomic) BOOL enhanceAudio;
objectivec对屏幕共享以外的其他音频,是否启用蜂窝网络辅助增强。默认不启用。
@property (assign, nonatomic) BOOL enhanceVideo;
objectivec对屏幕共享视频以外的其他视频,是否启用蜂窝网络辅助增强。默认不启用。
@property (assign, nonatomic) BOOL enhanceScreenAudio;
objectivec对屏幕共享音频,是否启用蜂窝网络辅助增强。默认不启用。
@property (assign, nonatomic) BOOL enhanceScreenVideo;
objectivec对屏幕共享视频,是否启用蜂窝网络辅助增强。默认不启用。