ByteRTCAudioScenarioType
typedef NS_ENUM(NSInteger, ByteRTCAudioScenarioType)
objectivec

音频场景类型。
选择音频场景后,SDK 会自动根据客户端音频采集播放设备和状态,适用通话音量/媒体音量。
如果以下音频场景类型无法满足你的业务需要,请联系技术支持人员。

枚举值
类型值说明
ByteRTCAudioScenarioMusic0(默认)音乐场景。
此场景适用于对音乐表现力有要求的场景,如音乐直播等。
音频采集播放设备和采集播放状态,到音量类型的映射如下:






不采集音频采集音频备注
设备自带麦克风和扬声器媒体音量通话音量/
听筒媒体音量通话音量/
有线耳机/ USB 耳机/ 外置声卡媒体音量媒体音量/
蓝牙耳机媒体音量媒体音量即使蓝牙耳机有麦克风,也只能使用设备自带麦克风进行本地音频采集。
ByteRTCAudioScenarioHighqualityCommunication1高质量通话场景。

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

此场景下,更倾向于使用媒体音量。由此,可能引起开关麦时音量突变。如不希望有此突变,请使用 ByteRTCAudioScenarioHighqualityChat。

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

音频采集播放设备和采集播放状态,到音量类型的映射如下:







不采集音频采集音频备注
设备自带麦克风和扬声器媒体音量通话音量/
听筒媒体音量通话音量/
有线耳机/ USB 耳机/ 外置声卡媒体音量媒体音量/
蓝牙耳机通话音量通话音量能够使用蓝牙耳机上自带的麦克风进行音频采集。
ByteRTCAudioScenarioCommunication2纯通话音量场景。
此场景下,无论客户端音频路由情况和发布订阅状态,全程使用通话音量。
适用于需要频繁上下麦的通话或会议场景。
此场景可以保持统一的音频模式,不会有音量突变的听感;
最大程度地消除回声,使通话清晰度达到最优;
使用蓝牙耳机时,能够使用蓝牙耳机上自带的麦克风进行音频采集。
但是,会压低使用媒体音量进行播放的其他音频的音量,且音质会变差。
ByteRTCAudioScenarioMedia3纯媒体场景。一般不建议使用。
此场景下,无论客户端音频采集播放设备和采集播放状态,全程使用媒体音量。
外放通话时,可能出现回声和啸叫,请联系技术支持人员。
ByteRTCAudioScenarioGameStreaming4游戏媒体场景。
若外放通话且无游戏音效消除优化时音质不理想,请联系技术支持人员。
音频采集播放设备和采集播放状态,到音量类型的映射如下:







不采集音频采集音频备注
设备自带麦克风和扬声器媒体音量媒体音量/
听筒媒体音量媒体音量/
有线耳机/ USB 耳机/ 外置声卡媒体音量媒体音量/
蓝牙耳机通话音量通话音量能够使用蓝牙耳机上自带的麦克风进行音频采集。
ByteRTCAudioScenarioHighqualityChat5高质量畅聊场景。

此场景和 ByteRTCAudioScenarioHighqualityCommunication 高度类似,唯一的差异在于:此场景下,在使用设备自带的麦克风和扬声器/听筒进行通话时,开关麦始终采用通话音量,不会引起音量类型突变。

音频采集播放设备和采集播放状态,到音量类型的映射如下:







不采集音频采集音频备注
设备自带麦克风和扬声器通话音量通话音量/
听筒通话音量通话音量/
有线耳机/ USB 耳机/ 外置声卡媒体音量媒体音量/
蓝牙耳机通话音量通话音量能够使用蓝牙耳机上自带的麦克风进行音频采集。
ByteRTCVoiceChangerType
typedef NS_ENUM(NSInteger, ByteRTCVoiceChangerType)
objectivec

变声特效类型。如需更多类型,联系技术支持。

枚举值
类型值说明
ByteRTCVoiceChangerOriginal0原声,不含特效
ByteRTCVoiceChangerGiant1巨人
ByteRTCVoiceChangerChipmunk2花栗鼠
ByteRTCVoiceChangerMinionst3小黄人
ByteRTCVoiceChangerVibrato4颤音
ByteRTCVoiceChangerRobot5机器人
ByteRTCVoiceReverbType
typedef NS_ENUM(NSInteger, ByteRTCVoiceReverbType)
objectivec

混响特效类型

枚举值
类型值说明
ByteRTCVoiceReverbOriginal0原声,不含特效
ByteRTCVoiceReverbEcho1回声
ByteRTCVoiceReverbConcert2演唱会
ByteRTCVoiceReverbEthereal3空灵
ByteRTCVoiceReverbKTV4KTV
ByteRTCVoiceReverbStudio5录音棚
ByteRTCVoiceReverbVirtualStereo6虚拟立体声
ByteRTCVoiceReverbSpacious7空旷
ByteRTCVoiceReverb3D83D人声
ByteRTCBandFrequency
typedef NS_ENUM(NSInteger, ByteRTCBandFrequency)
objectivec

音频均衡效果。

枚举值
类型值说明
ByteRTCBandFrequency310中心频率为 31Hz 的频带。
ByteRTCBandFrequency621中心频率为 62Hz 的频带。
ByteRTCBandFrequency1252中心频率为 125Hz 的频带。
ByteRTCBandFrequency2503中心频率为 250Hz 的频带。
ByteRTCBandFrequency5004中心频率为 500Hz 的频带。
ByteRTCBandFrequency1k5中心频率为 1kHz 的频带。
ByteRTCBandFrequency2k6中心频率为 2kHz 的频带。
ByteRTCBandFrequency4k7中心频率为 4kHz 的频带。
ByteRTCBandFrequency8k8中心频率为 8kHz 的频带。
ByteRTCBandFrequency16k9中心频率为 16kHz 的频带。
ByteRTCVoiceEqualizationConfig
@interface ByteRTCVoiceEqualizationConfig : NSObject
objectivec

语音均衡效果。

成员变量
类型名称
ByteRTCBandFrequencyfrequency
intgain
变量说明

frequency
@property(assign, nonatomic) ByteRTCBandFrequency frequency;
objectivec

频带。参看 ByteRTCBandFrequency。

gain
@property(assign, nonatomic) int gain;
objectivec

频带增益(dB)。取值范围是 [-15, 15]。

ByteRTCVoiceReverbConfig
@interface ByteRTCVoiceReverbConfig : NSObject
objectivec

音频混响效果。

成员变量
类型名称
floatroomSize
floatdecayTime
floatdamping
floatwetGain
floatdryGain
floatpreDelay
变量说明

roomSize
@property(assign, nonatomic) float roomSize;
objectivec

混响模拟的房间大小,取值范围 [0.0, 100.0]。默认值为 50.0f。房间越大,混响越强。

decayTime
@property(assign, nonatomic) float decayTime;
objectivec

混响的拖尾长度,取值范围 [0.0, 100.0]。默认值为 50.0f。

damping
@property(assign, nonatomic) float damping;
objectivec

混响的衰减阻尼大小,取值范围 [0.0, 100.0]。默认值为 50.0f。

wetGain
@property(assign, nonatomic) float wetGain;
objectivec

早期反射信号强度。取值范围 [-20.0, 10.0],单位为 dB。默认值为 0.0f。

dryGain
@property(assign, nonatomic) float dryGain;
objectivec

原始信号强度。取值范围 [-20.0, 10.0],单位为 dB。默认值为 0.0f。

preDelay
@property(assign, nonatomic) float preDelay;
objectivec

早期反射信号的延迟。取值范围 [0.0, 200.0],单位为 ms。默认值为 0.0f。

ByteRTCAudioProfileType
typedef NS_ENUM(NSInteger, ByteRTCAudioProfileType)
objectivec

音质档位

枚举值
类型值说明
ByteRTCAudioProfileDefault0默认音质

服务器下发或客户端已设置的 ByteRTCRoomProfile 的音质配置
ByteRTCAudioProfileFluent1流畅

单声道,采样率为 16 kHz,编码码率为 32 Kbps。

流畅优先、低功耗、低流量消耗,适用于大部分游戏场景,如小队语音、组队语音、国战语音等。
ByteRTCAudioProfileStandard2单声道标准音质。

采样率为 24 kHz,编码码率为 48 Kbps。

适用于对音质有一定要求的场景,同时延时、功耗和流量消耗相对适中,适合教育场景和狼人杀等游戏。
ByteRTCAudioProfileHD3双声道音乐音质

采样率为 48 kHz,编码码率为 128 kbps。

超高音质,同时延时、功耗和流量消耗相对较大,适用于连麦 PK 等音乐场景。

游戏场景不建议使用。
ByteRTCAudioProfileStandardStereo4双声道标准音质。采样率为 48 KHz,编码码率最大值为 80 Kbps
ByteRTCAudioProfileHDMono5单声道音乐音质。采样率为 48 kHz,编码码率最大值为 64 Kbps
ByteRTCAnsMode
typedef NS_ENUM(NSInteger, ByteRTCAnsMode)
objectivec

降噪模式。降噪算法受调用 joinRoom:userInfo:roomConfig: 时设置的房间模式影响。

枚举值
类型值说明
ByteRTCAnsModeDisable0关闭所有音频降噪能力。
ByteRTCAnsModeLow1适用于微弱降噪。
ByteRTCAnsModeMedium2适用于抑制中度平稳噪声,如空调声和风扇声。
ByteRTCAnsModeHigh3适用于抑制嘈杂非平稳噪声,如键盘声、敲击声、碰撞声、动物叫声。
ByteRTCAnsModeAutomatic4启用音频降噪能力。具体的降噪算法由 RTC 智能决策。
ByteRTCAudioDeviceType
typedef NS_ENUM(NSInteger, ByteRTCAudioDeviceType)
objectivec

当前音频设备类型

枚举值
类型值说明
ByteRTCAudioDeviceTypeUnknown-1未知音频设备
ByteRTCAudioDeviceTypeRenderDevice0音频渲染设备
ByteRTCAudioDeviceTypeCaptureDevice1音频采集设备
ByteRTCAudioDeviceTypeScreenCaptureDevice2屏幕流音频设备
ByteRTCAudioSampleRate
typedef NS_ENUM(NSInteger, ByteRTCAudioSampleRate)
objectivec

音频采样率,单位为 Hz。

枚举值
类型值说明
ByteRTCAudioSampleRateAuto-1默认设置。48000Hz。
ByteRTCAudioSampleRate800080008000Hz
ByteRTCAudioSampleRate160001600016000Hz
ByteRTCAudioSampleRate320003200032000Hz
ByteRTCAudioSampleRate441004410044100Hz
ByteRTCAudioSampleRate480004800048000Hz
ByteRTCAudioChannel
typedef NS_ENUM(NSInteger, ByteRTCAudioChannel)
objectivec

音频声道。

枚举值
类型值说明
ByteRTCAudioChannelAuto-1默认设置。默认值为 2。
ByteRTCAudioChannelMono1单声道
ByteRTCAudioChannelStereo2双声道
ByteRTCTranscodingAudioCodec
typedef NS_ENUM(NSInteger, ByteRTCTranscodingAudioCodec)
objectivec

音频编码类型。

枚举值
类型值说明
ByteRTCTranscodingAudioCodecAAC0AAC 格式。
ByteRTCMixedStreamAudioCodecType
typedef NS_ENUM(NSInteger, ByteRTCMixedStreamAudioCodecType)
objectivec

音频编码类型。(新)

枚举值
类型值说明
ByteRTCMixedStreamAudioCodecTypeAAC0AAC 格式。
ByteRTCMixedStreamAudioProfile
typedef NS_ENUM(NSInteger, ByteRTCMixedStreamAudioProfile)
objectivec

AAC 编码规格。

枚举值
类型值说明
ByteRTCMixedStreamAudioProfileLC0AAC-LC 规格,默认值。
ByteRTCMixedStreamAudioProfileHEv11HE-AAC v1 规格。
ByteRTCMixedStreamAudioProfileHEv22HE-AAC v2 规格。
ByteRTCAACProfile
typedef NS_ENUM(NSInteger, ByteRTCAACProfile)
objectivec

AAC 编码规格。

枚举值
类型值说明
ByteRTCAACProfileLC0AAC-LC 规格,默认值。
ByteRTCAACProfileHEv11HE-AAC v1 规格。
ByteRTCAACProfileHEv22HE-AAC v2 规格。
ByteRTCAudioRoute
typedef NS_ENUM(NSInteger, ByteRTCAudioRoute)
objectivec

音频播放路由

枚举值
类型值说明
ByteRTCAudioRouteDefault-1默认设备。通过 setDefaultAudioRoute: 设置的音频路由。
ByteRTCAudioRouteHeadset1有线耳机
ByteRTCAudioRouteEarpiece2听筒。设备自带的,一般用于通话的播放硬件。
ByteRTCAudioRouteSpeakerphone3扬声器。设备自带的,一般用于免提播放的硬件。
ByteRTCAudioRouteHeadsetBluetooth4蓝牙耳机
ByteRTCAudioRouteHeadsetUSB5USB设备
ByteRTCAudioPlaybackDevice
typedef NS_ENUM(NSInteger, ByteRTCAudioPlaybackDevice)
objectivec

音频播放设备

音频设备变化时 SDK 通过 rtcEngine:onAudioPlaybackDeviceChanged: 回调当前音频播放设备。

枚举值
类型值说明
ByteRTCAudioPlaybackDeviceHeadset1有线耳机
ByteRTCAudioPlaybackDeviceEarpiece2听筒
ByteRTCAudioPlaybackDeviceSpeakerphone3扬声器
ByteRTCAudioPlaybackDeviceHeadsetBluetooth4蓝牙耳机
ByteRTCAudioPlaybackDeviceHeadsetUSB5USB设备
ByteRTCASRAuthorizationType
typedef NS_ENUM(NSInteger, ByteRTCASRAuthorizationType)
objectivec

语音识别服务鉴权方式,详情请咨询语音识别服务相关人员

枚举值
类型值说明
ByteRTCASRAuthorizationTypeToken0使用 token 不设置加密形式。
ByteRTCASRAuthorizationTypeSignature1带有 token 额外使用 signature 加密,此种加密形式需要额外传递 secret token 。
ByteRTCASRErrorCode
typedef NS_ENUM(NSInteger, ByteRTCASRErrorCode)
objectivec

语音识别服务错误码。

除网络原因导致的错误,语音识别服务内部会自行重试之外,其他错误都会停止服务,此时建议再次调用 startASR:handler: 重启语音识别功能。

枚举值
类型值说明
ByteRTCASRErrorNetworkInterrupted-1网络连接中断,服务不可用,内部会进行重连
ByteRTCASRErrorAlreadyStarted-2用户已经调用过 startASR:handler:。

开启语音识别服务后,你需要先调用 stopASR 停止语音识别服务,才能二次调用 startASR:handler: 再次开启服务。
ByteRTCASRErrorTokenEmpty-3语音识别服务所需 token 为空
ByteRTCErrorSignatureKeyEmpty-4Signature 鉴权模式下 secretKey 为空
ByteRTCASRErrorUserIdNull-5用户 ID 为空
ByteRTCASRErrorAPPIDNull-6应用 ID 为空
ByteRTCASRErrorClusterNull-7语音识别服务 cluster 为空
ByteRTCASRErrorOperationDenied-8语音识别服务连接失败,该版本没有语音识别功能,请联系 RTC 技术支持。
ByteRTCAudioMixingType
typedef NS_ENUM(NSInteger, ByteRTCAudioMixingType)
objectivec

混音播放类型

枚举值
类型值说明
ByteRTCAudioMixingTypePlayout0仅本地播放
ByteRTCAudioMixingTypePublish1仅远端播放
ByteRTCAudioMixingTypePlayoutAndPublish2本地和远端同时播放
ByteRTCAudioMixingDualMonoMode
typedef NS_ENUM(NSInteger, ByteRTCAudioMixingDualMonoMode)
objectivec

混音播放声道类型

枚举值
类型值说明
ByteRTCAudioMixingDualMonoModeAuto0和音频文件一致
ByteRTCAudioMixingDualMonoModeL1只能听到音频文件中左声道的音频
ByteRTCAudioMixingDualMonoModeR2只能听到音频文件中右声道的音频
ByteRTCAudioMixingDualMonoModeMix3能同时听到音频文件中左右声道的音频
ByteRTCAudioMixingState
typedef NS_ENUM(NSInteger, ByteRTCAudioMixingState)
objectivec

音频混音文件播放状态。

枚举值
类型值说明
ByteRTCAudioMixingStatePreloaded0混音已加载
ByteRTCAudioMixingStatePlaying1混音正在播放
ByteRTCAudioMixingStatePaused2混音暂停
ByteRTCAudioMixingStateStopped3混音停止
ByteRTCAudioMixingStateFailed4混音播放失败
ByteRTCAudioMixingStateFinished5混音播放结束
ByteRTCAudioMixingStatePCMEnabled6准备PCM混音
ByteRTCAudioMixingStatePCMDisabled7PCM混音播放结束
ByteRTCAudioMixingError
typedef NS_ENUM(NSInteger, ByteRTCAudioMixingError)
objectivec

混音错误码。

枚举值
类型值说明
ByteRTCAudioMixingErrorOk0正常
ByteRTCAudioMixingErrorPreloadFailed1预加载失败,找不到混音文件或者文件长度超出 20s
ByteRTCAudioMixingErrorStartFailed2混音开启失败,找不到混音文件或者混音文件打开失败
ByteRTCAudioMixingErrorIdNotFound3混音 ID 异常
ByteRTCAudioMixingErrorSetPositionFailed4设置混音文件的播放位置出错
ByteRTCAudioMixingErrorInValidVolume5音量参数不合法,仅支持设置的音量值为[0, 400]
ByteRTCAudioMixingErrorLoadConflict6播放的文件与预加载的文件不一致。请先使用 unloadAudioMixing: 卸载此前的文件。
ByteRTCAudioMixingErrorIdTypeNotMatch7不支持此混音类型。
ByteRTCAudioMixingErrorInValidPitch8设置混音文件的音调不合法
ByteRTCAudioMixingErrorInValidAudioTrack9设置混音文件的音轨不合法
ByteRTCAudioMixingErrorIsStarting10混音文件正在启动中
ByteRTCAudioMixingErrorInValidPlaybackSpeed11设置混音文件的播放速度不合法
ByteRTCAudioSourceType
typedef NS_ENUM(NSInteger, ByteRTCAudioSourceType)
objectivec

音频输入源类型

枚举值
类型值说明
ByteRTCAudioSourceTypeExternal0自定义采集音频源
ByteRTCAudioSourceTypeInternal1RTC SDK 内部采集音频源
ByteRTCAudioRenderType
typedef NS_ENUM(NSInteger, ByteRTCAudioRenderType)
objectivec

音频输出源类型

枚举值
类型值说明
ByteRTCAudioRenderTypeExternal0自定义渲染音频
ByteRTCAudioRenderTypeInternal1RTC SDK 内部渲染音频
ByteRTCEarMonitorMode
typedef NS_ENUM(NSInteger, ByteRTCEarMonitorMode)
objectivec

开启/关闭耳返功能。

枚举值
类型值说明
ByteRTCEarMonitorModeOff0关闭耳返功能。
ByteRTCEarMonitorModeOn1开启耳返功能。
ByteRTCAudioFrameCallbackMethod
typedef NS_ENUM(NSInteger, ByteRTCAudioFrameCallbackMethod)
objectivec

音频回调方法

枚举值
类型值说明
ByteRTCAudioFrameCallbackRecord0本地麦克风录制的音频数据回调
ByteRTCAudioFrameCallbackPlayback1订阅的远端所有用户混音后的音频数据回调
ByteRTCAudioFrameCallbackMixed2本地麦克风录制和订阅的远端所有用户混音后的音频数据回调
ByteRTCAudioFrameCallbackRemoteUser3订阅的远端每个用户混音前的音频数据回调
ByteRTCAudioFrameMethod
typedef NS_ENUM(NSInteger, ByteRTCAudioFrameMethod)
objectivec

返回给音频处理器的音频类型。

枚举值
类型值说明
ByteRTCAudioFrameProcessorRecord0本地采集的音频。
ByteRTCAudioFrameProcessorPlayback1远端音频流的混音音频。
ByteRTCAudioFrameProcessorRemoteUser2各个远端音频流。
ByteRTCAudioFrameProcessorScreen4屏幕共享音频。
ByteRTCAudioReportMode
typedef NS_ENUM(NSInteger, ByteRTCAudioReportMode)
objectivec

音量回调模式。

枚举值
类型值说明
ByteRTCAudioReportModeNormal0默认始终开启音量回调。
ByteRTCAudioReportModeDisconnect1可见用户进房并停止推流后,关闭音量回调。
ByteRTCAudioReportModeReset2可见用户进房并停止推流后,开启音量回调,回调值重置为0。
ByteRTCAudioPropertiesMode
typedef NS_ENUM(NSInteger, ByteRTCAudioPropertiesMode)
objectivec

rtcEngine:onLocalAudioPropertiesReport: 中包含的音频信息的范围。

枚举值
类型值说明
ByteRTCAudioPropertiesModeMicrohone0仅包含本地麦克风采集的音频数据和本地屏幕音频采集数据。
ByteRTCAudioPropertiesModeAudioMixing1包含以下信息:
+ 本地麦克风采集的音频数据和本地屏幕音频采集数据;
+ 本地混音的音频数据。
ByteRTCAudioVolumeInfo
@interface ByteRTCAudioVolumeInfo : NSObject
objectivec

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

成员变量
类型名称
NSString*uid
NSUIntegerlinearVolume
NSUIntegernonlinearVolume
变量说明

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

音频流来源的用户 ID

linearVolume
@property(assign, nonatomic) NSUInteger linearVolume;
objectivec

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

nonlinearVolume
@property(assign, nonatomic) NSUInteger nonlinearVolume;
objectivec

非线性音量,取值范围为:[-127,0]

ByteRTCAudioFormat
@interface ByteRTCAudioFormat : NSObject
objectivec

音频参数格式

成员变量
类型名称
ByteRTCAudioSampleRatesampleRate
ByteRTCAudioChannelchannel
变量说明

sampleRate
@property(nonatomic, assign) ByteRTCAudioSampleRate sampleRate;
objectivec

音频采样率,详见 ByteRTCAudioSampleRate

channel
@property(nonatomic, assign) ByteRTCAudioChannel channel;
objectivec

音频声道,详见 ByteRTCAudioChannel

ByteRTCAudioFrame
@interface ByteRTCAudioFrame : NSObject
objectivec

PCM 音频帧

成员变量
类型名称
NSData*buffer
intsamples
ByteRTCAudioChannelchannel
ByteRTCAudioSampleRatesampleRate
变量说明

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

PCM 数据

samples
@property(assign, nonatomic) int samples;
objectivec

采样点个数

channel
@property(assign, nonatomic) ByteRTCAudioChannel channel;
objectivec

音频声道,参看 ByteRTCAudioChannel。
双声道的情况下,左右声道的音频帧数据以 LRLRLR 形式排布。

sampleRate
@property(assign, nonatomic) ByteRTCAudioSampleRate sampleRate;
objectivec

采样率,参看 ByteRTCAudioSampleRate。

ByteRTCASRConfig
@interface ByteRTCASRConfig : NSObject
objectivec

使用自动语音识别服务所需校验信息

成员变量
类型名称
NSString*appId
NSString*userId
NSString*accessToken
NSString*secretKey
NSString*cluster
ByteRTCASRAuthorizationTypeauthorizationType
变量说明

appId
@property(copy, nonatomic) NSString *_Nonnull appId;
objectivec

应用 ID

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

用户 ID

accessToken
@property(copy, nonatomic) NSString *_Nonnull accessToken;
objectivec

访问令牌

secretKey
@property(copy, nonatomic) NSString *_Nonnull secretKey;
objectivec

私钥。Signature 鉴权模式下不能为空,token 鉴权模式下为空。参看关于鉴权

cluster
@property(copy, nonatomic) NSString *_Nonnull cluster;
objectivec

场景信息,参看业务集群

authorizationType
@property(assign, nonatomic) ByteRTCASRAuthorizationType authorizationType;
objectivec

鉴权模式,参看 ByteRTCASRAuthorizationType

ByteRTCAudioMixingConfig
@interface ByteRTCAudioMixingConfig : NSObject
objectivec

混音配置

成员变量
类型名称
ByteRTCAudioMixingTypetype
NSIntegerplayCount
NSIntegerposition
NSIntegercallbackOnProgressInterval
BOOLsyncProgressToRecordFrame
变量说明

type
@property(assign, nonatomic) ByteRTCAudioMixingType type;
objectivec

混音播放类型,详见 ByteRTCAudioMixingType

playCount
@property(assign, nonatomic) NSInteger playCount;
objectivec

混音播放次数

position
@property(assign, nonatomic) NSInteger position;
objectivec

混音时音频文件播放进度条位置,参数为整数,单位为毫秒

callbackOnProgressInterval
@property(assign, nonatomic) NSInteger callbackOnProgressInterval;
objectivec

设置音频文件播放进度回调的时间间隔,参数为为大于 0 的 10 的倍数,单位为毫秒,设置后 SDK 将按照设置的值触发 rtcEngine:onAudioMixingPlayingProgress:progress: 回调,默认不回调。

