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降噪模式。降噪算法受调用 joinRoomByToken:userInfo:roomConfig: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, 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, 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 | 各个远端音频流。 |
| 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 |
@property(nonatomic, assign) ByteRTCAudioSampleRate sampleRate;
objectivec音频采样率,详见 ByteRTCAudioSampleRate
@property(nonatomic, assign) ByteRTCAudioChannel channel;
objectivec音频声道,详见 ByteRTCAudioChannel
@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 时关闭此功能,默认为关闭。
仅在单个音频文件混音时使用有效。
true 时开启此功能,false 时关闭此功能,默认为关闭。
@interface ByteRTCAudioPropertiesConfig : NSObject
objectivec音频属性信息提示的相关配置。
| 类型 | 名称 |
|---|---|
| NSInteger | interval |
| BOOL | enable_spectrum |
| BOOL | enable_vad |
| ByteRTCAudioReportMode | local_main_report_mode |
| float | smooth |
| ByteRTCAudioPropertiesMode | audio_report_mode |
@property(assign, nonatomic) NSInteger interval;
objectivec信息提示间隔,单位:ms
<= 0: 关闭信息提示 (0,100]: 开启信息提示,不合法的 interval 值,SDK 自动设置为 100ms > 100: 开启信息提示,并将信息提示间隔设置为此值 @property(assign, nonatomic) BOOL enable_spectrum;
objectivec是否开启音频频谱检测。
@property(assign, nonatomic) BOOL enable_vad;
objectivec是否开启人声检测 (VAD)。
@property(assign, nonatomic) ByteRTCAudioReportMode local_main_report_mode;
objectivec音量回调模式。详见 ByteRTCAudioReportMode。
@property(nonatomic, assign) float smooth;
objectivec适用于音频属性信息提示的平滑系数。取值范围是 (0.0, 1.0]。
默认值为 1.0,不开启平滑效果;值越小,提示音量平滑效果越明显。如果要开启平滑效果,可以设置为 0.3。
@property(assign, nonatomic) ByteRTCAudioPropertiesMode audio_report_mode;
objectivecrtcEngine:onLocalAudioPropertiesReport: 中包含音频数据的范围。参看 ByteRTCAudioPropertiesMode。
默认仅包含本地麦克风采集的音频数据和本地屏幕音频采集数据。
@interface ByteRTCAudioPropertiesInfo : NSObject
objectivec音频属性信息
| 类型 | 名称 |
|---|---|
| NSInteger | linearVolume |
| NSInteger | nonlinearVolume |
| NSInteger | vad |
| NSArray<NSNumber>** | spectrum |
@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。
@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 Position : 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 Orientation : 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 HumanOrientation : NSObject
objectivec三维朝向信息,三个向量需要两两垂直。参看 Orientation。
| 类型 | 名称 |
|---|---|
| Orientation* | forward |
| Orientation* | right |
| Orientation* | up |
@property(nonatomic, strong) Orientation* _Nonnull forward;
objectivec正前方朝向,默认值为 {1,0,0},即正前方朝向 x 轴正方向
@property(nonatomic, strong) Orientation* _Nonnull right;
objectivec正右方朝向,默认值为 {0,1,0},即右手朝向 y 轴正方向
@property(nonatomic, strong) Orientation* _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。
@property(nonatomic, assign) ByteRTCAudioSampleRate sampleRate;
objectivec录音采样率。参看 ByteRTCAudioSampleRate。
@property(nonatomic, assign) ByteRTCAudioChannel channel;
objectivec录音音频声道。参看 ByteRTCAudioChannel。
注意:
如果录制时设置的的音频声道数与采集时的音频声道数不同:+ 如果采集的声道数为 1,录制的声道数为 2,那么,录制的音频为经过单声道数据拷贝后的双声道数据,而不是立体声。
如果录制时设置的的音频声道数与采集时的音频声道数不同:+ 如果采集的声道数为 1,录制的声道数为 2,那么,录制的音频为经过单声道数据拷贝后的双声道数据,而不是立体声。
@property(nonatomic, assign) ByteRTCAudioQuality quality;
objectivec录音音质。仅在录制文件格式为 .aac 时可以设置。参看 ByteRTCAudioQuality。
注意:
采样率为 32kHz 时,不同音质录制文件(时长为 10min)的大小分别是: + 低音质:1.2MB;
采样率为 32kHz 时,不同音质录制文件(时长为 10min)的大小分别是: + 低音质:1.2MB;
typedef NS_ENUM(NSInteger, ByteRTCAudioRecordingState)
objectivec录音配置
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCAudioRecordingStateError | 0 | 录制异常 |
| ByteRTCAudioRecordingStateProcessing | 1 | 录制进行中 |
| ByteRTCAudioRecordingStateSuccess | 2 | 已结束录制,并且录制文件保存成功。 |
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 | 失败,屏幕流不支持。 |
| 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 | 保活失败。 |
| 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, ByteRTCSEIMessageSourceType)
objectivecSEI 信息来源。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCSEIMessageSourceTypeDefault | 0 | (默认值)用户自定义。 |
| ByteRTCSEIMessageSourceTypeSystem | 1 | 系统定义,包含音量指示信息。 |
typedef NS_ENUM(NSInteger, ByteRTCSEICountPerFrame)
objectivecSEI 发送模式。
| 类型 | 值 | 说明 |
|---|---|---|
| kSingleSEIPerFrame | 0 | 单发模式。即在 1 帧间隔内多次发送 SEI 数据时,多个 SEI 按队列逐帧发送。 |
| kMultiSEIPerFrame | 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 | 远端音频流播放失败 |
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 | 设备采样率不支持 |
typedef NS_ENUM(NSInteger, ByteRTCMediaDeviceWarning)
objectivec媒体设备警告
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCMediaDeviceWarningOK | 0 | 无警告 |
| ByteRTCMediaDeviceWarningOperationDenied | 1 | 非法设备操作。在使用外部设备时,调用了 SDK 内部设备 API。 |
| ByteRTCMediaDeviceWarningCaptureSilence | 2 | 采集到的数据为静音帧。 |
| ByteRTCMediaDeviceWarningCaptureDetectHowling | 16 | 啸叫。触发该回调的情况如下:1)不支持啸叫抑制的房间模式下,检测到啸叫;2)支持啸叫抑制的房间模式下,检测到未被抑制的啸叫。 仅 ByteRTCRoomProfileCommunication、ByteRTCRoomProfileMeeting、ByteRTCRoomProfileMeetingRoom 三种房间模式支持啸叫抑制。 建议提醒用户检查客户端的距离或将麦克风和扬声器调至静音。 |
typedef NS_OPTIONS(NSUInteger, ByteRTCProblemFeedbackOption)
objectivec音视频质量反馈问题类型
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCProblemFeedbackOptionNone | 0 | 没有问题 |
| ByteRTCProblemFeedbackOptionOtherMessage | (1 << 0) | 其他问题 |
| ByteRTCProblemFeedbackOptionAudioNotClear | (1 << 1) | 声音不清晰 |
| ByteRTCProblemFeedbackOptionVideoNotClear | (1 << 2) | 视频不清晰 |
| ByteRTCProblemFeedbackOptionNotSync | (1 << 3) | 音视频不同步 |
| ByteRTCProblemFeedbackOptionAudioLagging | (1 << 4) | 音频卡顿 |
| ByteRTCProblemFeedbackOptionVideoLagging | (1 << 5) | 视频卡顿 |
| ByteRTCProblemFeedbackOptionDisconnected | (1 << 6) | 连接断开 |
| ByteRTCProblemFeedbackOptionNoAudio | (1 << 7) | 无声音 |
| ByteRTCProblemFeedbackOptionNoVideo | (1 << 8) | 无画面 |
| ByteRTCProblemFeedbackOptionAudioStrength | (1 << 9) | 声音过小 |
| ByteRTCProblemFeedbackOptionEcho | (1 << 10) | 回声噪音 |
| ByteRTCFeedBackProblemTypeEarBackDelay | (1 << 11) | 耳返延迟大 |
@interface ByteRTCProblemOption: NSObject
objectivec通话质量反馈预设问题列表
| 类型 | 名称 |
|---|---|
| ByteRTCProblemFeedbackOption | option |
| NSString* | desc |
| 返回 | 名称 |
|---|---|
| instancetype | initWithOption: |
@property(nonatomic, assign, readonly) ByteRTCProblemFeedbackOption option;
objectivec读取音视频质量反馈问题类型,参看 ByteRTCProblemFeedbackOption。
@property(nonatomic, copy, readonly) NSString * _Nonnull desc;
objectivec读取 ByteRTCProblemOption 类对应的文字描述
- (instancetype _Nonnull)initWithOption:(ByteRTCProblemFeedbackOption)option;
objectivec初始化 ByteRTCProblemOption
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, ByteRTCMuteState)
objectivec音视频流的发送/播放状态
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCMuteStateOff | 0 | 发送 |
| ByteRTCMuteStateOn | 1 | 停止发送 |
typedef NS_ENUM(NSInteger, ByteSEIStreamEventType)
objectivec黑帧视频流状态
| 类型 | 值 | 说明 |
|---|---|---|
| ByteSEIStreamEventTypeStreamAdd | 0 | 远端用户发布黑帧视频流。 纯语音通话场景下,远端用户调用 sendSEIMessage:andMessage:andRepeatCount:andCountPerFrame: 发送 SEI 数据时,SDK 会自动发布一路黑帧视频流,并触发该回调。 |
| ByteSEIStreamEventTypeStreamRemove | 1 | 远端黑帧视频流移除。该回调的触发时机包括: + 远端用户开启摄像头采集,由语音通话切换至视频通话,黑帧视频流停止发布; + 远端用户调用 sendSEIMessage:andMessage:andRepeatCount:andCountPerFrame: 后 1min 内未有 SEI 数据发送,黑帧视频流停止发布; + 远端用户调用 setVideoSourceType:WithStreamIndex: 切换至自定义视频采集时,黑帧视频流停止发布。 |
typedef NS_ENUM(NSInteger, ByteRTCStreamIndex)
objectivec流属性
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCStreamIndexMain | 0 | 主流。包括: + 由摄像头/麦克风通过内部采集机制,采集到的视频/音频; + 通过自定义采集,采集到的视频/音频。 |
| ByteRTCStreamIndexScreen | 1 | 屏幕流。屏幕共享时共享的视频流,或来自声卡的本地播放音频流。 |
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本地录制的状态
| 类型 | 值 | 说明 |
|---|---|---|
| RecordingStateError | 0 | 录制异常 |
| RecordingStateProcessing | 1 | 录制进行中 |
| RecordingStateSuccess | 2 | 录制文件保存成功,调用 stopFileRecording: 结束录制之后才会收到该状态码。 |
typedef NS_ENUM(NSInteger, ByteRTCRecordingErrorCode)
objectivec本地录制错误码
| 类型 | 值 | 说明 |
|---|---|---|
| RecordingErrorCodeOk | 0 | 录制正常 |
| RecordingErrorCodeNoPermission | -1 | 没有文件写权限 |
| RecordingErrorCodeNotSupport | -2 | 当前版本 SDK 不支持本地录制功能,请联系技术支持人员 |
| RecordingErrorCodeOther | -3 | 其他异常 |
typedef NS_ENUM(NSInteger, ByteRTCRecordingFileType)
objectivec本地录制文件的存储格式
| 类型 | 值 | 说明 |
|---|---|---|
| RecordingFileTypeAAC | 0 | aac 格式文件 |
| RecordingFileTypeMP4 | 1 | mp4 格式文件 |
typedef NS_ENUM(NSInteger, ByteRTCAVSyncState)
objectivec音视频同步状态
| 类型 | 值 | 说明 |
|---|---|---|
| AVSyncStateAVStreamSyncBegin | 0 | 音视频开始同步 |
| AVSyncStateAudioStreamRemove | 1 | 音视频同步过程中音频移除,但不影响当前的同步关系 |
| AVSyncStateVdieoStreamRemove | 2 | 音视频同步过程中视频移除,但不影响当前的同步关系 |
typedef NS_ENUM(NSInteger, ByteRTCEchoTestResult)
objectivec音视频回路测试结果
| 类型 | 值 | 说明 |
|---|---|---|
| EchoTestSuccess | 0 | 接收到采集的音视频的回放,通话回路检测成功 |
| EchoTestTimeout | 1 | 测试超过 60s 仍未完成,已自动停止 |
| EchoTestIntervalShort | 2 | 上一次测试结束和下一次测试开始之间的时间间隔少于 5s |
| EchoTestAudioDeviceError | 3 | 音频采集异常 |
| EchoTestVideoDeviceError | 4 | 视频采集异常 |
| EchoTestAudioReceiveError | 5 | 音频接收异常 |
| EchoTestVideoReceiveError | 6 | 视频接收异常 |
| EchoTestInternalError | 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 端默认检测列表中第一个视频设备。
注意:
视频的发布参数固定为:分辨率 640px × 360px,帧率 15fps。
视频的发布参数固定为:分辨率 640px × 360px,帧率 15fps。
@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 | txJitter |
| NSInteger | rxJitter |
| NSInteger | tx_cellular_kbitrate |
| NSInteger | rx_cellular_kbitrate |
@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 txJitter;
objectivec系统上行网络抖动(ms)
@property(assign, nonatomic) NSInteger rxJitter;
objectivec系统下行网络抖动(ms)
@property(assign, nonatomic) NSInteger tx_cellular_kbitrate;
objectivec蜂窝路径发送的码率 (kbps),为获取该数据时的瞬时值
@property(assign, nonatomic) NSInteger rx_cellular_kbitrate;
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 |
@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。
@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 |
@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。
@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 | total_rtt |
| 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 total_rtt;
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* | audio_stats |
| ByteRTCLocalVideoStats* | video_stats |
| BOOL | is_screen |
| ByteRTCNetworkQuality | [deprecated] tx_quality |
| ByteRTCNetworkQuality | [deprecated] rx_quality |
@property(strong, nonatomic) ByteRTCLocalAudioStats *_Nonnull audio_stats;
objectivec本地设备发送音频流的统计信息,详见 ByteRTCLocalAudioStats
@property(strong, nonatomic) ByteRTCLocalVideoStats *_Nonnull video_stats;
objectivec本地设备发送视频流的统计信息,详见 ByteRTCLocalVideoStats
@property(assign, nonatomic) ByteRTCNetworkQuality tx_quality;
objectivec所属用户的媒体流上行网络质量,详见 ByteRTCNetworkQuality
Deprecated since 3.36 and will be deleted in 3.51, use rtcRoom:onNetworkQuality:remoteQualities: instead
@property(assign, nonatomic) ByteRTCNetworkQuality rx_quality;
objectivec所属用户的媒体流下行网络质量,详见 ByteRTCNetworkQuality
Deprecated since 3.36 and will be deleted in 3.51, use rtcRoom:onNetworkQuality:remoteQualities: instead
@property(nonatomic, assign) BOOL is_screen;
objectivec所属用户的媒体流是否为屏幕流。你可以知道当前统计数据来自主流还是屏幕流。
@interface ByteRTCRemoteStreamStats : NSObject
objectivec用户订阅的远端音/视频流统计信息以及网络状况,统计周期为 2s 。
订阅远端用户发布音/视频流成功后,SDK 会周期性地通过 onRemoteStreamStats
通知本地用户订阅的远端音/视频流在此次统计周期内的接收状况。此数据结构即为回调给本地用户的参数类型。
| 类型 | 名称 |
|---|---|
| NSString* | uid |
| ByteRTCRemoteAudioStats* | audio_stats |
| ByteRTCRemoteVideoStats* | video_stats |
| BOOL | is_screen |
| ByteRTCNetworkQuality | [deprecated] tx_quality |
| ByteRTCNetworkQuality | [deprecated] rx_quality |
@property(copy, nonatomic) NSString *_Nonnull uid;
objectivec用户 ID 。音频来源的用户 ID 。
@property(strong, nonatomic) ByteRTCRemoteAudioStats *_Nonnull audio_stats;
objectivec远端音频流的统计信息,详见 ByteRTCRemoteAudioStats
@property(strong, nonatomic) ByteRTCRemoteVideoStats *_Nonnull video_stats;
objectivec远端视频流的统计信息,详见 ByteRTCRemoteVideoStats
@property(assign, nonatomic) ByteRTCNetworkQuality tx_quality;
objectivec所属用户的媒体流上行网络质量,详见 ByteRTCNetworkQuality
Deprecated since 3.36 and will be deleted in 3.51, use rtcRoom:onNetworkQuality:remoteQualities: instead
@property(assign, nonatomic) ByteRTCNetworkQuality rx_quality;
objectivec所属用户的媒体流下行网络质量,详见 ByteRTCNetworkQuality
Deprecated since 3.36 and will be deleted in 3.51, use rtcRoom:onNetworkQuality:remoteQualities: instead
@property(nonatomic, assign) BOOL is_screen;
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 ForwardStreamConfiguration: 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 ForwardStreamStateInfo: 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 ForwardStreamEventInfo: 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(NSInteger, AttenuationType)
objectivec空间音频音量随距离衰减模式
| 类型 | 值 | 说明 |
|---|---|---|
| AttenuationTypeNone | 0 | 不随距离衰减 |
| AttenuationTypeLinear | 1 | 线性衰减,音量随距离增大而线性减小 |
| AttenuationTypeExponential | 2 | 指数型衰减,音量随距离增大进行指数衰减 |
@interface ReceiveRange : 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(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 | 无法获取对端用户在线状态 发生级联错误、对端用户在线状态异常时返回 |
@interface ByteRTCSysStats : NSObject
objectivecApp 使用的 cpu 和 memory 信息
信息由 SDK 周期性(2s)地通过 reportSysStats 回调事件通知给用户。
| 类型 | 名称 |
|---|---|
| unsigned | cpu_cores |
| double | cpu_app_usage |
| double | memory_usage |
| unsigned | full_memory |
| unsigned | total_memory_usage |
| unsigned | free_memory |
| double | memory_ratio |
| double | total_memory_ratio |
@property(assign, nonatomic) unsigned int cpu_cores;
objectivec当前系统 cpu 核数
@property(assign, nonatomic) double cpu_app_usage;
objectivec当前应用的 CPU 使用率,取值范围为 [0, 1]。
@property(assign, nonatomic) double memory_usage;
objectivec当前App的内存使用(单位 MB)
@property(assign, nonatomic) unsigned long long full_memory;
objectivec全量内存(单位MB)
@property(assign, nonatomic) unsigned long long total_memory_usage;
objectivec系统已使用内存(单位MB)
@property(assign, nonatomic) unsigned long long free_memory;
objectivec空闲可分配内存(单位MB)
@property(assign, nonatomic) double memory_ratio;
objectivec当前应用的内存使用率(单位 %)
@property(assign, nonatomic) double total_memory_ratio;
objectivec系统内存使用率(单位 %)
@interface ByteRTCCloudProxyInfo: NSObject
objectivec云代理信息
| 类型 | 名称 |
|---|---|
| NSString* | cloudProxyIp |
| int | cloudProxyPort |
@property(strong, nonatomic) NSString* _Nonnull cloudProxyIp;
objectivec云代理服务器 IP
@property(assign, nonatomic) int cloudProxyPort;
objectivec云代理服务器端口
@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, ByteRTCEffectBeautyMode)
objectivec基础美颜模式
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCEffectWhiteMode | 0 | 美白 |
| ByteRTCEffectSmoothMode | 1 | 磨皮 |
| ByteRTCEffectSharpenMode | 2 | 锐化 |
typedef NS_ENUM(NSInteger, ByteRTCVideoRotation)
objectivec视频旋转信息,枚举类型,定义了以 90 度为间隔的四种旋转模式。
| 类型 | 值 | 说明 |
|---|---|---|
| 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屏幕流编码模式。默认采用清晰模式。若在 macOS 平台采集时调用 updateScreenCaptureFilterConfig: 排除指定窗口,共享视频时帧率无法达到 30fps。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCScreenVideoEncodePreferenceAuto | 0 | 智能模式。根据屏幕内容智能决策选择流畅模式或清晰模式。 |
| 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, ByteRTCVideoSinkPixelFormat)
objectivec视频帧编码格式
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCVideoSinkPixelFormatOriginal | 0 | 原始视频帧格式 |
| ByteRTCVideoSinkPixelFormatI420 | 1 | YUV I420 格式 |
| ByteRTCVideoSinkPixelFormatBGRA | 2 | BGRA 格式 |
| ByteRTCVideoSinkPixelFormatNV12 | 8 | YUV NV21 格式 |
typedef NS_ENUM(NSUInteger, ByteRTCStreamMixingType)
objectivec合流方式
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCStreamMixingTypeByServer | 0 | 通过服务端转推 |
| ByteRTCStreamMixingTypeByClient | 1 | 端云一体转推 |
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, 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, 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 | 内部采集视频源 |
| ByteRTCVideoSourceTypeEncodedManualSimulcast | 2 | 自定义编码视频源。 SDK 不会自动生成多路流,你需要自行生成并推送多路流 |
| ByteRTCVideoSourceTypeEncodedAutoSimulcast | 3 | 自定义编码视频源。 你仅需推送分辨率最大的一路编码后视频流,SDK 将自动转码生成多路小流 |
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 | 后置摄像头 |
| ByteRTCCameraIDExternal | 2 | 外接摄像头 |
| ByteRTCCameraIDInvalid | 3 | 无效值 |
typedef NS_ENUM(NSInteger, ByteRTCRecordingType)
objectivec本地录制的媒体类型
| 类型 | 值 | 说明 |
|---|---|---|
| RecordAudioOnly | 0 | 只录制音频 |
| RecordVideoOnly | 1 | 只录制视频 |
| RecordVideoAndAudio | 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 | 重力方向 |
@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 |
@property(strong, nonatomic) ByteRTCView* _Nullable view;
objectivec本地视图句柄
@property(assign, nonatomic) ByteRTCRenderMode renderMode;
objectivec渲染模式,参看 ByteRTCRenderMode
@property(assign, nonatomic) NSInteger backgroundColor;
objectivec用于填充画布空白部分的背景颜色。取值范围是 [0x00000000, 0xFFFFFFFF],格式为 BGR。默认值是 0x00000000。其中,透明度设置无效。
@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 |
| int | cropLeft |
| int | cropTop |
| int | cropRight |
| int | cropBottom |
| ByteRTCVideoRotation | rotation |
| ByteRTCColorSpace | colorSpace |
| ByteRTCCameraID | cameraId |
| NSData* | extendedData |
| NSData* | supplementaryInfo |
| 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) int cropLeft;
objectivec视频帧左侧被裁剪的尺寸(像素)
@property(assign, nonatomic) int cropTop;
objectivec视频帧上部被裁剪的尺寸(像素)
@property(assign, nonatomic) int cropRight;
objectivec视频帧右侧被裁剪的尺寸(像素)
@property(assign, nonatomic) int cropBottom;
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数据
@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 |
| Position* | spatialPosition |
@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 相对画布宽度的比例值。
做范围判定时,首先根据画布的宽高,将 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) Position * _Nullable spatialPosition;
objectivec空间位置。参看 Position。
@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 |
| Position* | audienceSpatialPosition |
| HumanOrientation* | audienceSpatialOrientation |
@property(assign, nonatomic) BOOL enableSpatialRender;
objectivec是否开启推流 CDN 时的空间音频效果。
注意:
当你启用此效果时,你需要设定推流中各个 ByteRTCTranscodingSpatialConfig 的 spatialPosition 值,实现空间音频效果。
当你启用此效果时,你需要设定推流中各个 ByteRTCTranscodingSpatialConfig 的 spatialPosition 值,实现空间音频效果。
@property (strong, nonatomic) Position * _Nullable audienceSpatialPosition;
objectivec听众的空间位置。参看 Position。
听众指收听来自 CDN 的音频流的用户。
@property(strong, nonatomic) HumanOrientation * _Nullable audienceSpatialOrientation;
objectivec听众的空间朝向。参看 HumanOrientation。
听众指收听来自 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 |
| 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(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 ByteRTCPushSingleStreamParam : NSObject
objectivec单流转推直播配置参数。
| 类型 | 名称 |
|---|---|
| NSString* | url |
| NSString* | roomId |
| NSString* | userId |
| BOOL | isScreen |
@property(copy, nonatomic) NSString * _Nullable url;
objectivec推流地址
@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 | renderPixelBuffer:rotation:contentType:extendedData: |
- (void)renderPixelBuffer:(CVPixelBufferRef _Nonnull)pixelBuffer rotation:(ByteRTCVideoRotation)rotation contentType:(ByteRTCVideoContentType)contentType extendedData:(NSData * _Nullable)extendedData;
objectivec输出视频的 PixelBuffer
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| pixelBuffer | CVPixelBufferRef | 视频的 PixelBuffer |
| rotation | ByteRTCVideoRotation | 视频旋转角度,参看 ByteRTCVideoRotation |
| contentType | ByteRTCVideoContentType | 视频内部类型 参看 ByteRTCVideoContentType |
| extendedData | NSData* | 视频解码后获得的附加数据 |
@interface ByteRTCVideoPreprocessorConfig : NSObject
objectivec视频处理配置参数
| 类型 | 名称 |
|---|---|
| ByteRTCVideoPixelFormat | required_pixel_format |
@property(nonatomic, assign) ByteRTCVideoPixelFormat required_pixel_format;
objectivec视频帧的像素格式,参看 ByteRTCVideoPixelFormat。
@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帧率。