class bytertc::IRTCASREngineEventHandler
语音识别服务使用状态回调
Defined in : byte_rtc_asr_engine_event_handler.h
| 返回 | 名称 |
|---|---|
| virtual void | OnSuccess |
| virtual void | OnMessage |
| virtual void | OnError |
virtual void bytertc::IRTCASREngineEventHandler::OnSuccess()
语音识别服务开启成功回调
virtual void bytertc::IRTCASREngineEventHandler::OnMessage(
const char* message)
语音转文字成功回调,该回调返回识别后的全量消息。
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| message | const char* | 识别完成后得到的文字消息 |
注意 若识别过程中发生了网络连接中断,则重连后回调的信息中只包含重连后识别的文字消息,不再包含上一次连接后识别的消息。
virtual void bytertc::IRTCASREngineEventHandler::OnError(
int error_code,
const char* error_message)
当语音识别服务内部发生错误事件时触发该回调。
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| error_code | int | 错误码 • < 0: 参数错误或 API 调用顺序错误,参看 RTCASRErrorCode; • >0: 参看 语音识别服务错误码 |
| error_message | const char* | 错误原因说明 |
enum bytertc::AudioSampleRate
音频采样率,单位为 Hz。
Defined in : bytertc_audio_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kAudioSampleRateAuto | -1 | 默认设置。 |
| kAudioSampleRate8000 | 8000 | 8000 Hz |
| kAudioSampleRate16000 | 16000 | 16000 Hz |
| kAudioSampleRate32000 | 32000 | 32000 Hz |
| kAudioSampleRate44100 | 44100 | 44100 Hz |
| kAudioSampleRate48000 = 48000 | 48000 | 48000 Hz |
enum bytertc::AudioChannel
音频声道。
Defined in : bytertc_audio_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kAudioChannelAuto | -1 | 默认设置。 |
| kAudioChannelMono | 1 | 单声道 |
| kAudioChannelStereo = 2 | 2 | 双声道 |
struct bytertc::AudioFormat
音频参数格式
Defined in : bytertc_audio_defines.h
| 类型 | 名称 |
|---|---|
| AudioSampleRate | sample_rate |
| AudioChannel | channel |
AudioSampleRate bytertc::AudioFormat::sample_rate;
音频采样率,详见 AudioSampleRate
AudioChannel bytertc::AudioFormat::channel;
音频声道,详见 AudioChannel
enum bytertc::RTCAudioDeviceType
当前音频设备类型
Defined in : bytertc_audio_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kRTCAudioDeviceTypeUnknown | -1 | 未知设备类型 |
| kRTCAudioDeviceTypeRenderDevice | 0 | 音频渲染设备类型 |
| kRTCAudioDeviceTypeCaptureDevice | 1 | 音频采集设备类型 |
| kRTCAudioDeviceTypeScreenCaptureDevice | 2 | 屏幕流音频设备 |
enum bytertc::AudioRouteDevice
音频播放设备
Defined in : bytertc_audio_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kAudioRouteDeviceUnknown | -1 | 未知设备 |
| kAudioRouteDeviceHeadset | 1 | 有线耳机 |
| kAudioRouteDeviceEarpiece | 2 | 听筒 |
| kAudioRouteDeviceSpeakerphone | 3 | 扬声器 |
| kAudioRouteDeviceHeadsetBluetooth | 4 | 蓝牙耳机 |
| kAudioRouteDeviceHeadsetUSB = 5 | 5 | USB设备 |
enum bytertc::AudioPlaybackDevice
音频播放设备
Defined in : bytertc_audio_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kAudioPlaybackDeviceHeadset | 1 | 有线耳机 |
| kAudioPlaybackDeviceEarpiece | 2 | 听筒 |
| kAudioPlaybackDeviceSpeakerphone | 3 | 扬声器 |
| kAudioPlaybackDeviceHeadsetBluetooth | 4 | 蓝牙耳机 |
| kAudioPlaybackDeviceHeadsetUSB = 5 | 5 | USB设备 |
enum bytertc::VoiceChangerType
变声特效类型
Defined in : bytertc_audio_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kVoiceChangerTypeOriginal | 0 | 原声,不含特效 |
| kVoiceChangerTypeGiant | 1 | 巨人 |
| kVoiceChangerTypeChipmunk | 2 | 花栗鼠 |
| kVoiceChangerTypeMinionst | 3 | 小黄人 |
| kVoiceChangerTypeVibrato | 4 | 颤音 |
| kVoiceChangerTypeRobot | 5 | 机器人 |
enum bytertc::VoiceReverbType
混响特效类型
Defined in : bytertc_audio_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kVoiceReverbTypeOriginal | 0 | 原声,不含特效 |
| kVoiceReverbTypeEcho | 1 | 回声 |
| kVoiceReverbTypeConcert | 2 | 演唱会 |
| kVoiceReverbTypeEthereal | 3 | 空灵 |
| kVoiceReverbTypeKTV | 4 | KTV |
| kVoiceReverbTypeStudio | 5 | 录音棚 |
struct bytertc::AudioVolumeInfo
音频流来源的用户 ID 及对应的音量。
Defined in : bytertc_audio_defines.h
| 类型 | 名称 |
|---|---|
| int | linear_volume |
| int | nonlinear_volume |
| const char* | uid |
int bytertc::AudioVolumeInfo::linear_volume;
线性音量,取值范围是:[0,255],与原始音量呈线性关系,数值越大,音量越大。 无声为25以下(绝对无声为0,25以下基本已经无声音了,可以视为无声),低音量为25~76,中音量为76~204,高音量为204以上
int bytertc::AudioVolumeInfo::nonlinear_volume;
非线性音量,取值范围是:[-127,0],单位dB。此音量范围是将原始音量进行对数转化,在中低音量时分辨更为灵敏,适用于作为Active Speaker(房间内最活跃用户)的识别。 高音量为0~-20dB,中音量为-20~-40dB,低音量为-40~-60dB,若低于-60dB,则为无声。
const char* bytertc::AudioVolumeInfo::uid;
音频流来源的用户 ID
enum bytertc::AudioMixingState
音频混音文件播放状态。
Defined in : bytertc_audio_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kAudioMixingStatePreloaded | 0 | 混音已加载 |
| kAudioMixingStatePlaying | 1 | 混音正在播放 |
| kAudioMixingStatePaused | 2 | 混音暂停 |
| kAudioMixingStateStopped | 3 | 混音停止 |
| kAudioMixingStateFailed | 4 | 混音播放失败 |
| kAudioMixingStateFinished | 5 | 混音播放结束 |
| kAudioMixingStatePCMEnabled | 6 | 准备PCM混音 |
| kAudioMixingStatePCMDisabled | 7 | PCM混音播放结束 |
enum bytertc::AudioMixingError
混音错误码。
Defined in : bytertc_audio_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kAudioMixingErrorOk | 0 | 正常 |
| kAudioMixingErrorPreloadFailed | 1 | 预加载失败。找不到混音文件或者文件长度超出 20s |
| kAudioMixingErrorStartFailed | 2 | 混音开启失败。找不到混音文件或者混音文件打开失败 |
| kAudioMixingErrorIdNotFound | 3 | 混音 ID 异常 |
| kAudioMixingErrorSetPositionFailed | 4 | 设置混音文件的播放位置出错 |
| kAudioMixingErrorInValidVolume | 5 | 音量参数不合法,仅支持设置的音量值为[0, 400] |
| kAudioMixingErrorLoadConflict | 6 | 已有另一个文件完成了预加载。请先使用 UnloadAudioMixing 卸载此前的文件。 |
| kAudioMixingErrorIdTypeNotMatch | 7 | 不支持此混音类型。 |
| kAudioMixingErrorInValidPitch | 8 | 设置混音文件的音调不合法 |
| kAudioMixingErrorInValidAudioTrack | 9 | 设置混音文件的音轨不合法 |
| kAudioMixingErrorIsStarting | 10 | 混音文件正在启动中 |
| kAudioMixingErrorInValidPlaybackSpeed | 11 | 设置混音文件的播放速度不合法 |
enum bytertc::AudioSourceType
音频输入源类型
Defined in : bytertc_audio_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kAudioSourceTypeExternal | 0 | |
| kAudioSourceTypeInternal | 1 |
enum bytertc::ASRAuthorizationType
语音识别服务鉴权方式,详情请咨询语音识别服务服务相关同学
Defined in : bytertc_audio_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kASRAuthorizationTypeToken | 0 | Token 鉴权 |
| kASRAuthorizationTypeSignature | 1 | Signature 鉴权 |
struct bytertc::RTCASRConfig
使用自动语音识别服务所需校验信息
Defined in : bytertc_audio_defines.h
| 类型 | 名称 |
|---|---|
| const char* | app_id |
| const char* | user_id |
| ASRAuthorizationType | authorization_type |
| const char* | access_token |
| const char* | secret_key |
| const char* | cluster |
const char* bytertc::RTCASRConfig::app_id;
应用 ID
const char* bytertc::RTCASRConfig::user_id;
用户 ID
ASRAuthorizationType bytertc::RTCASRConfig::authorization_type;
鉴权方式,参看 ASRAuthorizationType
const char* bytertc::RTCASRConfig::access_token;
访问令牌
const char* bytertc::RTCASRConfig::secret_key;
私钥。Signature 鉴权模式下不能为空,token 鉴权模式下为空。参看关于鉴权
const char* bytertc::RTCASRConfig::cluster;
场景信息,参看业务集群
enum bytertc::RTCASRErrorCode
语音识别服务错误码。
除网络原因导致的错误,语音识别服务内部会自行重试之外,其他错误都会停止服务,此时建议再次调用 StartASR 重启语音识别功能。
Defined in : bytertc_audio_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kRTCASRErrorNetworkInterrupted | -1 | 网络连接中断,服务不可用,内部会进行重连 |
| kRTCASRErrorAlreadyStarted | -2 | 重复调用 StartASR。开启语音识别服务后,你需要先调用 StopASR 停止语音识别服务,才能二次调用 StartASR 再次开启服务。 |
| kRTCASRErrorTokenEmpty | -3 | 语音识别服务所需 token 为空 |
| kRTCErrorSignatureKeyEmpty | -4 | Signature 鉴权模式下 secret_key 为空 |
| kRTCASRErrorUserIdNull | -5 | 用户 ID 为空 |
| kRTCASRErrorAPPIDNull | -6 | 应用 ID 为空 |
| kRTCASRErrorClusterNull | -7 | 语音识别服务 cluster 为空 |
| kRTCASRErrorOperationDenied = -8 | -8 | 语音识别服务连接失败,该版本没有语音识别功能,请联系 RTC 技术支持。 |
enum bytertc::AudioMixingType
混音播放类型
Defined in : bytertc_audio_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kAudioMixingTypePlayout | 0 | 仅本地播放 |
| kAudioMixingTypePublish | 1 | 仅发送到远端 |
| kAudioMixingTypePlayoutAndPublish | 2 | 在本地播放并发送到远端 |
struct bytertc::AudioMixingConfig
混音配置
Defined in : bytertc_audio_defines.h
| 类型 | 名称 |
|---|---|
| AudioMixingType | type |
| int | play_count |
| int | position |
| int64_t | callback_on_progress_interval |
AudioMixingType bytertc::AudioMixingConfig::type;
混音播放类型,详见 AudioMixingType
int bytertc::AudioMixingConfig::play_count;
混音播放次数,
int bytertc::AudioMixingConfig::position;
混音时音频文件播放进度条位置,参数为整数,单位为毫秒
int64_t bytertc::AudioMixingConfig::callback_on_progress_interval = 0;
设置音频文件播放进度回调的时间间隔,单位毫秒,并按照设置的值触发 OnAudioMixingPlayingProgress 回调,默认不回调。
enum bytertc::AudioMixingDualMonoMode
混音播放声道类型
Defined in : bytertc_audio_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kAudioMixingDualMonoModeAuto | 0 | 和音频文件一致 |
| kAudioMixingDualMonoModeL | 1 | 只能听到音频文件中左声道的音频 |
| kAudioMixingDualMonoModeR | 2 | 只能听到音频文件中右声道的音频 |
| kAudioMixingDualMonoModeMix | 3 | 能同时听到音频文件中左右声道的音频 |
struct bytertc::AudioPropertiesConfig
音频属性信息提示的相关配置
Defined in : bytertc_audio_defines.h
| 类型 | 名称 |
|---|---|
| int | interval |
| bool | enable_spectrum |
| bool | enable_vad |
int bytertc::AudioPropertiesConfig::interval;
信息提示间隔,单位:ms
注意:
0 && <=100: 开启信息提示,不合法的 interval 值,SDK 自动设置为 100ms
100: 开启信息提示,并将信息提示间隔设置为此值
<= 0: 关闭信息提示
0 && <=100: 开启信息提示,不合法的 interval 值,SDK 自动设置为 100ms
100: 开启信息提示,并将信息提示间隔设置为此值
bool bytertc::AudioPropertiesConfig::enable_spectrum = false;
是否开启音频频谱检测
bool bytertc::AudioPropertiesConfig::enable_vad = false;
是否开启人声检测 (VAD)
struct bytertc::AudioPropertiesInfo
音频属性信息
Defined in : bytertc_audio_defines.h
| 类型 | 名称 |
|---|---|
| int | linear_volume |
| int | nonlinear_volume |
| float | spectrum |
| int | vad |
int bytertc::AudioPropertiesInfo::linear_volume;
线性音量,与原始音量呈线性关系,数值越大,音量越大。取值范围是:[0,255]。
int bytertc::AudioPropertiesInfo::nonlinear_volume;
非线性音量。由原始音量的对数值转化而来,因此在中低音量时更灵敏,可以用作 Active Speaker(房间内最活跃用户)的识别。取值范围是:[-127,0],单位 dB。
float bytertc::AudioPropertiesInfo::spectrum[SPECTRUM_SIZE] = {0};
频谱数组。默认长度为 257。
int bytertc::AudioPropertiesInfo::vad = -1;
人声检测(VAD)结果
struct bytertc::RemoteAudioPropertiesInfo
远端音频属性信息
Defined in : bytertc_audio_defines.h
| 类型 | 名称 |
|---|---|
| RemoteStreamKey | stream_key |
| AudioPropertiesInfo | audio_properties_info |
RemoteStreamKey bytertc::RemoteAudioPropertiesInfo::stream_key;
远端流信息,详见 RemoteStreamKey
AudioPropertiesInfo bytertc::RemoteAudioPropertiesInfo::audio_properties_info;
音频属性信息,详见 AudioPropertiesInfo
struct bytertc::LocalAudioPropertiesInfo
本地音频属性信息
Defined in : bytertc_audio_defines.h
| 类型 | 名称 |
|---|---|
| StreamIndex | stream_index |
| AudioPropertiesInfo | audio_properties_info |
StreamIndex bytertc::LocalAudioPropertiesInfo::stream_index;
流属性,主流或屏幕流。参看 StreamIndex
AudioPropertiesInfo bytertc::LocalAudioPropertiesInfo::audio_properties_info;
音频属性信息,详见 AudioPropertiesInfo
enum bytertc::AudioProfileType
音质档位
调用 SetAudioProfile 设置的音质档位
Defined in : bytertc_audio_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kAudioProfileTypeDefault | 0 | 默认音质 服务器下发或客户端已设置的 RoomProfileType 的音质配置 |
| kAudioProfileTypeFluent | 1 | 流畅音质。 单声道,采样率为 16kHz,编码码率为 24kbps。 流畅优先、低延迟、低功耗、低流量消耗,适用于大部分游戏场景,如 MMORPG、MOBA、FPS 等游戏中的小队语音、组队语音、国战语音等。 |
| kAudioProfileTypeStandard | 2 | 标准音质。 单声道,采样率为 48kHz,编码码率为 48kbps。 适用于对音质有一定要求的场景,同时延时、功耗和流量消耗相对适中,适合教育场景和 Sirius 等狼人杀类游戏。 |
| kAudioProfileTypeHD | 3 | 高清音质 双声道,采样率为 48kHz,编码码率为 128kbps。 超高音质,同时延时、功耗和流量消耗相对较大,适用于连麦 PK 等音乐场景。 游戏场景不建议使用。 |
enum bytertc::AudioFrameType
音频帧类型
Defined in : bytertc_audio_frame.h
| 类型 | 值 | 说明 |
|---|---|---|
| kFrameTypePCM16 = 0 | 0 | PCM 16bit |
typedef struct bytertc::AudioFrameBuilder
音频帧构建类
Defined in : bytertc_audio_frame.h
| 类型 | 名称 |
|---|---|
| AudioSampleRate | sample_rate |
| AudioChannel | channel |
| int64_t | timestamp_us |
| uint8_t* | data |
| int64_t | data_size |
AudioSampleRate bytertc::AudioFrameBuilder::sample_rate;
音频采样率
AudioChannel bytertc::AudioFrameBuilder::channel;
音频通道数
int64_t bytertc::AudioFrameBuilder::timestamp_us = 0;
音频帧时间戳,单位:微秒
uint8_t* bytertc::AudioFrameBuilder::data;
音频帧数据
int64_t bytertc::AudioFrameBuilder::data_size = 0;
音频帧数据大小
class bytertc::IAudioFrame
音频帧
Defined in : bytertc_audio_frame.h
| 返回 | 名称 |
|---|---|
| virtual int64_t | timestamp_us |
| virtual AudioSampleRate | sample_rate |
| virtual AudioChannel | channel |
| virtual uint8_t* | data |
| virtual int | data_size |
| virtual AudioFrameType | frame_type |
| virtual void | release |
| virtual bool | is_muted_data |
virtual int64_t bytertc::IAudioFrame::timestamp_us() const
获取音频帧时间戳。
返回值 音频帧时间戳,单位:微秒
virtual AudioSampleRate bytertc::IAudioFrame::sample_rate() const
获取音频采样率。参看 AudioSampleRate
返回值 音频采样率,单位:Hz
virtual AudioChannel bytertc::IAudioFrame::channel() const
获取音频通道数。参看 AudioChannel
返回值 音频通道数
virtual uint8_t* bytertc::IAudioFrame::data() const
获取音频帧内存块地址
返回值 音频帧内存块地址
virtual int bytertc::IAudioFrame::data_size() const
获取音频帧数据大小
返回值 音频帧数据大小,单位:字节。
virtual AudioFrameType bytertc::IAudioFrame::frame_type() const
获取音频帧类型
返回值 音频帧类型,目前只支持 PCM,详见 AudioFrameType
virtual void bytertc::IAudioFrame::release()
释放音频帧
virtual bool bytertc::IAudioFrame::is_muted_data() const
获取音频静音标志
返回值 是否静音数据
enum class bytertc::AudioFrameCallbackMethod
音频回调方法
Defined in : bytertc_audio_frame.h
| 类型 | 值 | 说明 |
|---|---|---|
| kAudioFrameCallbackRecord | 0 | 本地麦克风录制的音频数据回调 |
| kAudioFrameCallbackPlayback | 1 | 订阅的远端所有用户混音后的音频数据回调 |
| kAudioFrameCallbackMixed | 2 | 本地麦克风录制和订阅的远端所有用户混音后的音频数据回调 |
| kAudioFrameCallbackRemoteUser | 3 | 订阅的远端每个用户混音前的音频数据回调 |
| kAudioFrameCallbackRecordScreen | 4 | 本地屏幕录制的音频数据回调 |
class bytertc::IAudioProcessor
自定义音频处理器
Defined in : bytertc_audio_frame.h
| 返回 | 名称 |
|---|---|
| virtual int | ProcessAudioFrame |
virtual int bytertc::IAudioProcessor::ProcessAudioFrame(
const IAudioFrame& audioFrame)
获取 RTC SDK 采集得到的音频帧,并进行自定义处理,最终将处理后的音频帧给到 RTC SDK 用于编码传输。
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| audioFrame | const IAudioFrame& | RTC SDK 采集到的音频帧,自定义处理可直接对音频 data 中的数据进行修改。参看 IAudioFrame。 |
返回值
0: 未处理
>0: 处理成功
< 0: 处理失败
注意
在进行音频自定义处理前,你需要调用 RegisterLocalAudioProcessor 设置音频自定义处理器。
enum bytertc::UserOfflineReason
用户离开房间的原因。
Defined in : bytertc_common_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kUserOfflineReasonQuit | 0 | 远端用户调用 LeaveRoom 方法主动退出房间。 |
| kUserOfflineReasonDropped | 1 | 远端用户因网络等原因掉线。 |
| kUserOfflineReasonSwitchToInvisible | 2 | 远端用户切换至隐身状态。 |
enum bytertc::StreamRemoveReason
房间内远端流被移除的原因。
Defined in : bytertc_common_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kStreamRemoveReasonUnpublish | 0 | 远端用户停止发布流。 |
| kStreamRemoveReasonPublishFailed | 1 | 远端用户发布流失败。 |
| kStreamRemoveReasonKeepLiveFailed | 2 | 保活失败。 |
| kStreamRemoveReasonClientDisconnected | 3 | 远端用户断网。 |
| kStreamRemoveReasonRepublish | 4 | 远端用户重新发布流。 |
| kStreamRemoveReasonOther | 5 | 其他原因。 |
enum bytertc::JoinRoomType
用户加入房间的类型。
Defined in : bytertc_common_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kJoinRoomTypeFirst | 0 | 首次加入房间。用户手动调用 JoinRoom 加入房间。 |
| kJoinRoomTypeReconnected | 1 | 重新加入房间。用户网络较差,失去与服务器的连接,进行重连时收到加入成功。 |
enum bytertc::LoginType
用户登录的类型
Defined in : bytertc_common_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kLoginTypeFirst | 0 | 首次登录。用户手动调用 Login,收到登录成功。 |
| kLoginTypeReconnected | 1 | 重连。用户网络较差,失去与服务器的连接,SDK 自动重连登录成功。 |
enum bytertc::USER_ONLINE_STATUS
用户在线状态。
Defined in : bytertc_common_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kUserOnlineStatusOffline | 0 | 对端用户离线 对端用户已调用 Logout,或者没有调用 Login 进行登录。 |
| kUserOnlineStatusOnline | 1 | 对端用户在线 对端用户调用 Login 登录,并且连接状态正常。 |
| kUserOnlineStatusUnreachable | 2 | 无法获取对端用户在线状态 发生级联错误、对端用户在线状态异常时返回。 |
enum bytertc::RoomMessageSendResult
发送消息给房间的结果
Defined in : bytertc_common_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kRoomMessageSendResultSuccess | 200 | 房间Broadcast消息发送成功 |
| kRoomMessageSendResultNotJoin | 100 | 没有加入房间 |
| kRoomMessageSendResultNoConnection | 102 | 没有可用的数据传输通道连接 |
| kRoomMessageSendResultExceedMaxLength | 103 | 消息超过最大长度,当前为64KB |
| kRoomMessageSendResultUnknown | 1000 | 未知错误 |
enum bytertc::ConnectionState
SDK 与信令服务器连接状态。
Defined in : bytertc_common_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kConnectionStateDisconnected | 1 | 连接断开。 |
| kConnectionStateConnecting | 2 | 首次连接,正在连接中。 |
| kConnectionStateConnected | 3 | 首次连接成功。 |
| kConnectionStateReconnecting | 4 | 连接断开后重新连接中。 |
| kConnectionStateReconnected | 5 | 连接断开后重连成功。 |
| kConnectionStateLost | 6 | 网络连接断开超过 10 秒,仍然会继续重连。 |
enum bytertc::NetworkDetectionStopReason
通话前探测的停止原因
OnNetworkDetectionStopped 回调的参数类型
Defined in : bytertc_common_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kNetworkDetectionStopReasonUser | 0 | 用户主动停止 |
| kNetworkDetectionStopReasonTimeout | 1 | 探测超过三分钟 |
| kNetworkDetectionStopReasonConnectionLost | 2 | 探测网络连接断开。 当超过 12s 没有收到回复,SDK 将断开网络连接,并且不再尝试重连。 |
| kNetworkDetectionStopReasonStreaming | 3 | 本地开始推拉流,停止探测 |
| kNetworkDetectionStopReasonInnerErr | 4 | 网络探测失败,内部异常 |
enum bytertc::NetworkDetectionLinkType
通话前探测链接的类型。
OnNetworkDetectionResult 回调的参数类型
Defined in : bytertc_common_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kNetworkDetectionLinkTypeUp | 0 | 上行网络探测 |
| kNetworkDetectionLinkTypeDown | 1 | 下行网络探测 |
enum bytertc::NetworkQuality
媒体流网络质量。
Defined in : bytertc_common_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kNetworkQualityUnknown | 0 | 网络质量未知。 |
| kNetworkQualityExcellent | 1 | 网络质量极好。 |
| kNetworkQualityGood | 2 | 主观感觉和 kNetworkQualityExcellent 差不多,但码率可能略低。 |
| kNetworkQualityPoor | 3 | 主观感受有瑕疵但不影响沟通。 |
| kNetworkQualityBad | 4 | 勉强能沟通但不顺畅。 |
| kNetworkQualityVbad | 5 | 网络质量非常差,基本不能沟通。 |
struct bytertc::NetworkQualityStats
上行/下行网络质量
Defined in : bytertc_common_defines.h
| 类型 | 名称 |
|---|---|
| const char* | uid |
| double | fraction_lost |
| int | rtt |
| int | total_bandwidth |
| NetworkQuality | tx_quality |
| NetworkQuality | rx_quality |
const char* bytertc::NetworkQualityStats::uid;
用户 ID
double bytertc::NetworkQualityStats::fraction_lost;
本端的上行/下行的丢包率,范围 [0.0,1.0]
当 uid 为本地用户时,代表发布流的上行丢包率。
当 uid 为远端用户时,代表接收所有订阅流的下行丢包率。
int bytertc::NetworkQualityStats::rtt;
当 uid 为本地用户时有效,客户端到服务端的往返延时(RTT),单位:ms
int bytertc::NetworkQualityStats::total_bandwidth;
本端的音视频 RTP 包 2 秒内的平均传输速率,单位:bps
当 uid 为本地用户时,代表发送速率。
当 uid 为远端用户时,代表所有订阅流的接收速率。
NetworkQuality bytertc::NetworkQualityStats::tx_quality;
上行网络质量评分,详见 NetworkQuality。
NetworkQuality bytertc::NetworkQualityStats::rx_quality;
下行网络质量评分,详见 NetworkQuality。
enum bytertc::NetworkType
SDK 网络连接类型。
Defined in : bytertc_common_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kNetworkTypeUnknown | -1 | 网络连接类型未知。 |
| kNetworkTypeDisconnected | 0 | 网络连接已断开。 |
| kNetworkTypeLAN | 1 | 网络连接类型为 LAN 。 |
| kNetworkTypeWIFI | 2 | 网络连接类型为 Wi-Fi(包含热点)。 |
| kNetworkTypeMobile2G | 3 | 网络连接类型为 2G 移动网络。 |
| kNetworkTypeMobile3G | 4 | 网络连接类型为 3G 移动网络。 |
| kNetworkTypeMobile4G | 5 | 网络连接类型为 4G 移动网络。 |
| kNetworkTypeMobile5G | 6 | 网络连接类型为 5G 移动网络。 |
enum bytertc::RoomProfileType
房间模式
Defined in : bytertc_common_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kRoomProfileTypeCommunication | 0 | 普通音视频通话模式。 单声道,采样率为 48kHz。 你应在 1V1 音视频通话时,使用此设置。 此设置下,弱网抗性较好。 |
| kRoomProfileTypeLiveBroadcasting | 1 | 直播模式。 单声道,采样率为 48kHz。 当你对音视频通话的音质和画质要求较高时,应使用此设置。 此设置下,当用户使用蓝牙耳机收听时,蓝牙耳机使用媒体模式。 |
| kRoomProfileTypeGame | 2 | 游戏语音模式。 单声道,采样率为 16kHz。 低端机在此模式下运行时,进行了额外的性能优化: + 部分低端机型配置编码帧长 40/60 + 部分低端机型关闭软件 3A 音频处理 增强对 iOS 其他屏幕录制进行的兼容性,避免音频录制被 RTC 打断。 |
| kRoomProfileTypeCloudGame | 3 | 云游戏模式。 单声道,采样率为 48kHz。 如果你需要低延迟、高码率的设置时,你可以使用此设置。 此设置下,弱网抗性较差。 |
| kRoomProfileTypeLowLatency | 4 | 低时延模式。SDK 会使用低延时设置。 当你的场景非游戏或云游戏场景,又需要极低延时的体验时,可以使用该模式。 该模式下,音视频通话延时会明显降低,但同时弱网抗性、通话音质等均会受到一定影响。 在使用此模式前,强烈建议咨询技术支持同学。 |
struct bytertc::AudioRoomConfig
多房间参数配置
Defined in : bytertc_common_defines.h
| 类型 | 名称 |
|---|---|
| RoomProfileType | room_profile_type |
| bool | is_auto_subscribe_audio |
RoomProfileType bytertc::AudioRoomConfig::room_profile_type = kRoomProfileTypeCommunication;
房间模式,参看 RoomProfileType,默认为 kRoomProfileTypeCommunication,进房后不可更改。
bool bytertc::AudioRoomConfig::is_auto_subscribe_audio = true;
是否自动订阅音频流,默认为自动订阅。
enum bytertc::MediaDeviceType
当前媒体设备类型
Defined in : bytertc_common_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kMediaDeviceTypeAudioUnknown | -1 | 未知设备类型 |
| kMediaDeviceTypeAudioRenderDevice | 0 | 音频渲染设备类型 |
| kMediaDeviceTypeAudioCaptureDevice | 1 | 音频采集设备类型 |
| kMediaDeviceTypeVideoCaptureDevice | 3 | 视频采集设备类型 |
| kMediaDeviceTypeScreenVideoCaptureDevice | 4 | 屏幕流视频设备 |
| kMediaDeviceTypeScreenAudioCaptureDevice | 5 | 屏幕流音频设备 |
enum bytertc::MediaDeviceState
媒体设备状态。通过 OnAudioDeviceStateChanged 或 OnVideoDeviceStateChanged 回调设备状态。
Defined in : bytertc_common_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kMediaDeviceStateStarted | 1 | 设备已开启 |
| kMediaDeviceStateStopped | 2 | 设备已停止 |
| kMediaDeviceStateRuntimeError | 3 | 设备运行时错误 例如,当媒体设备的预期行为是正常采集,但没有收到采集数据时,将回调该状态。 |
| kMediaDeviceStatePaused | 4 | 设备已暂停。包括: + 采集过程中,目标应用窗体最小化到任务栏。 + 开启采集或采集过程中,目标应用窗体被隐藏。 + 采集过程中,目标应用窗体正在被拉伸。 + 采集过程中,目标应用窗体正在被拖动。 |
| kMediaDeviceStateResumed | 5 | 设备已恢复 |
| kMediaDeviceStateAdded | 10 | 设备已插入 |
| kMediaDeviceStateRemoved | 11 | 设备被移除 |
| kMediaDeviceInterruptionBegan | 12 | 用户合盖打断了视频通话。如果系统未休眠或关机,将在开盖后自动恢复视频通话。 |
| kMediaDeviceInterruptionEnded = 13 | 13 | 视频通话已从合盖打断中恢复 |
enum bytertc::MediaDeviceError
媒体设备错误类型
Defined in : bytertc_common_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kMediaDeviceErrorOK | 0 | 媒体设备正常 |
| kMediaDeviceErrorDeviceNoPermission | 1 | 没有权限启动媒体设备 |
| kMediaDeviceErrorDeviceBusy | 2 | 媒体设备已经在使用中 |
| kMediaDeviceErrorDeviceFailure | 3 | 媒体设备错误 |
| kMediaDeviceErrorDeviceNotFound | 4 | 未找到指定的媒体设备 |
| kMediaDeviceErrorDeviceDisconnected | 5 | 媒体设备被移除 对象为采集屏幕流时,表明窗体被关闭或显示器被移除。 |
| kMediaDeviceErrorDeviceNoCallback | 6 | 设备没有数据回调 |
| kMediaDeviceErrorDeviceUNSupportFormat | 7 | 设备采样率不支持 |
| kMediaDeviceErrorDeviceNotFindGroupId | 8 | ios 屏幕采集没有 group id 参数 |
enum bytertc::MediaDeviceWarning
媒体设备警告
Defined in : bytertc_common_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kMediaDeviceWarningOK | 0 | 无警告 |
| kMediaDeviceWarningOperationDenied | 1 | 非法设备操作。在使用外部设备时,调用了 SDK 内部设备 API。 |
| kMediaDeviceWarningCaptureSilence | 2 | 采集静音。 |
| kMediaDeviceWarningAndroidSysSilenceDisappear | 4 | Android 特有的静音消失 |
enum bytertc::SubscribeState
订阅媒体流状态
Defined in : bytertc_common_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kSubscribeStateSuccess | 0 | 订阅/取消订阅流成功 |
| kSubscribeStateFailedNotInRoom | 1 | 订阅/取消订阅流失败,本地用户未在房间中 |
| kSubscribeStateFailedStreamNotFound | 2 | 订阅/取消订阅流失败,房间内未找到指定的音视频流 |
| kSubscribeStateFailedOverLimit | 3 | 超过订阅流数上限 |
enum bytertc::RemoteUserPriority
远端用户优先级,在性能不足需要回退时,会优先回退优先级低的用户的音视频流
Defined in : bytertc_common_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kRemoteUserPriorityLow | 0 | 用户优先级为低(默认值) |
| kRemoteUserPriorityMedium | 100 | 用户优先级为正常 |
| kRemoteUserPriorityHigh | 200 | 用户优先级为高 |
enum bytertc::PublishFallbackOption
发布端音视频流回退选项
Defined in : bytertc_common_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kPublishFallbackOptionDisabled | 0 | 上行网络不佳或设备性能不足时,不对音视频流作回退处理。默认设置。 |
| kPublishFallbackOptionSimulcast | 1 | 上行网络不佳或设备性能不足时,发布的视频流会从大流到小流依次降级,直到与当前网络性能匹配从大流开始做降级处理,具体降级规则参看性能回退文档。 |
enum bytertc::SubscribeFallbackOption
订阅端音视频流回退选项。
Defined in : bytertc_common_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kSubscribeFallbackOptionDisable | 0 | 下行网络不佳或设备性能不足时,不对音视频流作回退处理。默认设置。 |
| kSubscribeFallbackOptionVideoStreamLow | 1 | 下行网络不佳或设备性能不足时,对视频流做降级处理,具体降级规则参看性能回退文档。 该设置仅对发布端调用 EnableSimulcastMode 开启发送多路流功能的情况生效。 |
| kSubscribeFallbackOptionAudioOnly | 2 | 下行网络不佳或设备性能不足时,取消接收视频,仅接收音频。 |
enum bytertc::FallbackOrRecoverReason
远端订阅流发生回退或恢复的原因
Defined in : bytertc_common_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kFallbackOrRecoverReasonUnknown | -1 | 其他原因,非带宽和性能原因引起的回退或恢复。默认值 |
| kFallbackOrRecoverReasonSubscribeFallbackByBandwidth | 0 | 由带宽不足导致的订阅端音视频流回退。 |
| kFallbackOrRecoverReasonSubscribeFallbackByPerformance | 1 | 由性能不足导致的订阅端音视频流回退。 |
| kFallbackOrRecoverReasonSubscribeRecoverByBandwidth | 2 | 由带宽恢复导致的订阅端音视频流恢复。 |
| kFallbackOrRecoverReasonSubscribeRecoverByPerformance | 3 | 由性能恢复导致的订阅端音视频流恢复。 |
| kFallbackOrRecoverReasonPublishFallbackByBandwidth | 4 | 由带宽不足导致的发布端音视频流回退。 |
| kFallbackOrRecoverReasonPublishFallbackByPerformance | 5 | 由性能不足导致的发布端音视频流回退。 |
| kFallbackOrRecoverReasonPublishRecoverByBandwidth | 6 | 由带宽恢复导致的发布端音视频流恢复。 |
| kFallbackOrRecoverReasonPublishRecoverByPerformance | 7 | 由性能恢复导致的发布端音视频流恢复。 |
enum bytertc::PerformanceAlarmReason
OnPerformanceAlarms 告警的原因
Defined in : bytertc_common_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kPerformanceAlarmReasonBandwidthFallbacked | 0 | 网络原因差,造成了发送性能回退。仅在开启发送性能回退时,会收到此原因。 |
| kPerformanceAlarmReasonBandwidthResumed | 1 | 网络性能恢复,发送性能回退恢复。仅在开启发送性能回退时,会收到此原因。 |
| kPerformanceAlarmReasonPerformanceFallbacked | 2 | 如果未开启发送性能回退,收到此告警时,意味着性能不足; 如果开启了发送性能回退,收到此告警时,意味着性能不足,且已发生发送性能回退。 |
| kPerformanceAlarmReasonPerformanceResumed | 3 | 如果未开启发送性能回退,收到此告警时,意味着性能不足已恢复; 如果开启了发送性能回退,收到此告警时,意味着性能不足已恢复,且已发生发送性能回退恢复。 |
enum bytertc::PerformanceAlarmMode
是否开启发布性能回退
Defined in : bytertc_common_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kPerformanceAlarmModeNormal | 0 | 未开启发布性能回退 |
| kPerformanceAlarmModeSimulcast | 1 | 已开启发布性能回退 |
enum bytertc::BusinessCheckCode
事务检查码
用户调用 SetBusinessId 方法设置业务标识参数的返回错误码。
Defined in : bytertc_common_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| ERROR_ALREADY_IN_ROOM | -6001 | 用户已经在房间中。 业务标识需要在加入房间之前设置,加入后设置无效。 |
| ERROR_INPUT_INVALIDATE | -6002 | 输入参数非法。 用户传入的业务标识参数非法,参数合法性参考 SetBusinessId 方法的参数说明。 |
enum bytertc::LocalAudioStreamState
本地音频流状态。
SDK 通过 OnLocalAudioStateChanged 回调本地音频流状态
Defined in : bytertc_common_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kLocalAudioStreamStateStopped | 0 | 本地音频默认初始状态。 麦克风停止工作时回调该状态,对应错误码 kLocalAudioStreamErrorOk |
| kLocalAudioStreamStateRecording | 1 | 本地音频录制设备启动成功。 采集到音频首帧时回调该状态,对应错误码 kLocalAudioStreamErrorOk |
| kLocalAudioStreamStateEncoding | 2 | 本地音频首帧编码成功。 音频首帧编码成功时回调该状态,对应错误码 kLocalAudioStreamErrorOk |
| kLocalAudioStreamStateFailed | 3 | 本地音频启动失败,在以下时机回调该状态: + 本地录音设备启动失败,对应错误码 kLocalAudioStreamErrorRecordFailure + 检测到没有录音设备权限,对应错误码 kLocalAudioStreamErrorDeviceNoPermission + 音频编码失败,对应错误码 kLocalAudioStreamErrorEncodeFailure |
| kLocalAudioStreamMute | 4 | 本地音频静音成功后回调该状态。 调用 SetAudioCaptureDeviceMuteIAudioDeviceManager-setaudiocapturedevicemute 成功后回调,对应错误码 LocalAudioStreamError 中的 kLocalAudioStreamErrorOk 。 |
| kLocalAudioStreamUnmute | 5 | 本地音频解除静音成功后回调该状态。 调用 SetAudioCaptureDeviceMuteIAudioDeviceManager-setaudiocapturedevicemute 成功后回调,对应错误码 LocalAudioStreamError 中的 kLocalAudioStreamErrorOk 。 |
enum bytertc::LocalAudioStreamError
本地音频流状态改变时的错误码。
SDK 通过 OnLocalAudioStateChanged 回调该错误码。
Defined in : bytertc_common_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kLocalAudioStreamErrorOk | 0 | 本地音频状态正常 |
| kLocalAudioStreamErrorFailure | 1 | 本地音频出错原因未知 |
| kLocalAudioStreamErrorDeviceNoPermission | 2 | 没有权限启动本地音频录制设备 |
| kLocalAudioStreamErrorDeviceBusy | 3 | 本地音频录制设备已经在使用中 |
| kLocalAudioStreamErrorRecordFailure | 4 | 本地音频录制失败,建议你检查录制设备是否正常工作 |
| kLocalAudioStreamErrorEncodeFailure | 5 | 本地音频编码失败 |
| kLocalAudioStreamErrorNoRecordingDevice | 6 | 没有可用的音频录制设备 |
enum bytertc::LocalVideoStreamState
本地视频流状态
Defined in : bytertc_common_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kLocalVideoStreamStateStopped | 0 | 本地视频采集停止状态 |
| kLocalVideoStreamStateRecording | 1 | 本地视频采集设备启动成功 |
| kLocalVideoStreamStateEncoding | 2 | 本地视频采集后,首帧编码成功 |
| kLocalVideoStreamStateFailed | 3 | 本地视频采集设备启动失败 |
enum bytertc::RemoteAudioState
远端音频流状态。
用户可以通过 OnRemoteAudioStateChanged 了解该状态。
Defined in : bytertc_common_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kRemoteAudioStateStopped | 0 | 不接收远端音频流。 以下情况下会触发回调 OnRemoteAudioStateChanged: + 本地用户停止接收远端音频流,对应原因是:kRemoteAudioStateChangeReasonLocalMutedRemoteAudioStateChangeReason + 远端用户停止发送音频流,对应原因是:kRemoteAudioStateChangeReasonRemoteMutedRemoteAudioStateChangeReason + 远端用户离开房间,对应原因是:kRemoteAudioStateChangeReasonRemoteOfflineRemoteAudioStateChangeReason |
| kRemoteAudioStateStarting | 1 | 开始接收远端音频流首包。 刚收到远端音频流首包会触发回调 OnRemoteAudioStateChanged,对应原因是: RemoteAudioStateChangeReason 中的 kRemoteAudioStateChangeReasonLocalUnmuted |
| kRemoteAudioStateDecoding | 2 | 远端音频流正在解码,正常播放。 以下情况下会触发回调 OnRemoteAudioStateChanged: + 成功解码远端音频首帧,对应原因是: RemoteAudioStateChangeReason 中的 kRemoteAudioStateChangeReasonLocalUnmuted + 网络由阻塞恢复正常,对应原因是: RemoteAudioStateChangeReason 中的 kRemoteAudioStateChangeReasonNetworkRecovery + 本地用户恢复接收远端音频流,对应原因是:RemoteAudioStateChangeReason 中的 kRemoteAudioStateChangeReasonLocalUnmuted + 远端用户恢复发送音频流,对应原因是: RemoteAudioStateChangeReason 中的 kRemoteAudioStateChangeReasonRemoteUnmuted |
| kRemoteAudioStateFrozen | 3 | 远端音频流卡顿。 网络阻塞、丢包率大于 40% 时,会触发回调 OnRemoteAudioStateChanged,对应原因是: RemoteAudioStateChangeReason 中的 kRemoteAudioStateChangeReasonNetworkCongestion |
enum bytertc::RemoteAudioStateChangeReason
接收远端音频流状态改变的原因。
用户可以通过 OnRemoteAudioStateChanged 了解该原因。
Defined in : bytertc_common_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kRemoteAudioStateChangeReasonInternal | 0 | 内部原因 |
| kRemoteAudioStateChangeReasonNetworkCongestion | 1 | 网络阻塞 |
| kRemoteAudioStateChangeReasonNetworkRecovery | 2 | 网络恢复正常 |
| kRemoteAudioStateChangeReasonLocalMuted | 3 | 本地用户停止接收远端音频流 |
| kRemoteAudioStateChangeReasonLocalUnmuted | 4 | 本地用户恢复接收远端音频流 |
| kRemoteAudioStateChangeReasonRemoteMuted | 5 | 远端用户停止发送音频流 |
| kRemoteAudioStateChangeReasonRemoteUnmuted | 6 | 远端用户恢复发送音频流 |
| kRemoteAudioStateChangeReasonRemoteOffline | 7 | 远端用户离开房间 |
enum bytertc::RemoteVideoState
远端视频流状态。状态改变时,会收到 OnRemoteVideoStateChanged 回调
Defined in : bytertc_common_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kRemoteVideoStateStopped | 0 | 远端视频流默认初始状态,视频尚未开始播放。 |
| kRemoteVideoStateStarting | 1 | 本地用户已接收远端视频流首包。 |
| kRemoteVideoStateDecoding | 2 | 远端视频流正在解码,正常播放。 |
| kRemoteVideoStateFrozen | 3 | 远端视频流卡顿,可能有网络等原因。 |
| kRemoteVideoStateFailed | 4 | 远端视频流播放失败。 |
enum bytertc::RemoteVideoStateChangeReason
远端视频流状态改变的原因
Defined in : bytertc_common_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kRemoteVideoStateChangeReasonInternal | 0 | 内部原因 |
| kRemoteVideoStateChangeReasonNetworkCongestion | 1 | 网络阻塞 |
| kRemoteVideoStateChangeReasonNetworkRecovery | 2 | 网络恢复正常 |
| kRemoteVideoStateChangeReasonLocalMuted | 3 | 本地用户停止接收远端视频流或本地用户禁用视频模块 |
| kRemoteVideoStateChangeReasonLocalUnmuted | 4 | 本地用户恢复接收远端视频流或本地用户启用视频模块 |
| kRemoteVideoStateChangeReasonRemoteMuted | 5 | 远端用户停止发送视频流或远端用户禁用视频模块 |
| kRemoteVideoStateChangeReasonRemoteUnmuted | 6 | 远端用户恢复发送视频流或远端用户启用视频模块 |
| kRemoteVideoStateChangeReasonRemoteOffline | 7 | 远端用户离开频道。状态转换参考 OnUserUnPublishStream。 |
struct bytertc::SourceWantedData
性能回退相关数据
Defined in : bytertc_common_defines.h
| 类型 | 名称 |
|---|---|
| int | width |
| int | height |
| int | frame_rate |
int bytertc::SourceWantedData::width;
未开启发布回退时,此值表示推荐的视频输入宽度,当回退模式为大小流模式时,表示当前推流的最大宽度
如果未开启发送性能回退,此值表示推荐的视频输入宽度;
如果开启了发送性能回退,此值表示当前推流的最大宽度。
int bytertc::SourceWantedData::height;
如果未开启发送性能回退,此值表示推荐的视频输入高度;
如果开启了发送性能回退,此值表示当前推流的最大高度。
int bytertc::SourceWantedData::frame_rate;
如果未开启发送性能回退,此值表示推荐的视频输入帧率,单位 fps;
如果开启了发送性能回退,此值表示当前推流的最大帧率,单位 fps。
struct bytertc::UserInfo
用户信息
Defined in : bytertc_common_defines.h
| 类型 | 名称 |
|---|---|
| const char* | uid |
| const char* | extra_info |
const char* bytertc::UserInfo::uid = nullptr;
用户 ID。该字符串符合正则表达式:[a-zA-Z0-9_@\-]{1,128}。
const char* bytertc::UserInfo::extra_info = nullptr;
用户的额外信息,最大长度为 200 字节。会在 OnUserJoined 中回调给远端用户。
struct bytertc::RtcRoomStats
通话相关的统计信息
Defined in : bytertc_common_defines.h
| 类型 | 名称 |
|---|---|
| float | txLostrate |
| float | rxLostrate |
| int | rtt |
| unsigned int | duration |
| unsigned int | tx_bytes |
| unsigned int | rx_bytes |
| unsigned short | tx_kbitrate |
| unsigned short | rx_kbitrate |
| unsigned short | rx_audio_kbitrate |
| unsigned short | tx_audio_kbitrate |
| unsigned short | rx_video_kbitrate |
| unsigned short | tx_video_kbitrate |
| unsigned int | user_count |
| double | cpu_app_usage |
| int | tx_jitter |
| int | rx_jitter |
float bytertc::RtcRoomStats::txLostrate;
当前应用的上行丢包率,取值范围为 [0, 1]
float bytertc::RtcRoomStats::rxLostrate;
当前应用的下行丢包率,取值范围为 [0, 1]
int bytertc::RtcRoomStats::rtt;
客户端到服务端数据传输的往返时延(单位 ms)
unsigned int bytertc::RtcRoomStats::duration;
进房到退房之间累计时长,单位为 s
unsigned int bytertc::RtcRoomStats::tx_bytes;
本地用户的总发送字节数 (bytes),累计值
unsigned int bytertc::RtcRoomStats::rx_bytes;
本地用户的总接收字节数 (bytes),累计值
unsigned short bytertc::RtcRoomStats::tx_kbitrate;
发送码率(kbps),获取该数据时的瞬时值
unsigned short bytertc::RtcRoomStats::rx_kbitrate;
接收码率(kbps),获取该数据时的瞬时值
unsigned short bytertc::RtcRoomStats::rx_audio_kbitrate;
音频接收码率(kbps),获取该数据时的瞬时值
unsigned short bytertc::RtcRoomStats::tx_audio_kbitrate;
音频包的发送码率(kbps),获取该数据时的瞬时值
unsigned short bytertc::RtcRoomStats::rx_video_kbitrate;
视频接收码率(kbps),获取该数据时的瞬时值
unsigned short bytertc::RtcRoomStats::tx_video_kbitrate;
视频发送码率(kbps),获取该数据时的瞬时值
unsigned int bytertc::RtcRoomStats::user_count;
当前房间内的可见用户人数
double bytertc::RtcRoomStats::cpu_app_usage;
当前应用的 CPU 使用率 (%)
int bytertc::RtcRoomStats::tx_jitter;
系统上行网络抖动(ms)
int bytertc::RtcRoomStats::rx_jitter;
系统下行网络抖动(ms)
enum bytertc::VideoCodecType
视频的编码类型
Defined in : bytertc_common_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kVideoCodecTypeH264 | 1 | 标准 H264 编码器 |
| kVideoCodecTypeByteVC1 | 2 | 标准 ByteVC1 编码器 |
struct bytertc::LocalAudioStats
本地音频流统计信息,统计周期为 2s 。
本地用户发布音频流成功后,SDK 会周期性地通过 OnLocalStreamStats
通知用户发布的音频流在此次统计周期内的发送状况。此数据结构即为回调给用户的参数类型。
Defined in : bytertc_common_defines.h
| 类型 | 名称 |
|---|---|
| float | audio_loss_rate |
| int | send_kbitrate |
| int | record_sample_rate |
| int | stats_interval |
| int | rtt |
| int | num_channels |
| int | sent_sample_rate |
| int | jitter |
float bytertc::LocalAudioStats::audio_loss_rate;
音频丢包率。此次统计周期内的音频上行丢包率,单位为 % ,取值范围为 [0, 1]。
int bytertc::LocalAudioStats::send_kbitrate;
发送码率。此次统计周期内的音频发送码率,单位为 kbps 。
int bytertc::LocalAudioStats::record_sample_rate;
采集采样率。此次统计周期内的音频采集采样率信息,单位为 Hz 。
int bytertc::LocalAudioStats::stats_interval;
统计间隔。此次统计周期的间隔,单位为 ms 。
注意: 此字段用于设置回调的统计周期,默认设置为 2s 。 此字段用于设置回调的统计周期,默认设置为 2s 。
int bytertc::LocalAudioStats::rtt;
往返时延。单位为 ms 。
int bytertc::LocalAudioStats::num_channels;
音频声道数。
int bytertc::LocalAudioStats::sent_sample_rate;
音频发送采样率。此次统计周期内的音频发送采样率信息,单位为 Hz 。
int bytertc::LocalAudioStats::jitter;
音频上行网络抖动,单位为 ms 。
struct bytertc::RemoteAudioStats
远端音频流统计信息,统计周期为 2s。
本地用户订阅远端音频流成功后,SDK 会周期性地通过 OnRemoteStreamStats 通知本地用户订阅的音频流在此次统计周期内的接收状况。此数据结构即为回调给本地用户的参数类型。
Defined in : bytertc_common_defines.h
| 类型 | 名称 |
|---|---|
| float | audio_loss_rate |
| int | received_kbitrate |
| int | stall_count |
| int | stall_duration |
| long | e2e_delay |
| int | playout_sample_rate |
| int | stats_interval |
| int | rtt |
| int | total_rtt |
| int | quality |
| int | jitter_buffer_delay |
| int | num_channels |
| int | received_sample_rate |
| int | frozen_rate |
| int | concealed_samples |
| int | concealment_event |
| int | dec_sample_rate |
| int | dec_duration |
| int | jitter |
float bytertc::RemoteAudioStats::audio_loss_rate;
音频丢包率。统计周期内的音频下行丢包率,取值范围为 [0, 1] 。
int bytertc::RemoteAudioStats::received_kbitrate;
接收码率。统计周期内的音频接收码率,单位为 kbps 。
int bytertc::RemoteAudioStats::stall_count;
音频卡顿次数。统计周期内的卡顿次数。
int bytertc::RemoteAudioStats::stall_duration;
音频卡顿时长。统计周期内的卡顿时长,单位为 ms 。
long bytertc::RemoteAudioStats::e2e_delay;
用户体验级别的端到端延时。从发送端采集完成编码开始到接收端解码完成渲染开始的延时,单位为 ms 。
int bytertc::RemoteAudioStats::playout_sample_rate;
播放采样率。统计周期内的音频播放采样率信息,单位为 Hz 。
int bytertc::RemoteAudioStats::stats_interval;
统计间隔。此次统计周期的间隔,单位为 ms 。
int bytertc::RemoteAudioStats::rtt;
客户端到服务端数据传输的往返时延,单位为 ms。
int bytertc::RemoteAudioStats::total_rtt;
发送端——服务端——接收端全链路数据传输往返时延。单位为 ms 。
int bytertc::RemoteAudioStats::quality;
远端用户发送的音频流质量。值含义参考 NetworkQuality 。
int bytertc::RemoteAudioStats::jitter_buffer_delay;
因引入 jitter buffer 机制导致的延时。单位为 ms 。
int bytertc::RemoteAudioStats::num_channels;
音频声道数。
int bytertc::RemoteAudioStats::received_sample_rate;
音频接收采样率。统计周期内接收到的远端音频采样率信息,单位为 Hz 。
int bytertc::RemoteAudioStats::frozen_rate;
远端用户在加入房间后发生音频卡顿的累计时长占音频总有效时长的百分比。音频有效时长是指远端用户进房发布音频流后,除停止发送音频流和禁用音频模块之外的音频时长。
int bytertc::RemoteAudioStats::concealed_samples;
音频丢包补偿(PLC) 样点总个数。
int bytertc::RemoteAudioStats::concealment_event;
音频丢包补偿(PLC) 累计次数。
int bytertc::RemoteAudioStats::dec_sample_rate;
音频解码采样率。统计周期内的音频解码采样率信息,单位为 Hz 。
int bytertc::RemoteAudioStats::dec_duration;
解码时长。对此次统计周期内接收的远端音频流进行解码的总耗时,单位为 s 。
int bytertc::RemoteAudioStats::jitter;
音频下行网络抖动,单位为 ms 。
struct bytertc::LocalVideoStats
本地视频流统计信息,统计周期为 2s 。
本地用户发布视频流成功后,SDK 会周期性地通过 OnLocalStreamStats
通知用户发布的视频流在此次统计周期内的发送状况。此数据结构即为回调给用户的参数类型。
Defined in : bytertc_common_defines.h
| 类型 | 名称 |
|---|---|
| int | sent_kbitrate |
| int | input_frame_rate |
| int | sent_frame_rate |
| int | encoder_output_frame_rate |
| int | renderer_output_frame_rate |
| int | target_kbitrate |
| int | target_frame_rate |
| int | stats_interval |
| float | video_loss_rate |
| int | rtt |
| int | encoded_bitrate |
| int | encoded_frame_width |
| int | encoded_frame_height |
| int | encoded_frame_count |
| VideoCodecType | codec_type |
| bool | is_screen |
| int | jitter |
int bytertc::LocalVideoStats::sent_kbitrate;
发送码率。此次统计周期内的视频发送码率,单位为 kbps 。
int bytertc::LocalVideoStats::input_frame_rate;
采集帧率。此次统计周期内的视频采集帧率,单位为 fps 。
int bytertc::LocalVideoStats::sent_frame_rate;
发送帧率。此次统计周期内的视频发送帧率,单位为 fps 。
int bytertc::LocalVideoStats::encoder_output_frame_rate;
编码器输出帧率。当前编码器在此次统计周期内的输出帧率,单位为 fps 。
int bytertc::LocalVideoStats::renderer_output_frame_rate;
本地渲染帧率。此次统计周期内的本地视频渲染帧率,单位为 fps 。
int bytertc::LocalVideoStats::target_kbitrate;
目标发送码率。此次统计周期内的视频目标发送码率,单位为 kbps 。
int bytertc::LocalVideoStats::target_frame_rate;
目标发送帧率。当前编码器在此次统计周期内的目标发送帧率,单位为 fps 。
int bytertc::LocalVideoStats::stats_interval;
统计间隔,单位为 ms 。
注意: 此字段用于设置回调的统计周期,默认设置为 2s 。 此字段用于设置回调的统计周期,默认设置为 2s 。
float bytertc::LocalVideoStats::video_loss_rate;
视频丢包率。此次统计周期内的视频上行丢包率,取值范围为 [0,1] 。
int bytertc::LocalVideoStats::rtt;
往返时延,单位为 ms 。
int bytertc::LocalVideoStats::encoded_bitrate;
视频编码码率。此次统计周期内的视频编码码率,单位为 kbps 。
int bytertc::LocalVideoStats::encoded_frame_width;
视频编码宽度,单位为 px 。
int bytertc::LocalVideoStats::encoded_frame_height;
视频编码高度,单位为 px 。
int bytertc::LocalVideoStats::encoded_frame_count;
此次统计周期内发送的视频帧总数。
VideoCodecType bytertc::LocalVideoStats::codec_type;
视频的编码类型,具体参考 VideoCodecType 。
bool bytertc::LocalVideoStats::is_screen;
所属用户的媒体流是否为屏幕流。你可以知道当前统计数据来自主流还是屏幕流。
int bytertc::LocalVideoStats::jitter;
视频上行网络抖动,单位为 ms 。
struct bytertc::RemoteVideoStats
远端音频流统计信息,统计周期为 2s 。
本地用户订阅远端音频流成功后,SDK 会周期性地通过 OnRemoteStreamStats
通知本地用户订阅的远端视频流在此次统计周期内的接收状况。此数据结构即为回调给本地用户的参数类型。
Defined in : bytertc_common_defines.h
| 类型 | 名称 |
|---|---|
| int | width |
| int | height |
| float | video_loss_rate |
| int | received_kbitrate |
| int | decoder_output_frame_rate |
| int | renderer_output_frame_rate |
| int | stall_count |
| int | stall_duration |
| long | e2e_delay |
| bool | is_screen |
| int | stats_interval |
| int | rtt |
| int | frozen_rate |
| int | video_index |
| int | jitter |
int bytertc::RemoteVideoStats::width;
视频宽度
int bytertc::RemoteVideoStats::height;
视频高度
float bytertc::RemoteVideoStats::video_loss_rate;
视频丢包率。统计周期内的视频下行丢包率,单位为 % ,取值范围:[0,1] 。
int bytertc::RemoteVideoStats::received_kbitrate;
接收码率。统计周期内的视频接收码率,单位为 kbps 。
int bytertc::RemoteVideoStats::decoder_output_frame_rate;
解码器输出帧率。统计周期内的视频解码器输出帧率,单位 fps 。
int bytertc::RemoteVideoStats::renderer_output_frame_rate;
渲染帧率。统计周期内的视频渲染帧率,单位 fps 。
int bytertc::RemoteVideoStats::stall_count;
卡顿次数。统计周期内的卡顿次数。
int bytertc::RemoteVideoStats::stall_duration;
卡顿时长。统计周期内的视频卡顿总时长。单位 ms 。
long bytertc::RemoteVideoStats::e2e_delay;
用户体验级别的端到端延时。从发送端采集完成编码开始到接收端解码完成渲染开始的延时,单位为 ms 。
bool bytertc::RemoteVideoStats::is_screen;
所属用户的媒体流是否为屏幕流。你可以知道当前数据来自主流还是屏幕流。
int bytertc::RemoteVideoStats::stats_interval;
统计间隔,此次统计周期的间隔,单位为 ms 。
注意: 此字段用于设置回调的统计周期,目前设置为 2s 。 此字段用于设置回调的统计周期,目前设置为 2s 。
int bytertc::RemoteVideoStats::rtt;
往返时延,单位为 ms 。
int bytertc::RemoteVideoStats::frozen_rate;
远端用户在进房后发生视频卡顿的累计时长占视频总有效时长的百分比(%)。视频有效时长是指远端用户进房发布视频流后,除停止发送视频流和禁用视频模块之外的视频时长。
int bytertc::RemoteVideoStats::video_index;
对应多种分辨率的流的下标,详见 VideoSolutionDescription
int bytertc::RemoteVideoStats::jitter;
视频下行网络抖动,单位为 ms 。
struct bytertc::LocalStreamStats
本地音/视频流统计信息以及网络状况,统计周期为 2s 。
本地用户发布音/视频流成功后,SDK 会周期性地通过 OnLocalStreamStats
通知本地用户发布的音/视频流在此次统计周期内的发送状况。此数据结构即为回调给用户的参数类型。
Defined in : bytertc_common_defines.h
| 类型 | 名称 |
|---|---|
| LocalAudioStats | audio_stats |
| LocalVideoStats | video_stats |
| bool | is_screen |
LocalAudioStats bytertc::LocalStreamStats::audio_stats;
本地设备发送音频流的统计信息,详见 LocalAudioStats
LocalVideoStats bytertc::LocalStreamStats::video_stats;
本地设备发送视频流的统计信息,详见 LocalVideoStats
bool bytertc::LocalStreamStats::is_screen;
所属用户的媒体流是否为屏幕流。你可以知道当前统计数据来自主流还是屏幕流。
struct bytertc::RemoteStreamStats
用户订阅的远端音/视频流统计信息以及网络状况,统计周期为 2s 。
订阅远端用户发布音/视频流成功后,SDK 会周期性地通过 OnRemoteStreamStats
通知本地用户订阅的远端音/视频流在此次统计周期内的接收状况。此数据结构即为回调给本地用户的参数类型。
Defined in : bytertc_common_defines.h
| 类型 | 名称 |
|---|---|
| const char* | uid |
| RemoteAudioStats | audio_stats |
| RemoteVideoStats | video_stats |
| bool | is_screen |
const char* bytertc::RemoteStreamStats::uid;
用户 ID 。音频来源的远端用户 ID 。
RemoteAudioStats bytertc::RemoteStreamStats::audio_stats;
远端音频流的统计信息,详见 RemoteAudioStats
RemoteVideoStats bytertc::RemoteStreamStats::video_stats;
远端视频流的统计信息,详见 RemoteVideoStats
bool bytertc::RemoteStreamStats::is_screen;
所属用户的媒体流是否为屏幕流。你可以知道当前统计数据来自主流还是屏幕流。
enum bytertc::ProblemFeedbackOption
音视频质量反馈问题类型
Defined in : bytertc_common_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kProblemFeedbackOptionNone | 0 | 没有问题 |
| kProblemFeedbackOptionOtherMessage | (1 << 0) | 其他问题 |
| kProblemFeedbackOptionAudioNotClear | (1 << 1) | 声音不清晰 |
| kProblemFeedbackOptionVideoNotClear | (1 << 2) | 视频不清晰 |
| kProblemFeedbackOptionNotSync | (1 << 3) | 音视频不同步 |
| kProblemFeedbackOptionAudioLagging | (1 << 4) | 音频卡顿 |
| kProblemFeedbackOptionVideoLagging | (1 << 5) | 视频卡顿 |
| kProblemFeedbackOptionDisconnected | (1 << 6) | 连接失败 |
| kProblemFeedbackOptionNoAudio | (1 << 7) | 无声音 |
| kProblemFeedbackOptionNoVideo | (1 << 8) | 无画面 |
| kProblemFeedbackOptionAudioStrength | (1 << 9) | 声音过小 |
| kProblemFeedbackOptionEcho | (1 << 10) | 回声噪音 |
| KFeedbackOptionEarBackDelay | (1 << 11) | 耳返延迟大 |
struct bytertc::SysStats
App 使用的 cpu 和内存信息。
信息由 SDK 周期性(2s)地通过 OnSysStats 回调通知给用户。
Defined in : bytertc_common_defines.h
| 类型 | 名称 |
|---|---|
| unsigned int | cpu_cores |
| double | cpu_app_usage |
| double | cpu_total_usage |
| double | memory_usage |
| unsigned long long | full_memory |
| unsigned long long | total_memory_usage |
| unsigned long long | free_memory |
| double | memory_ratio |
| double | total_memory_ratio |
unsigned int bytertc::SysStats::cpu_cores;
当前系统 CPU 核数
double bytertc::SysStats::cpu_app_usage;
当前应用的 cpu 使用率,取值范围为 [0, 1]。
double bytertc::SysStats::cpu_total_usage;
当前系统的 cpu 使用率,取值范围为 [0, 1]。
double bytertc::SysStats::memory_usage;
当前应用的内存使用量(单位 MB)
unsigned long long bytertc::SysStats::full_memory;
全量内存(单位MB)
unsigned long long bytertc::SysStats::total_memory_usage;
系统已使用内存(单位MB)
unsigned long long bytertc::SysStats::free_memory;
空闲可分配内存(单位MB)
double bytertc::SysStats::memory_ratio;
当前应用的内存使用率(单位 %)
double bytertc::SysStats::total_memory_ratio;
系统内存使用率(单位 %)
enum bytertc::EncryptType
自定义加密类型
Defined in : bytertc_common_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kEncryptTypeCustomize | 0 | 不使用内置加密。默认值。 |
| kEncryptTypeAES128CBC | 1 | AES-128-CBC 加密算法 |
| kEncryptTypeAES256CBC | 2 | AES-256-CBC 加密算法 |
| kEncryptTypeAES128ECB | 3 | AES-128-ECB 加密算法 |
| kEncryptTypeAES256ECB = 4 | 4 | AES-256-ECB 加密算法 |
struct bytertc::RtcUser
用户信息
Defined in : bytertc_common_defines.h
| 类型 | 名称 |
|---|---|
| const char* | user_id |
| const char* | meta_data |
const char* bytertc::RtcUser::user_id;
const char* bytertc::RtcUser::meta_data;
enum bytertc::FirstFrameSendState
首帧发送状态
Defined in : bytertc_common_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kFirstFrameSendStateSending | 0 | 发送中 |
| kFirstFrameSendStateSent | 1 | 发送成功 |
| kFirstFrameSendStateEnd | 2 | 发送失败 |
enum bytertc::FirstFramePlayState
首帧播放状态
Defined in : bytertc_common_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kFirstFramePlayStatePlaying | 0 | 播放中 |
| kFirstFramePlayStatePlayed | 1 | 播放成功 |
| kFirstFramePlayStateEnd | 2 | 播放失败 |
enum bytertc::MuteState
音视频流的发送/播放状态
Defined in : bytertc_common_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kMuteStateOff | 0 | 发送 |
| kMuteStateOn | 1 | 停止发送 |
enum bytertc::StreamIndex
流属性
Defined in : bytertc_common_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kStreamIndexMain | 0 | 主流。包括: + 由摄像头/麦克风通过内部采集机制,采集到的视频/音频; + 通过自定义采集,采集到的视频/音频。 |
| kStreamIndexScreen | 1 | 屏幕流。屏幕共享时共享的视频流,或来自声卡的本地播放音频流。 |
struct bytertc::RemoteStreamKey
远端流信息
Defined in : bytertc_common_defines.h
| 类型 | 名称 |
|---|---|
| const char* | room_id |
| const char* | user_id |
| StreamIndex | stream_index |
const char* bytertc::RemoteStreamKey::room_id;
媒体流所在房间的房间 ID。
如果此媒体流是通过 StartForwardStreamToRooms 转发到你所在房间的媒体流时,你应将房间 ID 设置为你所在的房间 ID。
const char* bytertc::RemoteStreamKey::user_id;
用户 ID
StreamIndex bytertc::RemoteStreamKey::stream_index;
流属性,主流或屏幕流。参看 StreamIndex
enum bytertc::HttpProxyState
HTTP/HTTPS 代理状态
Defined in : bytertc_common_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kHttpInit | 0 | HTTP/HTTPS 初始化状态 |
| kHttpConnected | 1 | HTTP/HTTPS 连接成功 |
| kHttpError | 2 | HTTP/HTTPS 连接失败 |
enum bytertc::Socks5ProxyState
SOCKS5 代理连接状态
Defined in : bytertc_common_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kSocks5Init | 0 | SOCKS5 连接初始化 |
| kSocks5Connected | 1 | SOCKS5 连接成功 |
| kSocks5Error | 2 | SOCKS5 连接错误 |
| kSocks5TcpConnectFail | 3 | TCP 连接失败 |
| kSocks5TcpClose | 4 | TCP 连接关闭 |
| kSocks5ProtocolTcpFail | 5 | SOCKS 协议 TCP 协商阶段失败 |
| kSocks5ProtocolUdpFail | 6 | UDP 连接失败 |
| kSocks5AuthFail | 7 | 授权失败 |
| kSocks5Unknown | 8 | 未知状态 |
enum bytertc::RecordingFileType
本地录制文件的存储格式
Defined in : bytertc_common_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kRecordingFileTypeAAC | 0 | aac 格式文件 |
| kRecordingFileTypeMP4 | 1 | mp4 格式文件 |
enum bytertc::RecordingState
本地录制的状态
Defined in : bytertc_common_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kRecordingStateError | 0 | 录制异常 |
| kRecordingStateProcessing | 1 | 录制进行中 |
| kRecordingStateSuccess | 2 | 录制文件保存成功,调用 StopFileRecording 结束录制之后才会收到该状态码。 |
enum bytertc::RecordingErrorCode
本地录制的错误码
Defined in : bytertc_common_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kRecordingErrorCodeOk | 0 | 录制正常 |
| kRecordingErrorCodeNoPermission | -1 | 没有文件写权限 |
| kRecordingErrorCodeNotSupport | -2 | 当前版本 SDK 不支持本地录制功能,请联系技术支持人员 |
| kRecordingErrorCodeOther | -3 | 其他异常 |
struct bytertc::RecordingProgress
本地录制进度
Defined in : bytertc_common_defines.h
| 类型 | 名称 |
|---|---|
| unsigned long long | duration |
| unsigned long long | file_size |
unsigned long long bytertc::RecordingProgress::duration;
当前文件的累计录制时长,单位:毫秒
unsigned long long bytertc::RecordingProgress::file_size;
当前录制文件的大小,单位:byte
struct bytertc::RecordingInfo
本地录制的详细信息
Defined in : bytertc_common_defines.h
| 类型 | 名称 |
|---|---|
| const char* | file_path |
| VideoCodecType | video_codec_type |
| int | width |
| int | height |
const char* bytertc::RecordingInfo::file_path;
录制文件的绝对路径,包含文件名和文件后缀
VideoCodecType bytertc::RecordingInfo::video_codec_type;
录制文件的视频编码类型,参看 VideoCodecType
int bytertc::RecordingInfo::width;
录制视频的宽,单位:像素。纯音频录制请忽略该字段
int bytertc::RecordingInfo::height;
录制视频的高,单位:像素。纯音频录制请忽略该字段
struct bytertc::RecordingConfig
本地录制参数配置
Defined in : bytertc_common_defines.h
| 类型 | 名称 |
|---|---|
| const char* | dir_path |
| RecordingFileType | file_type |
const char* bytertc::RecordingConfig::dir_path;
录制文件保存的绝对路径。你需要指定一个有读写权限的合法路径。
RecordingFileType bytertc::RecordingConfig::file_type;
录制存储文件格式,参看 RecordingFileType
enum bytertc::UserWorkerType
定义linux用户的用户功能
Defined in : bytertc_common_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| UserWorkerNormal | 0 | 正常用户,没有任何特殊属性 |
| UserWorkerSupportSip | (1 << 0) | 用户支持SIP流,信令只下发SIP流 |
| UserWorkerByteVc1Transcoder | (1 << 1) | 用户支持屏幕流的bytevc1到H264转码 |
| UserWorkerNeedUserListAndCb | (1 << 2) | 用户需要信令服务器下发全量的用户列表和回调函数 |
| UserWorkerNeedStreamCallBack | (1 << 3) | 用户需要在房间进入多人模式时获取房间内所有流的相关回调 |
enum bytertc::SyncInfoStreamType
媒体流信息同步的流类型
Defined in : bytertc_common_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kSyncInfoStreamTypeAudio = 0 | 0 | 音频流 |
struct bytertc::StreamSycnInfoConfig
媒体流信息同步的相关配置
Defined in : bytertc_common_defines.h
| 类型 | 名称 |
|---|---|
| StreamIndex | stream_index |
| int | repeat_count |
| SyncInfoStreamType | stream_type |
StreamIndex bytertc::StreamSycnInfoConfig::stream_index;
流属性,主流或屏幕流。见 StreamIndex
int bytertc::StreamSycnInfoConfig::repeat_count;
消息发送的重复次数,取值范围是 [0,25],建议设置为 [3,5]。
SyncInfoStreamType bytertc::StreamSycnInfoConfig::stream_type;
媒体流信息同步的流类型,见 SyncInfoStreamType
struct bytertc::ForwardStreamInfo
媒体流跨房间转发的目标房间的相关信息
Defined in : bytertc_common_defines.h
| 类型 | 名称 |
|---|---|
| const char* | token |
| const char* | room_id |
const char* bytertc::ForwardStreamInfo::token;
用于向该房间转发媒体流的 Token。
如果 Token 无效,转发失败。
const char* bytertc::ForwardStreamInfo::room_id;
跨间转发媒体流过程中目标房间 ID
struct bytertc::ForwardStreamConfiguration
媒体流跨房间转发的目标房间的相关信息
Defined in : bytertc_common_defines.h
| 类型 | 名称 |
|---|---|
| ForwardStreamInfo* | forward_stream_dests |
| int | dest_count |
ForwardStreamInfo* bytertc::ForwardStreamConfiguration::forward_stream_dests = nullptr;
目标房间信息,数组中的每个元素包含一个房间的信息。
int bytertc::ForwardStreamConfiguration::dest_count = 0;
目标房间数量。媒体流同时转发的目标房间数量建议小于等于 4 个。
enum bytertc::ForwardStreamState
媒体流跨房间转发状态
Defined in : bytertc_common_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kForwardStreamStateIdle | 0 | 空闲状态 + 成功调用 StopForwardStreamToRooms 后,所有目标房间为空闲状态。+ 成功调用 UpdateForwardStreamToRooms 减少目标房间后,本次减少的目标房间为空闲状态。 |
| kForwardStreamStateSuccess | 1 | 开始转发 + 调用 StartForwardStreamToRooms 成功向所有房间开始转发媒体流后,返回此状态。+ 调用 UpdateForwardStreamToRooms 后,成功向新增目标房间开始转发媒体流后,返回此状态。 |
| kForwardStreamStateFailure | 2 | 转发失败,失败详情参考 ForwardStreamError 调用 StartForwardStreamToRooms 或 UpdateForwardStreamToRooms 后,如遇转发失败,返回此状态。 |
enum bytertc::ForwardStreamError
媒体流跨房间转发过程中抛出的错误码
Defined in : bytertc_common_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kForwardStreamErrorOK | 0 | 正常 |
| kForwardStreamErrorInvalidArgument | 1201 | 参数异常 |
| kForwardStreamErrorInvalidToken | 1202 | token 错误 |
| kForwardStreamErrorResponse | 1203 | 服务端异常 |
| kForwardStreamErrorRemoteKicked | 1204 | 目标房间有相同 user id 的用户加入,转发中断 |
| kForwardStreamErrorNotSupport | 1205 | 服务端不支持转发功能 |
enum bytertc::ForwardStreamEvent
媒体流跨房间转发事件
Defined in : bytertc_common_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kForwardStreamEventDisconnected | 0 | 本端与服务器网络连接断开,暂停转发。 |
| kForwardStreamEventConnected | 1 | 本端与服务器网络连接恢复,转发服务连接成功。 |
| kForwardStreamEventInterrupt | 2 | 转发中断。转发过程中,如果相同 user_id 的用户进入目标房间,转发中断。 |
| kForwardStreamEventDstRoomUpdated | 3 | 目标房间已更新,由 UpdateForwardStreamToRooms 触发。 |
| kForwardStreamEventUnExpectAPICall | 4 | API 调用时序错误。例如,在调用 StartForwardStreamToRooms 之前调用 UpdateForwardStreamToRooms 。 |
struct bytertc::ForwardStreamStateInfo
跨房间转发媒体流过程中的不同目标房间的状态和错误信息
Defined in : bytertc_common_defines.h
| 类型 | 名称 |
|---|---|
| const char* | room_id |
| ForwardStreamState | state |
| ForwardStreamError | error |
const char* bytertc::ForwardStreamStateInfo::room_id;
跨间转发媒体流过程中目标房间 ID
ForwardStreamState bytertc::ForwardStreamStateInfo::state;
跨房间转发媒体流过程中该目标房间的状态,参看 ForwardStreamState
ForwardStreamError bytertc::ForwardStreamStateInfo::error;
跨房间转发媒体流过程中该目标房间抛出的错误码,参看 ForwardStreamError
struct bytertc::ForwardStreamEventInfo
跨房间转发媒体流过程中的不同目标房间发生的事件
Defined in : bytertc_common_defines.h
| 类型 | 名称 |
|---|---|
| const char* | room_id |
| ForwardStreamEvent | event |
const char* bytertc::ForwardStreamEventInfo::room_id;
跨房间转发媒体流过程中的发生该事件的目标房间 ID
空字符串代表所有目标房间
ForwardStreamEvent bytertc::ForwardStreamEventInfo::event;
跨房间转发媒体流过程中该目标房间发生的事件,参看 ForwardStreamEvent
struct bytertc::VideoMetadataBuffer
视频帧中包含的 metadata 信息
Defined in : bytertc_engine_lite_interface.h
| 类型 | 名称 |
|---|---|
| char* | data |
| int | size |
| int64_t | timestamp_us |
char* bytertc::VideoMetadataBuffer::data;
接收或者发送的 metadata
int bytertc::VideoMetadataBuffer::size;
接收或者发送的 metadata 数据大小,不能超过 1024
int64_t bytertc::VideoMetadataBuffer::timestamp_us;
包含 metadata 视频帧的时间戳,单位微秒
enum bytertc::ScreenCaptureSourceType
屏幕采集对象的类型
Defined in : bytertc_engine_lite_interface.h
| 类型 | 值 | 说明 |
|---|---|---|
| kScreenCaptureSourceTypeUnknown | 0 | 类型未知 |
| kScreenCaptureSourceTypeWindow | 1 | 应用程序的窗口 |
| kScreenCaptureSourceTypeScreen | 2 | 桌面 |
struct bytertc::ScreenCaptureSourceInfo
屏幕采集对象的具体信息
Defined in : bytertc_engine_lite_interface.h
| 类型 | 名称 |
|---|---|
| ScreenCaptureSourceType | type |
| view_t | source_id |
| const char* | source_name |
ScreenCaptureSourceType bytertc::ScreenCaptureSourceInfo::type = kScreenCaptureSourceTypeUnknown;
屏幕分享时,共享对象的类型,参看 ScreenCaptureSourceType
view_t bytertc::ScreenCaptureSourceInfo::source_id = nullptr;
屏幕分享时,共享对象的 ID。
const char* bytertc::ScreenCaptureSourceInfo::source_name = nullptr;
屏幕分享时共享对象的名称。
内存在调用 Release 时释放,请及时转为 string 对象保存
enum bytertc::StreamLayoutMode
公共流的布局模式
Defined in : bytertc_publicstream_interface.h
| 类型 | 值 | 说明 |
|---|---|---|
| kLayoutCustomerMode = 2 | 2 | 自定义 |
typedef struct bytertc::SourceCrop
公共流视频裁剪配置
Defined in : bytertc_publicstream_interface.h
| 类型 | 名称 |
|---|---|
| float | LocationX |
| float | LocationY |
| float | WidthProportion |
| float | HeightProportion |
float bytertc::SourceCrop::LocationX = 0.0;
裁剪后得到的视频帧左上角横坐标相对于裁剪前整体画面的归一化比例,取值范围[0.0, 1.0)
float bytertc::SourceCrop::LocationY = 0.0;
裁剪后得到的视频帧左上角纵坐标相对于裁剪前整体画面的归一化比例,取值范围[0.0, 1.0)
float bytertc::SourceCrop::WidthProportion = 0.0;
裁剪后得到的视频帧宽度相对于裁剪前整体画面的归一化比例,取值范围(0.0, 1.0]
float bytertc::SourceCrop::HeightProportion = 0.0;
裁剪后得到的视频帧高度相对于裁剪前整体画面的归一化比例,取值范围(0.0, 1.0]
typedef struct bytertc::PublicStreamVideoParam
公共流视频参数
Defined in : bytertc_publicstream_interface.h
| 类型 | 名称 |
|---|---|
| int32_t | width |
| int32_t | height |
| int32_t | fps |
| int32_t | bitrate_kpbs |
int32_t bytertc::PublicStreamVideoParam::width;
宽度,单位:px。
仅支持设为偶数,如果设为奇数,将导致公共流发布失败。
int32_t bytertc::PublicStreamVideoParam::height;
高度,单位:px。
仅支持设为偶数,如果设为奇数,后处理会直接拒绝,导致公共流失败。
int32_t bytertc::PublicStreamVideoParam::fps;
帧率,单位:fps
int32_t bytertc::PublicStreamVideoParam::bitrate_kpbs;
码率,单位:kbps
typedef struct bytertc::PublicStreamAudioParam
公共流音频参数
Defined in : bytertc_publicstream_interface.h
| 类型 | 名称 |
|---|---|
| int32_t | sample_rate |
| int32_t | channel_num |
| int32_t | bitrate_kbps |
int32_t bytertc::PublicStreamAudioParam::sample_rate;
音频采样率,包括 16k, 32k, 44.1k, 48k
int32_t bytertc::PublicStreamAudioParam::channel_num;
声道数
int32_t bytertc::PublicStreamAudioParam::bitrate_kbps;
音频码率,单位:kbps,包括 16kbps, 32kbps, 64kbps
typedef struct bytertc::PublicStreamLayoutRegion
单个视频流在公共流中的布局信息。
在多路视频流公共流时,你可以设置其中一路视频流在公共流中的预设布局信息。
Defined in : bytertc_publicstream_interface.h
| 类型 | 名称 |
|---|---|
| const char* | user_id |
| const char* | room_id |
| const char* | alternate_image_uri |
| float | x |
| float | y |
| float | width |
| float | height |
| float | alpha |
| int32_t | z_order |
| int | stream_type |
| TranscoderContentControlType | media_type |
| RenderMode | render_mode |
| SourceCrop | source_crop |
const char* bytertc::PublicStreamLayoutRegion::user_id = "";
目标公共流用户的 ID
const char* bytertc::PublicStreamLayoutRegion::room_id = "";
跨房间订阅流时,目标流所在的房间 ID
const char* bytertc::PublicStreamLayoutRegion::alternate_image_uri = "";
背景图片地址
float bytertc::PublicStreamLayoutRegion::x;
用户视频布局相对画布左侧的偏移量,取值的范围为 [0.0, 1.0)
float bytertc::PublicStreamLayoutRegion::y;
用户视频布局相对画布顶端的偏移量,取值的范围为 [0.0, 1.0)
float bytertc::PublicStreamLayoutRegion::width;
用户视频宽度相对画布宽度的比例,取值的范围为 (0.0, 1.0]
float bytertc::PublicStreamLayoutRegion::height;
用户视频高度相对画布高度的比例,取值的范围为 (0.0, 1.0]
float bytertc::PublicStreamLayoutRegion::alpha;
透明度,取值范围 [0,255]
int32_t bytertc::PublicStreamLayoutRegion::z_order;
用户视频布局在画布中的层级,取值范围 [0,100],0 为底层,值越大层级越高
int bytertc::PublicStreamLayoutRegion::stream_type = 0;
媒体流类型:
TranscoderContentControlType bytertc::PublicStreamLayoutRegion::media_type;
公共流输出类型,参看 TranscoderContentControlType
RenderMode bytertc::PublicStreamLayoutRegion::render_mode;
渲染时,视频内容缩放模式,参看 RenderMode
SourceCrop bytertc::PublicStreamLayoutRegion::source_crop;
支持对每一路参与公共流的视频进行裁剪,参看 SourceCrop
struct bytertc::PublicStreamLayout
公共流布局设置。
Defined in : bytertc_publicstream_interface.h
| 类型 | 名称 |
|---|---|
| int | layoutMode |
| int | interMode |
| const char* | background_image |
| const char* | background_color |
| PublicStreamLayoutRegion* | regions |
| int | regions_num |
int bytertc::PublicStreamLayout::layoutMode;
布局模式
int bytertc::PublicStreamLayout::interMode;
插帧模式
const char* bytertc::PublicStreamLayout::background_image = nullptr;
背景图片
const char* bytertc::PublicStreamLayout::background_color = nullptr;
公共流视频的背景颜色,默认值 #000000,表示为黑色。
PublicStreamLayoutRegion* bytertc::PublicStreamLayout::regions = nullptr;
公共流布局信息。详见 PublicStreamLayoutRegion
int bytertc::PublicStreamLayout::regions_num = 0;
参与合流的数量
struct bytertc::PublicStreamConfig
公共流配置信息
Defined in : bytertc_publicstream_interface.h
| 类型 | 名称 |
|---|---|
| const char* | stream_id |
| PublicStreamVideoParam | video_config |
| PublicStreamAudioParam | audio_config |
| PublicStreamLayout | layout |
const char* bytertc::PublicStreamConfig::stream_id = nullptr;
公共流 ID
PublicStreamVideoParam bytertc::PublicStreamConfig::video_config;
公共流视频配置。详见 PublicStreamVideoParam
PublicStreamAudioParam bytertc::PublicStreamConfig::audio_config;
公共流音频配置。详见 PublicStreamAudioParam
PublicStreamLayout bytertc::PublicStreamConfig::layout;
公共流流布局设置。详见 PublicStreamLayout
class bytertc::IPublicStreamParam
公共流参数
Defined in : bytertc_publicstream_interface.h
| 返回 | 名称 |
|---|---|
| virtual const char* | PublicStreamID |
| virtual Stream | LayoutMode |
| virtual int | InterpolationMode |
| virtual const char* | BackgroundImageUri |
| virtual PublicStream | AudioParam |
| virtual PublicStream | VideoParam |
| virtual PublicStreamLayoutRegion | LayoutRegionByIndex |
| virtual void | SetPublicStreamID |
| virtual void | SetInterpolationMode |
| virtual void | SetBackgroundImageUri |
| virtual void | SetAudioParam |
| virtual void | SetVideoParam |
| virtual void | SetLayoutParam |
| virtual IPublicStreamParam* | Inflatten |
| virtual bool | CheckParameter |
virtual const char* bytertc::IPublicStreamParam::PublicStreamID()
获取公共流的 ID
返回值 公共流的 ID
virtual StreamLayoutMode bytertc::IPublicStreamParam::LayoutMode()
设置公共流的布局模式,目前只支持 kLayoutCustomerMode 模式
返回值 公共流的布局模式,参看 StreamLayoutMode
virtual int bytertc::IPublicStreamParam::InterpolationMode()
获取补帧模式
返回值
补帧模式
0: 补最后一帧
1: 补背景图片或者黑帧
virtual const char* bytertc::IPublicStreamParam::BackgroundImageUri()
获取背景图片地址
返回值 背景图片的地址
virtual PublicStreamAudioParam bytertc::IPublicStreamParam::AudioParam()
获取公共流音频参数
返回值 公共流音频参数内容,参看 PublicStreamAudioParam
virtual PublicStreamVideoParam bytertc::IPublicStreamParam::VideoParam()
获取公共流视频参数
返回值 公共流视频参数内容,参看 PublicStreamVideoParam
virtual PublicStreamLayoutRegion bytertc::IPublicStreamParam::LayoutRegionByIndex(
int32_t index)
获取公共流视窗布局信息
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| index | int32_t | 视窗对应下标 |
返回值 公共流视窗布局信息,参看 PublicStreamLayoutRegion
virtual void bytertc::IPublicStreamParam::SetPublicStreamID(
const char* public_stream_id)
设置公共流 ID
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| public_stream_id | const char* | 公共流 ID 长度在 128 字节以内的非空字符串,支持以下字符集范围: 1. 26 个大写字母 A ~ Z 。 2. 26 个小写字母 a ~ z 。 3. 10 个数字 0 ~ 9 。 4. 下划线 "_",at 符 "@",减号 "-","."。 |
virtual void bytertc::IPublicStreamParam::SetInterpolationMode(
int mode)
设置补帧模式
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| mode | int | 补帧模式0: 补最后一帧1: 补背景图片或者黑帧 |
virtual void bytertc::IPublicStreamParam::SetBackgroundImageUri(
const char* uri)
设置背景图片的地址
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| uri | const char* | 公共流的背景图片的地址 |
virtual void bytertc::IPublicStreamParam::SetAudioParam(
const PublicStreamAudioParam&)
设置音频参数
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| PublicStreamAudioParam | const | 音频参数,参看 PublicStreamAudioParam |
virtual void bytertc::IPublicStreamParam::SetVideoParam(
const PublicStreamVideoParam&)
设置视频参数
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| PublicStreamVideoParam | const | 音频参数,参看 PublicStreamVideoParam |
virtual void bytertc::IPublicStreamParam::SetLayoutParam(
PublicStreamLayoutRegion regions[],
int32_t regions_size,
const char* bg_color,
StreamLayoutMode mode)
设置公共流布局参数
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| regions[] | PublicStreamLayoutRegion | 公共流布局参数,参看 PublicStreamLayoutRegion |
| regions_size | int32_t | 公共流视窗数量 |
| bg_color | const char* | 公共流背景颜色 |
| mode | StreamLayoutMode | 布局参数,参看 StreamLayoutMode |
virtual IPublicStreamParam* bytertc::IPublicStreamParam::Inflatten(
const char* json_str)
将输入的 json 格式的字符串转成 ITranscoderParam 结构体
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| json_str | const char* | json 格式字符串 |
返回值 转换后的 ITranscoderParam 结构体
virtual bool bytertc::IPublicStreamParam::CheckParameter(
const char* json_str)
参数校验
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| json_str | const char* | 传入参数,json 格式字符串 |
返回值
检查结果
true: 所有参数都合法
false: 存在不合法参数
enum bytertc::TranscoderContentControlType
合流输出内容类型
Defined in : bytertc_transcoder_base_interface.h
| 类型 | 值 | 说明 |
|---|---|---|
| kHasAudioAndVideo | 0 | 输出的混流包含音频和视频 |
| kHasAudioOnly | 1 | 输出的混流只包含音频 |
| kHasVideoOnly | 2 | 输出的混流只包含视频 |
class bytertc::ITranscoderParamBase
合流转码参数
Defined in : bytertc_transcoder_base_interface.h
| 返回 | 名称 |
|---|---|
| virtual const char* | RoomID |
| virtual const char* | UserID |
| virtual const char* | JsonContent |
| virtual int32_t | LayoutRegionsSize |
| virtual const char* | BackgroundColor |
| virtual void | SetRoomID |
| virtual void | SetUserID |
| virtual void | SetJsonContent |
| virtual const char* | Flatten |
| **** | ~ITranscoderParamBase |
virtual const char* bytertc::ITranscoderParamBase::RoomID()
获取合流房间 ID
返回值 合流房间 ID
virtual const char* bytertc::ITranscoderParamBase::UserID()
获取合流用户 ID
返回值 合流用户 ID
virtual const char* bytertc::ITranscoderParamBase::JsonContent()
获取通过 Flatten 方法转换得到的 json 格式内容
返回值 json 格式数据
virtual int32_t bytertc::ITranscoderParamBase::LayoutRegionsSize()
获取合流参数中视窗的数量
返回值 合流参数中视窗的数量
virtual const char* bytertc::ITranscoderParamBase::BackgroundColor()
获取背景颜色
返回值 背景颜色
virtual void bytertc::ITranscoderParamBase::SetRoomID(
const char* room_id)
设置合流房间 ID
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| room_id | const char* | 发起合流的用户所在的房间 ID |
virtual void bytertc::ITranscoderParamBase::SetUserID(
const char* user_id)
设置合流用户 ID
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| user_id | const char* | 发起合流的用户的 ID |
virtual void bytertc::ITranscoderParamBase::SetJsonContent(
const char* json_content)
设置 jsonContent
传入通过 Flatten 方法转换得到的 json 格式内容
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| json_content | const char* | json 格式内容 |
virtual const char* bytertc::ITranscoderParamBase::Flatten(
const char* contentType,
const char* action)
将合流参数转成 json 字符串
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| contentType | const char* | 内容属性,表明是合流信令 |
| action | const char* | 合流状态,可选取值如下: • started: 开启合流 • layoutChanged: 更新合流布局 • stopped: 停止合流 |
返回值 转换后的 json 字符串
bytertc::ITranscoderParamBase::~ITranscoderParamBase()
enum bytertc::StreamMixingEvent
合流事件类型
Defined in : bytertc_transcoder_define.h
| 类型 | 值 | 说明 |
|---|---|---|
| kStreamMixingStart | 1 | 合流功能触发 |
| kStreamMixingStartSuccess | 2 | 合流成功 |
| kStreamMixingStartFailed | 3 | 合流启动失败 |
| kStreamMixingUpdate | 4 | 更新合流 |
| kStreamMixingStop | 5 | 合流结束 |
| kStreamMixingChangeMixType | 6 | 合流类型发生改变 |
| kStreamMixingFirstAudioFrameByClientMix | 7 | 收到客户端合流音频首帧 |
| kStreamMixingFirstVideoFrameByClientMix | 8 | 收到客户端合流视频首帧 |
| kStreamMixingUpdateTimeout | 9 | 更新合流超时 |
| kStreamMixingStartTimeout | 10 | 开始合流超时 |
| kStreamMixingRequestParamError | 11 | 合流布局参数错误 |
enum bytertc::StreamMixingType
合流类型
Defined in : bytertc_transcoder_define.h
| 类型 | 值 | 说明 |
|---|---|---|
| kStreamMixingTypeByServer | 0 | 服务端合流 |
| kStreamMixingTypeByClient | 1 | 端云一体合流 |
enum bytertc::TranscoderAudioCodecProfile
AAC 编码等级
Defined in : bytertc_transcoder_define.h
| 类型 | 值 | 说明 |
|---|---|---|
| kByteAACProfileLC | 0 | 编码等级 AAC-LC |
| kByteAACProfileMain | 1 | 编码等级 AAC-MAIN |
| kByteAACProfileHEv1 | 2 | 编码等级 HE-AAC v1 |
| kByteAACProfileHEv2 | 3 | 编码等级 HE-AAC v2 |
enum bytertc::TranscoderVideoCodecProfile
视频编码规格
Defined in : bytertc_transcoder_define.h
| 类型 | 值 | 说明 |
|---|---|---|
| kByteH264ProfileBaseline | 0 | H264 格式基本规格编码 |
| kByteH264ProfileMain | 1 | H264 格式主流规格编码 |
| kByteH264ProfileHigh | 2 | H264 格式高规格编码 |
| kByteVC1ProfileBaseline | 3 | ByteVC1 格式基本规格编码 |
| kByteVC1ProfileMain | 4 | ByteVC1 格式主流规格编码 |
| kByteVC1ProfileHigh | 5 | ByteVC1 格式高规格编码 |
enum bytertc::TranscoderRenderMode
渲染时,视频内容的缩放模式
Defined in : bytertc_transcoder_define.h
| 类型 | 值 | 说明 |
|---|---|---|
| kRenderHidden | 1 | 视频尺寸等比缩放,优先保证窗口被填满。当视频尺寸与显示窗口尺寸不一致时,多出的视频将被截掉。 |
| kRenderFit | 2 | 视频尺寸等比缩放,优先保证视频内容全部显示。当视频尺寸与显示窗口尺寸不一致时,会把窗口未被填满的区域填充成黑色。 |
| kRenderAdaptive | 3 | 视频尺寸非等比例缩放,把窗口充满。当视频尺寸与显示窗口尺寸不一致时,视频高或宽方向会被拉伸。 |
enum bytertc::DataFrameType
数据帧类型
Defined in : bytertc_transcoder_define.h
| 类型 | 值 | 说明 |
|---|---|---|
| kDataFrameTypeSei | 0 | SEI 视频帧 |
typedef struct bytertc::IDataFrame
数据帧
Defined in : bytertc_transcoder_define.h
| 类型 | 名称 |
|---|---|
| DataFrameType | frame_type |
| uint8_t* | u8_data |
| uint32_t | u32_data_size |
| uint64_t | u64_ts_us |
DataFrameType bytertc::IDataFrame::frame_type;
数据帧类型,参看 DataFrameType
uint8_t* bytertc::IDataFrame::u8_data;
数据帧数据
uint32_t bytertc::IDataFrame::u32_data_size;
数据帧数据大小
uint64_t bytertc::IDataFrame::u64_ts_us;
数据帧时间戳,单位:微秒
typedef struct bytertc::TranscoderLayoutRegion
单个视频流在合流中的布局信息。
开启转推直播功能后,在多路视频流合流时,你可以设置其中一路视频流在合流中的预设布局信息。
Defined in : bytertc_transcoder_define.h
| 类型 | 名称 |
|---|---|
| const char* | region_id |
| const char* | room_id |
| float | x |
| float | y |
| float | width |
| float | height |
| float | alpha |
| int32_t | i32_z_order |
| bool | local_user |
| bool | screen_stream |
| TranscoderContentControlType | content_control |
| TranscoderRenderMode | render_mode |
const char* bytertc::TranscoderLayoutRegion::region_id;
合流用户的 ID。必填。
const char* bytertc::TranscoderLayoutRegion::room_id;
媒体流所在房间的房间 ID。
如果此媒体流是通过 StartForwardStreamToRooms 转发到你所在房间的媒体流时,你应将房间 ID 设置为你所在的房间 ID。
float bytertc::TranscoderLayoutRegion::x;
用户视频布局相对画布左侧的偏移量,取值的范围为 [0.0, 1.0)
float bytertc::TranscoderLayoutRegion::y;
用户视频布局相对画布顶端的偏移量,取值的范围为 [0.0, 1.0)
float bytertc::TranscoderLayoutRegion::width;
用户视频宽度相对画布宽度的比例,取值的范围为 (0.0, 1.0]
float bytertc::TranscoderLayoutRegion::height;
用户视频高度相对画布高度的比例,取值的范围为 (0.0, 1.0]
float bytertc::TranscoderLayoutRegion::alpha;
透明度,取值范围 [0,255]
int32_t bytertc::TranscoderLayoutRegion::i32_z_order;
用户视频布局在画布中的层级,取值范围 [0,100],0 为底层,值越大层级越高
bool bytertc::TranscoderLayoutRegion::local_user;
是否为本地用户:
bool bytertc::TranscoderLayoutRegion::screen_stream = false;
是否为屏幕流:
TranscoderContentControlType bytertc::TranscoderLayoutRegion::content_control;
合流输出内容,参看 TranscoderContentControlType
TranscoderRenderMode bytertc::TranscoderLayoutRegion::render_mode;
渲染时,视频内容缩放模式,参看 TranscoderRenderMode
typedef struct bytertc::TranscoderAudioParam
合流音频参数
Defined in : bytertc_transcoder_define.h
| 类型 | 名称 |
|---|---|
| int32_t | i32_sample_rate |
| int32_t | i32_channel_num |
| int32_t | i32_bitrate_kbps |
| TranscoderAudioCodecProfile | audio_codec_profile |
int32_t bytertc::TranscoderAudioParam::i32_sample_rate;
音频采样率,包括 16k, 32k, 44.1k, 48k
int32_t bytertc::TranscoderAudioParam::i32_channel_num;
声道数
int32_t bytertc::TranscoderAudioParam::i32_bitrate_kbps;
音频码率,单位:kbps,包括 16kbsp, 32kbps, 64kbps
TranscoderAudioCodecProfile bytertc::TranscoderAudioParam::audio_codec_profile;
AAC 等级,参看 TranscoderAudioCodecProfile
typedef struct bytertc::TranscoderVideoParam
合流视频参数
Defined in : bytertc_transcoder_define.h
| 类型 | 名称 |
|---|---|
| int32_t | i32_width |
| int32_t | i32_height |
| int32_t | i32_fps |
| int32_t | i32_gop |
| int32_t | i32_bitrate_kbps |
| TranscoderVideoCodecProfile | video_codec_profile |
| bool | lowLatency |
int32_t bytertc::TranscoderVideoParam::i32_width;
合流视频宽度,单位:px。
仅支持设为偶数,如果设为奇数,后处理会直接拒绝,导致合流失败。
int32_t bytertc::TranscoderVideoParam::i32_height;
合流视频高度,单位:px。
仅支持设为偶数,如果设为奇数,后处理会直接拒绝,导致合流失败。
int32_t bytertc::TranscoderVideoParam::i32_fps;
合流视频帧率,单位:fps
int32_t bytertc::TranscoderVideoParam::i32_gop;
视频 I 帧间隔
int32_t bytertc::TranscoderVideoParam::i32_bitrate_kbps;
输出的合流视频码率,单位:kbps,取值范围 [1,10000]
TranscoderVideoCodecProfile bytertc::TranscoderVideoParam::video_codec_profile;
视频编码规格,参看 TranscoderVideoCodecProfile
bool bytertc::TranscoderVideoParam::lowLatency;
是否使用低延时特性:
enum bytertc::VirtualBackgroundSourceType
虚拟背景类型。
Defined in : bytertc_video_effect_interface.h
| 类型 | 值 | 说明 |
|---|---|---|
| kVirtualBackgroundSourceColor | 0 | 使用纯色背景替换视频原有背景。 |
| kVirtualBackgroundSourceImage | 1 | 使用自定义图片背景替换视频原有背景。 |
struct bytertc::VirtualBackgroundSource
虚拟背景对象。
Defined in : bytertc_video_effect_interface.h
| 类型 | 名称 |
|---|---|
| VirtualBackgroundSourceType | source_type |
| uint32_t | source_color |
| const char* | source_path |
VirtualBackgroundSourceType bytertc::VirtualBackgroundSource::source_type;
虚拟背景类型,详见 VirtualBackgroundSourceType 。
uint32_t bytertc::VirtualBackgroundSource::source_color = 0xFFFFFFFF;
纯色背景使用的颜色。
格式为 0xAARRGGBB 。
const char* bytertc::VirtualBackgroundSource::source_path = nullptr;
自定义图片背景使用的图片的绝对路径。
注意:
分辨率超过 1080P 时,图片会被等比缩放。背景图片和视频分辨率不一致时,图片会被裁剪缩放。
支持的格式为 jpg、jpeg、和 png。
struct bytertc::FaceDetectResult
人脸检测结果
Defined in : bytertc_video_effect_interface.h
| 类型 | 名称 |
|---|---|
| int | detect_result |
| int | face_count |
| Rectangle | rect |
| int | image_width |
| int | image_height |
int bytertc::FaceDetectResult::detect_result = 0;
人脸检测结果
int bytertc::FaceDetectResult::face_count = 0;
检测到的人脸的数量
Rectangle bytertc::FaceDetectResult::rect[max_face_num];
识别到人脸的矩形框。数组的长度和检测到的人脸数量一致。参看 Rectangle。
int bytertc::FaceDetectResult::image_width = 0;
原始图片宽度(px)
int bytertc::FaceDetectResult::image_height = 0;
原始图片高度(px)
enum bytertc::RenderMode
渲染模式
Defined in : bytertc_video_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kRenderModeHidden | 1 | 视窗填满优先。 视频帧等比缩放,直至视窗被视频填满。如果视频帧长宽比例与视窗不同,视频帧的多出部分将无法显示。 缩放完成后,视频帧的一边长和视窗的对应边长一致,另一边长大于等于视窗对应边长。 |
| kRenderModeFit | 2 | 视频帧内容全部显示优先。 视频帧等比缩放,直至视频帧能够在视窗上全部显示。如果视频帧长宽比例与视窗不同,视窗上未被视频帧填满区域将被涂黑。 缩放完成后,视频帧的一边长和视窗的对应边长一致,另一边长小于等于视窗对应边长。 |
| kRenderModeFill | 3 | 视频帧自适应画布 视频帧非等比缩放,直至画布被填满。在此过程中,视频帧的长宽比例可能会发生变化。 |
enum bytertc::CameraID
移动端摄像头。
Defined in : bytertc_video_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kCameraIDFront | 0 | 前置摄像头 |
| kCameraIDBack = 1 | 1 | 后置摄像头 |
enum bytertc::SubscribeMediaType
订阅媒体的类型
Defined in : bytertc_video_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kRTCSubscribeMediaTypeNone | 0 | 既不订阅音频,也不订阅视频 |
| kRTCSubscribeMediaTypeAudioOnly | 1 | 只订阅音频,不订阅视频 |
| kRTCSubscribeMediaTypeVideoOnly | 2 | 只订阅视频,不订阅音频 |
| kRTCSubscribeMediaTypeVideoAndAudio | 3 | 同时订阅音频和视频 |
enum bytertc::PauseResumeControlMediaType
暂停/恢复接收远端的媒体流类型。
Defined in : bytertc_video_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kRTCPauseResumeControlMediaTypeAudio | 0 | 只控制音频,不影响视频 |
| kRTCPauseResumeControlMediaTypeVideo | 1 | 只控制视频,不影响音频 |
| kRTCPauseResumeControlMediaTypeVideoAndAudio = 2 | 2 | 同时控制音频和视频 |
enum bytertc::SVCLayer
时域分层定义
Defined in : bytertc_video_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kSVCLayerDefault | 0 | 不指定分层(默认值) |
| kSVCLayerBase | 1 | T0层 |
| kSVCLayerMain | 2 | T0+T1层 |
| kSVCLayerHigh | 3 | T0+T1+T2层 |
struct bytertc::RemoteStreamSwitch
流切换信息。本地用户订阅的远端流触发回退策略时的流切换信息。
Defined in : bytertc_video_defines.h
| 类型 | 名称 |
|---|---|
| const char* | uid |
| bool | is_screen |
| int | before_video_index |
| int | after_video_index |
| bool | before_enable |
| bool | after_enable |
| FallbackOrRecoverReason | reason |
const char* bytertc::RemoteStreamSwitch::uid;
订阅的音视频流的发布者的用户 ID。
bool bytertc::RemoteStreamSwitch::is_screen;
是否是屏幕流。
int bytertc::RemoteStreamSwitch::before_video_index;
流切换前本地用户订阅的视频流的分辨率对应的索引。
int bytertc::RemoteStreamSwitch::after_video_index;
流切换后本地用户订阅的视频流的分辨率对应的索引。
bool bytertc::RemoteStreamSwitch::before_enable;
流切换前是否有视频流。
bool bytertc::RemoteStreamSwitch::after_enable;
流切换后是否有视频流。
FallbackOrRecoverReason bytertc::RemoteStreamSwitch::reason;
触发流回退的原因,详见类型 FallbackOrRecoverReason 。
enum bytertc::TransCodingError
直播推流转码功能错误码。
Defined in : bytertc_video_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kTransCodingErrorOK | 0 | 推流成功。 |
| kTransCodingErrorInvalidArgument | 1 | 推流参数错误。 |
| kTransCodingErrorSubscribe | 2 | 和 RTC 服务端建立连接失败。会自动重连 |
| kTransCodingErrorProcessing | 3 | 合流服务中间过程存在错误,建议重试。 |
| kTransCodingErrorPublish | 4 | 推流失败,可以等待服务端重新推流。 |
struct bytertc::MediaStreamInfo
流属性。
Defined in : bytertc_video_defines.h
| 类型 | 名称 |
|---|---|
| const char* | user_id |
| bool | is_screen |
| bool | has_video |
| bool | has_audio |
| VideoSolutionDescription* | profiles |
| int | profile_count |
| VideoSolutionDescription | max_profile |
const char* bytertc::MediaStreamInfo::user_id;
发布此流的用户 ID 。
bool bytertc::MediaStreamInfo::is_screen;
此流是否为共享屏幕流。
bool bytertc::MediaStreamInfo::has_video;
此流是否包括视频流。
bool bytertc::MediaStreamInfo::has_audio;
流是否包括音频流。
VideoSolutionDescription* bytertc::MediaStreamInfo::profiles;
视频流的属性。
当远端用户调用 SetVideoEncoderConfig 方法发布多个配置的视频流时,此处会包含该用户发布的所有视频流的属性信息。
参看 VideoSolutionDescription。
int bytertc::MediaStreamInfo::profile_count;
不同配置流的个数。
当远端用户调用 SetVideoEncoderConfig 方法发布多个配置的视频流时,此处会包含该用户发布的视频流的数目。
VideoSolutionDescription bytertc::MediaStreamInfo::max_profile;
最大视频流的属性。
since 336版本
当远端用户开启带通道划分的大小流时,回调最大视频流属性信息。用户可以使用新的订阅方式,订阅任意不超过该分辨率的流。
最终接收到的流,会受房间内其他用户的订阅行为的影响,综合确定一个最接近用户请求的分辨率的流。
struct bytertc::SubscribeVideoConfig
视频订阅配置信息
Defined in : bytertc_video_defines.h
| 类型 | 名称 |
|---|---|
| int | video_index |
| int | priority |
int bytertc::SubscribeVideoConfig::video_index = 0;
订阅的视频流分辨率下标。
当远端用户通过调用 SetVideoEncoderConfig 方法启动发布多路不同分辨率的视频流时,本地用户需通过此参数指定希望订阅的流。
默认值为 0,即订阅第一路流。
如果不想更改之前的设置,可以输入 -1。
int bytertc::SubscribeVideoConfig::priority = 0;
远端用户优先级,参看 RemoteUserPriority,默认值为 0。
struct bytertc::SubscribeConfig
手动订阅流的配置信息。
Defined in : bytertc_video_defines.h
| 类型 | 名称 |
|---|---|
| bool | is_screen |
| bool | sub_video |
| bool | sub_audio |
| int | video_index |
| int | priority |
| int | svc_layer |
| int | framerate |
| int | sub_width |
| int | sub_height |
bool bytertc::SubscribeConfig::is_screen = false;
是否是屏幕流(默认为否)。
bool bytertc::SubscribeConfig::sub_video;
是否订阅视频。
bool bytertc::SubscribeConfig::sub_audio;
是否订阅音频。
int bytertc::SubscribeConfig::video_index;
订阅的视频流分辨率下标。
用户可以通过调用 SetVideoEncoderConfig 方法在一路流中发布多个不同分辨率的视频。因此订阅流时,需要指定订阅的具体分辨率。此参数即用于指定需订阅的分辨率的下标,默认值为 0 。
int bytertc::SubscribeConfig::priority = 0;
远端用户的需求优先级,参看 RemoteUserPriority,默认值为 0 。
当开启了订阅流回退选项功能(详见 SetSubscribeFallbackOption 方法),弱网或性能不足时会优先保证收到的高优先级用户的流的质量。
int bytertc::SubscribeConfig::svc_layer = 0;
远端用户的时域分层,参看 SVCLayer,默认值为 0 。
仅码流支持SVC特性时可以生效。
int bytertc::SubscribeConfig::framerate = 0;
期望订阅的最高帧率,单位:fps,默认值为 0,设为大于 0 的值时开始生效。
当发布端帧率低于设定帧率,或订阅端开启性能回退后下行弱网,则帧率会相应下降。
仅码流支持 SVC 分级编码特性时方可生效。
int bytertc::SubscribeConfig::sub_width = 0;
用户通过指定UI对应的最合适的流的宽度,单位:px
int bytertc::SubscribeConfig::sub_height = 0;
用户通过指定UI对应的最合适的流的高度,单位:px
enum bytertc::VideoStreamType
远端视频类型 目前C++ sdk 只支持 kVideoStreamTypeHigh 类型
Defined in : bytertc_video_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kVideoStreamTypeHigh | 0 | 高分辨率视频流 |
| kVideoStreamTypeLow | 1 | 低分辨率视频 |
struct bytertc::VideoCanvas
视频帧渲染设置。
调用 SetLocalVideoCanvas 将视频流绑定到本地视图。
Defined in : bytertc_video_defines.h
| 类型 | 名称 |
|---|---|
| void* | view |
| int | render_mode |
| uint32_t | background_color |
void* bytertc::VideoCanvas::view;
本地视图句柄
int bytertc::VideoCanvas::render_mode;
视频渲染模式,参看 RenderMode
uint32_t bytertc::VideoCanvas::background_color;
用于填充画布空白部分的背景颜色。取值范围是 [0x0000000, 0xFFFFFFFF]。默认值是 0x00000000。其中,透明度设置无效。
typedef void* bytertc::view_t
Windows 窗口 id, Windows 平台下传 Windows 窗口句柄
Defined in : bytertc_video_defines.h
struct bytertc::Rectangle
矩形,用于屏幕共享指定区域, 默认值表示抓取整个屏幕
Defined in : bytertc_video_defines.h
| 类型 | 名称 |
|---|---|
| int | x |
| int | y |
| int | width |
| int | height |
int bytertc::Rectangle::x = 0;
矩形区域左上角的 x 坐标
int bytertc::Rectangle::y = 0;
矩形区域左上角的 y 坐标
int bytertc::Rectangle::width = 0;
矩形宽度
int bytertc::Rectangle::height = 0;
矩形高度
struct bytertc::HighlightConfig
屏幕共享时的边框高亮设置
Defined in : bytertc_video_defines.h
| 类型 | 名称 |
|---|---|
| bool | enable_highlight |
| uint32_t | border_color |
| int | border_width |
bool bytertc::HighlightConfig::enable_highlight = true;
是否显示高亮边框,默认显示。
uint32_t bytertc::HighlightConfig::border_color = 0xFF29CCA3;
边框的颜色, 颜色格式为十六进制 ARGB: 0xAARRGGBB
int bytertc::HighlightConfig::border_width = 4;
边框的宽度,单位:像素
struct bytertc::ScreenFilterConfig
抓取屏幕时排除指定窗口,默认不排除任何窗体
Defined in : bytertc_video_defines.h
| 类型 | 名称 |
|---|---|
| view_t* | excluded_window_list |
| int | excluded_window_num |
view_t* bytertc::ScreenFilterConfig::excluded_window_list = nullptr;
抓取屏幕时排除窗口列表。这个参数仅在抓取屏幕时生效。
int bytertc::ScreenFilterConfig::excluded_window_num = 0;
排除窗口的数量。
enum bytertc::MouseCursorCaptureState
内部采集屏幕视频流时,是否采集鼠标信息
Defined in : bytertc_video_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kMouseCursorCaptureStateOn | 0 | 采集鼠标信息 |
| kMouseCursorCaptureStateOff | 1 | 不采集鼠标信息 |
enum bytertc::ContentHint
内部采集屏幕视频流的内容类型。
Defined in : bytertc_video_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kContentHintDetails | 0 | 细节内容。当共享文档、图片时,建议使用该内容类型。 |
| kContentHintMotion | 1 | 动画内容。当共享视频、游戏时,建议使用该内容类型。 |
struct bytertc::ScreenCaptureParameters
屏幕共享内部采集参数
Defined in : bytertc_video_defines.h
| 类型 | 名称 |
|---|---|
| ContentHint | content_hint |
| Rectangle | region_rect |
| MouseCursorCaptureState | capture_mouse_cursor |
| ScreenFilterConfig | filter_config |
| HighlightConfig | highlight_config |
ContentHint bytertc::ScreenCaptureParameters::content_hint = kContentHintDetails;
内容类型,参看 ContentHint。
Rectangle bytertc::ScreenCaptureParameters::region_rect;
采集区域,参看 Rectangle。
MouseCursorCaptureState bytertc::ScreenCaptureParameters::capture_mouse_cursor;
是否采集鼠标状态,参看 MouseCursorCaptureState。
ScreenFilterConfig bytertc::ScreenCaptureParameters::filter_config;
屏幕过滤设置,参看 ScreenFilterConfig。
HighlightConfig bytertc::ScreenCaptureParameters::highlight_config;
采集区域的边框高亮设置,参看 HighlightConfig。
struct bytertc::DesktopCaptureParameters
屏幕共享的编码参数配置
Defined in : bytertc_video_defines.h
| 类型 | 名称 |
|---|---|
| int | max_width |
| int | max_height |
| int | frame_rate |
| int | bitrate |
| bool | capture_mouse_cursor |
| view_t* | excluded_window_list |
| int | excluded_window_num |
| HighlightConfig | highlight_config |
int bytertc::DesktopCaptureParameters::max_width = 1920;
屏幕采集编码最大宽度
int bytertc::DesktopCaptureParameters::max_height = 1080;
屏幕采集编码最大高度
int bytertc::DesktopCaptureParameters::frame_rate = 15;
屏幕采集编码帧率, 单位 fps
int bytertc::DesktopCaptureParameters::bitrate = -1;
屏幕采集编码码率, -1 为自动码率, SDK 会根据宽高信息选择合适的码率,单位 kbps
bool bytertc::DesktopCaptureParameters::capture_mouse_cursor = true;
是否捕获鼠标光标
view_t* bytertc::DesktopCaptureParameters::excluded_window_list = nullptr;
抓取屏幕时排除窗口列表。这个参数仅在抓取屏幕时生效。
int bytertc::DesktopCaptureParameters::excluded_window_num = 0;
抓取屏幕时排除的窗口数量。
HighlightConfig bytertc::DesktopCaptureParameters::highlight_config;
高亮边框的配置
class bytertc::IVideoSink
自定义视频渲染器
Defined in : bytertc_video_defines.h
| 返回 | 名称 |
|---|---|
| virtual bool | OnFrame |
| virtual void | Release |
virtual bool bytertc::IVideoSink::OnFrame(
IVideoFrame* videoFrame)
视频帧回调
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| videoFrame | IVideoFrame* | 视频帧结构类,参看 IVideoFrame |
返回值 返回值暂未使用
virtual void bytertc::IVideoSink::Release()
释放渲染器。
注意 通知开发者渲染器即将被废弃。收到该返回通知后即可释放资源。
enum bytertc::IVideoSink::PixelFormat
视频帧编码格式
Defined in : bytertc_video_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kI420 | VideoPixelFormat::kVideoPixelFormatI420 | YUV I420 格式 |
| kOriginal | VideoPixelFormat::kVideoPixelFormatUnknown | 原始视频帧格式 |
enum bytertc::MirrorType
镜像类型
Defined in : bytertc_video_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kMirrorTypeNone | 0 | 本地预览和编码传输时均无镜像效果 |
| kMirrorTypeRender | 1 | 本地预览时有镜像效果,编码传输时无镜像效果 |
| kMirrorTypeRenderAndEncoder | 3 | 本地预览和编码传输时均有镜像效果 |
enum bytertc::VideoSourceType
视频输入源类型
Defined in : bytertc_video_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| VideoSourceTypeExternal | 0 | 自定义采集视频源 |
| VideoSourceTypeInternal | 1 | 内部采集视频源 |
| VideoSourceTypeEncodedWithAutoSimulcast | 2 | 自定义编码视频源。 你仅需推送分辨率最大的一路编码后视频流,SDK 将自动转码生成多路小流 |
| VideoSourceTypeEncodedWithoutAutoSimulcast | 3 | 自定义编码视频源。 SDK 不会自动生成多路流,你需要自行生成并推送多路流 |
struct bytertc::VideoFrameInfo
视频帧信息
Defined in : bytertc_video_defines.h
| 类型 | 名称 |
|---|---|
| int | width |
| int | height |
| VideoRotation | rotation |
int bytertc::VideoFrameInfo::width = 0;
宽(像素)
int bytertc::VideoFrameInfo::height = 0;
高(像素)
VideoRotation bytertc::VideoFrameInfo::rotation = VideoRotation::kVideoRotation0;
视频帧顺时针旋转角度。参看 VideoRotation。
struct bytertc::VideoPreprocessorConfig
视频前处理配置参数。
Defined in : bytertc_video_defines.h
| 类型 | 名称 |
|---|---|
| VideoPixelFormat | required_pixel_format |
VideoPixelFormat bytertc::VideoPreprocessorConfig::required_pixel_format = kVideoPixelFormatUnknown;
视频帧像素格式,参看 VideoPixelFormat
struct bytertc::VideoRateInfo
自定义编码流信息
Defined in : bytertc_video_defines.h
| 类型 | 名称 |
|---|---|
| int | fps |
| int | bitrate_kbps |
int bytertc::VideoRateInfo::fps;
帧率,单位 fps
int bytertc::VideoRateInfo::bitrate_kbps;
码率,单位 kbps
enum bytertc::VideoDecoderConfig
视频解码方式
Defined in : bytertc_video_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kVideoDecoderConfigRaw | 0 | 开启 SDK 内部解码,只回调解码后的数据 |
| kVideoDecoderConfigEncode | 1 | 开启自定义解码,只回调解码前数据 |
| kVideoDecoderConfigBoth | 2 | 开启 SDK 内部解码,同时回调解码前和解码后的数据 |
struct bytertc::VideoCaptureConfig
视频采集配置参数。
Defined in : bytertc_video_defines.h
| 类型 | 名称 |
|---|---|
| CapturePreference | capturePreference |
| int | width |
| int | height |
| int | frameRate |
CapturePreference bytertc::VideoCaptureConfig::capturePreference = CapturePreference::KAuto;
视频采集模式,参看 CapturePreference
int bytertc::VideoCaptureConfig::width = 0;
视频采集分辨率的宽度,单位:px。
int bytertc::VideoCaptureConfig::height = 0;
视频采集分辨率的高度,单位:px。
int bytertc::VideoCaptureConfig::frameRate = 0;
视频采集帧率,单位:fps。
enum bytertc::VideoCaptureConfig::CapturePreference
视频采集模式
Defined in : bytertc_video_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| KAuto | 0 | (默认)自动设置采集参数。 SDK在开启采集时根据服务端下发的采集配置结合编码参数设置最佳采集参数。 |
| KManual | 1 | 手动设置采集参数,包括采集分辨率、帧率。 |
| KAutoPerformance | 2 | 采集参数与编码参数一致,即在 SetVideoEncoderConfig 中设置的参数。 |
enum bytertc::RecordingType
本地录制的媒体类型
Defined in : bytertc_video_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kRecordAudioOnly | 0 | 只录制音频 |
| kRecordVideoOnly | 1 | 只录制视频 |
| kRecordVideoAndAudio | 2 | 同时录制音频和视频 |
enum bytertc::RTCVideoDeviceType
当前视频设备类型
Defined in : bytertc_video_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kRTCVideoDeviceTypeUnknown | -1 | 未知设备类型 |
| kRTCVideoDeviceTypeRenderDevice | 0 | 视频渲染设备类型 |
| kRTCVideoDeviceTypeCaptureDevice | 1 | 视频采集设备类型 |
| kRTCVideoDeviceTypeScreenCaptureDevice | 2 | 屏幕流视频设备 |
enum bytertc::MediaStreamType
媒体流类型
Defined in : bytertc_video_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kMediaStreamTypeAudio | 1 << 0 | 只控制音频 |
| kMediaStreamTypeVideo | 1 << 1 | 只控制视频 |
| kMediaStreamTypeBoth = kMediaStreamTypeAudio | kMediaStreamTypeVideo | kMediaStreamTypeAudio |
enum bytertc::FrameRateRatio
占发布端原始帧率的比例
Defined in : bytertc_video_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kFrameRateRatioOriginal | 0 | 100% |
| kFrameRateRatioHalf | 1 | 50% |
| kFrameRateRatioQuarter | 2 | 25% |
struct bytertc::RemoteVideoConfig
远端视频帧信息
Defined in : bytertc_video_defines.h
| 类型 | 名称 |
|---|---|
| int | framerate |
| int | resolution_width |
| int | resolution_height |
int bytertc::RemoteVideoConfig::framerate = 0;
期望订阅的最高帧率,单位:fps,默认值为 0,设为大于 0 的值时开始生效。
当发布端帧率低于设定帧率,或订阅端开启性能回退后下行弱网,则帧率会相应下降。
仅码流支持 SVC 分级编码特性时方可生效。
int bytertc::RemoteVideoConfig::resolution_width = 0;
视频宽度,单位:px
int bytertc::RemoteVideoConfig::resolution_height = 0;
视频高度,单位:px
struct bytertc::RTCRoomConfig
房间参数配置
Defined in : bytertc_video_defines.h
| 类型 | 名称 |
|---|---|
| RoomProfileType | room_profile_type |
| bool | is_auto_publish |
| bool | is_auto_subscribe_audio |
| bool | is_auto_subscribe_video |
| RemoteVideoConfig | remote_video_config |
RoomProfileType bytertc::RTCRoomConfig::room_profile_type = kRoomProfileTypeCommunication;
房间模式,参看 RoomProfileType,默认为 kRoomProfileTypeCommunication,进房后不可更改。
bool bytertc::RTCRoomConfig::is_auto_publish = true;
是否自动发布音视频流,默认为自动发布。
若调用 SetUserVisibility 将自身可见性设为 false,无论是默认的自动发布流还是手动设置的自动发布流都不会进行发布,你需要将自身可见性设为 true 后方可发布。
bool bytertc::RTCRoomConfig::is_auto_subscribe_audio = true;
是否自动订阅音频流,默认为自动订阅。
bool bytertc::RTCRoomConfig::is_auto_subscribe_video = true;
是否自动订阅主视频流,默认为自动订阅。
屏幕流始终自动订阅,不受该方法影响。
RemoteVideoConfig bytertc::RTCRoomConfig::remote_video_config;
远端视频流参数,参看 RemoteVideoConfig
struct bytertc::MultiRoomConfig
多房间参数配置
Defined in : bytertc_video_defines.h
| 类型 | 名称 |
|---|---|
| RoomProfileType | room_profile_type |
| bool | is_auto_subscribe_audio |
| bool | is_auto_subscribe_video |
| RemoteVideoConfig | remote_video_config |
RoomProfileType bytertc::MultiRoomConfig::room_profile_type = kRoomProfileTypeCommunication;
房间模式,参看 RoomProfileType,默认为普通音视频通话模式,进房后不可更改。
bool bytertc::MultiRoomConfig::is_auto_subscribe_audio = true;
是否自动订阅音频流,默认为自动订阅
bool bytertc::MultiRoomConfig::is_auto_subscribe_video = true;
是否自动订阅视频流,默认为自动订阅
RemoteVideoConfig bytertc::MultiRoomConfig::remote_video_config;
远端视频流参数,参看 RemoteVideoConfig
enum bytertc::ScreenMediaType
屏幕采集的媒体类型
Defined in : bytertc_video_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kScreenMediaTypeVideoOnly | 0 | 仅采集视频 |
| kScreenMediaTypeAudioOnly | 1 | 仅采集音频 |
| kScreenMediaTypeVideoAndAudio | 2 | 同时采集音频和视频 |
enum bytertc::VideoPictureType
编码帧类型
Defined in : bytertc_video_frame.h
| 类型 | 值 | 说明 |
|---|---|---|
| kVideoPictureTypeUnknown | 0 | 未知类型 |
| kVideoPictureTypeI | 1 | I帧,关键帧,编解码不需要参考其他视频帧 |
| kVideoPictureTypeP | 2 | P帧,向前参考帧,编解码需要参考前一帧视频帧 |
| kVideoPictureTypeB | 3 | B帧,前后参考帧,编解码需要参考前后两帧视频帧 |
enum bytertc::VideoRotation
视频帧旋转角度
Defined in : bytertc_video_frame.h
| 类型 | 值 | 说明 |
|---|---|---|
| kVideoRotation0 | 0 | 顺时针旋转 0 度 |
| kVideoRotation90 | 90 | 顺时针旋转 90 度 |
| kVideoRotation180 | 180 | 顺时针旋转 180 度 |
| kVideoRotation270 = 270 | 270 | 顺时针旋转 270 度 |
enum bytertc::VideoStreamScaleMode
视频帧缩放模式
Defined in : bytertc_video_frame.h
| 类型 | 值 | 说明 |
|---|---|---|
| kVideoStreamScaleModeAuto | 0 | 自动模式,默认值为 FitWithCropping。 |
| kVideoStreamScaleModeStretch | 1 | 对视频帧进行缩放,直至充满和视窗分辨率一致为止。这一过程不保证等比缩放。这一过程不保证等比缩放。 |
| kVideoStreamScaleModeFitWithCropping | 2 | 视窗填满优先。 视频帧等比缩放,直至视窗被视频填满。如果视频帧长宽比例与视窗不同,视频帧的多出部分将无法显示。 缩放完成后,视频帧的一边长和视窗的对应边长一致,另一边长大于等于视窗对应边长。 |
| kVideoStreamScaleModeFitWithFilling | 3 | 视频帧内容全部显示优先。 视频帧等比缩放,直至视频帧能够在视窗上全部显示。如果视频帧长宽比例与视窗不同,视窗上未被视频帧填满区域将被涂黑。 缩放完成后,视频帧的一边长和视窗的对应边长一致,另一边长小于等于视窗对应边长。 |
enum bytertc::VideoCodecMode
视频编码模式
Defined in : bytertc_video_frame.h
| 类型 | 值 | 说明 |
|---|---|---|
| kCodecModeAuto | 0 | 自动选择 |
| kCodecModeHardware | 1 | 硬编码 |
| kCodecModeSoftware | 2 | 软编码 |
enum bytertc::VideoEncodePreference
编码策略偏好
Defined in : bytertc_video_frame.h
| 类型 | 值 | 说明 |
|---|---|---|
| kVideoEncodePreferenceDisabled | 0 | 无偏好 |
| kVideoEncodePreferenceFramerate | 1 | 帧率优先 |
| kVideoEncodePreferenceQuality | 2 | 质量优先 |
| kVideoEncodePreferenceBalance | 3 | 平衡质量与帧率 |
struct bytertc::VideoSolution
视频流参数
Defined in : bytertc_video_frame.h
| 类型 | 名称 |
|---|---|
| int | width |
| int | height |
| int | fps |
| int | max_send_kbps |
| VideoStreamScaleMode | scale_mode |
| VideoEncodePreference | encode_preference |
int bytertc::VideoSolution::width;
宽(像素)
int bytertc::VideoSolution::height;
高(像素)
int bytertc::VideoSolution::fps;
视频帧率
int bytertc::VideoSolution::max_send_kbps = SEND_KBPS_AUTO_CALCULATE;
最高编码码率(千比特每秒)
建议使用默认设置。
VideoStreamScaleMode bytertc::VideoSolution::scale_mode = VideoStreamScaleMode::kVideoStreamScaleModeAuto;
视频帧缩放模式。你可以设置缩放以适应视窗,参看 VideoStreamScaleMode
VideoEncodePreference bytertc::VideoSolution::encode_preference = VideoEncodePreference::kVideoEncodePreferenceFrame/;"
视频编码质量策略,参看 VideoEncodePreference
struct bytertc::VideoEncoderConfig
视频参数
Defined in : bytertc_video_frame.h
| 类型 | 名称 |
|---|---|
| int | width |
| int | height |
| int | frameRate |
| int | maxBitrate |
| VideoStreamScaleMode | scaleMode |
| VideoEncodePreference | encoderPreference |
int bytertc::VideoEncoderConfig::width;
视频宽度,单位:像素
int bytertc::VideoEncoderConfig::height;
视频高度,单位:像素
int bytertc::VideoEncoderConfig::frameRate;
视频帧率,单位:fps
int bytertc::VideoEncoderConfig::maxBitrate = SEND_KBPS_AUTO_CALCULATE;
最大编码码率,使用 SDK 内部采集时可选设置,自定义采集时必须设置,单位:kbps。
内部采集模式下默认值为 -1,即适配码率模式,系统将根据输入的分辨率和帧率自动计算适用的码率。
设为 0 则不对视频流进行编码发送。
VideoStreamScaleMode bytertc::VideoEncoderConfig::scaleMode = VideoStreamScaleMode::kVideoStreamScaleModeAuto;
视频帧缩放模式。你可以设置缩放以适应视窗,参看 VideoStreamScaleMode
VideoEncodePreference bytertc::VideoEncoderConfig::encoderPreference = VideoEncodePreference::kVideoEncodePreferenceFrame/;"
视频编码质量策略,参看 VideoEncodePreference
struct bytertc::VideoSolutionDescription
视频属性
Defined in : bytertc_video_frame.h
| 类型 | 名称 |
|---|---|
| int | width |
| int | height |
| int | fps |
| int | max_send_kbps |
| VideoStreamScaleMode | scale_mode |
| VideoCodecType | codec_name |
| VideoCodecMode | codec_mode |
| VideoEncodePreference | encode_preference |
int bytertc::VideoSolutionDescription::width;
宽(像素)
int bytertc::VideoSolutionDescription::height;
高(像素)
int bytertc::VideoSolutionDescription::fps;
视频帧率
int bytertc::VideoSolutionDescription::max_send_kbps;
最大发送速率(千比特每秒)
VideoStreamScaleMode bytertc::VideoSolutionDescription::scale_mode = VideoStreamScaleMode::kVideoStreamScaleModeAuto;
缩放模式。参看 VideoStreamScaleMode
VideoCodecType bytertc::VideoSolutionDescription::codec_name = VideoCodecType::kVideoCodecTypeUnknown;
视频的编码类型。参看 VideoCodecType
VideoCodecMode bytertc::VideoSolutionDescription::codec_mode = VideoCodecMode::kCodecModeAuto;
视频的编码模式。参看 VideoCodecMode
VideoEncodePreference bytertc::VideoSolutionDescription::encode_preference = VideoEncodePreference::kVideoEncodePreferenceFrame/;"
视频编码质量偏好策略。参看 VideoEncodePreference
enum bytertc::VideoPixelFormat
视频帧颜色编码格式
Defined in : bytertc_video_frame.h
| 类型 | 值 | 说明 |
|---|---|---|
| kVideoPixelFormatUnknown | 0 | 未知的颜色编码格式 |
| kVideoPixelFormatI420 | 1 | YUV I420 格式 |
| kVideoPixelFormatNV12 | 2 | YUV NV12 格式 |
| kVideoPixelFormatNV21 | 3 | YUV NV21 格式 |
| kVideoPixelFormatRGB24 | 4 | RGB 24bit格式, |
| kVideoPixelFormatRGBA | 5 | RGBA 编码格式 |
| kVideoPixelFormatARGB | 6 | ARGB 编码格式 |
| kVideoPixelFormatBGRA | 7 | BGRA 编码格式 |
| kVideoPixelFormatTexture2D | 0x0DE1 | Texture2D格式 |
| kVideoPixelFormatTextureOES | 0x8D65 | TextureOES格式 |
enum bytertc::ColorSpace
视频YUV格式颜色空间
Defined in : bytertc_video_frame.h
| 类型 | 值 | 说明 |
|---|---|---|
| kColorSpaceUnknown | 0 | |
| kColorSpaceYCbCrBT601LimitedRange | 1 | BT.601数字编码标准,颜色空间[16-235] |
| kColorSpaceYCbCrBT601FullRange | 2 | BT.601数字编码标准,颜色空间[0-255] |
| kColorSpaceYCbCrBT709LimitedRange | 3 | BT.7091数字编码标准,颜色空间[16-235] |
| kColorSpaceYCbCrBT709FullRange | 4 | BT.7091数字编码标准,颜色空间[0-255] |
enum bytertc::VideoFrameType
视频帧格式
Defined in : bytertc_video_frame.h
| 类型 | 值 | 说明 |
|---|---|---|
| kVideoFrameTypeRawMemory | 0 | 原始数据格式,按照内存存储 |
| kVideoFrameTypeCVPixelBuffer | 1 | CVPixelBufferRef类型,支持 iOS and macOS 平台 |
| kVideoFrameTypeGLTexture | 2 | open gl 纹理数据类型 |
| kVideoFrameTypeCuda | 3 | cuda 数据类型 |
| kVideoFrameTypeD3D11 | 4 | direct3d 11 数据格式 |
| kVideoFrameTypeD3D9 | 5 | direct3d 9 数据格式 |
| kVideoFrameTypeJavaFrame | 6 | Java的VideoFrame 数据格式 |
| kVideoFrameTypeVAAPI | 7 | vaapi 数据格式 |
struct bytertc::ManagedMemory
自定义内存释放器
Defined in : bytertc_video_frame.h
| 类型 | 名称 |
|---|---|
| uint8_t* | data |
| int | size |
| void* | user_opaque |
| int ()(uint8_t data, int size, void* user_opaque) | memory_deleter |
uint8_t* bytertc::ManagedMemory::data = nullptr;
内存数据地址
int bytertc::ManagedMemory::size = 0;
内存空间的大小
void* bytertc::ManagedMemory::user_opaque = nullptr;
用户自定义数据
int (*bytertc::ManagedMemory::memory_deleter)(uint8_t* data, int size, void* user_opaque) = nullptr;
自定义内存释放方法指针,如果指针不为空,方法会被调用,用来释放内存空间。 函数传入的参数分别是本结构体内 data、size、user_opaque 3个字段。
typedef struct bytertc::VideoFrameBuilder
视频帧构建类
Defined in : bytertc_video_frame.h
| 类型 | 名称 |
|---|---|
| uint8_t* | data |
| int | linesize |
| uint8_t* | extra_data |
| int | extra_data_size |
| uint8_t* | supplementary_info |
| int | supplementary_info_size |
| int | size |
| int | width |
| int | height |
| VideoRotation | rotation |
| void* | hwaccel_buffer |
| void* | user_opaque |
| int64_t | timestamp_us |
| int ()(struct VideoFrameBuilder builder) | memory_deleter |
uint8_t* bytertc::VideoFrameBuilder::data[ByteRTCNumDataPointers];
视频帧数据平面指针数组
int bytertc::VideoFrameBuilder::linesize[ByteRTCNumDataPointers];
视频帧数据平面行长度
uint8_t* bytertc::VideoFrameBuilder::extra_data = nullptr;
SEI 数据地址
int bytertc::VideoFrameBuilder::extra_data_size = 0;
SEI 数据大小
uint8_t* bytertc::VideoFrameBuilder::supplementary_info = nullptr;
补充数据地址
int bytertc::VideoFrameBuilder::supplementary_info_size = 0;
补充数据大小
int bytertc::VideoFrameBuilder::size = 0;
视频帧内存空间大小
int bytertc::VideoFrameBuilder::width = 0;
视频帧宽度
int bytertc::VideoFrameBuilder::height = 0;
视频帧高度
VideoRotation bytertc::VideoFrameBuilder::rotation = kVideoRotation0;
视频旋转角度,参看 VideoRotation
void* bytertc::VideoFrameBuilder::hwaccel_buffer = nullptr;
硬件加速缓冲区指针
void* bytertc::VideoFrameBuilder::user_opaque = nullptr;
用户私有数据指针
int64_t bytertc::VideoFrameBuilder::timestamp_us = 0;
视频帧时间戳
int (*bytertc::VideoFrameBuilder::memory_deleter)(struct VideoFrameBuilder* builder) = nullptr;
用户定义的视频帧释放回调函数指针,如果指针不为空,方法会被调用用来释放内存空间
class bytertc::IVideoFrame
设置视频帧
Defined in : bytertc_video_frame.h
| 返回 | 名称 |
|---|---|
| virtual VideoFrameType | frame_type |
| virtual VideoPixelFormat | pixel_format |
| virtual int64_t | timestamp_us |
| virtual int | width |
| virtual int | height |
| virtual VideoRotation | rotation |
| virtual ColorSpace | color_space |
| virtual int | number_of_planes |
| virtual uint8_t* | get_plane_data |
| virtual int | get_plane_line_size |
| virtual uint8_t* | get_extra_data_info |
| virtual uint8_t* | get_supplementary_info |
| virtual void* | get_hwaccel_buffer |
| virtual IVideoFrame* | shallow_copy |
| virtual void | release |
| virtual void | to_i420 |
virtual VideoFrameType bytertc::IVideoFrame::frame_type() const
获取视频帧类型,参看 VideoFrameType
virtual VideoPixelFormat bytertc::IVideoFrame::pixel_format() const
获取视频帧格式,参看 VideoPixelFormat
virtual int64_t bytertc::IVideoFrame::timestamp_us() const
获取视频帧时间戳,单位:微秒
virtual int bytertc::IVideoFrame::width() const
获取视频帧宽度,单位:px
virtual int bytertc::IVideoFrame::height() const
获取视频帧高度,单位:px
virtual VideoRotation bytertc::IVideoFrame::rotation() const
获取视频帧旋转角度,参看 VideoRotation
virtual ColorSpace bytertc::IVideoFrame::color_space() const
获取视频帧颜色空间,参看 ColorSpace
virtual int bytertc::IVideoFrame::number_of_planes() const
视频帧颜色 plane 数量
注意 yuv 数据存储格式分为打包(planar)存储格式和平面(packed)存储格式,planar 格式中 Y、U、V 分平面存储,packed 格式中 Y、U、V 交叉存储
virtual uint8_t* bytertc::IVideoFrame::get_plane_data(
int plane_index)
获取 plane 数据指针
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| plane_index | int | plane 数据索引 |
virtual int bytertc::IVideoFrame::get_plane_line_size(
int plane_index)
获取 plane 中数据行的长度
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| plane_index | int | plane 数据索引 |
virtual uint8_t* bytertc::IVideoFrame::get_extra_data_info(
int& size)
获取扩展数据指针
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| size | int& | 扩展数据字节数 |
virtual uint8_t* bytertc::IVideoFrame::get_supplementary_info(
int& size)
获取补充数据指针
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| size | int& | 补充数据字节数 |
virtual void* bytertc::IVideoFrame::get_hwaccel_buffer()
获取本地缓冲区指针
virtual IVideoFrame* bytertc::IVideoFrame::shallow_copy()
浅拷贝视频帧并返回指针
virtual void bytertc::IVideoFrame::release()
释放视频帧
virtual void bytertc::IVideoFrame::to_i420()
转换为i420格式的视频帧
typedef struct bytertc::EncodedVideoFrameBuilder
视频帧参数
Defined in : bytertc_video_frame.h
| 类型 | 名称 |
|---|---|
| VideoCodecType | codec_type |
| VideoPictureType | picture_type |
| VideoRotation | rotation |
| uint8_t* | data |
| int | size |
| int | width |
| int | height |
| int64_t | timestamp_us |
| int64_t | timestamp_dts_us |
| int ()(uint8_t data, int size, void* user_opaque) | memory_deleter |
VideoCodecType bytertc::EncodedVideoFrameBuilder::codec_type = kVideoCodecTypeUnknown;
视频帧编码格式,参看 VideoCodecType
VideoPictureType bytertc::EncodedVideoFrameBuilder::picture_type = kVideoPictureTypeUnknown;
视频帧编码类型,参看 VideoPictureType
VideoRotation bytertc::EncodedVideoFrameBuilder::rotation = kVideoRotation0;
视频帧旋转角度,参看 VideoRotation
uint8_t* bytertc::EncodedVideoFrameBuilder::data;
视频帧数据指针
注意: IEncodedVideoFrame 会获取数据的所有权 IEncodedVideoFrame 会获取数据的所有权
int bytertc::EncodedVideoFrameBuilder::size = 0;
视频帧数据大小
int bytertc::EncodedVideoFrameBuilder::width = 0;
视频帧宽度,单位:px
int bytertc::EncodedVideoFrameBuilder::height = 0;
视频帧高度,单位:px
int64_t bytertc::EncodedVideoFrameBuilder::timestamp_us = 0;
视频采集时间戳,单位:微秒
int64_t bytertc::EncodedVideoFrameBuilder::timestamp_dts_us = 0;
视频编码时间戳,单位:微秒
int (*bytertc::EncodedVideoFrameBuilder::memory_deleter)(uint8_t* data, int size, void* user_opaque) = nullptr;
用户定义的视频帧释放回调函数指针,如果指针不为空,方法会被调用用来释放内存空间
class bytertc::IEncodedVideoFrame
视频帧信息
Defined in : bytertc_video_frame.h
| 返回 | 名称 |
|---|---|
| static IEncodedVideoFrame* | build_encoded_video_frame |
| 返回 | 名称 |
|---|---|
| virtual VideoCodecType | codec_type |
| virtual int64_t | timestamp_us |
| virtual int64_t | timestamp_dts_us |
| virtual int | width |
| virtual int | height |
| virtual VideoPictureType | picture_type |
| virtual VideoRotation | rotation |
| virtual uint8_t* | data |
| virtual int | data_size |
| virtual IEncodedVideoFrame* | shallow_copy |
| virtual void | release |
static IEncodedVideoFrame* bytertc::IEncodedVideoFrame::build_encoded_video_frame(
const EncodedVideoFrameBuilder& builder)
根据视频帧参数创建视频帧并返回指针
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| builder | const EncodedVideoFrameBuilder& | 视频帧参数,参看 EncodedVideoFrameBuilder |
返回值 IEncodedVideoFrame 创建的视频帧的指针
virtual VideoCodecType bytertc::IEncodedVideoFrame::codec_type() const
获取视频编码类型
返回值 视频编码类型,参看 VideoCodecType
virtual int64_t bytertc::IEncodedVideoFrame::timestamp_us() const
获取视频采集时间戳
返回值 视频采集时间戳,单位:微秒
virtual int64_t bytertc::IEncodedVideoFrame::timestamp_dts_us() const
获取视频编码时间戳
返回值 视频编码时间戳,单位:微秒
virtual int bytertc::IEncodedVideoFrame::width() const
获取视频帧宽度
返回值 视频帧宽度,单位:px
virtual int bytertc::IEncodedVideoFrame::height() const
获取视频帧高度
返回值 视频帧高度,单位:px
virtual VideoPictureType bytertc::IEncodedVideoFrame::picture_type() const
获取视频编码帧类型
返回值 视频编码帧类型,参看 VideoPictureType
virtual VideoRotation bytertc::IEncodedVideoFrame::rotation() const
获取视频帧旋转角度
返回值 视频帧旋转角度,参看 VideoRotation
virtual uint8_t* bytertc::IEncodedVideoFrame::data() const
获取视频帧数据指针地址
返回值 视频帧数据指针地址
virtual int bytertc::IEncodedVideoFrame::data_size() const
获取视频帧数据大小
返回值 视频帧数据大小
virtual IEncodedVideoFrame* bytertc::IEncodedVideoFrame::shallow_copy() const
浅拷贝视频帧并返回指针
virtual void bytertc::IEncodedVideoFrame::release()
释放视频帧
struct bytertc::ReceiveRange
描述范围语音中语音接收范围
Defined in : position_audio_render_define.h
| 类型 | 名称 |
|---|---|
| int | min |
| int | max |
int bytertc::ReceiveRange::min;
不同小队成员设置收发世界模式并且开启区域语音时,设置收听的最小范围值,在小于 min 的时候,声音完全无衰减;
int bytertc::ReceiveRange::max;
不同小队成员设置收发世界模式并且开启区域语音时,设置收听的最大范围值,在大于 max 的时候,声音无法听见 在 [min, max) 之间根据距离远近实现声音的衰减
enum bytertc::ReceiveRangeLimit
描述范围语音中语音接受范围的界限, 当没有合理的范围提供时,作为默认的接收范围
Defined in : position_audio_render_define.h
| 类型 | 值 | 说明 |
|---|---|---|
| defaultMin | 0 | 默认最小范围 |
| defaultMax | 10000 | 默认最大范围 |
struct bytertc::Orientation
坐标
Defined in : position_audio_render_define.h
| 类型 | 名称 |
|---|---|
| float | x |
| float | y |
| float | z |
float bytertc::Orientation::x;
x 方向向量
float bytertc::Orientation::y;
y 方向向量
float bytertc::Orientation::z;
z 方向向量
struct bytertc::HumanOrientation
用于确定朝向的正方向基准。默认的正方向和位置坐标系的三个正方向一致。
Defined in : position_audio_render_define.h
| 类型 | 名称 |
|---|---|
| Orientation | forward |
| Orientation | right |
| Orientation | up |
Orientation bytertc::HumanOrientation::forward = { 1,0,0 };
正前方朝向向量
Orientation bytertc::HumanOrientation::right = { 0,1,0 };
正右方朝向向量
Orientation bytertc::HumanOrientation::up = { 0,0,1 };
正上方朝向向量