syncProgressToRecordFrame
@property(assign, nonatomic) BOOL syncProgressToRecordFrame;
objectivec

在采集音频数据时,附带本地混音文件播放进度的时间戳。启用此功能会提升远端人声和音频文件混音播放时的同步效果。

注意:

ByteRTCAudioPropertiesConfig
@interface ByteRTCAudioPropertiesConfig : NSObject
objectivec

音频属性信息提示的相关配置。

成员变量
类型名称
NSIntegerinterval
BOOLenable_spectrum
BOOLenable_vad
ByteRTCAudioReportModelocal_main_report_mode
floatsmooth
ByteRTCAudioPropertiesModeaudio_report_mode
变量说明

interval
@property(assign, nonatomic) NSInteger interval;
objectivec

信息提示间隔,单位:ms

enable_spectrum
@property(assign, nonatomic) BOOL enable_spectrum;
objectivec

是否开启音频频谱检测。

enable_vad
@property(assign, nonatomic) BOOL enable_vad;
objectivec

是否开启人声检测 (VAD)。

local_main_report_mode
@property(assign, nonatomic) ByteRTCAudioReportMode local_main_report_mode;
objectivec

音量回调模式。详见 ByteRTCAudioReportMode。

smooth
@property(nonatomic, assign) float smooth;
objectivec

适用于音频属性信息提示的平滑系数。取值范围是 (0.0, 1.0]。

默认值为 1.0,不开启平滑效果;值越小,提示音量平滑效果越明显。如果要开启平滑效果,可以设置为 0.3。

audio_report_mode
@property(assign, nonatomic) ByteRTCAudioPropertiesMode audio_report_mode;
objectivec

rtcEngine:onLocalAudioPropertiesReport: 中包含音频数据的范围。参看 ByteRTCAudioPropertiesMode。
默认仅包含本地麦克风采集的音频数据和本地屏幕音频采集数据。

ByteRTCAudioPropertiesInfo
@interface ByteRTCAudioPropertiesInfo : NSObject
objectivec

音频属性信息

成员变量
类型名称
NSIntegerlinearVolume
NSIntegernonlinearVolume
NSIntegervad
NSArray<NSNumber>**spectrum
变量说明

linearVolume
@property(assign, nonatomic) NSInteger linearVolume;
objectivec

线性音量,与原始音量呈线性关系,数值越大,音量越大。取值范围是:[0,255]。

nonlinearVolume
@property(assign, nonatomic) NSInteger nonlinearVolume;
objectivec

非线性音量。由原始音量的对数值转化而来,因此在中低音量时更灵敏,可以用作 Active Speaker(房间内最活跃用户)的识别。取值范围是:[-127,0],单位 dB。

vad
@property(assign, nonatomic) NSInteger vad;
objectivec

人声检测(VAD)结果

spectrum
@property(copy, nonatomic) NSArray<NSNumber*> * _Nonnull spectrum;
objectivec

频谱数组。默认长度为 257。

ByteRTCLocalAudioPropertiesInfo
@interface ByteRTCLocalAudioPropertiesInfo : NSObject
objectivec

本地音频属性信息

成员变量
类型名称
ByteRTCStreamIndexstreamIndex
ByteRTCAudioPropertiesInfo*audioPropertiesInfo
变量说明

streamIndex
@property(assign, nonatomic) ByteRTCStreamIndex streamIndex;
objectivec

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

audioPropertiesInfo
@property(strong, nonatomic) ByteRTCAudioPropertiesInfo *_Nonnull audioPropertiesInfo;
objectivec

音频属性信息,详见 ByteRTCAudioPropertiesInfo

ByteRTCRemoteAudioPropertiesInfo
@interface ByteRTCRemoteAudioPropertiesInfo : NSObject
objectivec

远端音频属性信息

成员变量
类型名称
ByteRTCRemoteStreamKey*streamKey
ByteRTCAudioPropertiesInfo*audioPropertiesInfo
变量说明

streamKey
@property(strong, nonatomic) ByteRTCRemoteStreamKey *_Nonnull streamKey;
objectivec

远端流信息,详见 ByteRTCRemoteStreamKey

audioPropertiesInfo
@property(strong, nonatomic) ByteRTCAudioPropertiesInfo *_Nonnull audioPropertiesInfo;
objectivec

音频属性信息,详见 ByteRTCAudioPropertiesInfo

Position
@interface Position : NSObject
objectivec

本地用户在房间内的位置坐标,需自行建立空间直角坐标系

成员变量
类型名称
floatx
floaty
floatz
变量说明

x
@property(nonatomic, assign) float x;
objectivec

x 坐标

y
@property(nonatomic, assign) float y;
objectivec

y 坐标

z
@property(nonatomic, assign) float z;
objectivec

z 坐标

Orientation
@interface Orientation : NSObject
objectivec

方向朝向信息

成员变量
类型名称
floatx
floaty
floatz
变量说明

x
@property(nonatomic, assign) float x;
objectivec

x 坐标

y
@property(nonatomic, assign) float y;
objectivec

y 坐标

z
@property(nonatomic, assign) float z;
objectivec

z 坐标

HumanOrientation
@interface HumanOrientation : NSObject
objectivec

三维朝向信息,三个向量需要两两垂直。参看 Orientation。

成员变量
类型名称
Orientation*forward
Orientation*right
Orientation*up
变量说明

forward
@property(nonatomic, strong) Orientation* _Nonnull forward;
objectivec

正前方朝向,默认值为 {1,0,0},即正前方朝向 x 轴正方向

@property(nonatomic, strong) Orientation* _Nonnull right;
objectivec

正右方朝向,默认值为 {0,1,0},即右手朝向 y 轴正方向

up
@property(nonatomic, strong) Orientation* _Nonnull up;
objectivec

正上方朝向,默认值为 {0,0,1},即头顶朝向 z 轴正方向

ByteRTCMulDimSingScoringMode
typedef NS_ENUM(NSInteger, ByteRTCMulDimSingScoringMode)
objectivec

K 歌打分维度。

枚举值
类型值说明
ByteRTCMulDimSingScoringModeNote0按照音高进行评分。
ByteRTCAudioAlignmentMode
typedef NS_ENUM(NSInteger, ByteRTCAudioAlignmentMode)
objectivec

远端音频流精准对齐模式

枚举值
类型值说明
ByteRTCAudioAlignmentModeOff0不对齐
ByteRTCAudioAlignmentModeAudioMixing1远端音频流都对齐伴奏进度同步播放
ByteRTCSingScoringRealtimeInfo
@interface ByteRTCSingScoringRealtimeInfo : NSObject
objectivec

实时评分信息。

成员变量
类型名称
intcurrentPosition
intuserPitch
intstandardPitch
intsentenceIndex
intsentenceScore
inttotalScore
intaverageScore
变量说明

currentPosition
@property(nonatomic, assign) int currentPosition;
objectivec

当前的播放进度。

userPitch
@property(nonatomic, assign) int userPitch;
objectivec

演唱者的音高。

standardPitch
@property(nonatomic, assign) int standardPitch;
objectivec

标准音高。

sentenceIndex
@property(nonatomic, assign) int sentenceIndex;
objectivec

歌词分句索引。

sentenceScore
@property(nonatomic, assign) int sentenceScore;
objectivec

上一句歌词的评分。

totalScore
@property(nonatomic, assign) int totalScore;
objectivec

当前演唱的累计分数。

averageScore
@property(nonatomic, assign) int averageScore;
objectivec

当前演唱的平均分数。

ByteRTCStandardPitchInfo
@interface ByteRTCStandardPitchInfo : NSObject
objectivec

标准音高数据组。

成员变量
类型名称
intstartTime
intduration
intpitch
变量说明

startTime
@property(nonatomic, assign) int startTime;
objectivec

开始时间,单位 ms。

duration
@property(nonatomic, assign) int duration;
objectivec

持续时间,单位 ms。

pitch
@property(nonatomic, assign) int pitch;
objectivec

音高。

ByteRTCSingScoringConfig
@interface ByteRTCSingScoringConfig : NSObject
objectivec

K 歌评分配置。

成员变量
类型名称
ByteRTCMulDimSingScoringModemode
ByteRTCAudioSampleRatesampleRate
NSString*lyricsFilepath
NSString*midiFilepath
变量说明

mode
@property(nonatomic, assign) ByteRTCMulDimSingScoringMode mode;
objectivec

打分维度,详见 ByteRTCMulDimSingScoringMode。

sampleRate
@property(nonatomic, assign) ByteRTCAudioSampleRate sampleRate;
objectivec

音频采样率。仅支持 44100 Hz、48000 Hz。

lyricsFilepath
@property(nonatomic, copy) NSString *_Nonnull lyricsFilepath;
objectivec

歌词文件路径。打分功能仅支持 KRC 歌词文件。

midiFilepath
@property(nonatomic, copy) NSString *_Nonnull midiFilepath;
objectivec

歌曲 midi 文件路径。

ByteRTCAudioFrameSource
typedef NS_ENUM(NSInteger, ByteRTCAudioFrameSource)
objectivec

音频文件录制内容来源。

枚举值
类型值说明
ByteRTCAudioFrameSourceTypeMic0本地麦克风采集的音频数据。
ByteRTCAudioFrameSourceTypePlayback1远端所有用户混音后的数据
ByteRTCAudioFrameSourceTypeMixed2本地麦克风和所有远端用户音频流的混音后的数据
ByteRTCAudioQuality
typedef NS_ENUM(NSInteger, ByteRTCAudioQuality)
objectivec

音频质量

枚举值
类型值说明
ByteRTCAudioQualityLow0低音质
ByteRTCAudioQualityMedium1中音质
ByteRTCAudioQualityHigh2高音质
ByteRTCAudioQualityUltraHigh3超高音质
ByteRTCAudioRecordingConfig
@interface ByteRTCAudioRecordingConfig : NSObject
objectivec

音频录制配置

成员变量
类型名称
NSString*absoluteFileName
ByteRTCAudioFrameSourceframeSource
ByteRTCAudioSampleRatesampleRate
ByteRTCAudioChannelchannel
ByteRTCAudioQualityquality
变量说明

absoluteFileName
@property(nonatomic, copy) NSString* _Nonnull absoluteFileName;
objectivec

录制文件路径。一个有读写权限的绝对路径,包含文件名和文件后缀。

注意:
录制文件的格式仅支持 .aac 和 .wav。
录制文件的格式仅支持 .aac 和 .wav。

frameSource
@property(nonatomic, assign) ByteRTCAudioFrameSource frameSource;
objectivec

录音内容来源,参看 ByteRTCAudioFrameSource。

sampleRate
@property(nonatomic, assign) ByteRTCAudioSampleRate sampleRate;
objectivec

录音采样率。参看 ByteRTCAudioSampleRate。

channel
@property(nonatomic, assign) ByteRTCAudioChannel channel;
objectivec

录音音频声道。参看 ByteRTCAudioChannel。
如果录制时设置的的音频声道数与采集时的音频声道数不同:

quality
@property(nonatomic, assign) ByteRTCAudioQuality quality;
objectivec

录音音质。仅在录制文件格式为 .aac 时可以设置。参看 ByteRTCAudioQuality。

注意:
采样率为 32kHz 时,不同音质录制文件(时长为 10min)的大小分别是: + 低音质:1.2MB;

采样率为 32kHz 时,不同音质录制文件(时长为 10min)的大小分别是: + 低音质:1.2MB;

ByteRTCAudioRecordingState
typedef NS_ENUM(NSInteger, ByteRTCAudioRecordingState)
objectivec

录音配置

枚举值
类型值说明
ByteRTCAudioRecordingStateError0录制异常
ByteRTCAudioRecordingStateProcessing1录制进行中
ByteRTCAudioRecordingStateSuccess2已结束录制,并且录制文件保存成功。
ByteRTCAudioEnhancementConfig
@interface ByteRTCAudioEnhancementConfig: NSObject
objectivec

蜂窝网络辅助增强应用的媒体模式

成员变量
类型名称
BOOLenhanceSignaling
BOOLenhanceAudio
变量说明

enhanceSignaling
@property (assign, nonatomic) BOOL enhanceSignaling;
objectivec

对信令消息,是否启用蜂窝网络辅助增强。默认不启用。

enhanceAudio
@property (assign, nonatomic) BOOL enhanceAudio;
objectivec

对音频,是否启用蜂窝网络辅助增强。默认不启用。

ByteRTCPositionInfo
@interface ByteRTCPositionInfo : NSObject
objectivec

用户在空间音频坐标系里的位置信息。

成员变量
类型名称
Position*position
HumanOrientation*orientation
变量说明

position
@property(strong, nonatomic) Position *_Nonnull position;
objectivec

用户在空间音频坐标系里的位置,需自行建立空间直角坐标系。参看 Position。

orientation
@property(strong, nonatomic) HumanOrientation *_Nonnull orientation;
objectivec

用户在空间音频坐标系里的三维朝向信息。三个向量需要两两垂直。参看 HumanOrientation。

ByteRTCReturnStatus
typedef NS_ENUM(NSInteger, ByteRTCReturnStatus)
objectivec

方法调用结果。

枚举值
类型值说明
ByteRTCReturnStatusSuccess0成功。
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 无效。
ByteRTCStreamRemoveReason
typedef NS_ENUM(NSInteger, ByteRTCStreamRemoveReason)
objectivec

房间内远端流移除原因。

枚举值
类型值说明
ByteRTCStreamRemoveReasonUnpublish0远端用户停止发布流。
ByteRTCStreamRemoveReasonPublishFailed1远端用户发布流失败。
ByteRTCStreamRemoveReasonKeepLiveFailed2保活失败。
ByteRTCStreamRemoveReasonClientDisconnected3远端用户断网。
ByteRTCStreamRemoveReasonRepublish4远端用户重新发布流。
ByteRTCStreamRemoveReasonOther5其他原因。
ByteRTCStreamRemoveReasonPublishPrivilegeExpired6远端用户 Token 发布权限过期。
ByteRTCRoomProfile
typedef NS_ENUM(NSInteger, ByteRTCRoomProfile)
objectivec

房间模式

根据所需场景,选择合适的房间模式,应用不同的音视频算法、视频参数和网络配置

调用 setAudioProfile 改变音频参数配置

枚举值
类型值说明
ByteRTCRoomProfileCommunication0默认场景,通用模式

与 ByteRTCRoomProfileMeeting = 16 配置相同。

你可以联系技术支持更换默认配置参数。
ByteRTCRoomProfileGame2游戏语音模式,低功耗、低流量消耗。

低端机在此模式下运行时,进行了额外的性能优化:

+ 部分低端机型配置编码帧长 40/60

+ 部分低端机型关闭软件 3A 音频处理

增强对 iOS 其他屏幕录制进行的兼容性,避免音频录制被 RTC 打断。
ByteRTCRoomProfileCloudGame3云游戏模式。

如果你的游戏场景需要低延迟的配置,使用此设置。

此设置下,弱网抗性较差。
ByteRTCRoomProfileLowLatency4云渲染模式。超低延时配置。

如果你的应用并非游戏但又对延时要求较高时,选用此模式

该模式下,音视频通话延时会明显降低,但同时弱网抗性、通话音质等均会受到一定影响。
ByteRTCRoomProfileChat5适用于 1 vs 1 音视频通话
ByteRTCRoomProfileChatRoom6适用于 3 人及以上纯语音通话。

通话中,闭麦时为是媒体模式,上麦后切换为通话模式。
ByteRTCRoomProfileLwTogether7实现多端同步播放音视频,适用于 “一起看” 或 “一起听” 场景。

该场景中,使用 RTC 信令同步播放进度,共享的音频内容不通过 RTC 进行传输。
ByteRTCRoomProfileGameHD8适用于对音质要求较高的游戏场景,优化音频 3A 策略,只通过媒体模式播放音频
ByteRTCRoomProfileCoHost9适用于直播中主播之间连麦的业务场景。

该场景中,直播时通过 CDN,发起连麦 PK 时使用 RTC。
ByteRTCRoomProfileInteractivePodcast10适用于单主播和观众进行音视频互动的直播。通话模式,上下麦不会有模式切换,避免音量突变现象
ByteRTCRoomProfileKTV11线上 KTV 场景,音乐音质,低延迟

使用 RTC 传输伴奏音乐,混音后的歌声,适合独唱或单通合唱
ByteRTCRoomProfileChorus12适合在线实时合唱场景,高音质,超低延迟。使用本配置前请联系技术支持进行协助完成其他配置。
ByteRTCRoomProfileVRChat13适用于 VR 场景。支持最高 192 KHz 音频采样率,可开启球形立体声。345之后支持
ByteRTCRoomProfileGameStreaming14适用于 1 vs 1 游戏串流,支持公网或局域网。
ByteRTCRoomProfileLanLiveStreaming15适用于局域网的 1 对多视频直播,最高支持 8K, 60 帧/秒, 100 Mbps 码率

需要在局域网配置私有化部署媒体服务器。
ByteRTCRoomProfileMeeting16适用于云端会议中的个人设备
ByteRTCRoomProfileMeetingRoom17适用于云端会议中的会议室终端设备,例如 Rooms,投屏盒子等。
ByteRTCRoomProfileClassroom18适用于课堂互动,房间内所有成员都可以进行音视频互动

当你的场景中需要同时互动的成员超过 10人时使用此模式
[deprecated] ByteRTCRoomProfileLiveBroadcasting1直播模式。

当你对音视频通话的音质和画质要求较高时,应使用此设置。

此设置下,当用户使用蓝牙耳机收听时,蓝牙耳机使用媒体模式。
ByteRTCDataMessageSourceType
typedef NS_ENUM(NSInteger, ByteRTCDataMessageSourceType)
objectivec

数据消息来源

枚举值
类型值说明
ByteRTCDataMessageSourceTypeDefault0通过客户端或服务端的插入的自定义消息。
ByteRTCDataMessageSourceTypeSystem1系统数据,包含音量指示信息。
ByteRTCSEICountPerFrame
typedef NS_ENUM(NSInteger, ByteRTCSEICountPerFrame)
objectivec

SEI 发送模式。

枚举值
类型值说明
kSingleSEIPerFrame0单发模式。即在 1 帧间隔内多次发送 SEI 数据时,多个 SEI 按队列逐帧发送。
kMultiSEIPerFrame1多发模式。即在 1 帧间隔内多次发送 SEI 数据时,多个 SEI 随下个视频帧同时发送。
ByteRTCSubscribeState
typedef NS_ENUM(NSInteger, ByteRTCSubscribeState)
objectivec

订阅媒体流状态

枚举值
类型值说明
ByteRTCSubscribeStateSuccess0订阅/取消订阅流成功
ByteRTCSubscribeStateFailedNotInRoom1订阅/取消订阅流失败,本地用户未在房间中
ByteRTCSubscribeStateFailedStreamNotFound2订阅/取消订阅流失败,房间内未找到指定的音视频流
ByteRTCSubscribeStateFailedOverLimit3超过订阅流数上限
ByteRTCPerformanceAlarmReason
typedef NS_ENUM(NSInteger, ByteRTCPerformanceAlarmReason)
objectivec

性能相关告警的原因

枚举值
类型值说明
ByteRTCPerformanceAlarmReasonBandwidthFallback0网络原因差,造成了发送性能回退。仅在开启发送性能回退时,会收到此原因。
ByteRTCPerformanceAlarmReasonBandwidthResumed1网络性能恢复,发送性能回退恢复。仅在开启发送性能回退时,会收到此原因。
ByteRTCPerformanceAlarmReasonFallback2如果未开启发送性能回退,收到此告警时,意味着性能不足;

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

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

性能回退的模式

枚举值
类型值说明
ByteRTCPerformanceAlarmModeNormal0未开启发布性能回退
ByteRTCPerformanceAlarmModeSimulcast1已开启发布性能回退
ByteRTCPublishFallbackOption
typedef NS_ENUM(NSUInteger, ByteRTCPublishFallbackOption)
objectivec

发布端音视频流回退选项

枚举值
类型值说明
ByteRTCPublishFallbackOptionDisabled0上行网络不佳或设备性能不足时,不对音视频流作回退处理。默认设置。
ByteRTCPublishFallbackOptionSimulcast1上行网络不佳或设备性能不足时,发布的视频流会从大流到小流依次降级,直到与当前网络性能匹配,具体降级规则参看性能回退文档。
ByteRTCSubscribeFallbackOption
typedef NS_ENUM(NSUInteger, ByteRTCSubscribeFallbackOption)
objectivec

订阅端音视频流回退选项。

枚举值
类型值说明
ByteRTCSubscribeFallbackOptionDisabled0下行网络不佳或设备性能不足时,不对音视频流作回退处理。默认设置。
ByteRTCSubscribeFallbackOptionVideoStreamLow1下行网络不佳或设备性能不足时,对视频流做降级处理,具体降级规则参看音视频流回退。

该设置仅对发布端调用 enableSimulcastMode: 开启发送多路流功能的情况生效。
ByteRTCSubscribeFallbackOptionAudioOnly2下行网络不佳或设备性能不足时,先对视频流做回退处理。当网络状况不满足接收弱流时,则自动取消接收视频,仅接收音频。

该设置仅对发布端调用 enableSimulcastMode: 开启发送多路流功能的情况生效。
ByteRTCRemoteUserPriority
typedef NS_ENUM(NSUInteger, ByteRTCRemoteUserPriority)
objectivec

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

枚举值
类型值说明
ByteRTCRemoteUserPriorityLow0用户优先级为低,默认值
ByteRTCRemoteUserPriorityMedium100用户优先级为正常
ByteRTCRemoteUserPriorityHigh200用户优先级为高
ByteRTCFallbackOrRecoverReason
typedef NS_ENUM(NSInteger, ByteRTCFallbackOrRecoverReason)
objectivec

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

枚举值
类型值说明
ByteRTCFallbackOrRecoverReasonUnknown-1其他原因,非带宽和性能原因引起的回退或恢复。默认值
ByteRTCFallbackOrRecoverReasonSubscribeFallbackByBandwidth0由带宽不足导致的订阅端音视频流回退。
ByteRTCFallbackOrRecoverReasonSubscribeFallbackByPerformance1由性能不足导致的订阅端音视频流回退。
ByteRTCFallbackOrRecoverReasonSubscribeRecoverByBandwidth2由带宽恢复导致的订阅端音视频流恢复。
ByteRTCFallbackOrRecoverReasonSubscribeRecoverByPerformance3由性能恢复导致的订阅端音视频流恢复。
ByteRTCFallbackOrRecoverReasonPublishFallbackByBandwidth4由带宽不足导致的发布端音视频流回退。
ByteRTCFallbackOrRecoverReasonPublishFallbackByPerformance5由性能不足导致的发布端音视频流回退。
ByteRTCFallbackOrRecoverReasonPublishRecoverByBandwidth6由带宽恢复导致的发布端音视频流恢复。
ByteRTCFallbackOrRecoverReasonPublishRecoverByPerformance7由性能恢复导致的发布端音视频流恢复。
ByteRTCLocalAudioStreamState
typedef NS_ENUM(NSInteger, ByteRTCLocalAudioStreamState)
objectivec

本地音频流状态。

枚举值
类型值说明
ByteRTCLocalAudioStreamStateStopped0本地音频默认初始状态。
麦克风停止工作时回调该状态,对应错误码 ByteRTCLocalAudioStreamError 中的 ByteRTCLocalAudioStreamErrorOk
ByteRTCLocalAudioStreamStateRecording1本地音频录制设备启动成功。
采集到音频首帧时回调该状态,对应错误码 ByteRTCLocalAudioStreamError 中的 ByteRTCLocalAudioStreamErrorOk
ByteRTCLocalAudioStreamStateEncoding2本地音频首帧编码成功。
音频首帧编码成功时回调该状态,对应错误码 ByteRTCLocalAudioStreamError 中的 ByteRTCLocalAudioStreamErrorOk
ByteRTCLocalAudioStreamStateFailed3本地音频启动失败,在以下时机回调该状态:

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

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

+ 音频编码失败,对应错误码 ByteRTCLocalAudioStreamError 中的 ByteRTCLocalAudioStreamError
ByteRTCLocalAudioStreamError
typedef NS_ENUM(NSInteger, ByteRTCLocalAudioStreamError)
objectivec

本地音频流状态改变时的错误码。

枚举值
类型值说明
ByteRTCLocalAudioStreamErrorOk0本地音频状态正常
ByteRTCLocalAudioStreamErrorFailure1本地音频出错原因未知
ByteRTCLocalAudioStreamErrorDeviceNoPermission2没有权限启动本地音频录制设备
ByteRTCLocalAudioStreamErrorRecordFailure4本地音频录制失败,建议你检查录制设备是否正常工作
ByteRTCLocalAudioStreamErrorEncodeFailure5本地音频编码失败
ByteRTCLocalAudioStreamErrorNoRecordingDevice6没有可用的音频录制设备
ByteRTCLocalVideoStreamState
typedef NS_ENUM(NSInteger, ByteRTCLocalVideoStreamState)
objectivec

本地视频流状态

枚举值
类型值说明
ByteRTCLocalVideoStreamStateStopped0本地视频默认初始状态
摄像头停止工作时回调该状态,对应错误码 ByteRTCLocalVideoStreamError 中的 ByteRTCLocalVideoStreamErrorOk
ByteRTCLocalVideoStreamStateRecording1本地视频录制设备启动成功
采集到视频首帧时回调该状态,对应错误码 ByteRTCLocalVideoStreamError 中的 ByteRTCLocalVideoStreamErrorOk
ByteRTCLocalVideoStreamStateEncoding2本地视频首帧编码成功
本地视频首帧编码成功时回调该状态,对应错误码 ByteRTCLocalVideoStreamError 中的 ByteRTCLocalVideoStreamErrorOk
ByteRTCLocalVideoStreamStateFailed3本地视频启动失败, 在以下时机回调该状态:

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

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

+ 视频编码失败,对应错误码 ByteRTCLocalVideoStreamError 中的 ByteRTCLocalVideoStreamErrorEncodeFailure
ByteRTCLocalVideoStreamError
typedef NS_ENUM(NSInteger, ByteRTCLocalVideoStreamError)
objectivec

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

枚举值
类型值说明
ByteRTCLocalVideoStreamErrorOk0本地视频状态正常(本地视频状态改变正常时默认返回值)
ByteRTCLocalVideoStreamErrorFailure1本地视频流发布失败
ByteRTCLocalVideoStreamErrorDeviceNoPermission2没有权限启动本地视频采集设备
ByteRTCLocalVideoStreamErrorDeviceBusy3本地视频采集设备已被占用
ByteRTCLocalVideoStreamErrorDeviceNotFound4本地视频采集设备不存在或已移除
ByteRTCLocalVideoStreamErrorCaptureFailure5本地视频采集失败,建议检查采集设备是否正常工作
ByteRTCLocalVideoStreamErrorEncodeFailure6本地视频编码失败
ByteRTCLocalVideoStreamErrorDeviceDisconnected7通话过程中本地视频采集设备被其他程序抢占,导致设备连接中断
ByteRTCRemoteAudioState
typedef NS_ENUM(NSInteger, ByteRTCRemoteAudioState)
objectivec

用户订阅的远端音频流状态。

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

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

+ 远端用户停止发送音频流,对应原因是 ByteRTCRemoteAudioStateChangeReason 中的 ByteRTCRemoteAudioStateChangeReasonRemoteMuted

+ 远端用户离开房间,对应原因是 ByteRTCRemoteAudioStateChangeReason 中的 ByteRTCRemoteAudioStateChangeReasonRemoteOffline
ByteRTCRemoteAudioStateStarting1开始接收远端音频流首包。
ByteRTCRemoteAudioStateDecoding2远端音频流正在解码,正常播放,在以下时机回调该状态:

+ 成功解码远端音频首帧,对应原因是 ByteRTCRemoteAudioStateChangeReason 中的 ByteRTCRemoteAudioStateChangeReasonLocalUnmuted

+ 网络由阻塞恢复正常,对应原因是 ByteRTCRemoteAudioStateChangeReason 中的 ByteRTCRemoteAudioStateChangeReasonNetworkRecovery

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

+ 远端用户恢复发送音频流,对应原因是 ByteRTCRemoteAudioStateChangeReason 中的 ByteRTCRemoteAudioStateChangeReasonRemoteUnmuted
ByteRTCRemoteAudioStateFrozen3远端音频流卡顿。
ByteRTCRemoteAudioStateChangeReason
typedef NS_ENUM(NSInteger, ByteRTCRemoteAudioStateChangeReason)
objectivec

接收远端音频流状态改变的原因。

枚举值
类型值说明
ByteRTCRemoteAudioStateChangeReasonInternal0内部原因
ByteRTCRemoteAudioStateChangeReasonNetworkCongestion1网络阻塞
ByteRTCRemoteAudioStateChangeReasonNetworkRecovery2网络恢复正常
ByteRTCRemoteAudioStateChangeReasonLocalMuted3本地用户停止接收远端音频流
ByteRTCRemoteAudioStateChangeReasonLocalUnmuted4本地用户恢复接收远端音频流
ByteRTCRemoteAudioStateChangeReasonRemoteMuted5远端用户停止发送音频流
ByteRTCRemoteAudioStateChangeReasonRemoteUnmuted6远端用户恢复发送音频流
ByteRTCRemoteAudioStateChangeReasonRemoteOffline7远端用户离开房间
ByteRTCRemoteVideoState
typedef NS_ENUM(NSInteger, ByteRTCRemoteVideoState)
objectivec

远端视频流状态

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

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

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

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

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

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

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

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

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

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

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

枚举值
类型值说明
ByteRTCRemoteVideoStateChangeReasonInternal0内部原因
ByteRTCRemoteVideoStateChangeReasonNetworkCongestion1网络阻塞
ByteRTCRemoteVideoStateChangeReasonNetworkRecovery2网络恢复正常
ByteRTCRemoteVideoStateChangeReasonLocalMuted3本地用户停止接收远端视频流或本地用户禁用视频模块
ByteRTCRemoteVideoStateChangeReasonLocalUnmuted4本地用户恢复接收远端视频流或本地用户启用视频模块
ByteRTCRemoteVideoStateChangeReasonRemoteMuted5远端用户停止发送视频流或远端用户禁用视频模块
ByteRTCRemoteVideoStateChangeReasonRemoteUnmuted6远端用户恢复发送视频流或远端用户启用视频模块
ByteRTCRemoteVideoStateChangeReasonRemoteOffline7远端用户离开房间
ByteRTCMediaDeviceType
typedef NS_ENUM(NSInteger, ByteRTCMediaDeviceType)
objectivec

当前媒体设备类型

枚举值
类型值说明
ByteRTCMediaDeviceTypeAudioUnknown-1未知音频设备
ByteRTCMediaDeviceTypeAudioRenderDevice0音频渲染设备类型
ByteRTCMediaDeviceTypeAudioCaptureDevice1音频采集设备类型
ByteRTCMediaDeviceTypeVideoCaptureDevice3视频采集设备类型
ByteRTCMediaDeviceTypeScreenVideoCaptureDevice4屏幕流视频设备
ByteRTCMediaDeviceTypeScreenAudioCaptureDevice5屏幕流音频设备
ByteRTCMediaDeviceState
typedef NS_ENUM(NSInteger, ByteRTCMediaDeviceState)
objectivec

媒体设备状态

通过 rtcEngine:onAudioDeviceStateChanged:device_type:device_state:device_error: 或 rtcEngine:onVideoDeviceStateChanged:device_type:device_state:device_error: 回调设备状态。

枚举值
类型值说明
ByteRTCMediaDeviceStateStarted1设备已开启
ByteRTCMediaDeviceStateStopped2设备已停止
ByteRTCMediaDeviceStateRuntimeError3设备运行时错误

例如,当媒体设备的预期行为是正常采集,但没有收到采集数据时,将回调该状态。
ByteRTCMediaDeviceStateAdded10设备已插入
ByteRTCMediaDeviceStateRemoved11设备被移除
ByteRTCMediaDeviceStateInterruptionBegan12系统通话,锁屏或第三方应用打断了音视频通话。将在通话结束或第三方应用结束占用后自动恢复。
ByteRTCMediaDeviceStateInterruptionEnded13音视频通话已从系统电话或第三方应用打断中恢复
ByteRTCMediaDeviceError
typedef NS_ENUM(NSInteger, ByteRTCMediaDeviceError)
objectivec

媒体设备错误类型

枚举值
类型值说明
ByteRTCMediaDeviceErrorOK0媒体设备正常
ByteRTCMediaDeviceErrorDeviceNoPermission1没有权限启动媒体设备
ByteRTCMediaDeviceErrorDeviceBusy2媒体设备已经在使用中
ByteRTCMediaDeviceErrorDeviceFailure3媒体设备错误
ByteRTCMediaDeviceErrorDeviceNotFound4未找到指定的媒体设备
ByteRTCMediaDeviceErrorDeviceDisconnected5媒体设备被移除
ByteRTCMediaDeviceErrorDeviceNoCallback6无采集数据。当媒体设备的预期行为是正常采集,但没有收到采集数据时,将收到该错误。
ByteRTCMediaDeviceErrorUNSupportFormat7设备采样率不支持
ByteRTCMediaDeviceWarning
typedef NS_ENUM(NSInteger, ByteRTCMediaDeviceWarning)
objectivec

媒体设备警告

枚举值
类型值说明
ByteRTCMediaDeviceWarningOK0无警告
ByteRTCMediaDeviceWarningOperationDenied1非法设备操作。在使用外部设备时,调用了 SDK 内部设备 API。
ByteRTCMediaDeviceWarningCaptureSilence2采集到的数据为静音帧。
ByteRTCMediaDeviceWarningDetectLeakEcho11通话中出现回声现象。

当 ByteRTCRoomProfile 为 ByteRTCRoomProfileMeeting 和 ByteRTCRoomProfileMeetingRoom ,且 AEC 关闭时,SDK 自动启动回声检测,如果检测到回声问题,将通过 rtcEngine:onAudioDeviceWarning:deviceType:deviceWarning: 返回本枚举值。
ByteRTCMediaDeviceWarningCaptureDetectHowling16啸叫。触发该回调的情况如下:1)不支持啸叫抑制的房间模式下,检测到啸叫;2)支持啸叫抑制的房间模式下,检测到未被抑制的啸叫。
仅 ByteRTCRoomProfileCommunication、ByteRTCRoomProfileMeeting、ByteRTCRoomProfileMeetingRoom 三种房间模式支持啸叫抑制。
建议提醒用户检查客户端的距离或将麦克风和扬声器调至静音。
ByteRTCProblemFeedbackOption
typedef NS_OPTIONS(uint64_t, ByteRTCProblemFeedbackOption)
objectivec

音视频质量反馈问题类型

枚举值
类型值说明
ByteRTCProblemFeedbackOptionNone0没有问题
ByteRTCProblemFeedbackOptionOtherMessage(1ULL << 0)其他问题
ByteRTCProblemFeedbackOptionDisconnected(1ULL << 1)连接失败
ByteRTCProblemFeedbackOptionEarBackDelay(1ULL << 2)耳返延迟大
ByteRTCProblemFeedbackOptionLocalNoise(1ULL << 10)本端有杂音
ByteRTCProblemFeedbackOptionLocalAudioLagging(1ULL << 11)本端声音卡顿
ByteRTCProblemFeedbackOptionLocalNoAudio(1ULL << 12)本端无声音
ByteRTCProblemFeedbackOptionLocalAudioStrength(1ULL << 13)本端声音大/小
ByteRTCProblemFeedbackOptionLocalEcho(1ULL << 14)本端有回声
ByteRTCProblemFeedbackOptionLocalVideoFuzzy(1ULL << 24)本端视频模糊
ByteRTCProblemFeedbackOptionLocalNotSync(1ULL << 25)本端音视频不同步
ByteRTCProblemFeedbackOptionLocalVideoLagging(1ULL << 26)本端视频卡顿
ByteRTCProblemFeedbackOptionLocalNoVideo(1ULL << 27)本端无画面
ByteRTCProblemFeedbackOptionRemoteNoise(1ULL << 37)远端有杂音
ByteRTCProblemFeedbackOptionRemoteAudioLagging(1ULL << 38)远端声音卡顿
ByteRTCProblemFeedbackOptionRemoteNoAudio(1ULL << 39)远端无声音
ByteRTCProblemFeedbackOptionRemoteAudioStrength(1ULL << 40)远端声音大/小
ByteRTCProblemFeedbackOptionRemoteEcho(1ULL << 41)远端有回声
ByteRTCProblemFeedbackOptionRemoteVideoFuzzy(1ULL << 51)远端视频模糊
ByteRTCProblemFeedbackOptionRemoteNotSync(1ULL << 52)远端音视频不同步
ByteRTCProblemFeedbackOptionRemoteVideoLagging(1ULL << 53)远端视频卡顿
ByteRTCProblemFeedbackOptionRemoteNoVideo(1ULL << 54)远端无画面
ByteRTCProblemFeedbackRoomInfo
@interface ByteRTCProblemFeedbackRoomInfo: NSObject
objectivec

通话质量反馈房间信息

成员变量
类型名称
NSString*roomId
NSString*userId
变量说明

roomId
@property(nonatomic, copy) NSString * _Nonnull roomId;
objectivec

通话质量反馈的房间ID

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

通话质量反馈的用户ID

ByteRTCProblemFeedbackInfo
@interface ByteRTCProblemFeedbackInfo: NSObject
objectivec

通话质量反馈信息

成员变量
类型名称
NSString*problemDesc
NSArray<ByteRTCProblemFeedbackRoomInfo>**roomInfo
变量说明

problemDesc
@property(nonatomic, copy) NSString * _Nonnull problemDesc;
objectivec

通话质量反馈的文字描述

roomInfo
@property(nonatomic, strong) NSArray<ByteRTCProblemFeedbackRoomInfo *> * _Nullable roomInfo;
objectivec

通话质量反馈的房间信息。参看 ByteRTCProblemFeedbackRoomInfo。

ByteRTCFirstFrameSendState
typedef NS_ENUM(NSUInteger, ByteRTCFirstFrameSendState)
objectivec

首帧发送状态

枚举值
类型值说明
ByteRTCFirstFrameSendStateSending0发送中
ByteRTCFirstFrameSendStateSent1发送成功
ByteRTCFirstFrameSendStateEnd2发送失败
ByteRTCFirstFramePlayState
typedef NS_ENUM(NSUInteger, ByteRTCFirstFramePlayState)
objectivec

首帧播放状态

枚举值
类型值说明
ByteRTCFirstFramePlayStatePlaying0播放中
ByteRTCFirstFramePlayStatePlay1播放成功
ByteRTCFirstFramePlayStateEnd2播放失败
ByteRTCEncryptType
typedef NS_OPTIONS(NSUInteger, ByteRTCEncryptType)
objectivec

自定义加密类型

枚举值
类型值说明
ByteRTCEncryptTypeCustomize0不使用内置加密。默认值。
ByteRTCEncryptTypeAES128CBC1AES-128-CBC 加密算法
ByteRTCEncryptTypeAES256CBC2AES-256-CBC 加密算法
ByteRTCEncryptTypeAES128ECB3AES-128-ECB 加密算法
ByteRTCEncryptTypeAES256ECB4AES-256-ECB 加密算法
ByteRTCVideoCodecType
typedef NS_ENUM(NSInteger, ByteRTCVideoCodecType)
objectivec

视频编码类型

枚举值
类型值说明
ByteRTCVideoCodecTypeUnknown0未知类型
ByteRTCVideoCodecTypeH2641标准 H264 编码格式
ByteRTCVideoCodecTypeByteVC12ByteVC1 编码器
ByteRTCVideoDenoiseMode
typedef NS_ENUM(NSInteger, ByteRTCVideoDenoiseMode)
objectivec

视频降噪模式。

枚举值
类型值说明
ByteRTCVideoDenoiseModeOff0视频降噪关闭。
ByteRTCVideoDenoiseModeAuto1视频降噪开启,由 ByteRTC 后台配置视频降噪算法。
ByteRTCMuteState
typedef NS_ENUM(NSInteger, ByteRTCMuteState)
objectivec

音视频流的发送/播放状态

枚举值
类型值说明
ByteRTCMuteStateOff0发送
ByteRTCMuteStateOn1停止发送
ByteSEIStreamEventType
typedef NS_ENUM(NSInteger, ByteSEIStreamEventType)
objectivec

黑帧视频流状态

枚举值
类型值说明
ByteSEIStreamEventTypeStreamAdd0远端用户发布黑帧视频流。

纯语音通话场景下,远端用户调用 sendSEIMessage:andMessage:andRepeatCount:andCountPerFrame: 发送 SEI 数据时,SDK 会自动发布一路黑帧视频流,并触发该回调。
ByteSEIStreamEventTypeStreamRemove1远端黑帧视频流移除。该回调的触发时机包括:

+ 远端用户开启摄像头采集,由语音通话切换至视频通话,黑帧视频流停止发布;

+ 远端用户调用 sendSEIMessage:andMessage:andRepeatCount:andCountPerFrame: 后 1min 内未有 SEI 数据发送,黑帧视频流停止发布;

+ 远端用户调用 setVideoSourceType:WithStreamIndex: 切换至自定义视频采集时,黑帧视频流停止发布。
ByteRTCStreamIndex
typedef NS_ENUM(NSInteger, ByteRTCStreamIndex)
objectivec

流属性

枚举值
类型值说明
ByteRTCStreamIndexMain0主流。包括:

+ 由摄像头/麦克风通过内部采集机制,采集到的视频/音频;

+ 通过自定义采集,采集到的视频/音频。
ByteRTCStreamIndexScreen1屏幕流。屏幕共享时共享的视频流,或来自声卡的本地播放音频流。
ByteRTCSyncInfoStreamType
typedef NS_ENUM(NSInteger, ByteRTCSyncInfoStreamType)
objectivec

媒体流信息同步的流类型

枚举值
类型值说明
ByteRTCSyncInfoStreamTypeAudio0音频流
ByteRTCColorSpace
typedef NS_ENUM(NSInteger, ByteRTCColorSpace)
objectivec

颜色空间

枚举值
类型值说明
ByteRTCColorSpaceUnknown0
ByteRTCColorSpaceYCbCrBT601LimitedRange1BT.601数字编码标准,颜色空间[16-235]
ByteRTCColorSpaceYCbCrBT601FullRange2BT.601数字编码标准,颜色空间[0-255]
ByteRTCColorSpaceYCbCrBT709LimitedRange3BT.7091数字编码标准,颜色空间[16-235]
ByteRTCColorSpaceYCbCrBT709FullRange4BT.7091数字编码标准,颜色空间[0-255]
ByteRTCForwardStreamState
typedef NS_ENUM(NSInteger, ByteRTCForwardStreamState)
objectivec

媒体流跨房间转发状态

枚举值
类型值说明
ByteRTCForwardStreamStateIdle0空闲状态
+ 成功调用 stopForwardStreamToRooms 后,所有目标房间为空闲状态。
+ 成功调用 updateForwardStreamToRooms 减少目标房间后,本次减少的目标房间为空闲状态。
ByteRTCForwardStreamStateSuccess1开始转发
+ 调用 startForwardStreamToRooms 成功向所有房间开始转发媒体流后,返回此状态。
+ 调用 updateForwardStreamToRooms 后,成功向新增目标房间开始转发媒体流后,返回此状态。
ByteRTCForwardStreamStateFailure2转发失败,失败详情参考 ByteRTCForwardStreamError
调用 startForwardStreamToRooms 或 updateForwardStreamToRooms 后,如遇转发失败,返回此状态。
ByteRTCForwardStreamError
typedef NS_ENUM(NSInteger, ByteRTCForwardStreamError)
objectivec

媒体流跨房间转发过程中抛出的错误码

枚举值
类型值说明
ByteRTCForwardStreamErrorOK0正常
ByteRTCForwardStreamErrorInvalidArgument1201参数异常
ByteRTCForwardStreamErrorInvalidToken1202Token 错误
ByteRTCForwardStreamErrorResponse1203服务端异常
ByteRTCForwardStreamErrorRemoteKicked1204目标房间有相同 user id 的用户加入,转发中断
ByteRTCForwardStreamErrorNotSupport1205服务端不支持转发功能
ByteRTCForwardStreamEvent
typedef NS_ENUM(NSInteger, ByteRTCForwardStreamEvent)
objectivec

媒体流跨房间转发事件

枚举值
类型值说明
ByteRTCForwardStreamEventDisconnected0本端与服务器网络连接断开,暂停转发。
ByteRTCForwardStreamEventConnected1本端与服务器网络连接恢复,转发服务连接成功。
ByteRTCForwardStreamEventInterrupt2转发中断。转发过程中,如果相同 user_id 的用户进入目标房间,转发中断。
ByteRTCForwardStreamEventDstRoomUpdated3目标房间已更新,由 updateForwardStreamToRooms 触发。
ByteRTCForwardStreamEventUnExpectAPICall4API 调用时序错误。例如,在调用 startForwardStreamToRooms 之前调用 updateForwardStreamToRooms 。
ByteRTCRecordingState
typedef NS_ENUM(NSInteger, ByteRTCRecordingState)
objectivec

本地录制的状态

枚举值
类型值说明
RecordingStateError0录制异常
RecordingStateProcessing1录制进行中
RecordingStateSuccess2录制文件保存成功,调用 stopFileRecording: 结束录制之后才会收到该状态码。
ByteRTCRecordingErrorCode
typedef NS_ENUM(NSInteger, ByteRTCRecordingErrorCode)
objectivec

本地录制错误码

枚举值
类型值说明
RecordingErrorCodeOk0录制正常
RecordingErrorCodeNoPermission-1没有文件写权限
RecordingErrorCodeNotSupport-2当前版本 SDK 不支持本地录制功能,请联系技术支持人员
RecordingErrorCodeOther-3其他异常
ByteRTCRecordingFileType
typedef NS_ENUM(NSInteger, ByteRTCRecordingFileType)
objectivec

本地录制文件的存储格式

枚举值
类型值说明
RecordingFileTypeAAC0aac 格式文件
RecordingFileTypeMP41mp4 格式文件
ByteRTCAVSyncState
typedef NS_ENUM(NSInteger, ByteRTCAVSyncState)
objectivec

音视频同步状态

枚举值
类型值说明
AVSyncStateAVStreamSyncBegin0音视频开始同步
AVSyncStateAudioStreamRemove1音视频同步过程中音频移除,但不影响当前的同步关系
AVSyncStateVdieoStreamRemove2音视频同步过程中视频移除,但不影响当前的同步关系
ByteRTCEchoTestResult
typedef NS_ENUM(NSInteger, ByteRTCEchoTestResult)
objectivec

音视频回路测试结果

枚举值
类型值说明
EchoTestSuccess0接收到采集的音视频的回放,通话回路检测成功
EchoTestTimeout1测试超过 60s 仍未完成,已自动停止
EchoTestIntervalShort2上一次测试结束和下一次测试开始之间的时间间隔少于 5s
EchoTestAudioDeviceError3音频采集异常
EchoTestVideoDeviceError4视频采集异常
EchoTestAudioReceiveError5音频接收异常
EchoTestVideoReceiveError6视频接收异常
EchoTestInternalError7内部错误,不可恢复
ByteRTCBluetoothMode
typedef NS_ENUM(NSInteger, ByteRTCBluetoothMode)
objectivec

蓝牙传输协议。

枚举值
类型值说明
ByteRTCBluetoothModeAuto0默认采用 auto 模式,具体如下:
















场景 HFP A2DP
纯通话场景 蓝牙设备支持 HFP 蓝牙设备不支持 HFP
纯媒体场景 使用蓝牙设备采集播放音频 使用 iOS 设备采集音频,蓝牙设备播放音频
ByteRTCBluetoothModeA2DP1高级音频分配配置文件(A2DP)。立体声、高音质。采用 iOS 设备进行音频采集,蓝牙设备进行播放。
ByteRTCBluetoothModeHFP2免提配置文件(HFP)。单声道、普通音质。音频采集和播放设备都使用蓝牙设备。
ByteRTCEchoTestConfig
@interface ByteRTCEchoTestConfig : NSObject
objectivec

音视频回路测试参数

成员变量
类型名称
ByteRTCView*view
NSString*roomId
NSString*userId
NSString*token
BOOLenableAudio
BOOLenableVideo
NSIntegeraudioReportInterval
变量说明

view
@property(strong, nonatomic) ByteRTCView* _Nullable view;
objectivec

用于渲染接收到的视频的视图

roomId
@property(copy, nonatomic) NSString *_Nonnull roomId;
objectivec

测试用户加入的房间 ID。

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

进行音视频通话回路测试的用户 ID

token
@property(copy, nonatomic) NSString *_Nonnull token;
objectivec

对用户进房时进行鉴权验证的动态密钥,用于保证音视频通话回路测试的安全性。

enableAudio
@property(assign, nonatomic) BOOL enableAudio;
objectivec

是否检测音频。检测设备为系统默认音频设备。

enableVideo
@property(assign, nonatomic) BOOL enableVideo;
objectivec

是否检测视频。PC 端默认检测列表中第一个视频设备。

注意:
视频的发布参数固定为:分辨率 640px × 360px,帧率 15fps。
视频的发布参数固定为:分辨率 640px × 360px,帧率 15fps。

audioReportInterval
@property(assign, nonatomic) NSInteger audioReportInterval;
objectivec

音量信息提示间隔,单位:ms,默认为 100ms

ByteRTCUserInfo
@interface ByteRTCUserInfo : NSObject
objectivec

用户信息。

成员变量
类型名称
NSString*userId
NSString*extraInfo
变量说明

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

用户 ID。该字符串符合正则表达式:[a-zA-Z0-9_@\-\.]{1,128}。

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

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

ByteRTCRoomStats
@interface ByteRTCRoomStats : NSObject
objectivec

房间通话统计数据,统计周期为 2s 。

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

成员变量
类型名称
NSIntegerduration
NSIntegertxBytes
NSIntegerrxBytes
NSIntegertxKbitrate
NSIntegerrxKbitrate
NSIntegertxAudioKBitrate
NSIntegerrxAudioKBitrate
NSIntegertxVideoKBitrate
NSIntegerrxVideoKBitrate
NSIntegertxScreenKBitrate
NSIntegerrxScreenKBitrate
NSIntegeruserCount
floatrxLostrate
floattxLostrate
NSIntegerrtt
NSIntegertxJitter
NSIntegerrxJitter
NSIntegertx_cellular_kbitrate
NSIntegerrx_cellular_kbitrate
变量说明

duration
@property(assign, nonatomic) NSInteger duration;
objectivec

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

txBytes
@property(assign, nonatomic) NSInteger txBytes;
objectivec

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

rxBytes
@property(assign, nonatomic) NSInteger rxBytes;
objectivec

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

txKbitrate
@property(assign, nonatomic) NSInteger txKbitrate;
objectivec

发送码率(kbps),获取该数据时的瞬时值

rxKbitrate
@property(assign, nonatomic) NSInteger rxKbitrate;
objectivec

接收码率(kbps),获取该数据时的瞬时值

txAudioKBitrate
@property(assign, nonatomic) NSInteger txAudioKBitrate;
objectivec

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

rxAudioKBitrate
@property(assign, nonatomic) NSInteger rxAudioKBitrate;
objectivec

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

txVideoKBitrate
@property(assign, nonatomic) NSInteger txVideoKBitrate;
objectivec

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

rxVideoKBitrate
@property(assign, nonatomic) NSInteger rxVideoKBitrate;
objectivec

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

txScreenKBitrate
@property(assign, nonatomic) NSInteger txScreenKBitrate;
objectivec

屏幕接收码率,获取该数据时的瞬时值,单位为 Kbps

rxScreenKBitrate
@property(assign, nonatomic) NSInteger rxScreenKBitrate;
objectivec

屏幕发送码率,获取该数据时的瞬时值,单位为 Kbps

userCount
@property(assign, nonatomic) NSInteger userCount;
objectivec

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

rxLostrate
@property(assign, nonatomic) float rxLostrate;
objectivec

App 现在的下行丢包率

txLostrate
@property(assign, nonatomic) float txLostrate;
objectivec

App 现在的上行丢包率

rtt
@property(assign, nonatomic) NSInteger rtt;
objectivec

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

txJitter
@property(assign, nonatomic) NSInteger txJitter;
objectivec

系统上行网络抖动(ms)

rxJitter
@property(assign, nonatomic) NSInteger rxJitter;
objectivec

系统下行网络抖动(ms)

tx_cellular_kbitrate
@property(assign, nonatomic) NSInteger tx_cellular_kbitrate;
objectivec

蜂窝路径发送的码率 (kbps),为获取该数据时的瞬时值

rx_cellular_kbitrate
@property(assign, nonatomic) NSInteger rx_cellular_kbitrate;
objectivec

蜂窝路径接收码率 (kbps),为获取该数据时的瞬时值

ByteRTCLocalVideoStats
@interface ByteRTCLocalVideoStats : NSObject
objectivec

本地视频流统计信息,统计周期为 2s 。

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

成员变量
类型名称
floatsentKBitrate
NSIntegerinputFrameRate
NSIntegersentFrameRate
NSIntegerencoderOutputFrameRate
NSIntegerrendererOutputFrameRate
NSIntegerstatsInterval
floatvideoLossRate
NSIntegerrtt
NSIntegerencodedBitrate
NSIntegerencodedFrameWidth
NSIntegerencodedFrameHeight
NSIntegerencodedFrameCount
ByteRTCVideoCodecTypecodecType
BOOLisScreen
NSIntegerjitter
ByteRTCVideoDenoiseModevideoDenoiseMode
变量说明

sentKBitrate
@property(assign, nonatomic) float sentKBitrate;
objectivec

发送码率。此次统计周期内实际发送的分辨率最大的视频流的发送码率,单位为 Kbps

inputFrameRate
@property(assign, nonatomic) NSInteger inputFrameRate;
objectivec

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

sentFrameRate
@property(assign, nonatomic) NSInteger sentFrameRate;
objectivec

发送帧率。此次统计周期内实际发送的分辨率最大的视频流的视频发送帧率,单位为 fps 。

encoderOutputFrameRate
@property(assign, nonatomic) NSInteger encoderOutputFrameRate;
objectivec

编码器输出帧率。当前编码器在此次统计周期内实际发送的分辨率最大的视频流的输出帧率,单位为 fps 。

rendererOutputFrameRate
@property(assign, nonatomic) NSInteger rendererOutputFrameRate;
objectivec

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

statsInterval
@property(assign, nonatomic) NSInteger statsInterval;
objectivec

统计间隔,单位为 ms 。
此字段用于设置回调的统计周期,默认设置为 2s 。

videoLossRate
@property(assign, nonatomic) float videoLossRate;
objectivec

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

rtt
@property(assign, nonatomic) NSInteger rtt;
objectivec

往返时延。单位为 ms 。

encodedBitrate
@property(assign, nonatomic) NSInteger encodedBitrate;
objectivec

视频编码码率。此次统计周期内的实际发送的分辨率最大的视频流视频编码码率,单位为 Kbps 。

encodedFrameWidth
@property(assign, nonatomic) NSInteger encodedFrameWidth;
objectivec

实际发送的分辨率最大的视频流的视频编码宽度,单位为 px 。

encodedFrameHeight
@property(assign, nonatomic) NSInteger encodedFrameHeight;
objectivec

实际发送的分辨率最大的视频流的视频编码高度,单位为 px 。

encodedFrameCount
@property(assign, nonatomic) NSInteger encodedFrameCount;
objectivec

此次统计周期内实际发送的分辨率最大的视频流的发送的视频帧总数。

codecType
@property(nonatomic) ByteRTCVideoCodecType codecType;
objectivec

编码类型。参看 ByteRTCVideoCodecType 类型。

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

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

jitter
@property(assign, nonatomic) NSInteger jitter;
objectivec

视频上行网络抖动,单位为 ms。

videoDenoiseMode
@property(assign, nonatomic) ByteRTCVideoDenoiseMode videoDenoiseMode;
objectivec

视频降噪模式。具体参看 ByteRTCVideoDenoiseMode 。

ByteRTCRemoteVideoStats
@interface ByteRTCRemoteVideoStats : NSObject
objectivec

远端视频流统计信息,统计周期为 2s 。

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

成员变量
类型名称
NSIntegerwidth
NSIntegerheight
floatvideoLossRate
floatreceivedKBitrate
NSIntegerreceivedFrameRate
NSIntegerdecoderOutputFrameRate
NSIntegerrenderOutputFrameRate
NSIntegerstallCount
NSIntegerstallDuration
NSIntegere2eDelay
BOOLisScreen
NSIntegerstatsInterval
NSIntegerrtt
NSIntegerfrozenRate
ByteRTCVideoCodecTypecodecType
NSIntegervideoIndex
NSIntegerjitter
变量说明

width
@property(assign, nonatomic) NSInteger width;
objectivec

远端视频宽度。

height
@property(assign, nonatomic) NSInteger height;
objectivec

远端视频高度。

videoLossRate
@property(assign, nonatomic) float videoLossRate;
objectivec

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

receivedKBitrate
@property(assign, nonatomic) float receivedKBitrate;
objectivec

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

receivedFrameRate
@property(assign, nonatomic) NSInteger receivedFrameRate;
objectivec

远端视频接收帧率。

decoderOutputFrameRate
@property(assign, nonatomic) NSInteger decoderOutputFrameRate;
objectivec

远端视频解码输出帧率。

renderOutputFrameRate
@property(assign, nonatomic) NSInteger renderOutputFrameRate;
objectivec

远端视频渲染输出帧率。

stallCount
@property(assign, nonatomic) NSInteger stallCount;
objectivec

远端视频卡顿次数。

stallDuration
@property(assign, nonatomic) NSInteger stallDuration;
objectivec

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

e2eDelay
@property(assign, nonatomic) NSInteger e2eDelay;
objectivec

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

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

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

statsInterval
@property(assign, nonatomic) NSInteger statsInterval;
objectivec

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

此字段用于设置回调的统计周期,目前设置为 2s 。

rtt
@property(assign, nonatomic) NSInteger rtt;
objectivec

往返时延。单位为 ms 。

frozenRate
@property(assign, nonatomic) NSInteger frozenRate;
objectivec

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

codecType
@property(nonatomic) ByteRTCVideoCodecType codecType;
objectivec

编码类型。参看 ByteRTCVideoCodecType 类型。

videoIndex
@property(assign, nonatomic) NSInteger videoIndex;
objectivec

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

jitter
@property(assign, nonatomic) NSInteger jitter;
objectivec

视频下行网络抖动,单位为 ms。

ByteRTCLocalAudioStats
@interface ByteRTCLocalAudioStats : NSObject
objectivec

本地音频流统计信息,统计周期为 2s 。

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

成员变量
类型名称
floataudioLossRate
floatsentKBitrate
NSIntegerrecordSampleRate
NSIntegerstatsInterval
NSIntegerrtt
NSIntegernumChannels
NSIntegersentSampleRate
NSIntegerjitter
变量说明

audioLossRate
@property(assign, nonatomic) float audioLossRate;
objectivec

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

sentKBitrate
@property(assign, nonatomic) float sentKBitrate;
objectivec

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

recordSampleRate
@property(assign, nonatomic) NSInteger recordSampleRate;
objectivec

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

statsInterval
@property(assign, nonatomic) NSInteger statsInterval;
objectivec

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

此字段用于设置回调的统计周期,默认设置为 2s 。

rtt
@property(assign, nonatomic) NSInteger rtt;
objectivec

往返时延。单位为 ms 。

numChannels
@property(assign, nonatomic) NSInteger numChannels;
objectivec

音频声道数。

sentSampleRate
@property(assign, nonatomic) NSInteger sentSampleRate;
objectivec

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

jitter
@property(assign, nonatomic) NSInteger jitter;
objectivec

音频上行网络抖动,单位为 ms。

ByteRTCRemoteAudioStats
@interface ByteRTCRemoteAudioStats : NSObject
objectivec

远端音频流统计信息,统计周期为 2s 。

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

成员变量
类型名称
floataudioLossRate
floatreceivedKBitrate
NSIntegerstallCount
NSIntegerstallDuration
NSIntegerplayoutSampleRate
NSIntegere2eDelay
NSIntegerstatsInterval
NSIntegerrtt
NSIntegertotal_rtt
NSIntegerquality
NSIntegerjitterBufferDelay
NSIntegernumChannels
NSIntegerreceivedSampleRate
NSIntegerfrozenRate
NSIntegerconcealedSamples
NSIntegerconcealmentEvent
NSIntegerdecSampleRate
NSIntegerdecDuration
NSIntegerjitter
变量说明

audioLossRate
@property(assign, nonatomic) float audioLossRate;
objectivec

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

receivedKBitrate
@property(assign, nonatomic) float receivedKBitrate;
objectivec

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

stallCount
@property(assign, nonatomic) NSInteger stallCount;
objectivec

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

stallDuration
@property(assign, nonatomic) NSInteger stallDuration;
objectivec

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

playoutSampleRate
@property(assign, nonatomic) NSInteger playoutSampleRate;
objectivec

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

e2eDelay
@property(assign, nonatomic) NSInteger e2eDelay;
objectivec

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

statsInterval
@property(assign, nonatomic) NSInteger statsInterval;
objectivec

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

rtt
@property(assign, nonatomic) NSInteger rtt;
objectivec

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

total_rtt
@property(assign, nonatomic) NSInteger total_rtt;
objectivec

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

quality
@property(assign, nonatomic) NSInteger quality;
objectivec

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

jitterBufferDelay
@property(assign, nonatomic) NSInteger jitterBufferDelay;
objectivec

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

numChannels
@property(assign, nonatomic) NSInteger numChannels;
objectivec

音频声道数。

receivedSampleRate
@property(assign, nonatomic) NSInteger receivedSampleRate;
objectivec

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

frozenRate
@property(assign, nonatomic) NSInteger frozenRate;
objectivec

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

concealedSamples
@property(assign, nonatomic) NSInteger concealedSamples;
objectivec

音频 PLC 样点总个数。

concealmentEvent
@property(assign, nonatomic) NSInteger concealmentEvent;
objectivec

音频丢包补偿(PLC) 累计次数。

decSampleRate
@property(assign, nonatomic) NSInteger decSampleRate;
objectivec

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

decDuration
@property(assign, nonatomic) NSInteger decDuration;
objectivec

此次订阅中,对远端音频流进行解码的累计耗时。单位为 s。

jitter
@property(assign, nonatomic) NSInteger jitter;
objectivec

视频下行网络抖动,单位为 ms。

ByteRTCLocalStreamStats
@interface ByteRTCLocalStreamStats : NSObject
objectivec

本地音/视频流统计信息以及网络状况,统计周期为 2s 。

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

成员变量
类型名称
ByteRTCLocalAudioStats*audio_stats
ByteRTCLocalVideoStats*video_stats
BOOLis_screen
ByteRTCNetworkQuality[deprecated] tx_quality
ByteRTCNetworkQuality[deprecated] rx_quality
变量说明

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

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

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

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

tx_quality
@property(assign, nonatomic) ByteRTCNetworkQuality tx_quality;
objectivec

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

Deprecated since 3.36 and will be deleted in 3.51, use rtcRoom:onNetworkQuality:remoteQualities: instead

rx_quality
@property(assign, nonatomic) ByteRTCNetworkQuality rx_quality;
objectivec

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

Deprecated since 3.36 and will be deleted in 3.51, use rtcRoom:onNetworkQuality:remoteQualities: instead

is_screen
@property(nonatomic, assign) BOOL is_screen;
objectivec

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

ByteRTCRemoteStreamStats
@interface ByteRTCRemoteStreamStats : NSObject
objectivec

用户订阅的远端音/视频流统计信息以及网络状况,统计周期为 2s 。

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

成员变量
类型名称
NSString*uid
ByteRTCRemoteAudioStats*audio_stats
ByteRTCRemoteVideoStats*video_stats
BOOLis_screen
ByteRTCNetworkQuality[deprecated] tx_quality
ByteRTCNetworkQuality[deprecated] rx_quality
变量说明

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

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

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

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

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

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

tx_quality
@property(assign, nonatomic) ByteRTCNetworkQuality tx_quality;
objectivec

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

Deprecated since 3.36 and will be deleted in 3.51, use rtcRoom:onNetworkQuality:remoteQualities: instead

rx_quality
@property(assign, nonatomic) ByteRTCNetworkQuality rx_quality;
objectivec

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

Deprecated since 3.36 and will be deleted in 3.51, use rtcRoom:onNetworkQuality:remoteQualities: instead

is_screen
@property(nonatomic, assign) BOOL is_screen;
objectivec

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

ByteRTCUser
@interface ByteRTCUser : NSObject
objectivec

用户信息

成员变量
类型名称
NSString*userId
NSString*metaData
变量说明

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

用户 ID

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

元信息

ByteRTCRemoteStreamKey
@interface ByteRTCRemoteStreamKey : NSObject
objectivec

用户信息

成员变量
类型名称
NSString*userId
NSString*roomId
ByteRTCStreamIndexstreamIndex
变量说明

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

用户 ID

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

房间 ID

streamIndex
@property(nonatomic, assign) ByteRTCStreamIndex streamIndex;
objectivec

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

ByteRTCRecordingConfig
@interface ByteRTCRecordingConfig : NSObject
objectivec

本地录制参数配置

成员变量
类型名称
NSString*dirPath
ByteRTCRecordingFileTyperecordingFileType
变量说明

dirPath
@property(strong, nonatomic) NSString* _Nullable dirPath;
objectivec

录制文件保存的绝对路径,需精确到文件夹,文件名由 RTC 自动生成。你需要确保对该路径具有读写权限。

recordingFileType
@property(assign, nonatomic) ByteRTCRecordingFileType recordingFileType;
objectivec

录制存储文件格式,参看 ByteRTCRecordingFileType

ByteRTCRecordingProgress
@interface ByteRTCRecordingProgress : NSObject
objectivec

本地录制进度

成员变量
类型名称
unsignedduration
unsignedfileSize
变量说明

duration
@property(assign, nonatomic) unsigned long long duration;
objectivec

当前文件的累计录制时长,单位:毫秒

fileSize
@property(assign, nonatomic) unsigned long long fileSize;
objectivec

当前录制文件的大小,单位:byte

ByteRTCRecordingInfo
@interface ByteRTCRecordingInfo : NSObject
objectivec

本地录制的详细信息

成员变量
类型名称
NSString*filePath
ByteRTCVideoCodecTypecodecType
NSIntegerwidth
NSIntegerheight
变量说明

filePath
@property(strong, nonatomic) NSString* _Nullable filePath;
objectivec

录制文件的绝对路径,包含文件名和文件后缀

codecType
@property(assign, nonatomic) ByteRTCVideoCodecType codecType;
objectivec

录制文件的视频编码类型,参看 ByteRTCVideoCodecType

width
@property(nonatomic, assign) NSInteger width;
objectivec

录制视频的宽,单位:像素。纯音频录制请忽略该字段

height
@property(nonatomic, assign) NSInteger height;
objectivec

录制视频的高,单位:像素。纯音频录制请忽略该字段

ByteRTCStreamSycnInfoConfig
@interface ByteRTCStreamSycnInfoConfig : NSObject
objectivec

媒体流信息同步的相关配置

成员变量
类型名称
ByteRTCStreamIndexstreamIndex
intrepeatCount
ByteRTCSyncInfoStreamTypestreamType
变量说明

streamIndex
@property(assign, nonatomic) ByteRTCStreamIndex streamIndex;
objectivec

流属性,主流或屏幕流。见 ByteRTCStreamIndex 。

repeatCount
@property(assign, nonatomic) int repeatCount;
objectivec

消息发送的重复次数,取值范围是 [0,25],建议设置为 [3,5]。

streamType
@property(assign, nonatomic) ByteRTCSyncInfoStreamType streamType;
objectivec

媒体流信息同步的流类型,见 ByteRTCSyncInfoStreamType 。

ForwardStreamConfiguration
@interface ForwardStreamConfiguration: NSObject
objectivec

媒体流跨房间转发的目标房间的相关信息

成员变量
类型名称
NSString*roomId
NSString*token
变量说明

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

跨房间转发媒体流过程中目标房间 ID

token
@property(strong, nonatomic) NSString* _Nullable token;
objectivec

使用转发目标房间 RoomID 和 UserID 生成 Token。

测试时可使用控制台生成临时 Token,正式上线需要使用密钥 SDK 在你的服务端生成并下发 Token。

如果 Token 无效,转发失败。

ForwardStreamStateInfo
@interface ForwardStreamStateInfo: NSObject
objectivec

跨房间转发媒体流过程中的不同目标房间的状态和错误信息

成员变量
类型名称
NSString*roomId
ByteRTCForwardStreamStatestate
ByteRTCForwardStreamErrorerror
变量说明

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

跨房间转发媒体流过程中目标房间 ID

空字符串代表所有目标房间

state
@property(assign, nonatomic) ByteRTCForwardStreamState state;
objectivec

跨房间转发媒体流过程中该目标房间的状态,参看 ByteRTCForwardStreamState

error
@property(assign, nonatomic) ByteRTCForwardStreamError error;
objectivec

跨房间转发媒体流过程中该目标房间抛出的错误码,参看 ByteRTCForwardStreamError

ForwardStreamEventInfo
@interface ForwardStreamEventInfo: NSObject
objectivec

跨房间转发媒体流过程中的不同目标房间发生的事件

成员变量
类型名称
NSString*roomId
ByteRTCForwardStreamEventevent
变量说明

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

跨房间转发媒体流过程中的发生该事件的目标房间 ID

空字符串代表所有目标房间

event
@property(assign, nonatomic) ByteRTCForwardStreamEvent event;
objectivec

跨房间转发媒体流过程中该目标房间发生的事件,参看 ByteRTCForwardStreamEvent

ByteRTCNetworkQualityStats
@interface ByteRTCNetworkQualityStats: NSObject
objectivec

上行/下行网络质量

成员变量
类型名称
NSString*uid
doublelossRatio
intrtt
inttotalBandwidth
ByteRTCNetworkQualitytxQuality
ByteRTCNetworkQualityrxQuality
变量说明

uid
@property(strong, nonatomic) NSString* _Nonnull uid;
objectivec

用户 ID

lossRatio
@property(assign, nonatomic) double lossRatio;
objectivec

本端的上行/下行的丢包率,范围 [0.0,1.0]
当 uid 为本地用户时,代表发布流的上行丢包率。
当 uid 为远端用户时,代表接收所有订阅流的下行丢包率。

rtt
@property(assign, nonatomic) int rtt;
objectivec

当 uid 为本地用户时有效,客户端到服务端的往返延时(RTT),单位:ms

totalBandwidth
@property(assign, nonatomic) int totalBandwidth;
objectivec

本端的音视频 RTP 包 2 秒内的平均传输速率,单位:bps
当 uid 为本地用户时,代表发送速率。
当 uid 为远端用户时,代表所有订阅流的接收速率。

txQuality
@property(assign, nonatomic) ByteRTCNetworkQuality txQuality;
objectivec

上行网络质量评分,详见 ByteRTCNetworkQuality。

rxQuality
@property(assign, nonatomic) ByteRTCNetworkQuality rxQuality;
objectivec

下行网络质量评分,详见 ByteRTCNetworkQuality。

ByteRTCNetworkTimeInfo
@interface ByteRTCNetworkTimeInfo: NSObject
objectivec

网络时间信息

成员变量
类型名称
int64_ttimestamp
变量说明

timestamp
@property(assign, nonatomic) int64_t timestamp;
objectivec

网络时间,单位:ms

ByteRTCAudioDumpStatus
typedef NS_ENUM(NSInteger, ByteRTCAudioDumpStatus)
objectivec

音频dump状态。

枚举值
类型值说明
ByteRTCAudioDumpStartFailure0音频dump启动失败
ByteRTCAudioDumpStartSuccess1音频dump启动成功
ByteRTCAudioDumpStopFailure2音频dump停止失败
ByteRTCAudioDumpStopSuccess3音频dump停止成功
ByteRTCAudioDumpRunningFailure4音频dump运行失败
ByteRTCAudioDumpRunningSuccess5音频dump运行成功
ByteRTCNetworkDetectionStopReason
typedef NS_ENUM(NSUInteger, ByteRTCNetworkDetectionStopReason)
objectivec

通话前探测的停止原因
rtcEngine:onNetworkDetectionStopped: 回调的参数类型

枚举值
类型值说明
ByteRTCNetworkDetectionStopReasonUser0用户主动停止。
ByteRTCNetworkDetectionStopReasonTimeout1探测超过三分钟。
ByteRTCNetworkDetectionStopReasonConnectionLost2探测网络连接断开。

当超过 12s 没有收到回复,SDK 将断开网络连接,并且不再尝试重连。
ByteRTCNetworkDetectionStopReasonStreaming3本地开始推拉流,停止探测。
ByteRTCNetworkDetectionStopReasonInnerErr4网络探测失败,内部异常
ByteRTCNetworkDetectionLinkType
typedef NS_ENUM(NSUInteger, ByteRTCNetworkDetectionLinkType)
objectivec

通话前探测链接的类型
rtcEngine:onNetworkDetectionResult:quality:rtt:lostRate:bitrate:jitter: 回调的参数类型

枚举值
类型值说明
ByteRTCNetworkDetectionLinkTypeUp0上行网络探测。
ByteRTCNetworkDetectionLinkTypeDown1下行网络探测。
ByteRTCHardwareEchoDetectionResult
typedef NS_ENUM(NSUInteger, ByteRTCHardwareEchoDetectionResult)
objectivec

通话前回声检测结果

枚举值
类型值说明
ByteRTCHardwareEchoDetectionCanceled0主动调用 stopHardwareEchoDetection 结束流程时,未有回声检测结果。
ByteRTCHardwareEchoDetectionUnknown1未检测出结果。建议重试,如果仍然失败请联系技术支持协助排查。
ByteRTCHardwareEchoDetectionNormal2无回声
ByteRTCHardwareEchoDetectionPoor3有回声。可通过 UI 建议用户使用耳机设备入会。
ByteRTCAudioSelectionPriority
typedef NS_ENUM(NSUInteger, ByteRTCAudioSelectionPriority)
objectivec

音频选路优先级设置

枚举值
类型值说明
ByteRTCAudioSelectionPriorityNormal0正常,参加音频选路
ByteRTCAudioSelectionPriorityHigh1高优先级,跳过音频选路
ByteRTCSetRoomExtraInfoResult
typedef NS_ENUM(NSInteger,ByteRTCSetRoomExtraInfoResult)
objectivec

设置房间附加消息结果。

枚举值
类型值说明
ByteRTCSetRoomExtraInfoResultSuccess0设置房间附加信息成功
ByteRTCSetRoomExtraInfoResultNotJoinRoom-1设置失败,尚未加入房间
ByteRTCSetRoomExtraInfoResultKeyIsNull-2设置失败,key 指针为空
ByteRTCSetRoomExtraInfoResultValueIsNull-3设置失败,value 指针为空
ByteRTCSetRoomExtraInfoResultUnknow-99设置失败,未知错误
ByteRTCSetRoomExtraInfoResultKeyIsEmpty-400设置失败,key 长度为 0
ByteRTCSetRoomExtraInfoResultTooOften-406调用 setRoomExtraInfo 过于频繁,建议不超过 10 次/秒。
ByteRTCSetRoomExtraInfoResultSilentUser-412设置失败,用户已调用 setUserVisibility 将自身设为隐身状态。
ByteRTCSetRoomExtraInfoResultKeyTooLong-413设置失败,Key 长度超过 10 字节
ByteRTCSetRoomExtraInfoResultValueTooLong-414设置失败,value 长度超过 128 字节
ByteRTCSetRoomExtraInfoResultServerError-500设置失败,服务器错误
ByteRTCSubtitleState
typedef NS_ENUM(NSInteger, ByteRTCSubtitleState)
objectivec

字幕任务状态。

枚举值
类型值说明
ByteRTCSubtitleStateStarted0开启字幕。
ByteRTCSubtitleStateStoped1关闭字幕。
ByteRTCSubtitleStateError2字幕任务出现错误。
ByteRTCSubtitleMode
typedef NS_ENUM(NSInteger, ByteRTCSubtitleMode)
objectivec

字幕模式。

枚举值
类型值说明
ByteRTCSubtitleModeRecognition0识别模式。在此模式下,房间内用户语音会被转为文字。
ByteRTCSubtitleModeTranslation1翻译模式。在此模式下,房间内用户语音会先被转为文字,再被翻译为目标语言。
ByteRTCSubtitleErrorCode
typedef NS_ENUM(NSInteger, ByteRTCSubtitleErrorCode)
objectivec

字幕任务错误码。

枚举值
类型值说明
ByteRTCSubtitleErrorCodeUnknow-1客户端无法识别云端媒体处理发送的错误码。
ByteRTCSubtitleErrorCodeSuccess0字幕已开启。
ByteRTCSubtitleErrorCodePostProcessError1云端媒体处理内部出现错误,请联系技术支持。
ByteRTCSubtitleErrorCodeASRConnectionError2第三方服务连接失败,请联系技术支持。
ByteRTCSubtitleErrorCodeASRServiceError3第三方服务内部出现错误,请联系技术支持。
ByteRTCSubtitleErrorCodeBeforeJoinRoom4未进房导致调用startSubtitle失败。请加入房间后再调用此方法。
ByteRTCSubtitleErrorCodeAlreadyOn5字幕已开启,无需重复调用 startSubtitle。
ByteRTCSubtitleErrorCodeUnsupportedLanguage6用户选择的目标语言目前暂不支持。
ByteRTCSubtitleErrorCodePostProcessTimeout7云端媒体处理超时未响应,请联系技术支持。
ByteRTCSubtitleConfig
@interface ByteRTCSubtitleConfig : NSObject
objectivec

字幕配置信息。

成员变量
类型名称
ByteRTCSubtitleModemode
NSString*targetLanguage
变量说明

mode
@property(assign, nonatomic) ByteRTCSubtitleMode mode;
objectivec

字幕模式。可以根据需要选择识别和翻译两种模式。开启识别模式,会将识别后的用户语音转化成文字;开启翻译模式,会在语音识别后进行翻译。参看 ByteRTCSubtitleMode。

targetLanguage
@property(copy, nonatomic) NSString *_Nonnull targetLanguage;
objectivec

目标翻译语言。可点击 语言支持 查看翻译服务最新支持的语种信息。

ByteRTCSubtitleMessage
@interface ByteRTCSubtitleMessage : NSObject
objectivec

字幕具体内容。

成员变量
类型名称
NSString*userId
NSString*text
NSIntegersequence
BOOLdefinite
变量说明

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

说话者的用户ID。

text
@property(copy, nonatomic) NSString *_Nonnull text;
objectivec

语音识别或翻译后的文本, 采用 UTF-8 编码。

sequence
@property(assign, nonatomic) NSInteger sequence;
objectivec

语音识别或翻译后形成的文本的序列号,同一发言人的完整发言和不完整发言会按递增顺序单独分别编号。

definite
@property(assign, nonatomic) BOOL definite;
objectivec

语音识别出的文本是否为一段完整的一句话。 True 代表是, False 代表不是。

AttenuationType
typedef NS_ENUM(NSInteger, AttenuationType)
objectivec

空间音频音量随距离衰减模式

枚举值
类型值说明
AttenuationTypeNone0不随距离衰减
AttenuationTypeLinear1线性衰减,音量随距离增大而线性减小
AttenuationTypeExponential2指数型衰减,音量随距离增大进行指数衰减
ReceiveRange
@interface ReceiveRange : NSObject
objectivec

本地用户能收听到、且具有衰减效果的音频接收范围

成员变量
类型名称
intmin
intmax
变量说明

min
@property(nonatomic, assign) int min;
objectivec

能够接收语音、并且具有衰减效果的最小距离值,该值须 ≥ 0,但 ≤ max。

小于该值的范围内没有范围语音效果,即收听到的音频音量相同。

max
@property(nonatomic, assign) int max;
objectivec

能够收听语音的最大距离值,该值须 > 0 且 ≥ min。

当收听者和声源距离处于 [min, max) 之间时,收听到的音量根据距离呈衰减效果。

超出该值范围的音频将无法收听到。

ByteRTCUserOfflineReason
typedef NS_ENUM(NSUInteger, ByteRTCUserOfflineReason)
objectivec

远端用户离开房间的原因。

枚举值
类型值说明
ByteRTCUserOfflineReasonQuit0远端用户调用 leaveRoom 方法主动退出房间。
ByteRTCUserOfflineReasonDropped1远端用户因网络等原因掉线。
ByteRTCUserOfflineReasonSwitchToInvisible2远端用户切换至隐身状态。
ByteRTCUserOfflineReasonKickedByAdmin3远端用户被踢出出房间。
因调用踢出用户的 OpenAPI,远端用户被踢出房间。
ByteRTCConnectionState
typedef NS_ENUM(NSInteger, ByteRTCConnectionState)
objectivec

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

枚举值
类型值说明
ByteRTCConnectionStateDisconnected1连接断开超过 12s,此时 SDK 会尝试自动重连。
ByteRTCConnectionStateConnecting2首次请求建立连接,正在连接中。
ByteRTCConnectionStateConnected3首次连接成功。
ByteRTCConnectionStateReconnecting4涵盖了以下情况:

+ 首次连接时,10秒连接不成功;

+ 连接成功后,断连 10 秒。自动重连中。
ByteRTCConnectionStateReconnected5连接断开后,重连成功。
ByteRTCConnectionStateLost6处于 ByteRTCConnectionStateDisconnected 状态超过 10 秒,且期间重连未成功。SDK 仍将继续尝试重连。
ByteRTCConnectionStateFailed7连接失败,服务端状态异常。SDK 不会自动重连,请重新进房,或联系技术支持。
ByteRTCNetworkType
typedef NS_ENUM(NSInteger, ByteRTCNetworkType)
objectivec

SDK 网络连接类型。

枚举值
类型值说明
ByteRTCNetworkTypeUnknown-1网络连接类型未知。
ByteRTCNetworkTypeDisconnected0网络连接已断开。
ByteRTCNetworkTypeLAN1网络连接类型为 LAN 。
ByteRTCNetworkTypeWIFI2网络连接类型为 Wi-Fi(包含热点)。
ByteRTCNetworkTypeMobile2G3网络连接类型为 2G 移动网络。
ByteRTCNetworkTypeMobile3G4网络连接类型为 3G 移动网络。
ByteRTCNetworkTypeMobile4G5网络连接类型为 4G 移动网络。
ByteRTCNetworkTypeMobile5G6网络连接类型为 5G 移动网络。
ByteRTCNetworkQuality
typedef NS_ENUM(NSUInteger, ByteRTCNetworkQuality)
objectivec

媒体流网络质量。

枚举值
类型值说明
ByteRTCNetworkQualityUnknown0网络质量未知。
ByteRTCNetworkQualityExcellent1网络质量极好。
ByteRTCNetworkQualityGood2主观感觉和 kNetworkQualityExcellent 差不多,但码率可能略低。
ByteRTCNetworkQualityPoor3主观感受有瑕疵但不影响沟通。
ByteRTCNetworkQualityBad4勉强能沟通但不顺畅。
ByteRTCNetworkQualityVeryBad5网络质量非常差,基本不能沟通。
ByteRTCNetworkQualityDown6网络连接断开,无法通话。网络可能由于 12s 内无应答、开启飞行模式、拔掉网线等原因断开。
更多网络状态信息参见 连接状态提示。
ByteRTCLogLevel
typedef NS_ENUM(NSUInteger, ByteRTCLogLevel)
objectivec

日志级别。

枚举值
类型值说明
ByteRTCLogLevelTrace0打印 trace 级别及以上级别信息。
ByteRTCLogLevelDebug1打印 debug 级别及以上级别信息。
ByteRTCLogLevelInfo2打印 info 级别及以上级别信息。
ByteRTCLogLevelWarning3打印 warning 级别及以上级别信息。
ByteRTCLogLevelError4打印 error 级别信息。
ByteRTCMessageConfig
typedef NS_ENUM(NSInteger, ByteRTCMessageConfig)
objectivec

发送消息的可靠有序类型

枚举值
类型值说明
ByteRTCMessageConfigReliableOrdered0低延时可靠有序消息
ByteRTCMessageConfigUnreliableOrdered1超低延时有序消息
ByteRTCMessageConfigUnreliableUnordered2超低延时无序消息
ByteRTCUserOnlineStatus
typedef NS_ENUM(NSInteger, ByteRTCUserOnlineStatus)
objectivec

用户在线状态

枚举值
类型值说明
ByteRTCUserOnlineStatusOffline0对端用户离线
对端用户已经调用 logout,或者没有调用 login:uid: 进行登录
ByteRTCUserOnlineStatusOnline1对端用户在线
对端用户调用 login:uid: 登录,并且连接状态正常
ByteRTCUserOnlineStatusUnreachable2无法获取对端用户在线状态
发生级联错误、对端用户在线状态异常时返回
ByteRTCSysStats
@interface ByteRTCSysStats : NSObject
objectivec

App 使用的 cpu 和 memory 信息

信息由 SDK 周期性(2s)地通过 reportSysStats 回调事件通知给用户。

成员变量
类型名称
unsignedcpu_cores
doublecpu_app_usage
doublememory_usage
unsignedfull_memory
unsignedtotal_memory_usage
unsignedfree_memory
doublememory_ratio
doubletotal_memory_ratio
变量说明

cpu_cores
@property(assign, nonatomic) unsigned int cpu_cores;
objectivec

当前系统 cpu 核数

cpu_app_usage
@property(assign, nonatomic) double cpu_app_usage;
objectivec

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

memory_usage
@property(assign, nonatomic) double memory_usage;
objectivec

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

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

全量内存(单位MB)

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

系统已使用内存(单位MB)

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

空闲可分配内存(单位MB)

memory_ratio
@property(assign, nonatomic) double memory_ratio;
objectivec

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

total_memory_ratio
@property(assign, nonatomic) double total_memory_ratio;
objectivec

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

ByteRTCCloudProxyInfo
@interface ByteRTCCloudProxyInfo: NSObject
objectivec

云代理信息

成员变量
类型名称
NSString*cloudProxyIp
intcloudProxyPort
变量说明

cloudProxyIp
@property(strong, nonatomic) NSString* _Nonnull cloudProxyIp;
objectivec

云代理服务器 IP

cloudProxyPort
@property(assign, nonatomic) int cloudProxyPort;
objectivec

云代理服务器端口

ByteRTCLocalProxyType
typedef NS_ENUM(NSUInteger, ByteRTCLocalProxyType)
objectivec

本地代理的类型。

枚举值
类型值说明
ByteRTCLocalProxyTypeSocks51Socks5 代理。选用此代理服务器,需满足 Socks5 协议标准文档的要求。
ByteRTCLocalProxyTypeHttpTunnel2Http 隧道代理。
ByteRTCLocalProxyInfo
@interface ByteRTCLocalProxyInfo : NSObject
objectivec

本地代理配置详细信息。

成员变量
类型名称
ByteRTCLocalProxyTypelocalProxyType
NSString*localProxyIp
intlocalProxyPort
NSString*localProxyUsername
NSString*localProxyPassword
变量说明

localProxyType
@property(assign, nonatomic) ByteRTCLocalProxyType localProxyType;
objectivec

本地代理的类型,参看 ByteRTCLocalProxyType。

localProxyIp
@property(copy, nonatomic) NSString * _Nullable localProxyIp;
objectivec

本地代理服务器 IP。

localProxyPort
@property(assign, nonatomic) int localProxyPort;
objectivec

本地代理服务器端口。

localProxyUsername
@property(copy, nonatomic) NSString * _Nullable localProxyUsername;
objectivec

本地代理用户名。

localProxyPassword
@property(copy, nonatomic) NSString * _Nullable localProxyPassword;
objectivec

本地代理密码。

ByteRTCLocalProxyState
typedef NS_ENUM(NSUInteger, ByteRTCLocalProxyState)
objectivec

本地代理连接状态。

枚举值
类型值说明
ByteRTCLocalProxyStateInited0TCP 代理服务器连接成功。
ByteRTCLocalProxyStateConnected1本地代理连接成功。
ByteRTCLocalProxyStateError2本地代理连接出现错误。
ByteRTCLocalProxyError
typedef NS_ENUM(NSUInteger, ByteRTCLocalProxyError)
objectivec

本地代理错误。

枚举值
类型值说明
ByteRTCLocalProxyErrorOK0本地代理服务器无错误。
ByteRTCLocalProxyErrorSocks5VersionError1代理服务器回复的版本号不符合 Socks5 协议标准文档的规定,导致 Socks5 代理连接失败。请检查代理服务器是否存在异常。
ByteRTCLocalProxyErrorSocks5FormatError2代理服务器回复的格式错误不符合 Socks5 协议标准文档的规定,导致 Socks5 代理连接失败。请检查代理服务器是否存在异常。
ByteRTCLocalProxyErrorSocks5InvalidValue3代理服务器回复的字段值不符合 Socks5 协议标准文档的规定,导致 Socks5 代理连接失败。请检查代理服务器是否存在异常。
ByteRTCLocalProxyErrorSocks5UserPassNotGiven4未提供代理服务器的用户名及密码,导致 Socks5 代理连接失败。请重新调用 setLocalProxy,在设置本地代理时填入用户名和密码。
ByteRTCLocalProxyErrorSocks5TcpClosed5TCP 关闭,导致 Socks5 代理连接失败。请检查网络或者代理服务器是否存在异常。
ByteRTCLocalProxyErrorHttpTunnelFailed6Http 隧道代理错误。请检查 Http 隧道代理服务器或者网络是否存在异常。
ByteRtcScreenCapturerExt
@interface ByteRtcScreenCapturerExt : NSObject
objectivec

屏幕采集相关扩展实例,仅适用于 SDK 内部采集。

用户创建 extesion 后生成的 SampleHandler 需通过此实例实现屏幕共享相关能力。

成员变量
类型名称
ByteRtcScreenCapturerExt*shared
NSObject*delegate
成员函数
返回名称
voidstartWithDelegate:groupId:
voidstop
voidprocessSampleBuffer:withType:
变量说明

shared
@property (readonly, class) ByteRtcScreenCapturerExt *shared;
objectivec

delegate
@property (nonatomic, weak, nullable) NSObject<ByteRtcScreenCapturerExtDelegate> *delegate;
objectivec
函数说明

startWithDelegate:groupId:
- (void)startWithDelegate:(NSObject<ByteRtcScreenCapturerExtDelegate> *)delegate groupId:(NSString *)groupId;
objectivec

开始屏幕采集

Extension 启动后,系统将自动调用该方法开启屏幕采集。

传入参数

参数名类型说明
delegateNSObject*回调代理,参看 ByteRtcScreenCapturerExtDelegate
groupIdNSString*App groups 中配置的 group ID

stop
- (void)stop;
objectivec

结束屏幕采集

Extension 关闭后,系统将自动调用该方法停止屏幕采集。

processSampleBuffer:withType:
- (void)processSampleBuffer:(CMSampleBufferRef)sampleBuffer withType:(RPSampleBufferType)sampleBufferType API_AVAILABLE(ios(10));
objectivec

推送 Extension 采集的数据

传入参数

参数名类型说明
sampleBufferCMSampleBufferRef采集到的数据
sampleBufferTypeRPSampleBufferType数据类型
ByteRTCRenderMode
typedef NS_ENUM(NSUInteger, ByteRTCRenderMode)
objectivec

图片或视频流的缩放模式。

枚举值
类型值说明
ByteRTCRenderModeHidden1视窗填满优先,默认值。
视频尺寸等比缩放,直至视窗被填满。当视频尺寸与显示窗口尺寸不一致时,多出的视频将被截掉。
ByteRTCRenderModeFit2视频帧内容全部显示优先。
视频尺寸等比缩放,优先保证视频内容全部显示。当视频尺寸与显示窗口尺寸不一致时,会把窗口未被填满的区域填充成背景颜色。
ByteRTCRenderModeFill3视频帧自适应画布。
视频尺寸非等比例缩放,把窗口充满。在此过程中,视频帧的长宽比例可能会发生变化。
ByteRTCTranscoderContentControlType
typedef NS_ENUM(NSUInteger, ByteRTCTranscoderContentControlType)
objectivec

合流输出内容类型

枚举值
类型值说明
ByteRTCTranscoderContentControlTypeHasAudioAndVideo0输出的混流包含音频和视频
ByteRTCTranscoderContentControlTypeHasAudioOnly1输出的混流只包含音频
ByteRTCTranscoderContentControlTypeHasVideoOnly2输出的混流只包含视频
ByteRTCTranscoderLayoutRegionType
typedef NS_ENUM(NSUInteger, ByteRTCTranscoderLayoutRegionType)
objectivec

合流布局区域类型。

枚举值
类型值说明
ByteRTCTranscoderLayoutRegionTypeVideoStream0合流布局区域类型为视频。
ByteRTCTranscoderLayoutRegionTypeImage1合流布局区域类型为图片。
ByteRTCVideoStreamType
typedef NS_ENUM(NSInteger, ByteRTCVideoStreamType)
objectivec

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

枚举值
类型值说明
ByteRTCVideoStreamTypeHigh0高分辨率视频流
ByteRTCVideoStreamTypeLow1低分辨率视频
ByteRTCVideoStreamState
typedef NS_ENUM(NSInteger, ByteRTCVideoStreamState)
objectivec

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

枚举值
类型值说明
ByteRTCVideoStreamStateSuccess0设置本地视频属性成功
ByteRTCVideoStreamStateInvalid-2本地视频属性参数不合法
ByteRTCVideoOutputOrientationMode
typedef NS_ENUM(NSInteger, ByteRTCVideoOutputOrientationMode)
objectivec

视频输出方向模式

枚举值
类型值说明
ByteRTCVideoOutputOrientationModeAdaptative0自适应布局
ByteRTCVideoOutputOrientationModeFixedLandscape1横屏布局
ByteRTCVideoOutputOrientationModeFixedPortrait2竖屏布局
ByteRTCVideoOrientation
typedef NS_ENUM(NSUInteger, ByteRTCVideoOrientation)
objectivec

视频帧朝向

枚举值
类型值说明
ByteRTCVideoOrientationAdaptive0(默认)使用相机输出的原始视频帧的角度,不对视频帧进行额外旋转。
ByteRTCVideoOrientationPortrait1固定为竖屏,将相机采集到的视频帧转换为竖屏,在整个 RTC 链路中传递竖屏帧。
ByteRTCVideoOrientationLandscape2固定为横屏,将相机采集到的视频帧转换为横屏,在整个 RTC 链路中传递横屏帧。
ByteRTCMirrorType
typedef NS_ENUM(NSUInteger, ByteRTCMirrorType)
objectivec

镜像类型

枚举值
类型值说明
ByteRTCMirrorTypeNone0本地预览和编码传输时均无镜像效果
ByteRTCMirrorTypeRender1本地预览时有镜像效果,编码传输时无镜像效果
ByteRTCMirrorTypeRenderAndEncoder3本地预览和编码传输时均有镜像效果
ByteRTCEffectBeautyMode
typedef NS_ENUM(NSUInteger, ByteRTCEffectBeautyMode)
objectivec

基础美颜模式

枚举值
类型值说明
ByteRTCEffectWhiteMode0美白
ByteRTCEffectSmoothMode1磨皮
ByteRTCEffectSharpenMode2锐化
ByteRTCVideoRotation
typedef NS_ENUM(NSInteger, ByteRTCVideoRotation)
objectivec

视频帧旋转信息

枚举值
类型值说明
ByteRTCVideoRotation00不旋转
ByteRTCVideoRotation9090顺时针旋转 90 度
ByteRTCVideoRotation180180顺时针旋转 180 度
ByteRTCVideoRotation270270顺时针旋转 270 度
ByteRTCVideoContentType
typedef NS_ENUM(NSInteger, ByteRTCVideoContentType)
objectivec

视频内容类型

枚举值
类型值说明
ByteRTCVideoContentTypeNormalFrame0普通视频
ByteRTCVideoContentTypeBlackFrame1黑帧视频
ByteRTCVideoStreamScaleMode
typedef NS_ENUM(NSInteger, ByteRTCVideoStreamScaleMode)
objectivec

视频帧缩放模式

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

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

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

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

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

编码帧类型

枚举值
类型值说明
ByteRTCVideoPictureTypeUnknown0未知类型
ByteRTCVideoPictureTypeI1I帧,关键帧,编解码不需要参考其他视频帧
ByteRTCVideoPictureTypeP2P帧,向前参考帧,编解码需要参考前一帧视频帧
ByteRTCVideoPictureTypeB3B帧,前后参考帧,编解码需要参考前后两帧视频帧
ByteRTCVideoEncoderPreference
typedef NS_ENUM(NSInteger, ByteRTCVideoEncoderPreference)
objectivec

编码策略偏好。

枚举值
类型值说明
ByteRTCVideoEncoderPreferenceDisabled0无偏好。不降低帧率和分辨率。
ByteRTCVideoEncoderPreferenceMaintainFramerate1(默认值)帧率优先。
ByteRTCVideoEncoderPreferenceMaintainQuality2分辨率优先。
ByteRTCVideoEncoderPreferenceBalance3平衡帧率与分辨率。
ByteRTCScreenVideoEncoderPreference
typedef NS_ENUM(NSInteger, ByteRTCScreenVideoEncoderPreference)
objectivec

屏幕流编码模式,默认采用清晰模式。

枚举值
类型值说明
ByteRTCScreenVideoEncodePreferenceAuto0智能模式。根据屏幕内容智能决策选择流畅模式或清晰模式。
ByteRTCScreenVideoEncodePreferenceFramerate1流畅模式,优先保障帧率。适用于共享游戏、视频等动态画面。
ByteRTCScreenVideoEncodePreferenceQuality2清晰模式,优先保障分辨率。适用于共享PPT、文档、图片等静态画面。
ByteRTCDataFrameType
typedef NS_ENUM(NSUInteger, ByteRTCDataFrameType)
objectivec

数据类型

枚举值
类型值说明
ByteRTCDataFrameTypeSei0SEI 数据
ByteRTCDataFrameTypeRoi1人脸识别数据
ByteRTCDataFrameTypeOther2其他数据帧类型
ByteRTCVideoCapturePreference
typedef NS_ENUM(NSInteger, ByteRTCVideoCapturePreference)
objectivec

视频采集模式

枚举值
类型值说明
ByteRTCVideoCapturePreferenceAuto0(默认)自动设置采集参数。
SDK在开启采集时根据服务端下发的采集配置结合编码参数设置最佳采集参数。
ByteRTCVideoCapturePreferenceMannal1手动设置采集参数,包括采集分辨率、帧率。
ByteRTCVideoCapturePreferenceAutoPerformance2采集参数与编码参数一致
ByteRTCVideoFrameType
typedef NS_ENUM(NSInteger, ByteRTCVideoFrameType)
objectivec

视频帧类型

枚举值
类型值说明
ByteRTCVideoFrameTypeRawMemory0视频帧类型:内存数据
ByteRTCVideoFrameTypePixelBuffer1视频帧类型:CVPixelBuffer
ByteRTCVideoPixelFormat
typedef NS_ENUM(NSInteger, ByteRTCVideoPixelFormat)
objectivec

视频帧格式

枚举值
类型值说明
ByteRTCVideoPixelFormatUnknown0未知格式
ByteRTCVideoPixelFormatI4201I420
ByteRTCVideoPixelFormatBGRA2BGRA
ByteRTCVideoPixelFormatNV213NV21
ByteRTCVideoPixelFormatRGBA4RGBA
ByteRTCVideoPixelFormatIMC25IMC2
ByteRTCVideoPixelFormatARGB7ARGB
ByteRTCVideoPixelFormatNV128NV12
ByteRTCVideoPixelFormatGLTexture2D10Opengl Texture2D纹理
ByteRTCVideoPixelFormatGLTextureOES11Opengl OES纹理
ByteRTCVideoPixelFormatCVPixelBuffer12CVPixelBuffer
ByteRTCVideoSinkPixelFormat
typedef NS_ENUM(NSInteger, ByteRTCVideoSinkPixelFormat)
objectivec

视频帧编码格式

枚举值
类型值说明
ByteRTCVideoSinkPixelFormatOriginal0原始视频帧格式
ByteRTCVideoSinkPixelFormatI4201YUV I420 格式
ByteRTCVideoSinkPixelFormatBGRA2BGRA 格式
ByteRTCVideoSinkPixelFormatNV128YUV NV21 格式
ByteRTCStreamMixingType
typedef NS_ENUM(NSUInteger, ByteRTCStreamMixingType)
objectivec

合流方式

枚举值
类型值说明
ByteRTCStreamMixingTypeByServer0通过服务端转推
ByteRTCStreamMixingTypeByClient1端云一体转推
ByteRTCStreamMixingEvent
typedef NS_ENUM(NSUInteger, ByteRTCStreamMixingEvent)
objectivec

转推直播事件

枚举值
类型值说明
ByteRTCStreamMixingEventStart1请求发起转推直播任务
ByteRTCStreamMixingEventStartSuccess2发起转推直播任务成功
ByteRTCStreamMixingEventStartFailed3发起转推直播任务失败
ByteRTCStreamMixingEventUpdate4请求更新转推直播任务配置
ByteRTCStreamMixingEventUpdateSuccess5成功更新转推直播任务配置
ByteRTCStreamMixingEventUpdateFailed6更新转推直播任务配置失败
ByteRTCStreamMixingEventStop7请求结束转推直播任务
ByteRTCStreamMixingEventStopSuccess8结束转推直播任务成功
ByteRTCStreamMixingEventStopFailed9结束转推直播任务失败
ByteRTCStreamMixingEventChangeMixType10更新转推直播任务配置的请求超时
ByteRTCStreamMixingEventFirstAudioFrameByClientMixer11得到客户端合流音频首帧
ByteRTCStreamMixingEventFirstVideoFrameByClientMixer12收到客户端合流视频首帧
ByteRTCStreamMixingEventUpdateTimeout13更新转推直播任务配置超时
ByteRTCStreamMixingEventStartTimeout14发起转推直播任务配置超时
ByteRTCStreamMixingEventRequestParamError15合流布局参数错误
ByteRTCStreamMixingEventMixImage16合流加图片
ByteRTCMixedStreamType
typedef NS_ENUM(NSUInteger, ByteRTCMixedStreamType)
objectivec

合流方式。(新)

枚举值
类型值说明
ByteRTCMixedStreamByServer0通过服务端合流
ByteRTCMixedStreamByClient1端云一体转推
ByteRTCMixedStreamClientMixVideoFormat
typedef NS_ENUM(NSUInteger, ByteRTCMixedStreamClientMixVideoFormat)
objectivec

客户端合流回调视频格式。(新)

设置为系统不支持的格式时,自动回调系统默认格式。

枚举值
类型值说明
ByteRTCMixedStreamClientMixVideoFormatI4200YUV I420。Android、Windows 默认回调格式。支持系统:Android、Windows。
ByteRTCMixedStreamClientMixVideoFormatTexture2D1OpenGL GL_TEXTURE_2D 格式纹理。支持系统:安卓。
ByteRTCMixedStreamClientMixVideoFormatCVPixelBufferBGRA2CVPixelBuffer BGRA。iOS 默认回调格式。支持系统: iOS。
ByteRTCMixedStreamClientMixVideoFormatNV123YUV NV12。macOS 默认回调格式。支持系统: macOS。
ByteRTCMixedStreamVideoCodecType
typedef NS_ENUM(NSUInteger, ByteRTCMixedStreamVideoCodecType)
objectivec

视频编码格式。(新)

枚举值
类型值说明
ByteRTCMixedStreamVideoCodecTypeH2640H.264 格式,默认值。
ByteRTCMixedStreamVideoCodecTypeByteVC11ByteVC1 格式。
ByteRTCMixedStreamMediaType
typedef NS_ENUM(NSUInteger, ByteRTCMixedStreamMediaType)
objectivec

合流输出内容类型。(新)

枚举值
类型值说明
ByteRTCMixedStreamMediaTypeAudioAndVideo0输出的混流包含音频和视频
ByteRTCMixedStreamMediaTypeAudioOnly1输出的混流只包含音频
ByteRTCMixedStreamMediaTypeVideoOnly2输出的混流只包含视频
ByteRTCMixedStreamRenderMode
typedef NS_ENUM(NSUInteger, ByteRTCMixedStreamRenderMode)
objectivec

图片或视频流的缩放模式。(新)

枚举值
类型值说明
ByteRTCMixedStreamRenderModeHidden1视窗填满优先,默认值。
视频尺寸等比缩放,直至视窗被填满。当视频尺寸与显示窗口尺寸不一致时,多出的视频将被截掉。
ByteRTCMixedStreamRenderModeFit2视频帧内容全部显示优先。
视频尺寸等比缩放,优先保证视频内容全部显示。当视频尺寸与显示窗口尺寸不一致时,会把窗口未被填满的区域填充成背景颜色。
ByteRTCMixedStreamRenderModeAdaptive3视频帧自适应画布。
视频尺寸非等比例缩放,把窗口充满。在此过程中,视频帧的长宽比例可能会发生变化。
ByteRTCMixedStreamLayoutRegionType
typedef NS_ENUM(NSUInteger, ByteRTCMixedStreamLayoutRegionType)
objectivec

合流布局区域类型。(新)

枚举值
类型值说明
ByteRTCMixedStreamLayoutRegionTypeVideoStream0合流布局区域类型为视频。
ByteRTCMixedStreamLayoutRegionTypeImage1合流布局区域类型为图片。
ByteRTCMixedStreamVideoType
typedef NS_ENUM(NSUInteger, ByteRTCMixedStreamVideoType)
objectivec

region 中流的类型属性

枚举值
类型值说明
ByteRTCMixedStreamVideoTypeMain0主流。包括:

+ 由摄像头/麦克风通过内部采集机制,采集到的流

+ 通过自定义采集,采集到的流。
ByteRTCMixedStreamVideoTypeScreen1屏幕流。
ByteRTCClientMixVideoFormat
typedef NS_ENUM(NSUInteger, ByteRTCClientMixVideoFormat)
objectivec

客户端合流回调视频格式。设置为系统不支持的格式时,自动回调系统默认格式。

枚举值
类型值说明
ByteRTCClientMixVideoFormatI4200YUV I420。Android、Windows 默认回调格式。支持系统:Android、Windows。
ByteRTCClientMixVideoFormatTexture2D1OpenGL GL_TEXTURE_2D 格式纹理。支持系统:安卓。
ByteRTCClientMixVideoFormatCVPixelBufferBGRA2CVPixelBuffer BGRA。iOS 默认回调格式。支持系统: iOS。
ByteRTCClientMixVideoFormatNV123YUV NV12。macOS 默认回调格式。支持系统: macOS。
ByteRTCTranscodingVideoCodec
typedef NS_ENUM(NSUInteger, ByteRTCTranscodingVideoCodec)
objectivec

视频编码格式。

枚举值
类型值说明
ByteRTCTranscodingVideoCodecH2640H.264 格式,默认值。
ByteRTCTranscodingVideoCodecH2651ByteVC1 格式。
ByteRTCSubscribeMediaType
typedef NS_ENUM(NSInteger, ByteRTCSubscribeMediaType)
objectivec

订阅媒体的类型

枚举值
类型值说明
ByteRTCSubscribeMediaTypeNone0既不订阅音频,也不订阅视频
ByteRTCSubscribeMediaTypeAudioOnly1只订阅音频,不订阅视频
ByteRTCSubscribeMediaTypeVideoOnly2只订阅视频,不订阅音频
ByteRTCSubscribeMediaTypeAudioAndVideo3同时订阅音频和视频
ByteRTCPauseResumControlMediaType
typedef NS_ENUM(NSInteger, ByteRTCPauseResumControlMediaType)
objectivec

暂停/恢复接收远端的媒体流类型。

枚举值
类型值说明
ByteRTCControlMediaTypeAudio0只控制音频,不影响视频
ByteRtcControlMediaTypeVideo1只控制视频,不影响音频
ByteRtcControlMediaTypeAudioAndVideo2同时控制音频和视频
ByteRTCVideoSourceType
typedef NS_ENUM(NSInteger, ByteRTCVideoSourceType)
objectivec

视频输入源类型

枚举值
类型值说明
ByteRTCVideoSourceTypeExternal0自定义采集视频源
ByteRTCVideoSourceTypeInternal1内部采集视频源
ByteRTCVideoSourceTypeEncodedManualSimulcast2自定义编码视频源。

SDK 不会自动生成多路流,你需要自行生成并推送多路流
ByteRTCVideoSourceTypeEncodedAutoSimulcast3自定义编码视频源。

你仅需推送分辨率最大的一路编码后视频流,SDK 将自动转码生成多路小流
ByteRTCZoomConfigType
typedef NS_ENUM(NSInteger, ByteRTCZoomConfigType)
objectivec

数码变焦参数类型

枚举值
类型值说明
ByteRTCZoomFocusOffset0设置缩放系数
ByteRTCZoomMoveOffset1设置移动步长
ByteRTCZoomDirectionType
typedef NS_ENUM(NSInteger, ByteRTCZoomDirectionType)
objectivec

数字变焦操作类型

枚举值
类型值说明
ByteRTCCameraMoveLeft0相机向左移动
ByteRTCCameraMoveRight1相机向右移动
ByteRTCCameraMoveUp2相机向上移动
ByteRTCCameraMoveDown3相机向下移动
ByteRTCCameraZoomOut4相机缩小焦距
ByteRTCCameraZoomIn5相机放大焦距
ByteRTCCameraReset6恢复到原始画面
ByteRTCVideoDecoderConfig
typedef NS_ENUM(NSInteger, ByteRTCVideoDecoderConfig)
objectivec

视频解码方式

枚举值
类型值说明
ByteRTCVideoDecoderConfigRaw0开启 SDK 内部解码,只回调解码后的数据。回调为renderPixelBuffer:rotation:contentType:extendedData:
ByteRTCVideoDecoderConfigEncode1开启自定义解码,只回调解码前数据。回调为onRemoteEncodedVideoFrame:withEncodedVideoFrame:。
ByteRTCVideoDecoderConfigBoth2开启 SDK 内部解码,同时回调解码前和解码后的数据
ByteRTCVirtualBackgroundSourceType
typedef NS_ENUM(NSInteger, ByteRTCVirtualBackgroundSourceType)
objectivec

虚拟背景类型。

枚举值
类型值说明
ByteRTCVirtualBackgroundSourceTypeColor0使用纯色背景替换视频原有背景。
ByteRTCVirtualBackgroundSourceTypeImage1使用自定义图片替换视频原有背景。
ByteRTCCameraID
typedef NS_ENUM(NSInteger, ByteRTCCameraID)
objectivec

摄像头类型

枚举值
类型值说明
ByteRTCCameraIDFront0前置摄像头
ByteRTCCameraIDBack1后置摄像头
ByteRTCCameraIDInvalid3无效值
ByteRTCRecordingType
typedef NS_ENUM(NSInteger, ByteRTCRecordingType)
objectivec

本地录制的媒体类型

枚举值
类型值说明
RecordAudioOnly0只录制音频
RecordVideoOnly1只录制视频
RecordVideoAndAudio2同时录制音频和视频
ByteRTCScreenMediaType
typedef NS_ENUM(NSInteger, ByteRTCScreenMediaType)
objectivec

屏幕采集媒体类型

枚举值
类型值说明
ByteRTCScreenMediaTypeVideoOnly0只采集视频数据
ByteRTCScreenMediaTypeAudioOnly1只采集音频数据
ByteRTCScreenMediaTypeVideoAndAudio2音视频数据都采集
ByteRTCScreenCaptureSourceType
typedef NS_ENUM(NSUInteger, ByteRTCScreenCaptureSourceType)
objectivec

屏幕采集对象的类型

枚举值
类型值说明
ByteRTCScreenCaptureSourceTypeUnknown0类型未知
ByteRTCScreenCaptureSourceTypeWindow1应用程序的窗口
ByteRTCScreenCaptureSourceTypeScreen2桌面
ByteRTCMouseCursorCaptureState
typedef NS_ENUM(NSUInteger, ByteRTCMouseCursorCaptureState)
objectivec

内部采集屏幕视频流时,是否采集鼠标信息。

枚举值
类型值说明
ByteRTCMouseCursorCaptureStateOn0采集鼠标信息。
ByteRTCMouseCursorCaptureStateOff1不采集鼠标信息。
ByteRTCHighlightConfig
@interface ByteRTCHighlightConfig: NSObject
objectivec

屏幕共享时的边框高亮设置。

成员变量
类型名称
BOOLenableHighlight
uint32_tborderColor
intborderWidth
变量说明

enableHighlight
@property (assign, nonatomic) BOOL enableHighlight;
objectivec

是否显示高亮边框,默认显示。

borderColor
@property (assign, nonatomic) uint32_t borderColor;
objectivec

边框的颜色, 颜色格式为十六进制 ARGB: 0xAARRGGB。

borderWidth
@property (assign, nonatomic) int borderWidth;
objectivec

边框的宽度,单位:像素。

ByteRTCTorchState
typedef NS_ENUM(NSInteger, ByteRTCTorchState)
objectivec

相机补光灯状态

枚举值
类型值说明
ByteRTCTorchStateOff0相机补光灯关闭
ByteRTCTorchStateOn1相机补光灯打开
ByteRTCVideoDeviceType
typedef NS_ENUM(NSInteger, ByteRTCVideoDeviceType)
objectivec

当前视频设备类型

枚举值
类型值说明
ByteRTCVideoDeviceTypeUnknown-1未知视频设备
ByteRTCVideoDeviceTypeRenderDevice0视频渲染设备类型
ByteRTCVideoDeviceTypeCaptureDevice1视频采集设备类型
ByteRTCVideoDeviceTypeScreenCaptureDevice2屏幕流视频设备
ByteRTCMediaStreamType
typedef NS_OPTIONS(NSUInteger, ByteRTCMediaStreamType)
objectivec

媒体流类型

枚举值
类型值说明
ByteRTCMediaStreamTypeAudio(1 << 0)只控制音频
ByteRTCMediaStreamTypeVideo(1 << 1)只控制视频
ByteRTCMediaStreamTypeBothByteRTCMediaStreamTypeAudio | ByteRTCMediaStreamTypeVideo同时控制音频和视频
ByteRTCFrameRateRatio
typedef NS_ENUM(NSUInteger, ByteRTCFrameRateRatio)
objectivec

占发布端原始帧率的比例

枚举值
类型值说明
ByteRTCFrameRateRatioOrigin0100%
ByteRTCFrameRateRatioHalf150%
ByteRTCFrameRateRatioQuater225%
ByteRTCVideoRotationMode
typedef NS_ENUM(NSUInteger, ByteRTCVideoRotationMode)
objectivec

视频旋转模式

枚举值
类型值说明
ByteRTCVideoRotationModeFollowApp0App 方向
ByteRTCVideoRotationModeFollowGSensor1重力方向
ByteRTCExpressionDetectConfig
@interface ByteRTCExpressionDetectConfig : NSObject
objectivec

人像属性检测参数

成员变量
类型名称
BOOLenableAgeDetect
BOOLenableGenderDetect
BOOLenableEmotionDetect
BOOLenableAttractivenessDetect
BOOLenableHappinessDetect
变量说明

enableAgeDetect
@property (assign, nonatomic) BOOL enableAgeDetect;
objectivec

是否开启年龄检测。

enableGenderDetect
@property (assign, nonatomic) BOOL enableGenderDetect;
objectivec

是否开启性别检测。

enableEmotionDetect
@property (assign, nonatomic) BOOL enableEmotionDetect;
objectivec

是否开启表情检测。

enableAttractivenessDetect
@property (assign, nonatomic) BOOL enableAttractivenessDetect;
objectivec

是否开启吸引力检测。

enableHappinessDetect
@property (assign, nonatomic) BOOL enableHappinessDetect;
objectivec

是否开启开心程度检测。

ByteRTCExpressionDetectInfo
@interface ByteRTCExpressionDetectInfo : NSObject
objectivec

人像属性检测信息

成员变量
类型名称
floatage
floatboyProb
floatattractive
floathappyScore
floatsadScore
floatangryScore
floatsurpriseScore
floatarousal
floatvalence
变量说明

age
@property (assign, nonatomic) float age;
objectivec

预测年龄,取值范围 (0, 100)。

boyProb
@property (assign, nonatomic) float boyProb;
objectivec

预测为男性的概率,取值范围 (0.0, 1.0)。

attractive
@property (assign, nonatomic) float attractive;
objectivec

预测的吸引力分数,取值范围 (0, 100)。

happyScore
@property (assign, nonatomic) float happyScore;
objectivec

预测的微笑程度,取值范围 (0, 100)。

sadScore
@property (assign, nonatomic) float sadScore;
objectivec

预测的伤心程度,取值范围 (0, 100)。

angryScore
@property (assign, nonatomic) float angryScore;
objectivec

预测的生气程度,取值范围 (0, 100)。

surpriseScore
@property (assign, nonatomic) float surpriseScore;
objectivec

预测的吃惊程度,取值范围 (0, 100)。

arousal
@property (assign, nonatomic) float arousal;
objectivec

预测的情绪激动程度,取值范围 (0, 100)。

valence
@property (assign, nonatomic) float valence;
objectivec

预测的情绪正负程度,取值范围 (-100, 100)。

ByteRTCExpressionDetectResult
@interface ByteRTCExpressionDetectResult : NSObject
objectivec

人像属性检测结果

成员变量
类型名称
intdetectResult
intfaceCount
NSArray<ByteRTCExpressionDetectInfo>**detectInfo
变量说明

detectResult
@property (assign, nonatomic) int detectResult;
objectivec

特征识别结果

faceCount
@property (assign, nonatomic) int faceCount;
objectivec

识别到的人脸数量。

detectInfo
@property (nonatomic, copy) NSArray<ByteRTCExpressionDetectInfo *> * _Nonnull detectInfo;
objectivec

特征识别信息。数组的长度和检测到的人脸数量一致。参看 ByteRTCExpressionDetectInfo。

ByteRTCRectangle
@interface ByteRTCRectangle : NSObject
objectivec

矩形区域,用于指定屏幕区域。

成员变量
类型名称
intx
inty
intwidth
intheight
变量说明

x
@property(assign, nonatomic) int x;
objectivec

矩形区域左上角的 x 坐标。

y
@property(assign, nonatomic) int y;
objectivec

矩形区域左上角的 y 坐标。

width
@property(assign, nonatomic) int width;
objectivec

矩形宽度,单位:px。

height
@property(assign, nonatomic) int height;
objectivec

矩形高度,单位:px。

ByteRTCFaceDetectionResult
@interface ByteRTCFaceDetectionResult : NSObject
objectivec

人脸检测结果

成员变量
类型名称
intdetectResult
intimageWidth
intimageHeight
NSArray<ByteRTCRectangle>**faces
CMTimeframeTimestamp
变量说明

detectResult
@property(assign, nonatomic) int detectResult;
objectivec

人脸检测结果

imageWidth
@property(assign, nonatomic) int imageWidth;
objectivec

原始图片宽度(px)

imageHeight
@property(assign, nonatomic) int imageHeight;
objectivec

原始图片高度(px)

faces
@property(nonatomic, copy) NSArray<ByteRTCRectangle *> * _Nullable faces;
objectivec

识别到人脸的矩形框。数组的长度和检测到的人脸数量一致。参看 ByteRTCRectangle。

frameTimestamp
@property(assign, nonatomic) CMTime frameTimestamp;
objectivec

进行人脸识别的视频帧的时间戳。

ByteRTCVideoCanvas
@interface ByteRTCVideoCanvas : NSObject
objectivec

视频帧渲染设置

成员变量
类型名称
ByteRTCView*view
ByteRTCRenderModerenderMode
NSIntegerbackgroundColor
变量说明

view
@property(strong, nonatomic) ByteRTCView* _Nullable view;
objectivec

本地视图句柄

renderMode
@property(assign, nonatomic) ByteRTCRenderMode renderMode;
objectivec

渲染模式,参看 ByteRTCRenderMode

backgroundColor
@property(assign, nonatomic) NSInteger backgroundColor;
objectivec

用于填充画布空白部分的背景颜色。取值范围是 [0x00000000, 0xFFFFFFFF],格式为 BGR。默认值是 0x00000000。其中,透明度设置无效。

ByteRTCFrameExtendedData
@interface ByteRTCFrameExtendedData : NSObject
objectivec

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

成员变量
类型名称
ByteRTCDataFrameTypeframeType
NSData*extendedData
NSIntegerextendedDataLen
变量说明

frameType
@property(assign, nonatomic) ByteRTCDataFrameType frameType;
objectivec

数据类型,详见 ByteRTCDataFrameType。

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

附加数据

extendedDataLen
@property(assign, nonatomic) NSInteger extendedDataLen;
objectivec

附加数据长度

ByteRTCVideoSolution
@interface ByteRTCVideoSolution: NSObject
objectivec

视频流参数

成员变量
类型名称
CGSizevideoSize
NSIntegerframeRate
NSIntegermaxKbps
NSIntegerminKbps
ByteRTCVideoEncoderPreferenceencoderPreference
变量说明

videoSize
@property(nonatomic, assign) CGSize videoSize;
objectivec

视频分辨率

frameRate
@property(nonatomic, assign) NSInteger frameRate;
objectivec

视频预设帧率

maxKbps
@property(nonatomic, assign) NSInteger maxKbps;
objectivec

最高编码码率(千比特每秒)。建议使用 -1,SDK 会自动根据分辨率和帧率适配合适的码率。

minKbps
@property(nonatomic, assign) NSInteger minKbps;
objectivec

最低编码码率(千比特每秒)

encoderPreference
@property(nonatomic, assign) ByteRTCVideoEncoderPreference encoderPreference;
objectivec

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

ByteRTCVideoCaptureConfig
@interface ByteRTCVideoCaptureConfig: NSObject
objectivec

视频采集参数

成员变量
类型名称
ByteRTCVideoCapturePreferencepreference
CGSizevideoSize
NSIntegerframeRate
变量说明

preference
@property(nonatomic, assign) ByteRTCVideoCapturePreference preference;
objectivec

视频采集模式,参看 ByteRTCVideoCapturePreference

videoSize
@property(nonatomic, assign) CGSize videoSize;
objectivec

视频采集分辨率

frameRate
@property(nonatomic, assign) NSInteger frameRate;
objectivec

视频采集帧率,单位:fps。

ByteRTCStream
@protocol ByteRTCStream <NSObject>
objectivec

流属性。

成员变量
类型名称
NSString*userId
BOOLisScreen
BOOLhasVideo
BOOLhasAudio
NSArray<ByteRTCVideoSolution>**videoStreamDescriptions
ByteRTCVideoSolution*maxVideoStreamDescription
变量说明

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

发布此流的用户 ID 。

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

此流是否为共享屏幕流。

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

此流是否包括视频流。

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

流是否包括音频流。

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

视频流的分辨率信息。

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

参看 ByteRTCVideoSolution。

maxVideoStreamDescription
@property(nonatomic, retain, readonly) ByteRTCVideoSolution *maxVideoStreamDescription;
objectivec

视频流最大分辨率,在开启多分辨率发布订阅时,回调发布端能支持的最大发布分辨率。

ByteRTCStreamEx
@interface ByteRTCStreamEx : NSObject <ByteRTCStream>
objectivec

流信息

成员变量
类型名称
NSString*userId
BOOLisScreen
BOOLhasVideo
BOOLhasAudio
NSArray<ByteRTCVideoSolution>**videoStreamDescriptions
ByteRTCVideoSolution*maxVideoStreamDescription
变量说明

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

用户ID

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

流是否为共享屏幕流。

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

该路流中是否包含视频

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

该路流中是否包含音频

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

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

maxVideoStreamDescription
@property(nonatomic, retain, nullable) ByteRTCVideoSolution *maxVideoStreamDescription;
objectivec

视频流最大分辨率,在开启多分辨率发布订阅时,回调发布端能支持的最大发布分辨率。

ByteRTCSubscribeConfig
@interface ByteRTCSubscribeConfig: NSObject
objectivec

订阅流的参数配置。用户手动订阅一路音视频流所使用的订阅配置参数。

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

成员变量
类型名称
BOOLisScreen
BOOLsubscribeVideo
BOOLsubscribeAudio
NSIntegervideoIndex
NSIntegersvcLayer
NSIntegerwidth
NSIntegerheight
NSIntegerframerate
变量说明

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

是否是屏幕流。

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

subscribeVideo
@property(nonatomic, assign) BOOL subscribeVideo;
objectivec

是否订阅视频。

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

subscribeAudio
@property(nonatomic, assign) BOOL subscribeAudio;
objectivec

是否订阅音频。

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

videoIndex
@property(nonatomic, assign) NSInteger videoIndex;
objectivec

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

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

svcLayer
@property(nonatomic, assign) NSInteger svcLayer;
objectivec

订阅的视频流时域分层,默认值为 0。

width
@property(nonatomic, assign) NSInteger width;
objectivec

订阅的宽度信息,单位:px,默认值为 0。

height
@property(nonatomic, assign) NSInteger height;
objectivec

订阅的高度信息,单位:px, 默认值为0。

framerate
@property (nonatomic, assign) NSInteger framerate;
objectivec

期望订阅的最高帧率,单位:fps,默认值为 0,设为大于 0 的值时开始生效。

当发布端帧率低于设定帧率,或订阅端开启性能回退后下行弱网,则帧率会相应下降。

仅码流支持 SVC 分级编码特性时方可生效。

ByteRTCVideoFrame
@interface ByteRTCVideoFrame : NSObject
objectivec

待 SDK 编码的视频数据

成员变量
类型名称
intformat
ByteRTCVideoContentTypecontentType
CMTimetime
intstrideInPixels
intwidth
intheight
CVPixelBufferReftextureBuf
NSData*dataBuf
ByteRTCVideoRotationrotation
ByteRTCColorSpacecolorSpace
ByteRTCCameraIDcameraId
NSData*extendedData
NSData*supplementaryInfo
int[deprecated] stride
变量说明

format
@property(assign, nonatomic) int format;
objectivec

视频帧格式,参考 ByteRTCVideoPixelFormat

contentType
@property(assign, nonatomic) ByteRTCVideoContentType contentType;
objectivec

获取视频内容类型,参看 ByteRTCVideoContentType

time
@property(assign, nonatomic) CMTime time;
objectivec

当前帧的时间戳信息

stride
@property(assign, nonatomic) int stride;
objectivec

Deprecated since 3.45 and will be deleted in 3.51, use strideInPixels instead.

strideInPixels
@property(assign, nonatomic) int strideInPixels;
objectivec

每一行像素占用的字节数

width
@property(assign, nonatomic) int width;
objectivec

视频帧宽度

height
@property(assign, nonatomic) int height;
objectivec

视频帧高度

textureBuf
@property(assign, nonatomic) CVPixelBufferRef _Nullable textureBuf;
objectivec

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

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

视频帧内存块首地址

rotation
@property(assign, nonatomic) ByteRTCVideoRotation rotation;
objectivec

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

colorSpace
@property(assign, nonatomic) ByteRTCColorSpace colorSpace;
objectivec

颜色空间

cameraId
@property(assign, nonatomic) ByteRTCCameraID cameraId;
objectivec

视频帧的摄像头信息,参考 ByteRTCCameraID

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

视频帧附加的sei数据

supplementaryInfo
@property(strong, nonatomic) NSData * _Nonnull supplementaryInfo;
objectivec

视频帧附加的roi数据

ByteRTCEncodedVideoFrame
@interface ByteRTCEncodedVideoFrame : NSObject
objectivec

视频帧信息

成员变量
类型名称
ByteRTCVideoCodecTypecodecType
ByteRTCVideoPictureTypepictureType
SInt64timestampUs
SInt64timestampDtsUs
intwidth
intheight
ByteRTCVideoRotationrotation
NSData*data
变量说明

codecType
@property(assign, nonatomic) ByteRTCVideoCodecType codecType;
objectivec

视频编码类型。参看 ByteRTCVideoCodecType

pictureType
@property(assign, nonatomic) ByteRTCVideoPictureType pictureType;
objectivec

视频帧类型。参看 ByteRTCVideoPictureType

timestampUs
@property(assign, nonatomic) SInt64 timestampUs;
objectivec

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

timestampDtsUs
@property(assign, nonatomic) SInt64 timestampDtsUs;
objectivec

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

width
@property(assign, nonatomic) int width;
objectivec

视频帧宽,单位:px

height
@property(assign, nonatomic) int height;
objectivec

视频帧高,单位:px

rotation
@property(nonatomic, assign) ByteRTCVideoRotation rotation;
objectivec

视频帧旋转角度。参看 ByteRTCVideoRotation

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

视频帧数据指针地址

ByteRTCTranscoderLayoutRegionDataParam
@interface ByteRTCTranscoderLayoutRegionDataParam : NSObject
objectivec

图片合流相关参数

成员变量
类型名称
NSIntegerimageWidth
NSIntegerimageHeight
变量说明

imageWidth
@property (assign, nonatomic) NSInteger imageWidth;
objectivec

原始图片的宽度,单位为 px。

imageHeight
@property (assign, nonatomic) NSInteger imageHeight;
objectivec

原始图片的高度,单位为 px。

ByteRTCVideoCompositingRegion
@interface ByteRTCVideoCompositingRegion : NSObject
objectivec

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

成员变量
类型名称
NSString*uid
NSString*roomId
CGFloatx
CGFloaty
CGFloatwidth
CGFloatheight
NSIntegerzOrder
BOOLlocalUser
BOOLscreenStream
CGFloatalpha
CGFloatcornerRadius
ByteRTCTranscoderContentControlTypecontentControl
ByteRTCRenderModerenderMode
ByteRTCTranscoderLayoutRegionTypetype
NSData*data
ByteRTCTranscoderLayoutRegionDataParam*dataParam
Position*spatialPosition
BOOLapplySpatialAudio
变量说明

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

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

roomId
@property(copy, nonatomic) NSString * _Nonnull roomId;
objectivec

图片或视频流所在房间的房间 ID。必填。
如果此图片或视频流是通过 startForwardStreamToRooms: 转发到你所在房间的媒体流时,你应将房间 ID 设置为你所在的房间 ID。

x
@property(assign, nonatomic) CGFloat x;
objectivec

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

y
@property(assign, nonatomic) CGFloat y;
objectivec

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

width
@property(assign, nonatomic) CGFloat width;
objectivec

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

height
@property(assign, nonatomic) CGFloat height;
objectivec

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

zOrder
@property(assign, nonatomic) NSInteger zOrder;
objectivec

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

localUser
@property(assign, nonatomic) BOOL localUser;
objectivec

是否为本地用户

screenStream
@property(assign, nonatomic) BOOL screenStream;
objectivec

(仅服务端合流支持合屏幕流)是否为屏幕流,默认为 NO

alpha
@property(assign, nonatomic) CGFloat alpha;
objectivec

(仅服务端合流支持设置)透明度,可选范围为 (0.0, 1.0],0.0 为全透明。默认值为 1.0。

cornerRadius
@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 相对画布宽度的比例值。

contentControl
@property (assign, nonatomic) ByteRTCTranscoderContentControlType contentControl;
objectivec

(仅服务端合流支持设置)合流内容控制。默认值为 ByteRTCTranscoderContentControlTypeHasAudioAndVideo,参看 ByteRTCTranscoderContentControlType 。

renderMode
@property(assign, nonatomic) ByteRTCRenderMode renderMode;
objectivec

图片或视频流的缩放模式,参看 ByteRTCRenderMode。默认值为 1。

type
@property (assign, nonatomic) ByteRTCTranscoderLayoutRegionType type;
objectivec

合流布局区域类型。参看 ByteRTCTranscoderLayoutRegionType。

data
@property (strong, nonatomic) NSData * _Nullable data;
objectivec

图片合流布局区域类型对应的数据。类型为图片时传入图片 RGBA 数据,当类型为视频流时传空。

dataParam
@property (strong, nonatomic) ByteRTCTranscoderLayoutRegionDataParam * _Nullable dataParam;
objectivec

合流布局区域数据的对应参数。当类型为视频流时传空,类型为图片时传入对应图片的参数,参看 ByteRTCTranscoderLayoutRegionDataParam。

spatialPosition
@property (strong, nonatomic) Position * _Nullable spatialPosition;
objectivec

空间位置。参看 Position。

applySpatialAudio
@property(assign, nonatomic) BOOL applySpatialAudio;
objectivec
ByteRTCVideoCompositingLayout
@interface ByteRTCVideoCompositingLayout : NSObject
objectivec

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

成员变量
类型名称
NSString*backgroundColor
NSArray<ByteRTCVideoCompositingRegion>**regions
NSString*appData
变量说明

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

合流背景颜色,用十六进制颜色码(HEX)表示。例如,#FFFFFF 表示纯白,#000000 表示纯黑。默认值为 #000000。
值不合法或未设置时,自动使用默认值。

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

用户布局信息列表。每条流的具体布局参看 ByteRTCVideoCompositingRegion。
值不合法或未设置时,自动使用默认值。

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

透传的 App 数据,长度不超过 4KB。

ByteRTCTranscodingVideoConfig
@interface ByteRTCTranscodingVideoConfig : NSObject
objectivec

视频转码配置参数。值不合法或未设置时,自动使用默认值。

成员变量
类型名称
ByteRTCTranscodingVideoCodeccodec
NSIntegerwidth
NSIntegerheight
NSIntegerfps
NSIntegergop
NSIntegerkBitRate
BOOLbFrame
BOOL[deprecated] lowLatency
变量说明

codec
@property(assign, nonatomic) ByteRTCTranscodingVideoCodec codec;
objectivec

视频编码格式,参看 ByteRTCTranscodingVideoCodec。默认值为 0。
本参数不支持过程中更新。

width
@property(assign, nonatomic) NSInteger width;
objectivec

合流视频宽度。单位为 px,范围为 [2, 1920],必须是偶数。默认值为 640 px。
设置值为非偶数时,自动向上取偶数。

height
@property(assign, nonatomic) NSInteger height;
objectivec

合流视频高度。单位为 px,范围为 [2, 1920],必须是偶数。默认值为 360 px。
设置值为非偶数时,自动向上取偶数。

fps
@property(assign, nonatomic) NSInteger fps;
objectivec

合流视频帧率。单位为 FPS,取值范围为 [1,60],默认值为 15 FPS。

gop
@property(assign, nonatomic) NSInteger gop;
objectivec

视频 I 帧时间间隔。单位为秒,取值范围为 [1, 5],默认值为 2 秒。
本参数不支持过程中更新。

kBitRate
@property(assign, nonatomic) NSInteger kBitRate;
objectivec

合流视频码率。单位为 Kbps,取值范围为 [1,10000],默认值为自适应模式。

lowLatency
@property(assign, nonatomic) BOOL lowLatency;
objectivec

是否使用低延时特性。

Deprecated since 3.45 and will be deleted in 3.51.

bFrame
@property(assign, nonatomic) BOOL bFrame;
objectivec

是否在合流中开启B帧,仅服务端合流支持.

ByteRTCTranscodingAudioConfig
@interface ByteRTCTranscodingAudioConfig : NSObject
objectivec

音频转码配置参数。值不合法或未设置时,自动使用默认值。
本参数不支持过程中更新。

成员变量
类型名称
ByteRTCTranscodingAudioCodeccodec
NSIntegersampleRate
NSIntegerchannels
NSIntegerkBitRate
ByteRTCAACProfileprofile
静态函数
返回名称
NSString*[deprecated] toStringWithProfile:
变量说明

codec
@property(assign, nonatomic) ByteRTCTranscodingAudioCodec codec;
objectivec

音频编码格式。

sampleRate
@property(assign, nonatomic) NSInteger sampleRate;
objectivec

音频采样率,单位 Hz。可取 32000 Hz、44100 Hz、48000 Hz,默认值为 48000 Hz。

channels
@property(assign, nonatomic) NSInteger channels;
objectivec

音频声道数。可取 1(单声道)、2(双声道),默认值为 2。

kBitRate
@property(assign, nonatomic) NSInteger kBitRate;
objectivec

音频码率,单位 Kbps。可取范围 [32, 192],默认值为 64 Kbps。

profile
@property(assign, nonatomic) ByteRTCAACProfile profile;
objectivec

AAC 编码规格,参看 ByteRTCAACProfile。默认值为 0。

函数说明

toStringWithProfile:
+ (NSString* _Nonnull) toStringWithProfile:(ByteRTCAACProfile) aacProfile;
objectivec

Deprecated since 3.45 and will be deleted in 3.51.

ByteRTCTranscodingSpatialConfig
@interface ByteRTCTranscodingSpatialConfig : NSObject
objectivec

推流 CDN 的空间音频参数。

成员变量
类型名称
BOOLenableSpatialRender
Position*audienceSpatialPosition
HumanOrientation*audienceSpatialOrientation
变量说明

enableSpatialRender
@property(assign, nonatomic) BOOL enableSpatialRender;
objectivec

是否开启推流 CDN 时的空间音频效果。

注意:
当你启用此效果时,你需要设定推流中各个 ByteRTCTranscodingSpatialConfig 的 spatialPosition 值,实现空间音频效果。
当你启用此效果时,你需要设定推流中各个 ByteRTCTranscodingSpatialConfig 的 spatialPosition 值,实现空间音频效果。

audienceSpatialPosition
@property (strong, nonatomic) Position * _Nullable audienceSpatialPosition;
objectivec

听众的空间位置。参看 Position。

听众指收听来自 CDN 的音频流的用户。

audienceSpatialOrientation
@property(strong, nonatomic) HumanOrientation * _Nullable audienceSpatialOrientation;
objectivec

听众的空间朝向。参看 HumanOrientation。

听众指收听来自 CDN 的音频流的用户。

ByteRTCTranscodingClientMixParam
@interface ByteRTCTranscodingClientMixParam : NSObject
objectivec

客户端合流参数。

成员变量
类型名称
BOOLclientMixUseOriginalFrame
BOOLclientMixUseAudioMixer
ByteRTCClientMixVideoFormatclientMixVideoFormat
变量说明

clientMixUseOriginalFrame
@property(assign, nonatomic) BOOL clientMixUseOriginalFrame;
objectivec

是否使用原始视频帧。默认为 False。

clientMixUseAudioMixer
@property(assign, nonatomic) BOOL clientMixUseAudioMixer;
objectivec

客户端合流是否使用音频混音,默认为 true。

clientMixVideoFormat
@property(assign, nonatomic) ByteRTCClientMixVideoFormat clientMixVideoFormat;
objectivec

客户端合流回调视频格式,参看 ByteRTCClientMixVideoFormat。

ByteRTCLiveTranscoding
@interface ByteRTCLiveTranscoding : NSObject
objectivec

转推直播配置参数。

成员变量
类型名称
ByteRTCStreamMixingTypeexpectedMixingType
ByteRTCVideoCompositingLayout*layout
ByteRTCTranscodingVideoConfig*video
ByteRTCTranscodingAudioConfig*audio
ByteRTCTranscodingClientMixParam*clientMixParam
NSString*url
NSString*roomId
NSString*userId
静态函数
返回名称
instancetypedefaultTranscoding
变量说明

expectedMixingType
@property(assign, nonatomic) ByteRTCStreamMixingType expectedMixingType;
objectivec

合流类型,详见 ByteRTCStreamMixingType 数据类型。
本参数不支持过程中更新。

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

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

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

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

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

音频转码配置参数,参看 ByteRTCTranscodingAudioConfig。

clientMixParam
@property(strong, nonatomic) ByteRTCTranscodingClientMixParam * _Nullable clientMixParam;
objectivec

客户端合流配置。详见 ByteRTCTranscodingClientMixParam 。

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

推流 CDN 地址。仅支持 RTMP 协议,Url 必须满足正则 /^rtmps?:\/\//。
本参数不支持过程中更新。

roomId
@property(copy, nonatomic) NSString * _Nonnull roomId;
objectivec

推流房间 ID。roomId 和 userId 长度相加不得超过 126 字节。
本参数不支持过程中更新。

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

推流用户 ID。roomId 和 userId 长度相加不得超过 126 字节。
本参数不支持过程中更新。

函数说明

defaultTranscoding
+ (instancetype _Nonnull)defaultTranscoding;
objectivec

获取默认转推直播配置参数。

返回值
转推直播配置参数,参看 ByteRTCLiveTranscoding。

ByteRTCMixedStreamLayoutRegionImageWaterMarkConfig
@interface ByteRTCMixedStreamLayoutRegionImageWaterMarkConfig : NSObject
objectivec

图片合流相关参数。(新)

成员变量
类型名称
NSIntegerimageWidth
NSIntegerimageHeight
变量说明

imageWidth
@property (assign, nonatomic) NSInteger imageWidth;
objectivec

原始图片的宽度,单位为 px。

imageHeight
@property (assign, nonatomic) NSInteger imageHeight;
objectivec

原始图片的高度,单位为 px。

ByteRTCMixedStreamLayoutRegionConfig
@interface ByteRTCMixedStreamLayoutRegionConfig : NSObject
objectivec

单个图片或视频流在合流中的布局信息。(新)

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

成员变量
类型名称
NSString*userID
NSString*roomID
CGFloatlocationX
CGFloatlocationY
CGFloatwidthProportion
CGFloatheightProportion
NSIntegerzOrder
BOOLisLocalUser
ByteRTCMixedStreamVideoTypestreamType
CGFloatalpha
CGFloatcornerRadius
ByteRTCMixedStreamMediaTypemediaType
ByteRTCMixedStreamRenderModerenderMode
ByteRTCMixedStreamLayoutRegionTyperegionContentType
NSData*imageWaterMark
ByteRTCMixedStreamLayoutRegionImageWaterMarkConfig*imageWaterMarkConfig
Position*spatialPosition
BOOLapplySpatialAudio
变量说明

userID
@property(copy, nonatomic) NSString * _Nonnull userID;
objectivec

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

roomID
@property(copy, nonatomic) NSString * _Nonnull roomID;
objectivec

图片或视频流所在房间的房间 ID。必填。
如果此图片或视频流是通过 startForwardStreamToRooms: 转发到你所在房间的媒体流时,你应将房间 ID 设置为你所在的房间 ID。

locationX
@property(assign, nonatomic) CGFloat locationX;
objectivec

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

locationY
@property(assign, nonatomic) CGFloat locationY;
objectivec

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

widthProportion
@property(assign, nonatomic) CGFloat widthProportion;
objectivec

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

heightProportion
@property(assign, nonatomic) CGFloat heightProportion;
objectivec

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

zOrder
@property(assign, nonatomic) NSInteger zOrder;
objectivec

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

isLocalUser
@property(assign, nonatomic) BOOL isLocalUser;
objectivec

是否为本地用户

streamType
@property(assign, nonatomic) ByteRTCMixedStreamVideoType streamType;
objectivec

流类型,默认为主流

alpha
@property(assign, nonatomic) CGFloat alpha;
objectivec

透明度,可选范围为 (0.0, 1.0],0.0 为全透明。默认值为 1.0。

cornerRadius
@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 相对画布宽度的比例值。

mediaType
@property (assign, nonatomic) ByteRTCMixedStreamMediaType mediaType;
objectivec

合流内容控制。默认值为 ByteRTCTranscoderContentControlTypeHasAudioAndVideo,参看 ByteRTCMixedStreamMediaType 。

renderMode
@property(assign, nonatomic) ByteRTCMixedStreamRenderMode renderMode;
objectivec

图片或视频流的缩放模式,参看 ByteRTCMixedStreamRenderMode。默认值为 1。

regionContentType
@property (assign, nonatomic) ByteRTCMixedStreamLayoutRegionType regionContentType;
objectivec

合流布局区域类型。参看 ByteRTCMixedStreamLayoutRegionType。

imageWaterMark
@property (strong, nonatomic) NSData * _Nullable imageWaterMark;
objectivec

图片合流布局区域类型对应的数据。类型为图片时传入图片 RGBA 数据,当类型为视频流时传空。

imageWaterMarkConfig
@property (strong, nonatomic) ByteRTCMixedStreamLayoutRegionImageWaterMarkConfig * _Nullable imageWaterMarkConfig;
objectivec

合流布局区域数据的对应参数。当类型为视频流时传空,类型为图片时传入对应图片的参数,参看 ByteRTCMixedStreamLayoutRegionImageWaterMarkConfig。

spatialPosition
@property (strong, nonatomic) Position * _Nullable spatialPosition;
objectivec

空间位置。参看 Position。

applySpatialAudio
@property(assign, nonatomic) BOOL applySpatialAudio;
objectivec
ByteRTCMixedStreamLayoutConfig
@interface ByteRTCMixedStreamLayoutConfig : NSObject
objectivec

视频流合流整体布局信息。(新)

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

成员变量
类型名称
NSString*backgroundColor
NSArray<ByteRTCMixedStreamLayoutRegionConfig>**regions
NSString*userConfigExtraInfo
变量说明

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

合流背景颜色,用十六进制颜色码(HEX)表示。例如,#FFFFFF 表示纯白,#000000 表示纯黑。默认值为 #000000。
值不合法或未设置时,自动使用默认值。

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

用户布局信息列表。每条流的具体布局参看 ByteRTCMixedStreamLayoutRegionConfig。
值不合法或未设置时,自动使用默认值。

userConfigExtraInfo
@property(copy, nonatomic) NSString *_Nonnull userConfigExtraInfo;
objectivec

用户透传的额外数据。

ByteRTCMixedStreamVideoConfig
@interface ByteRTCMixedStreamVideoConfig : NSObject
objectivec

视频转码配置参数。(新)

值不合法或未设置时,自动使用默认值。

成员变量
类型名称
ByteRTCMixedStreamVideoCodecTypevideoCodec
NSIntegerwidth
NSIntegerheight
NSIntegerfps
NSIntegergop
NSIntegerbitrate
BOOLenableBFrame
变量说明

videoCodec
@property(assign, nonatomic) ByteRTCMixedStreamVideoCodecType videoCodec;
objectivec

视频编码格式,参看 ByteRTCMixedStreamVideoCodecType。默认值为 0。
本参数不支持过程中更新。

width
@property(assign, nonatomic) NSInteger width;
objectivec

合流视频宽度。单位为 px,范围为 [2, 1920],必须是偶数。默认值为 640 px。
设置值为非偶数时,自动向上取偶数。

height
@property(assign, nonatomic) NSInteger height;
objectivec

合流视频高度。单位为 px,范围为 [2, 1920],必须是偶数。默认值为 360 px。
设置值为非偶数时,自动向上取偶数。

fps
@property(assign, nonatomic) NSInteger fps;
objectivec

合流视频帧率。单位为 FPS,取值范围为 [1,60],默认值为 15 FPS。

gop
@property(assign, nonatomic) NSInteger gop;
objectivec

视频 I 帧时间间隔。单位为秒,取值范围为 [1, 5],默认值为 2 秒。
本参数不支持过程中更新。

bitrate
@property(assign, nonatomic) NSInteger bitrate;
objectivec

合流视频码率。单位为 Kbps,取值范围为 [1,10000],默认值为自适应模式。

enableBFrame
@property(assign, nonatomic) BOOL enableBFrame;
objectivec

是否在合流中开启B帧,仅服务端合流支持.

ByteRTCMixedStreamAudioConfig
@interface ByteRTCMixedStreamAudioConfig : NSObject
objectivec

音频转码配置参数。(新)

值不合法或未设置时,自动使用默认值。

本参数不支持过程中更新。

成员变量
类型名称
ByteRTCMixedStreamAudioCodecTypeaudioCodec
NSIntegersampleRate
NSIntegerchannels
NSIntegerbitrate
ByteRTCMixedStreamAudioProfileaudioProfile
变量说明

audioCodec
@property(assign, nonatomic) ByteRTCMixedStreamAudioCodecType audioCodec;
objectivec

音频编码格式。

sampleRate
@property(assign, nonatomic) NSInteger sampleRate;
objectivec

音频采样率,单位 Hz。可取 32000 Hz、44100 Hz、48000 Hz,默认值为 48000 Hz。

channels
@property(assign, nonatomic) NSInteger channels;
objectivec

音频声道数。可取 1(单声道)、2(双声道),默认值为 2。

bitrate
@property(assign, nonatomic) NSInteger bitrate;
objectivec

音频码率,单位 Kbps。可取范围 [32, 192],默认值为 64 Kbps。

audioProfile
@property(assign, nonatomic) ByteRTCMixedStreamAudioProfile audioProfile;
objectivec

AAC 编码规格,参看 ByteRTCMixedStreamAudioProfile。默认值为 0。

ByteRTCMixedStreamSpatialAudioConfig
@interface ByteRTCMixedStreamSpatialAudioConfig : NSObject
objectivec

推流 CDN 的空间音频参数。(新)

成员变量
类型名称
BOOLenableSpatialRender
Position*audienceSpatialPosition
HumanOrientation*audienceSpatialOrientation
变量说明

enableSpatialRender
@property(assign, nonatomic) BOOL enableSpatialRender;
objectivec

是否开启推流 CDN 时的空间音频效果。

注意:
当你启用此效果时,你需要设定推流中各个 ByteRTCMixedStreamLayoutRegionConfig 的 spatialPosition 值,实现空间音频效果。
当你启用此效果时,你需要设定推流中各个 ByteRTCMixedStreamLayoutRegionConfig 的 spatialPosition 值,实现空间音频效果。

audienceSpatialPosition
@property (strong, nonatomic) Position * _Nullable audienceSpatialPosition;
objectivec

听众的空间位置。参看 Position。

听众指收听来自 CDN 的音频流的用户。

audienceSpatialOrientation
@property(strong, nonatomic) HumanOrientation * _Nullable audienceSpatialOrientation;
objectivec

听众的空间朝向。参看 HumanOrientation。

听众指收听来自 CDN 的音频流的用户。

ByteRTCMixedStreamClientMixConfig
@interface ByteRTCMixedStreamClientMixConfig : NSObject
objectivec

客户端合流参数。(新)

成员变量
类型名称
BOOLuseAudioMixer
ByteRTCMixedStreamClientMixVideoFormatvideoFormat
变量说明

useAudioMixer
@property(assign, nonatomic) BOOL useAudioMixer;
objectivec

客户端合流是否使用混音,默认为 true。

videoFormat
@property(assign, nonatomic) ByteRTCMixedStreamClientMixVideoFormat videoFormat;
objectivec

客户端合流回调视频格式,参看 ByteRTCMixedStreamClientMixVideoFormat。

ByteRTCMixedStreamConfig
@interface ByteRTCMixedStreamConfig : NSObject
objectivec

转推直播配置参数。(新)

成员变量
类型名称
ByteRTCMixedStreamTypeexpectedMixingType
ByteRTCMixedStreamLayoutConfig*layoutConfig
ByteRTCMixedStreamVideoConfig*videoConfig
ByteRTCMixedStreamAudioConfig*audioConfig
ByteRTCMixedStreamClientMixConfig*clientMixConfig
NSString*pushURL
NSString*roomID
NSString*userID
静态函数
返回名称
instancetypedefaultMixedStreamConfig
变量说明

expectedMixingType
@property(assign, nonatomic) ByteRTCMixedStreamType expectedMixingType;
objectivec

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

layoutConfig
@property(strong, nonatomic) ByteRTCMixedStreamLayoutConfig * _Nonnull layoutConfig;
objectivec

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

videoConfig
@property(strong, nonatomic) ByteRTCMixedStreamVideoConfig * _Nonnull videoConfig;
objectivec

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

audioConfig
@property(strong, nonatomic) ByteRTCMixedStreamAudioConfig * _Nonnull audioConfig;
objectivec

音频合流配置参数,参看 ByteRTCMixedStreamAudioConfig。

clientMixConfig
@property(strong, nonatomic) ByteRTCMixedStreamClientMixConfig * _Nullable clientMixConfig;
objectivec

客户端合流配置。详见 ByteRTCMixedStreamClientMixConfig 。

pushURL
@property(copy, nonatomic) NSString * _Nullable pushURL;
objectivec

推流 CDN 地址。仅支持 RTMP 协议,Url 必须满足正则 /^rtmps?:\/\//。
本参数不支持过程中更新。

roomID
@property(copy, nonatomic) NSString * _Nonnull roomID;
objectivec

推流房间 ID。roomID 和 userID 长度相加不得超过 126 字节。
本参数不支持过程中更新。

userID
@property(copy, nonatomic) NSString * _Nonnull userID;
objectivec

推流用户 ID。roomID 和 userID 长度相加不得超过 126 字节。
本参数不支持过程中更新。

函数说明

defaultMixedStreamConfig
+ (instancetype _Nonnull)defaultMixedStreamConfig;
objectivec

获取默认转推直播配置参数。

返回值
转推直播配置参数,参看 ByteRTCMixedStreamConfig。

ByteRTCPushSingleStreamParam
@interface ByteRTCPushSingleStreamParam : NSObject
objectivec

单流转推直播配置参数。

成员变量
类型名称
NSString*url
NSString*roomId
NSString*userId
BOOLisScreen
变量说明

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

推流地址

roomId
@property(copy, nonatomic) NSString * _Nonnull roomId;
objectivec

媒体流所在的房间 ID

userId
@property(copy, nonatomic) NSString * _Nullable userId;
objectivec

媒体流所属的用户 ID

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

媒体流是否为屏幕流。

ByteRTCSubscribeVideoConfig
@interface ByteRTCSubscribeVideoConfig : NSObject
objectivec

视频订阅配置信息

成员变量
类型名称
NSIntegervideoIndex
NSIntegerpriority
变量说明

videoIndex
@property(assign, nonatomic) NSInteger videoIndex;
objectivec

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

当远端用户通过调用 enableSimulcastMode: 方法启动发布多路不同分辨率的视频流时,本地用户需通过此参数指定希望订阅的流。

默认值为 0,即订阅第一路流。

如果不想更改之前的设置,可以输入 -1。

priority
@property(assign, nonatomic) NSInteger priority;
objectivec

远端用户优先级,参看 ByteRTCRemoteUserPriority,默认值为 0。

ByteRTCSourceWantedData
@interface ByteRTCSourceWantedData : NSObject
objectivec

性能回退相关数据

成员变量
类型名称
NSIntegerwidth
NSIntegerheight
NSIntegerframeRate
变量说明

width
@property(nonatomic, assign) NSInteger width;
objectivec

推荐视频输入宽

height
@property(nonatomic, assign) NSInteger height;
objectivec

推荐视频输入高

frameRate
@property(nonatomic, assign) NSInteger frameRate;
objectivec

推荐视频输入帧率

ByteRTCRemoteStreamSwitchEvent
@interface ByteRTCRemoteStreamSwitchEvent : NSObject
objectivec

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

成员变量
类型名称
NSString*uid
BOOLisScreen
NSIntegerbeforeVideoIndex
NSIntegerafterVideoIndex
BOOLbeforeVideoEnabled
BOOLafterVideoEnabled
ByteRTCFallbackOrRecoverReasonreason
变量说明

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

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

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

流是否是屏幕流

beforeVideoIndex
@property(nonatomic, assign) NSInteger beforeVideoIndex;
objectivec

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

afterVideoIndex
@property(nonatomic, assign) NSInteger afterVideoIndex;
objectivec

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

beforeVideoEnabled
@property(nonatomic, assign) BOOL beforeVideoEnabled;
objectivec

流切换前是否有视频流

afterVideoEnabled
@property(nonatomic, assign) BOOL afterVideoEnabled;
objectivec

流切换后是否有视频流

reason
@property(nonatomic, assign) ByteRTCFallbackOrRecoverReason reason;
objectivec

流切换原因,详见 ByteRTCFallbackOrRecoverReason。

ByteRTCVideoSinkDelegate
@protocol ByteRTCVideoSinkDelegate <NSObject>
objectivec

自定义视频渲染器

成员函数
返回名称
voidrenderPixelBuffer:rotation:contentType:extendedData:
函数说明

renderPixelBuffer:rotation:contentType:extendedData:
- (void)renderPixelBuffer:(CVPixelBufferRef _Nonnull)pixelBuffer rotation:(ByteRTCVideoRotation)rotation contentType:(ByteRTCVideoContentType)contentType extendedData:(NSData * _Nullable)extendedData;
objectivec

输出视频的 PixelBuffer

传入参数

参数名类型说明
pixelBufferCVPixelBufferRef视频的 PixelBuffer
rotationByteRTCVideoRotation视频旋转角度,参看 ByteRTCVideoRotation
contentTypeByteRTCVideoContentType视频内部类型 参看 ByteRTCVideoContentType
extendedDataNSData*视频解码后获得的附加数据
ByteRTCVideoPreprocessorConfig
@interface ByteRTCVideoPreprocessorConfig : NSObject
objectivec

视频处理配置参数

成员变量
类型名称
ByteRTCVideoPixelFormatrequired_pixel_format
变量说明

required_pixel_format
@property(nonatomic, assign) ByteRTCVideoPixelFormat required_pixel_format;
objectivec

视频帧的像素格式,参看 ByteRTCVideoPixelFormat。
当前仅支持 ByteRTCVideoPixelFormatI420 和 ByteRTCVideoPixelFormatUnknown 格式。

ByteRTCScreenCaptureParam
@interface ByteRTCScreenCaptureParam : NSObject
objectivec

屏幕采集设置参数

成员变量
类型名称
NSIntegerwidth
NSIntegerheight
NSIntegerframeRate
NSIntegerbitrate
NSIntegerminBitrate
CGRectregionRect
ByteRTCMouseCursorCaptureStatemouseCursorCaptureState
NSArray<NSNumber>**excludedWindowList
ByteRTCHighlightConfig*highlightConfig
变量说明

width
@property(nonatomic, assign) NSInteger width;
objectivec

屏幕采集宽度

height
@property(nonatomic, assign) NSInteger height;
objectivec

屏幕采集高度

frameRate
@property(nonatomic, assign) NSInteger frameRate;
objectivec

屏幕采集帧率,单位 fps

bitrate
@property(nonatomic, assign) NSInteger bitrate;
objectivec

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

minBitrate
@property(nonatomic, assign) NSInteger minBitrate;
objectivec

视频最小编码码率, 单位 kbps。编码码率不会低于 minBitrate。

默认值为 0。

范围:[0, bitrate),当 bitrate < minBitrate 时,为适配码率模式。

以下情况,设置本参数无效:

regionRect
@property(nonatomic, assign) CGRect regionRect;
objectivec

采集区域

mouseCursorCaptureState
@property(nonatomic, assign) ByteRTCMouseCursorCaptureState mouseCursorCaptureState;
objectivec

是否采集鼠标

excludedWindowList
@property (strong, nonatomic) NSArray<NSNumber *> * _Nullable excludedWindowList;
objectivec

屏幕过滤设置

highlightConfig
@property (strong, nonatomic) ByteRTCHighlightConfig * _Nonnull highlightConfig;
objectivec

采集区域的边框高亮设置,参看 ByteRTCHighlightConfig。

ByteRTCScreenCaptureSourceInfo
@interface ByteRTCScreenCaptureSourceInfo : NSObject
objectivec

屏幕采集对象的具体信息

成员变量
类型名称
ByteRTCScreenCaptureSourceTypesourceType
intptr_tsourceId
NSString*sourceName
NSString*application
intpid
BOOLprimaryMonitor
CGRectregionRect
变量说明

sourceType
@property (assign, nonatomic) ByteRTCScreenCaptureSourceType sourceType;
objectivec

屏幕分享时,共享对象的类型,参看 ByteRTCScreenCaptureSourceType

sourceId
@property (assign, nonatomic) intptr_t sourceId;
objectivec

屏幕分享时,共享对象的 ID。

sourceName
@property (copy, nonatomic) NSString * _Nullable sourceName;
objectivec

屏幕分享时共享对象的名称。

application
@property (copy, nonatomic) NSString * _Nullable application;
objectivec

共享的应用窗体所属应用的名称

当共享对象为应用窗体时有效

pid
@property (assign, nonatomic) int pid;
objectivec

共享的应用窗体所属应用进程的 pid

当共享对象为应用窗体时有效

primaryMonitor
@property (assign, nonatomic) BOOL primaryMonitor;
objectivec

共享的屏幕是否为主屏。

当共享对象为屏幕时有效

regionRect
@property (assign, nonatomic) CGRect regionRect;
objectivec

屏幕共享对象的坐标。多显示器的场景下,屏幕坐标系统以主屏左上角为原点 (0, 0),向右向下扩展。

ByteRTCScreenParam
@interface ByteRTCScreenParam : NSObject
objectivec

屏幕采集设置参数

成员变量
类型名称
NSIntegerframeRate
NSIntegerbitrate
变量说明

frameRate
@property(nonatomic, assign) NSInteger frameRate;
objectivec

编码帧率,单位为 fps

bitrate
@property(nonatomic, assign) NSInteger bitrate;
objectivec

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

ByteRTCVirtualBackgroundSource
@interface ByteRTCVirtualBackgroundSource: NSObject
objectivec

虚拟背景对象。

成员变量
类型名称
ByteRTCVirtualBackgroundSourceTypesourceType
intsourceColor
NSString*sourcePath
变量说明

sourceType
@property(nonatomic, assign) ByteRTCVirtualBackgroundSourceType sourceType;
objectivec

虚拟背景类型,详见 ByteRTCVirtualBackgroundSourceType 。

sourceColor
@property int sourceColor;
objectivec

纯色背景使用的颜色。

格式为 0xAARRGGBB 。

sourcePath
@property(nonatomic) NSString* _Nullable sourcePath;
objectivec

自定义背景图片的绝对路径。

ByteRTCVideoFrameInfo
@interface ByteRTCVideoFrameInfo : NSObject
objectivec

视频帧基础信息

成员变量
类型名称
NSIntegerwidth
NSIntegerheight
ByteRTCVideoRotationrotation
变量说明

width
@property(nonatomic, assign) NSInteger width;
objectivec

视频帧的宽度(像素)

height
@property(nonatomic, assign) NSInteger height;
objectivec

视频帧的高度(像素)

rotation
@property(nonatomic, assign) ByteRTCVideoRotation rotation;
objectivec

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

ByteRTCVideoEncoderConfig
@interface ByteRTCVideoEncoderConfig: NSObject
objectivec

视频编码配置。参考 设置视频发布参数

成员变量
类型名称
NSIntegerwidth
NSIntegerheight
NSIntegerframeRate
NSIntegermaxBitrate
NSIntegerminBitrate
ByteRTCVideoEncoderPreferenceencoderPreference
变量说明

width
@property(nonatomic, assign) NSInteger width;
objectivec

视频宽度,单位:px

height
@property(nonatomic, assign) NSInteger height;
objectivec

视频高度,单位:px

frameRate
@property(nonatomic, assign) NSInteger frameRate;
objectivec

视频帧率,单位:fps

maxBitrate
@property(nonatomic, assign) NSInteger maxBitrate;
objectivec

最大编码码率,使用 SDK 内部采集时可选设置,自定义采集时必须设置,单位:kbps。

设为 -1 即适配码率模式,系统将根据输入的分辨率和帧率自动计算适用的码率。

设为 0 则不对视频流进行编码发送。

344 及以上版本,内部采集时默认值为 -1,344 以前版本无默认值,需手动设置。

minBitrate
@property(nonatomic, assign) NSInteger minBitrate;
objectivec

视频最小编码码率, 单位 kbps。编码码率不会低于 minBitrate。

默认值为 0。

范围:[0, maxBitrate),当 maxBitrate < minBitrate 时,为适配码率模式。

以下情况,设置本参数无效:

encoderPreference
@property(nonatomic, assign) ByteRTCVideoEncoderPreference encoderPreference;
objectivec

编码策略偏好,默认为帧率优先。参看 ByteRTCVideoEncoderPreference。

ByteRTCScreenVideoEncoderConfig
@interface ByteRTCScreenVideoEncoderConfig: NSObject
objectivec

屏幕流编码配置。参考 设置视频发布参数。

成员变量
类型名称
NSIntegerwidth
NSIntegerheight
NSIntegerframeRate
NSIntegermaxBitrate
NSIntegerminBitrate
ByteRTCScreenVideoEncoderPreferenceencoderPreference
变量说明

width
@property(nonatomic, assign) NSInteger width;
objectivec

屏幕帧宽度,单位:px。

height
@property(nonatomic, assign) NSInteger height;
objectivec

屏幕帧高度,单位:px。

frameRate
@property(nonatomic, assign) NSInteger frameRate;
objectivec

屏幕流帧率,单位:fps。

maxBitrate
@property(nonatomic, assign) NSInteger maxBitrate;
objectivec

最大编码码率,使用 SDK 内部采集时可选设置,自定义采集时必须设置,单位:kbps。
设为 -1 即适配码率模式,系统将根据输入的分辨率和帧率自动计算适用的码率。
设为 0 则不对视频流进行编码发送。
3.44 及以上版本,内部采集时默认值为 -1,3.44 以前版本无默认值,需手动设置。

minBitrate
@property(nonatomic, assign) NSInteger minBitrate;
objectivec

最小编码码率,使用 SDK 内部采集时可选设置,自定义采集时必须设置,单位:kbps。
最小编码码率必须小于或等于最大编码,否则不对视频流进行编码发送。

encoderPreference
@property(nonatomic, assign) ByteRTCScreenVideoEncoderPreference encoderPreference;
objectivec

屏幕流编码模式。参见 ByteRTCScreenVideoEncoderPreference。

ByteRTCRemoteVideoConfig
@interface ByteRTCRemoteVideoConfig : NSObject
objectivec

远端视频帧信息

成员变量
类型名称
intframerate
intwidth
intheight
变量说明

framerate
@property (nonatomic, assign) int framerate;
objectivec

期望订阅的最高帧率,单位:fps,默认值为 0 即满帧订阅,设为大于 0 的值时开始生效。

当发布端帧率低于设定帧率,或订阅端开启性能回退后下行弱网,则帧率会相应下降。

仅码流支持 SVC 分级编码特性时方可生效。

width
@property(nonatomic, assign) int  width;
objectivec

视频宽度,单位:px

height
@property(nonatomic, assign) int   height;
objectivec

视频高度,单位:px

ByteRTCRoomConfig
@interface ByteRTCRoomConfig : NSObject
objectivec

房间参数配置

成员变量
类型名称
ByteRTCRoomProfileprofile
BOOLisAutoPublish
BOOLisAutoSubscribeAudio
BOOLisAutoSubscribeVideo
ByteRTCRemoteVideoConfig*remoteVideoConfig
变量说明

profile
@property(nonatomic) ByteRTCRoomProfile profile;
objectivec

房间模式,参看 ByteRTCRoomProfile,默认为普通音视频通话模式,进房后不可更改。

isAutoPublish
@property(assign, nonatomic) BOOL isAutoPublish;
objectivec

是否自动发布音视频流,默认为自动发布。

创建和加入多房间时,只能将其中一个房间设置为自动发布。若每个房间均不做设置,则默认在第一个加入的房间内自动发布流。

若调用 setUserVisibility: 将自身可见性设为 false,无论是默认的自动发布流还是手动设置的自动发布流都不会进行发布,你需要将自身可见性设为 true 后方可发布。

isAutoSubscribeAudio
@property(assign, nonatomic) BOOL isAutoSubscribeAudio;
objectivec

是否自动订阅音频流,默认为自动订阅。

包含主流和屏幕流。

isAutoSubscribeVideo
@property(assign, nonatomic) BOOL isAutoSubscribeVideo;
objectivec

是否自动订阅主视频流,默认为自动订阅。

包含主流和屏幕流。

remoteVideoConfig
@property(nonatomic, strong) ByteRTCRemoteVideoConfig * _Nonnull remoteVideoConfig;
objectivec

远端视频流参数,参看 ByteRTCRemoteVideoConfig

ByteRTCSourceCropInfo
@interface ByteRTCSourceCropInfo : NSObject
objectivec

公共流裁剪信息

成员变量
类型名称
CGFloatLocationX
CGFloatLocationY
CGFloatWidthProportion
CGFloatHeightProportion
变量说明

LocationX
@property(assign, nonatomic) CGFloat LocationX;
objectivec

裁剪后得到的视频帧左上角横坐标相对于裁剪前整体画面的比例,取值范围[0.0, 1.0)

LocationY
@property(assign, nonatomic) CGFloat LocationY;
objectivec

裁剪后得到的视频帧左上角纵坐标相对于裁剪前整体画面的比例,取值范围[0.0, 1.0)

WidthProportion
@property(assign, nonatomic) CGFloat WidthProportion;
objectivec

裁剪后得到的视频帧宽度相对于裁剪前整体画面的比例,取值范围(0.0, 1.0]

HeightProportion
@property(assign, nonatomic) CGFloat HeightProportion;
objectivec

裁剪后得到的视频帧高度相对于裁剪前整体画面的比例,取值范围(0.0, 1.0]

ByteRTCPublicStreamRegion
@interface ByteRTCPublicStreamRegion : NSObject
objectivec

合成公共流的每条流的布局信息

成员变量
类型名称
NSString*userId
NSString*roomId
NSString*alternateImage
CGFloatx
CGFloaty
CGFloatwidth
CGFloatheight
NSIntegerzOrder
CGFloatalpha
NSIntegermediaType
NSIntegerstreamType
ByteRTCRenderModerenderMode
ByteRTCSourceCropInfo*sourceCrop
变量说明

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

用户 ID。必填。

服务端将通过用户 ID 和 房间 ID,找到需要合成到公共流中的媒体流。

roomId
@property(copy, nonatomic) NSString * _Nonnull roomId;
objectivec

房间 ID。必填。

服务端将通过用户 ID 和 房间 ID,找到需要合成到公共流中的媒体流。

alternateImage
@property(copy, nonatomic) NSString * _Nonnull alternateImage;
objectivec

背景图片地址

x
@property(assign, nonatomic) CGFloat x;
objectivec

用户视频布局相对画布左侧的偏移量, 相对值。范围[0.0 - 1.0]

y
@property(assign, nonatomic) CGFloat y;
objectivec

用户视频布局相对画布顶端的偏移量, 相对值。范围[0.0 - 1.0]

width
@property(assign, nonatomic) CGFloat width;
objectivec

用户视频宽度相对用户原始视频宽度的比例,相对值。范围[0.0 - 1.0]

height
@property(assign, nonatomic) CGFloat height;
objectivec

用户视频高度相对用户原始视频高度的比例,相对值。范围[0.0 - 1.0]

zOrder
@property(assign, nonatomic) NSInteger zOrder;
objectivec

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

alpha
@property(assign, nonatomic) CGFloat alpha;
objectivec

透明度,必填。可选范围为 [0.0, 1.0]。

mediaType
@property(assign, nonatomic) NSInteger mediaType;
objectivec

推流内容控制。默认为0。

0: 输出的混流包含音视频

1: 只包含音频

2: 表示只包含视频

streamType
@property(assign, nonatomic) NSInteger streamType;
objectivec

推流媒体类型

0:普通音视频流

1: 屏幕流

renderMode
@property(assign, nonatomic) ByteRTCRenderMode renderMode;
objectivec

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

sourceCrop
@property(strong, nonatomic) ByteRTCSourceCropInfo * _Nonnull sourceCrop;
objectivec

视频裁剪信息。 详见 ByteRTCSourceCropInfo。

ByteRTCPublicStreamLayout
@interface ByteRTCPublicStreamLayout : NSObject
objectivec

公共流的合流布局。必填

成员变量
类型名称
NSIntegerlayoutMode
NSIntegerinterpolationMode
NSString*backgroundColor
NSString*backgroundImage
NSArray<ByteRTCPublicStreamRegion>**regions
变量说明

layoutMode
@property(assign, nonatomic) NSInteger layoutMode;
objectivec

布局模式。可选:

interpolationMode
@property(assign, nonatomic) NSInteger interpolationMode;
objectivec

插帧模式。

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

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

backgroundImage
@property(copy, nonatomic) NSString *_Nonnull backgroundImage;
objectivec

背景图片地址

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

用户布局信息列表。每一个该类型对象为一路单独的视频流的布局信息。

ByteRTCPublicStreamVideoConfig
@interface ByteRTCPublicStreamVideoConfig : NSObject
objectivec

公共流的视频编码参数

成员变量
类型名称
NSIntegerwidth
NSIntegerheight
NSIntegerfps
NSIntegerbitrate
变量说明

width
@property(assign, nonatomic) NSInteger width;
objectivec

公共流视频宽度,必填。单位为 px,范围为 [2, 1920],必须是偶数。

height
@property(assign, nonatomic) NSInteger height;
objectivec

公共流视频高度,必填。单位为 px,范围为 [16, 1280],必须是偶数。

fps
@property(assign, nonatomic) NSInteger fps;
objectivec

公共流视频帧率。必填

范围:[1, 60]

bitrate
@property(assign, nonatomic) NSInteger bitrate;
objectivec

视频码率,必填

范围:[1,10000000]
单位为 bps

ByteRTCVideoByteWatermark
@interface ByteRTCVideoByteWatermark: NSObject
objectivec

水印图片相对视频流的位置和大小。

成员变量
类型名称
floatx
floaty
floatwidth
floatheight
变量说明

x
@property(assign, nonatomic) float x;
objectivec

水印图片相对视频流左上角的横向偏移与视频流宽度的比值,取值范围为 [0,1)。

y
@property(assign, nonatomic) float y;
objectivec

水印图片相对视频流左上角的纵向偏移与视频流高度的比值,取值范围为 [0,1)。

width
@property(assign, nonatomic) float width;
objectivec

水印图片宽度与视频流宽度的比值,取值范围 [0,1)。

height
@property(assign, nonatomic) float height;
objectivec

水印图片高度与视频流高度的比值,取值范围为 [0,1)。

ByteRTCVideoWatermarkConfig
@interface ByteRTCVideoWatermarkConfig: NSObject
objectivec

水印参数

成员变量
类型名称
BOOLvisibleInPreview
ByteRTCVideoByteWatermark*positionInLandscapeMode
ByteRTCVideoByteWatermark*positionInPortraitMode
变量说明

visibleInPreview
@property(nonatomic, assign) BOOL visibleInPreview;
objectivec

水印是否在视频预览中可见,默认可见。

positionInLandscapeMode
@property(strong, nonatomic) ByteRTCVideoByteWatermark * _Nonnull positionInLandscapeMode;
objectivec

横屏时的水印位置和大小,参看 ByteRTCVideoByteWatermark。

positionInPortraitMode
@property(strong, nonatomic) ByteRTCVideoByteWatermark * _Nonnull positionInPortraitMode;
objectivec

竖屏时的水印位置和大小,参看 ByteRTCVideoByteWatermark。

ByteRTCPublicStreaming
@interface ByteRTCPublicStreaming : NSObject
objectivec

公共流参数

成员变量
类型名称
ByteRTCPublicStreamLayout*layout
ByteRTCPublicStreamVideoConfig*video
静态函数
返回名称
instancetypedefaultPublicStreaming
变量说明

layout
@property(strong, nonatomic) ByteRTCPublicStreamLayout * _Nonnull layout;
objectivec

视频流公共流整体布局参数,必填。详见 ByteRTCPublicStreamLayout

video
@property(strong, nonatomic) ByteRTCPublicStreamVideoConfig * _Nonnull video;
objectivec

公共流视频编码参数。详见 ByteRTCPublicStreamVideoConfig。

函数说明

defaultPublicStreaming
+ (instancetype _Nonnull)defaultPublicStreaming;
objectivec

获取默认的公共流转码配置属性。

返回值
包含默认配置的 ByteRTCPublicStreaming 结构体

ByteRTCFrameUpdateInfo
@interface ByteRTCFrameUpdateInfo : NSObject
objectivec

RTC 智能决策后得到的帧率和分辨率积(宽*高)。

成员变量
类型名称
intpixel
intframerate
变量说明

pixel
@property(assign, nonatomic) int pixel;
objectivec

分辨率积(宽*高)。

framerate
@property(assign, nonatomic) int framerate;
objectivec

帧率。