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::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 bytertc::RenderMode
渲染模式
Defined in : bytertc_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kRenderModeHidden | 1 | 视窗填满优先。 视频帧等比缩放,直至视窗被视频填满。如果视频帧长宽比例与视窗不同,视频帧的多出部分将无法显示。 缩放完成后,视频帧的一边长和视窗的对应边长一致,另一边长大于等于视窗对应边长。 |
| kRenderModeFit | 2 | 视频帧内容全部显示优先。 视频帧等比缩放,直至视频帧能够在视窗上全部显示。如果视频帧长宽比例与视窗不同,视窗上未被视频帧填满区域将被涂黑。 缩放完成后,视频帧的一边长和视窗的对应边长一致,另一边长小于等于视窗对应边长。 |
enum bytertc::UserOfflineReason
用户离开房间的原因。
Defined in : bytertc_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kUserOfflineReasonQuit | 0 | 远端用户调用 LeaveRoom 方法主动退出房间,或切换为不可见。 |
| kUserOfflineReasonDropped | 1 | 远端用户因网络等原因掉线,或切换至隐身状态。 |
enum bytertc::StreamRemoveReason
房间内远端流被移除的原因。
Defined in : bytertc_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kStreamRemoveReasonUnpublish | 0 | 远端用户停止发布流。 |
| kStreamRemoveReasonPublishFailed | 1 | 远端用户发布流失败。 |
| kStreamRemoveReasonKeepLiveFailed | 2 | 保活失败。 |
| kStreamRemoveReasonClientDisconnected | 3 | 远端用户断网。 |
| kStreamRemoveReasonRepublish | 4 | 远端用户重新发布流。 |
| kStreamRemoveReasonOther | 5 | 其他原因。 |
enum bytertc::UserRoleType
用户角色。
Defined in : bytertc_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kUserRoleTypeBroadcaster | 1 | 主播角色。该角色用户可在房间内发布和订阅音视频流,房间中的其他用户可以感知到该用户的存在。 |
| kUserRoleTypeSilentAudience | 2 | 静默观众角色。该众角色用户只可在房间内订阅音视频流,房间中的其他用户无法感知到该用户的存在。 |
enum bytertc::JoinRoomType
用户加入房间的类型。
Defined in : bytertc_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kJoinRoomTypeFirst | 0 | 首次加入房间。用户手动调用 JoinRoom,收到加入成功。 |
| kJoinRoomTypeReconnected | 1 | 重新加入房间。用户网络较差,失去与服务器的连接,进行重连时收到加入成功。 |
enum bytertc::LoginType
用户登录的类型
Defined in : bytertc_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kLoginTypeFirst | 0 | 首次登录。用户手动调用 Login,收到登录成功。 |
| kLoginTypeReconnected | 1 | 重连。用户网络较差,失去与服务器的连接,SDK 自动重连登录成功。 |
enum bytertc::RoomMessageSendResult
发送消息给房间的结果
Defined in : bytertc_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kRoomMessageSendResultSuccess | 200 | 房间Broadcast消息发送成功 |
| kRoomMessageSendResultNotJoin | 100 | 没有加入房间 |
| kRoomMessageSendResultNoConnection | 102 | 没有可用的数据传输通道连接 |
| kRoomMessageSendResultExceedMaxLength | 103 | 消息超过最大长度,当前为64KB |
| kRoomMessageSendResultUnknown | 1000 | 未知错误 |
enum bytertc::ConnectionState
SDK 与信令服务器连接状态。
Defined in : bytertc_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kConnectionStateDisconnected | 1 | 连接断开。 |
| kConnectionStateConnecting | 2 | 首次连接,正在连接中。 |
| kConnectionStateConnected | 3 | 首次连接成功。 |
| kConnectionStateReconnecting | 4 | 连接断开后重新连接中。 |
| kConnectionStateReconnected | 5 | 连接断开后重连成功。 |
| kConnectionStateLost | 6 | 网络连接断开超过 10 秒,仍然会继续重连。 |
enum bytertc::NetworkQuality
媒体流网络质量。
Defined in : bytertc_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kNetworkQualityUnknown | 0 | 网络质量未知。 |
| kNetworkQualityExcellent | 1 | 网络质量极好。 |
| kNetworkQualityGood | 2 | 主观感觉和 kNetworkQualityExcellent 差不多,但码率可能略低。 |
| kNetworkQualityPoor | 3 | 主观感受有瑕疵但不影响沟通。 |
| kNetworkQualityBad | 4 | 勉强能沟通但不顺畅。 |
| kNetworkQualityVbad | 5 | 网络质量非常差,基本不能沟通。 |
struct bytertc::UserNetworkQualityMsg
用户维度媒体流网络质量。
Defined in : bytertc_defines.h
| 类型 | 名称 |
|---|---|
| const char* | uid |
| double | fraction_lost |
| int | rtt |
| int | total_bandwidth |
| int | tx_quality |
| int | rx_quality |
| 返回 | 名称 |
|---|---|
| **** | UserNetworkQualityMsg |
const char* bytertc::UserNetworkQualityMsg::uid;
自己或者远端用户的 uid。
double bytertc::UserNetworkQualityMsg::fraction_lost;
端到端的丢包,取值 (0~1)
int bytertc::UserNetworkQualityMsg::rtt;
端到端的往返延时,单位:ms
int bytertc::UserNetworkQualityMsg::total_bandwidth;
rtp包的传输总量,单位:bps
int bytertc::UserNetworkQualityMsg::tx_quality;
上行质量分,取值见 NetworkQuality
int bytertc::UserNetworkQualityMsg::rx_quality;
下行质量分,取值见 NetworkQuality
bytertc::UserNetworkQualityMsg::UserNetworkQualityMsg() : uid(""), fraction_lost(0.), rtt(0), total_bandwidth(0), tx_quality(0), rx_quality(0)
enum bytertc::NetworkType
SDK 网络连接类型。
Defined in : bytertc_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::PublishFallbackOption
性能回退
Defined in : bytertc_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kPublishFallbackOptionDisabled | 0 | 关闭发送视频流时的性能回退功能,默认值 |
| kPublishFallbackOptionSimulcast | 1 | 开启在网络情况不佳或设备性能不足时只发送小流的功能 |
enum bytertc::RoomProfileType
房间模式
Defined in : bytertc_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kRoomProfileTypeCommunication | 0 | 普通音视频通话模式。 你应在 1V1 音视频通话时,使用此设置。 此设置下,弱网抗性较好。 |
| kRoomProfileTypeLiveBroadcasting | 1 | 直播模式。 当你对音视频通话的音质和画质要求较高时,应使用此设置。 此设置下,当用户使用蓝牙耳机收听时,蓝牙耳机使用媒体模式。 |
| kRoomProfileTypeGame | 2 | 游戏语音模式。此模式下延时较低。 低端机在此模式下运行时,进行了额外的性能优化: + 采集播放采用 16kHz 单通道采样 + 部分低端机型配置编码帧长 40/60 + 部分低端机型关闭软件 3A 音频处理 增强对 iOS 其他屏幕录制进行的兼容性,避免音频录制被 RTC 打断。 |
| kRoomProfileTypeCloudGame | 3 | 云游戏模式。 如果你需要低延迟、高码率的设置时,你可以使用此设置。 此设置下,弱网抗性较差。 |
| kRoomProfileTypeLowLatency | 4 | 低时延模式。SDK 会使用低延时设置。 当你的场景非游戏或云游戏场景,又需要极低延时的体验时,可以使用该模式。 该模式下,音视频通话延时会明显降低,但同时弱网抗性、通话音质等均会受到一定影响。 在使用此模式前,强烈建议咨询技术支持同学。 |
struct bytertc::RTCRoomConfig
房间参数配置
Defined in : bytertc_defines.h
| 类型 | 名称 |
|---|---|
| RoomProfileType | room_profile_type |
| bool | is_auto_publish |
| bool | is_auto_subscribe_audio |
| bool | is_auto_subscribe_video |
RoomProfileType bytertc::RTCRoomConfig::room_profile_type = kRoomProfileTypeCommunication;
房间模式,参看 RoomProfileType,默认为普通音视频通话模式,进房后不可更改。
bool bytertc::RTCRoomConfig::is_auto_publish = true;
是否自动发布音视频流,默认为自动发布。
若调用 SetUserVisibility 将自身可见性设为 false,无论是默认的自动发布流还是手动设置的自动发布流都不会进行发布,你需要将自身可见性设为 true 后方可发布。
bool bytertc::RTCRoomConfig::is_auto_subscribe_audio = true;
是否自动订阅音频流,默认为自动订阅。
进房后,你可以调用 SubscribeUserStream 修改订阅设置。
bool bytertc::RTCRoomConfig::is_auto_subscribe_video = true;
是否自动订阅主视频流,默认为自动订阅。
进房后,你可以调用 SubscribeUserStream 修改订阅设置。
屏幕流始终自动订阅,不受该方法影响。
struct bytertc::MultiRoomConfig
多房间参数配置
Defined in : bytertc_defines.h
| 类型 | 名称 |
|---|---|
| RoomProfileType | room_profile_type |
| bool | is_auto_subscribe_audio |
| bool | is_auto_subscribe_video |
RoomProfileType bytertc::MultiRoomConfig::room_profile_type = kRoomProfileTypeCommunication;
房间模式,参看 RoomProfileType,默认为普通音视频通话模式,进房后不可更改。
bool bytertc::MultiRoomConfig::is_auto_subscribe_audio = true;
是否自动订阅音频流,默认为自动订阅
bool bytertc::MultiRoomConfig::is_auto_subscribe_video = true;
是否自动订阅视频流,默认为自动订阅
enum bytertc::MediaDeviceType
当前媒体设备类型
Defined in : bytertc_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kMediaDeviceTypeAudioRenderDevice | 0 | 音频渲染设备类型 |
| kMediaDeviceTypeAudioCaptureDevice | 1 | 音频采集设备类型 |
| kMediaDeviceTypeVideoCaptureDevice = 3 | 3 | 视频采集设备类型 |
enum bytertc::MediaDeviceState
媒体设备状态类型
Defined in : bytertc_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kMediaDeviceStateStarted | 1 | 设备已开启 |
| kMediaDeviceStateStopped | 2 | 设备已停止 |
| kMediaDeviceStateRuntimeError | 3 | 设备运行时错误 |
| kMediaDeviceStateAdded | 10 | 设备已插入 |
| kMediaDeviceStateRemoved = 11 | 11 | 设备被移除 |
enum bytertc::MediaDeviceError
媒体设备错误类型
Defined in : bytertc_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kMediaDeviceErrorOK | 0 | 媒体设备正常 |
| kMediaDeviceErrorDeviceNoPermission | 1 | 没有权限启动媒体设备 |
| kMediaDeviceErrorDeviceBusy | 2 | 媒体设备已经在使用中 |
| kMediaDeviceErrorDeviceFailure | 3 | 媒体设备错误 |
| kMediaDeviceErrorDeviceNotFound | 4 | 未找到指定的媒体设备 |
| kMediaDeviceErrorDeviceDisconnected | 5 | 媒体设备被移除 |
enum bytertc::CameraID
移动端摄像头。
Defined in : bytertc_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kCameraIDFront | 0 | 前置摄像头 |
| kCameraIDBack = 1 | 1 | 后置摄像头 |
enum bytertc::AudioPlaybackDevice
音频播放设备类型
Defined in : bytertc_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kAudioPlaybackDeviceHeadset | 1 | 有线耳机 |
| kAudioPlaybackDeviceEarpiece | 2 | 听筒 |
| kAudioPlaybackDeviceSpeakerphone | 3 | 扬声器 |
| kAudioPlaybackDeviceHeadsetBluetooth = 4 | 4 | 蓝牙耳机 |
enum bytertc::SubscribeFallbackOption
订阅回退选项
Defined in : bytertc_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kSubscribeFallbackOptionDisable | 0 | 下行网络较弱时,关闭订阅音视频流时的性能回退功能,默认值 |
| kSubscribeFallbackOptionVideoStreamLow | 1 | 下行网络较弱时,只接收视频小流 |
| kSubscribeFallbackOptionAudioOnly | 2 | 下行网络较弱时,先尝试只接收视频小流;如果网络环境无法显示视频,则再回退到只接收远端订阅的音频流 |
enum bytertc::SubscribeMediaType
订阅媒体的类型
Defined in : bytertc_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kRTCSubscribeMediaTypeNone | 0 | 既不订阅音频,也不订阅视频 |
| kRTCSubscribeMediaTypeAudioOnly | 1 | 只订阅音频,不订阅视频 |
| kRTCSubscribeMediaTypeVideoOnly | 2 | 只订阅视频,不订阅音频 |
| kRTCSubscribeMediaTypeVideoAndAudio | 3 | 同时订阅音频和视频 |
enum bytertc::PauseResumeControlMediaType
暂停/恢复接收远端的媒体流类型。
Defined in : bytertc_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kRTCPauseResumeControlMediaTypeAudio | 0 | 只控制音频,不影响视频 |
| kRTCPauseResumeControlMediaTypeVideo | 1 | 只控制视频,不影响音频 |
| kRTCPauseResumeControlMediaTypeVideoAndAudio = 2 | 2 | 同时控制音频和视频 |
enum bytertc::RemoteUserPriority
远端用户优先级,在性能不足需要回退时,会优先回退优先级低的用户的音视频流
Defined in : bytertc_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kRemoteUserPriorityLow | 0 | 用户优先级为低(默认值) |
| kRemoteUserPriorityMedium | 100 | 用户优先级为正常 |
| kRemoteUserPriorityHigh | 200 | 用户优先级为高 |
enum bytertc::SVCLayer
时域分层定义
Defined in : bytertc_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kSVCLayerDefault | 0 | 不指定分层(默认值) |
| kSVCLayerBase | 1 | T0层 |
| kSVCLayerMain | 2 | T0+T1层 |
| kSVCLayerHigh | 3 | T0+T1+T2层 |
enum bytertc::FallbackOrRecoverReason
远端订阅流发生回退或恢复的原因
Defined in : bytertc_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kFallbackOrRecoverReasonUnknown | -1 | 其他原因,非带宽和性能原因引起的回退或恢复。默认值 |
| kFallbackOrRecoverReasonSubscribeFallbackByBandwidth | 0 | 由带宽不足导致的订阅端音视频流回退。 |
| kFallbackOrRecoverReasonSubscribeFallbackByPerformance | 1 | 由性能不足导致的订阅端音视频流回退。 |
| kFallbackOrRecoverReasonSubscribeRecoverByBandwidth | 2 | 由带宽恢复导致的订阅端音视频流恢复。 |
| kFallbackOrRecoverReasonSubscribeRecoverByPerformance | 3 | 由性能恢复导致的订阅端音视频流恢复。 |
| kFallbackOrRecoverReasonPublishFallbackByBandwidth | 4 | 由带宽不足导致的发布端音视频流回退。 |
| kFallbackOrRecoverReasonPublishFallbackByPerformance | 5 | 由性能不足导致的发布端音视频流回退。 |
| kFallbackOrRecoverReasonPublishRecoverByBandwidth | 6 | 由带宽恢复导致的发布端音视频流恢复。 |
| kFallbackOrRecoverReasonPublishRecoverByPerformance | 7 | 由性能恢复导致的发布端音视频流恢复。 |
struct bytertc::RemoteStreamSwitch
流切换信息。本地用户订阅的远端流触发回退策略时的流切换信息。
Defined in : bytertc_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::USER_ONLINE_STATUS
用户在线状态。
Defined in : bytertc_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kUserOnlineStatusOffline | 0 | 对端用户离线 对端用户已调用 Logout,或者没有调用 Login 进行登录。 |
| kUserOnlineStatusOnline | 1 | 对端用户在线 对端用户调用 Login 登录,并且连接状态正常。 |
| kUserOnlineStatusUnreachable | 2 | 无法获取对端用户在线状态 发生级联错误、对端用户在线状态异常时返回。 |
enum bytertc::TransCodingError
直播推流转码功能错误码。 用户调用 StartLiveTranscoding 方法启动直播推流转码功能后,服务端返回的执行结果。
Defined in : bytertc_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kTransCodingErrorOK | 0 | 推流成功。 |
| kTransCodingErrorInvalidArgument | 1 | 推流参数错误。 |
| kTransCodingErrorSubscribe | 2 | 后处理订阅流失败。 |
| kTransCodingErrorProcessing | 3 | 合流服务中间过程存在错误。 |
| kTransCodingErrorPublish | 4 | 推 CDN 失败。 |
enum bytertc::BusinessCheckCode
事务检查码。
用户调用 SetBusinessId 方法设置业务标识参数的返回错误码。
Defined in : bytertc_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| ERROR_ALREADY_IN_ROOM | -6001 | 用户已经在房间中。 业务标识需要在加入房间之前设置,加入后设置无效。 |
| ERROR_INPUT_INVALIDATE | -6002 | 输入参数非法。 用户传入的业务标识参数非法,参数合法性参考 SetBusinessId 方法的参数说明。 |
enum bytertc::LocalAudioStreamState
本地音频流状态。 SDK 通过 OnLocalAudioStateChanged 回调本地音频流状态
Defined in : bytertc_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kLocalAudioStreamStateStopped | 0 | 本地音频默认初始状态。 麦克风停止工作时回调该状态,对应错误码 kLocalAudioStreamErrorOk |
| kLocalAudioStreamStateRecording | 1 | 本地音频录制设备启动成功。 采集到音频首帧时回调该状态,对应错误码 kLocalAudioStreamErrorOk |
| kLocalAudioStreamStateEncoding | 2 | 本地音频首帧编码成功。 音频首帧编码成功时回调该状态,对应错误码 kLocalAudioStreamErrorOk |
| kLocalAudioStreamStateFailed | 3 | 本地音频启动失败,在以下时机回调该状态: + 本地录音设备启动失败,对应错误码 kLocalAudioStreamErrorRecordFailure + 检测到没有录音设备权限,对应错误码 kLocalAudioStreamErrorDeviceNoPermission + 音频编码失败,对应错误码 kLocalAudioStreamErrorEncodeFailure |
| kLocalAudioStreamMute | 4 | 本地音频静音成功后回调该状态。 调用 MuteLocalAudioStream 成功后回调,对应错误码 LocalAudioStreamError 中的 kLocalAudioStreamErrorOk 。 |
| kLocalAudioStreamUnmute | 5 | 本地音频解除静音成功后回调该状态。 调用 MuteLocalAudioStream 成功后回调,对应错误码 LocalAudioStreamError 中的 kLocalAudioStreamErrorOk 。 |
enum bytertc::LocalAudioStreamError
本地音频流状态改变时的错误码。 SDK 通过 OnLocalAudioStateChanged 回调该错误码。
Defined in : bytertc_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kLocalAudioStreamErrorOk | 0 | 本地音频状态正常 |
| kLocalAudioStreamErrorFailure | 1 | 本地音频出错原因未知 |
| kLocalAudioStreamErrorDeviceNoPermission | 2 | 没有权限启动本地音频录制设备 |
| kLocalAudioStreamErrorDeviceBusy | 3 | 本地音频录制设备已经在使用中 |
| kLocalAudioStreamErrorRecordFailure | 4 | 本地音频录制失败,建议你检查录制设备是否正常工作 |
| kLocalAudioStreamErrorEncodeFailure | 5 | 本地音频编码失败 |
| kLocalAudioStreamErrorNoRecordingDevice | 6 | 没有可用的音频录制设备 |
enum bytertc::LocalVideoStreamState
本地视频流状态
Defined in : bytertc_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kLocalVideoStreamStateStopped | 0 | 本地视频采集停止状态 |
| kLocalVideoStreamStateRecording | 1 | 本地视频采集设备启动成功 |
| kLocalVideoStreamStateEncoding | 2 | 本地视频采集后,首帧编码成功 |
| kLocalVideoStreamStateFailed | 3 | 本地视频采集设备启动失败 |
enum bytertc::RemoteAudioState
远端音频流状态。
用户可以通过 OnRemoteAudioStateChanged 了解该状态。
Defined in : bytertc_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kRemoteAudioStateStopped | 0 | 不接收远端音频流。 以下情况下会触发回调 OnRemoteAudioStateChanged: + 本地用户停止接收远端音频流,对应原因是:kRemoteAudioStateChangeReasonLocalMutedRemoteAudioStateChangeReason + 远端用户停止发送音频流,对应原因是:kRemoteAudioStateChangeReasonRemoteMutedRemoteAudioStateChangeReason + 远端用户离开房间,对应原因是:kRemoteAudioStateChangeReasonRemoteOfflineRemoteAudioStateChangeReason |
| kRemoteAudioStateStarting | 1 | 开始接收远端音频流首包。 刚收到远端音频流首包会触发回调 OnRemoteAudioStateChanged, 对应原因是: kRemoteAudioStateChangeReasonLocalUnmutedRemoteAudioStateChangeReason。 |
| kRemoteAudioStateDecoding | 2 | 远端音频流正在解码,正常播放。 以下情况下会触发回调 OnRemoteAudioStateChanged: + 成功解码远端音频首帧,对应原因是:kRemoteAudioStateChangeReasonLocalUnmutedRemoteAudioStateChangeReason + 网络由阻塞恢复正常,对应原因是:kRemoteAudioStateChangeReasonNetworkRecoveryRemoteAudioStateChangeReason + 本地用户恢复接收远端音频流,对应原因是:kRemoteAudioStateChangeReasonLocalUnmutedRemoteAudioStateChangeReason + 远端用户恢复发送音频流,对应原因是:kRemoteAudioStateChangeReasonRemoteUnmutedRemoteAudioStateChangeReason |
| kRemoteAudioStateFrozen | 3 | 远端音频流卡顿。 网络阻塞、丢包率大于 40% 时,会触发回调 OnRemoteAudioStateChanged, 对应原因是:kRemoteAudioStateChangeReasonNetworkCongestionRemoteAudioStateChangeReason |
enum bytertc::RemoteAudioStateChangeReason
接收远端音频流状态改变的原因。
用户可以通过 OnRemoteAudioStateChanged 了解该原因。
Defined in : bytertc_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_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kRemoteVideoStateStopped | 0 | 远端视频流默认初始状态,视频尚未开始播放。 |
| kRemoteVideoStateStarting | 1 | 本地用户已接收远端视频流首包。 |
| kRemoteVideoStateDecoding | 2 | 远端视频流正在解码,正常播放。 |
| kRemoteVideoStateFrozen | 3 | 远端视频流卡顿,可能有网络等原因。 |
| kRemoteVideoStateFailed | 4 | 远端视频流播放失败。 |
enum bytertc::RemoteVideoStateChangeReason
远端视频流状态改变的原因
Defined in : bytertc_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kRemoteVideoStateChangeReasonInternal | 0 | 内部原因 |
| kRemoteVideoStateChangeReasonNetworkCongestion | 1 | 网络阻塞 |
| kRemoteVideoStateChangeReasonNetworkRecovery | 2 | 网络恢复正常 |
| kRemoteVideoStateChangeReasonLocalMuted | 3 | 本地用户停止接收远端视频流或本地用户禁用视频模块 |
| kRemoteVideoStateChangeReasonLocalUnmuted | 4 | 本地用户恢复接收远端视频流或本地用户启用视频模块 |
| kRemoteVideoStateChangeReasonRemoteMuted | 5 | 远端用户停止发送视频流或远端用户禁用视频模块 |
| kRemoteVideoStateChangeReasonRemoteUnmuted | 6 | 远端用户恢复发送视频流或远端用户启用视频模块 |
| kRemoteVideoStateChangeReasonRemoteOffline | 7 | 远端用户离开频道。 状态转换参考 OnStreamRemove |
struct bytertc::AudioVolumeInfo
音频流来源的用户 ID 及对应的音量。
Defined in : bytertc_defines.h
| 类型 | 名称 |
|---|---|
| int | volume |
| const char* | uid |
int bytertc::AudioVolumeInfo::volume;
音量,取值范围为:[0,255]
const char* bytertc::AudioVolumeInfo::uid;
音频流来源的用户 ID
enum bytertc::PerformanceAlarmReason
OnPerformanceAlarms 告警的原因
Defined in : bytertc_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kPerformanceAlarmReasonBandwidthFallbacked | 0 | 网络原因差,造成了发送性能回退。仅在开启发送性能回退时,会收到此原因。 |
| kPerformanceAlarmReasonBandwidthResumed | 1 | 网络性能恢复,发送性能回退恢复。仅在开启发送性能回退时,会收到此原因。 |
| kPerformanceAlarmReasonPerformanceFallbacked | 2 | 如果未开启发送性能回退,收到此告警时,意味着性能不足; 如果开启了发送性能回退,收到此告警时,意味着性能不足,且已发生发送性能回退。 |
| kPerformanceAlarmReasonPerformanceResumed | 3 | 如果未开启发送性能回退,收到此告警时,意味着性能不足已恢复; 如果开启了发送性能回退,收到此告警时,意味着性能不足已恢复,且已发生发送性能回退恢复。 |
enum bytertc::PerformanceAlarmMode
是否开启发布性能回退
Defined in : bytertc_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kPerformanceAlarmModeNormal | 0 | 未开启发布性能回退 |
| kPerformanceAlarmModeSimulcast | 1 | 已开启发布性能回退 |
struct bytertc::SourceWantedData
性能回退相关数据
Defined in : bytertc_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_defines.h
| 类型 | 名称 |
|---|---|
| const char* | uid |
| const char* | extra_info |
const char* bytertc::UserInfo::uid = nullptr;
用户 ID,长度在 128 字节以内的非空字符串。支持以下字符集范围:
1. 26 个大写字母 A ~ Z
2. 26 个小写字母 a ~ z
3. 10 个数字 0 ~ 9
4. 下划线 "_",at 符 "@",减 号 "-"
const char* bytertc::UserInfo::extra_info = nullptr;
用户传递的额外信息,最大长度为 200 字节。会在 onUserJoinedOnUserJoined 中回调给远端用户。
struct bytertc::RtcRoomStats
通话相关的统计信息
Defined in : bytertc_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 |
float bytertc::RtcRoomStats::txLostrate;
当前应用的上行丢包率,取值范围为 [0, 1]。
float bytertc::RtcRoomStats::rxLostrate;
当前应用的下行丢包率,取值范围为 [0, 1]。
int bytertc::RtcRoomStats::rtt;
客户端到服务端数据传输的往返时延(单位 ms)
unsigned int bytertc::RtcRoomStats::duration;
通话时长,单位为秒,累计值
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;
当前房间内的用户人数
struct bytertc::RemoteAudioStats
远端音频流统计信息,统计周期为 2s。
本地用户订阅远端音频流成功后,SDK 会周期性地通过 OnRemoteStreamStats 通知本地用户订阅的音频流在此次统计周期内的接收状况。此数据结构即为回调给本地用户的参数类型。
Defined in : bytertc_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::LocalAudioStats
本地音频流统计信息,统计周期为 2s 。
本地用户发布音频流成功后,SDK 会周期性地通过 OnLocalStreamStats
通知用户发布的音频流在此次统计周期内的发送状况。此数据结构即为回调给用户的参数类型。
Defined in : bytertc_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 。
int bytertc::LocalAudioStats::rtt;
往返时延。单位为 ms 。
int bytertc::LocalAudioStats::num_channels;
音频声道数。
int bytertc::LocalAudioStats::sent_sample_rate;
音频发送采样率。此次统计周期内的音频发送采样率信息,单位为 Hz 。
int bytertc::LocalAudioStats::jitter;
音频上行网络抖动,单位为 ms 。
struct bytertc::MediaStreamInfo
流属性。
Defined in : bytertc_defines.h
| 类型 | 名称 |
|---|---|
| const char* | user_id |
| bool | is_screen |
| bool | has_video |
| bool | has_audio |
| VideoSolutionDescription* | profiles |
| int | profile_count |
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 方法发布多个配置的视频流时,此处会包含该用户发布的视频流的数目。
struct bytertc::SubscribeVideoConfig
视频订阅配置信息
Defined in : bytertc_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_defines.h
| 类型 | 名称 |
|---|---|
| bool | is_screen |
| bool | sub_video |
| bool | sub_audio |
| int | video_index |
| int | priority |
| int | svc_layer |
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特性时可以生效。
enum bytertc::ProblemFeedbackOption
音视频质量反馈问题类型
Defined in : bytertc_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) | 耳返延迟大 |
enum bytertc::VideoStreamType
远端视频类型 目前C++ sdk 只支持 kVideoStreamTypeHigh 类型
Defined in : bytertc_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kVideoStreamTypeHigh | 0 | 高分辨率视频流 |
| kVideoStreamTypeLow | 1 | 低分辨率视频 |
struct bytertc::VideoCanvas
画布信息和渲染模式。
你应使用 SetLocalVideoCanvas 将视频流绑定到本地视图。
Defined in : bytertc_defines.h
| 类型 | 名称 |
|---|---|
| void* | view |
| int | render_mode |
| const char* | uid |
| void* | priv |
void* bytertc::VideoCanvas::view;
本地视图句柄
int bytertc::VideoCanvas::render_mode;
渲染模式,参看 RenderMode
const char* bytertc::VideoCanvas::uid;
视图对应的用户 ID
void* bytertc::VideoCanvas::priv;
你的自定义数据,SDK 透传该数据。
struct bytertc::RemoteVideoStats
远端音频流统计信息,统计周期为 2s 。
本地用户订阅远端音频流成功后,SDK 会周期性地通过 OnRemoteStreamStats
通知本地用户订阅的远端视频流在此次统计周期内的接收状况。此数据结构即为回调给本地用户的参数类型。
Defined in : bytertc_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 。
int bytertc::RemoteVideoStats::rtt;
往返时延,单位为 ms 。
int bytertc::RemoteVideoStats::frozen_rate;
远端用户在进房后发生视频卡顿的累计时长占视频总有效时长的百分比(%)。视频有效时长是指远端用户进房发布视频流后,除停止发送视频流和禁用视频模块之外的视频时长。
int bytertc::RemoteVideoStats::video_index;
对应多种分辨率的流的下标,详见 VideoSolutionDescription
int bytertc::RemoteVideoStats::jitter;
视频下行网络抖动,单位为 ms 。
struct bytertc::LocalVideoStats
本地视频流统计信息,统计周期为 2s 。
本地用户发布视频流成功后,SDK 会周期性地通过 OnLocalStreamStats
通知用户发布的视频流在此次统计周期内的发送状况。此数据结构即为回调给用户的参数类型。
Defined in : bytertc_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 。
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::LocalStreamStats
本地音/视频流统计信息以及网络状况,统计周期为 2s 。
本地用户发布音/视频流成功后,SDK 会周期性地通过 OnLocalStreamStats
通知本地用户发布的音/视频流在此次统计周期内的发送状况。此数据结构即为回调给用户的参数类型。
Defined in : bytertc_defines.h
| 类型 | 名称 |
|---|---|
| LocalAudioStats | audio_stats |
| LocalVideoStats | video_stats |
| NetworkQuality | local_tx_quality |
| NetworkQuality | local_rx_quality |
| bool | is_screen |
LocalAudioStats bytertc::LocalStreamStats::audio_stats;
本地设备发送音频流的统计信息,详见 LocalAudioStats
LocalVideoStats bytertc::LocalStreamStats::video_stats;
本地设备发送视频流的统计信息,详见 LocalVideoStats
NetworkQuality bytertc::LocalStreamStats::local_tx_quality;
所属用户的媒体流上行网络质量,详见 NetworkQuality
NetworkQuality bytertc::LocalStreamStats::local_rx_quality;
所属用户的媒体流下行网络质量,详见 NetworkQuality
bool bytertc::LocalStreamStats::is_screen;
所属用户的媒体流是否为屏幕流。你可以知道当前统计数据来自主流还是屏幕流。
struct bytertc::RemoteStreamStats
用户订阅的远端音/视频流统计信息以及网络状况,统计周期为 2s 。
订阅远端用户发布音/视频流成功后,SDK 会周期性地通过 OnRemoteStreamStats
通知本地用户订阅的远端音/视频流在此次统计周期内的接收状况。此数据结构即为回调给本地用户的参数类型。
Defined in : bytertc_defines.h
| 类型 | 名称 |
|---|---|
| const char* | uid |
| RemoteAudioStats | audio_stats |
| RemoteVideoStats | video_stats |
| NetworkQuality | remote_tx_quality |
| NetworkQuality | remote_rx_quality |
| bool | is_screen |
const char* bytertc::RemoteStreamStats::uid;
用户 ID 。音频来源的远端用户 ID 。
RemoteAudioStats bytertc::RemoteStreamStats::audio_stats;
远端音频流的统计信息,详见 RemoteAudioStats
RemoteVideoStats bytertc::RemoteStreamStats::video_stats;
远端视频流的统计信息,详见 RemoteVideoStats
NetworkQuality bytertc::RemoteStreamStats::remote_tx_quality;
所属用户的媒体流上行网络质量,详见 NetworkQuality
NetworkQuality bytertc::RemoteStreamStats::remote_rx_quality;
所属用户的媒体流下行网络质量,详见 NetworkQuality
bool bytertc::RemoteStreamStats::is_screen;
所属用户的媒体流是否为屏幕流。你可以知道当前统计数据来自主流还是屏幕流。
struct bytertc::SysStats
App 使用的 cpu 和内存信息。
信息由 SDK 周期性(2s)地通过 OnSysStats 回调通知给用户。
Defined in : bytertc_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;
全量内存(单位字节)
unsigned long long bytertc::SysStats::total_memory_usage;
系统已使用内存(单位字节)
unsigned long long bytertc::SysStats::free_memory;
空闲可分配内存(单位字节)
double bytertc::SysStats::memory_ratio;
当前应用的内存使用率(单位 %)
double bytertc::SysStats::total_memory_ratio;
系统内存使用率(单位 %)
typedef void* bytertc::view_t
windows 窗口 id, windows 平台下传 windows 窗口句柄
Defined in : bytertc_defines.h
struct bytertc::Rectangle
矩形,用于屏幕共享指定区域, 默认值表示抓取整个屏幕
Defined in : bytertc_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_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_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_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kMouseCursorCaptureStateOn | 0 | 采集鼠标信息 |
| kMouseCursorCaptureStateOff | 1 | 不采集鼠标信息 |
struct bytertc::ScreenCaptureParameters
屏幕共享时,内部采集参数配置
Defined in : bytertc_defines.h
| 类型 | 名称 |
|---|---|
| Rectangle | region_rect |
| MouseCursorCaptureState | capture_mouse_cursor |
| ScreenFilterConfig | filter_config |
| HighlightConfig | highlight_config |
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_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;
高亮边框的配置
enum bytertc::EncryptType
自定义加密类型
Defined in : bytertc_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 加密算法 |
enum bytertc::AudioMixingState
音频混音文件播放状态。
Defined in : bytertc_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kAudioMixingStatePreloaded | 0 | 混音已加载 |
| kAudioMixingStatePlaying | 1 | 混音正在播放 |
| kAudioMixingStatePaused | 2 | 混音暂停 |
| kAudioMixingStateStopped | 3 | 混音停止 |
| kAudioMixingStateFailed | 4 | 混音播放失败 |
| kAudioMixingStateFinished | 5 | 混音播放结束 |
enum bytertc::AudioMixingError
音频混音文件播放错误码。
Defined in : bytertc_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kAudioMixingErrorOk | 0 | 混音错误码,正常 |
| kAudioMixingErrorPreloadFailed | 1 | 预加载失败,找不到混音文件或者文件长度超出 20s |
| kAudioMixingErrorStartFailed | 2 | 混音开启失败,找不到混音文件或者混音文件打开失败 |
| kAudioMixingErrorIdNotFound | 3 | 混音 ID 异常 |
| kAudioMixingErrorSetPositionFailed | 4 | 设置混音文件的播放位置出错 |
| kAudioMixingErrorInValidVolume | 5 | 音量参数不合法,仅支持设置的音量值为[0 400] |
| kAudioMixingErrorLoadConflict | 6 | 播放的文件与预加载的文件不一致,请先使用 UnloadAudioMixing 卸载文件 |
class bytertc::IVideoSink
自定义视频渲染器
Defined in : bytertc_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_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kI420 | VideoPixelFormat::kVideoPixelFormatI420 | YUV I420 格式 |
| kOriginal | VideoPixelFormat::kVideoPixelFormatUnknown | 原始视频帧格式 |
struct bytertc::RtcUser
用户信息
Defined in : bytertc_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_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kFirstFrameSendStateSending | 0 | 发送中 |
| kFirstFrameSendStateSent | 1 | 发送成功 |
| kFirstFrameSendStateEnd | 2 | 发送失败 |
enum bytertc::FirstFramePlayState
首帧播放状态
Defined in : bytertc_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kFirstFramePlayStatePlaying | 0 | 播放中 |
| kFirstFramePlayStatePlayed | 1 | 播放成功 |
| kFirstFramePlayStateEnd | 2 | 播放失败 |
enum bytertc::MirrorMode
是否开启镜像模式
Defined in : bytertc_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kMirrorModeOff | 0 | 不开启 |
| kMirrorModeOn | 1 | 开启 |
enum bytertc::MirrorType
镜像类型
Defined in : bytertc_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kMirrorTypeNone | 0 | 本地渲染和编码传输时均无镜像效果 |
| kMirrorTypeRender | 1 | 本地渲染时有镜像效果,编码传输时无镜像效果 |
| kMirrorTypeRenderAndEncoder | 3 | 本地渲染和编码传输时均有镜像效果 |
enum bytertc::MuteState
停止/启动发送音/视频流的状态
Defined in : bytertc_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kMuteStateOff | 0 | 启动发送音/视频流的状态 |
| kMuteStateOn | 1 | 停止发送音/视频流的状态 |
enum bytertc::StreamIndex
流属性
Defined in : bytertc_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kStreamIndexMain | 0 | 主流。包括: + 通过默认摄像头/麦克风采集到的视频/音频; + 通过自定义设备采集到的视频/音频。 |
| kStreamIndexScreen | 1 | 屏幕流。屏幕共享时共享的视频流,或来自声卡的本地播放音频流。 |
struct bytertc::RemoteStreamKey
远端流信息
Defined in : bytertc_defines.h
| 类型 | 名称 |
|---|---|
| const char* | room_id |
| const char* | user_id |
| StreamIndex | stream_index |
const char* bytertc::RemoteStreamKey::room_id;
房间 ID
const char* bytertc::RemoteStreamKey::user_id;
用户 ID
StreamIndex bytertc::RemoteStreamKey::stream_index;
流属性,主流或屏幕流。参看 StreamIndex
enum bytertc::AudioSourceType
音频输入源类型
Defined in : bytertc_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kAudioSourceTypeExternal | 0 | |
| kAudioSourceTypeInternal | 1 |
enum bytertc::VideoSourceType
视频输入源类型
Defined in : bytertc_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| VideoSourceTypeExternal | 0 | 自定义采集视频源 |
| VideoSourceTypeInternal | 1 | SDK 内部采集视频源 |
| VideoSourceTypeEncodedWithAutoSimulcast | 2 | 自定义编码视频源。 你仅需推送分辨率最大的一路编码后视频流,SDK 将自动转码生成多路小流 |
| VideoSourceTypeEncodedWithoutAutoSimulcast | 3 | 自定义编码视频源。 SDK 不会自动生成多路流,你需要自行生成并推送多路流 |
struct bytertc::VideoFrameInfo
视频帧信息
Defined in : bytertc_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。
enum bytertc::AudioSampleRate
音频采样率,单位为 HZ。
Defined in : bytertc_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kAudioSampleRateAuto | -1 | 自动采样率,适用于从 SDK 获取音频数据,使用 SDK 内部处理的采样率,不经过 resample。 当你需要从 SDK 获取音频数据时,若对采样率没有强依赖,建议设置成该值,可以通过避免 resample 带来一些性能优化。 |
| kAudioSampleRate8000 | 8000 | 8000 采样率 |
| kAudioSampleRate16000 | 16000 | 16000 采样率 |
| kAudioSampleRate32000 | 32000 | 32000 采样率 |
| kAudioSampleRate44100 | 44100 | 44100 采样率 |
| kAudioSampleRate48000 = 48000 | 48000 | 48000 采样率 |
enum bytertc::AudioChannel
音频声道。
Defined in : bytertc_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kAudioChannelAuto | -1 | 自动声道,适用于从 SDK 获取音频数据,使用 SDK 内部处理的声道,不经过 resample。 当你需要从 SDK 获取音频数据时,若对声道没有强依赖,建议设置成该值,可以通过避免 resample 带来一些性能优化。 |
| kAudioChannelMono | 1 | 单声道 |
| kAudioChannelStereo = 2 | 2 | 双声道 |
struct bytertc::AudioFormat
音频参数格式
Defined in : bytertc_defines.h
| 类型 | 名称 |
|---|---|
| AudioSampleRate | sample_rate |
| AudioChannel | channel |
AudioSampleRate bytertc::AudioFormat::sample_rate;
音频采样率,详见 AudioSampleRate
AudioChannel bytertc::AudioFormat::channel;
音频声道,详见 AudioChannel
enum bytertc::HttpProxyState
HTTP/HTTPS 代理状态
Defined in : bytertc_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kHttpInit | 0 | HTTP/HTTPS 初始化状态 |
| kHttpConnected | 1 | HTTP/HTTPS 连接成功 |
| kHttpError | 2 | HTTP/HTTPS 连接失败 |
enum bytertc::Socks5ProxyState
SOCKS5 代理连接状态
Defined in : bytertc_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::ASRAuthorizationType
语音识别服务鉴权方式,详情请咨询语音识别服务服务相关同学
Defined in : bytertc_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kASRAuthorizationTypeToken | 0 | Token 鉴权 |
| kASRAuthorizationTypeSignature | 1 | Signature 鉴权 |
struct bytertc::RTCASRConfig
使用自动语音识别服务所需校验信息
Defined in : bytertc_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_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::RecordingType
本地录制的媒体类型
Defined in : bytertc_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kRecordAudioOnly | 0 | 只录制音频 |
| kRecordVideoOnly | 1 | 只录制视频 |
| kRecordVideoAndAudio | 2 | 同时录制音频和视频 |
enum bytertc::RecordingFileType
本地录制文件的存储格式
Defined in : bytertc_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kRecordingFileTypeAAC | 0 | aac 格式文件 |
| kRecordingFileTypeMP4 | 1 | mp4 格式文件 |
enum bytertc::RecordingState
本地录制的状态
Defined in : bytertc_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kRecordingStateError | 0 | 录制异常 |
| kRecordingStateProcessing | 1 | 录制进行中 |
| kRecordingStateSuccess | 2 | 录制文件保存成功,调用 StopFileRecording 结束录制之后才会收到该状态码。 |
enum bytertc::RecordingErrorCode
本地录制的错误码
Defined in : bytertc_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kRecordingErrorCodeOk | 0 | 录制正常 |
| kRecordingErrorCodeNoPermission | -1 | 没有文件写权限 |
| kRecordingErrorCodeNotSupport | -2 | 当前版本 SDK 不支持本地录制功能,请联系技术支持人员 |
| kRecordingErrorCodeOther | -3 | 其他异常 |
struct bytertc::RecordingProgress
本地录制进度
Defined in : bytertc_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_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_defines.h
| 类型 | 名称 |
|---|---|
| const char* | dir_path |
| RecordingFileType | file_type |
| RecordingType | recording_type |
const char* bytertc::RecordingConfig::dir_path;
录制文件保存的绝对路径。你需要指定一个有读写权限的合法路径。
RecordingFileType bytertc::RecordingConfig::file_type;
录制存储文件格式,参看 RecordingFileType
RecordingType bytertc::RecordingConfig::recording_type;
录制媒体类型,参看 RecordingType
enum bytertc::AudioMixingType
混音播放类型
Defined in : bytertc_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kAudioMixingTypePlayout | 0 | 仅本地播放 |
| kAudioMixingTypePublish | 1 | 仅远端播放 |
| kAudioMixingTypePlayoutAndPublish | 2 | 本地和远端同时播放 |
struct bytertc::AudioMixingConfig
混音配置
Defined in : bytertc_defines.h
| 类型 | 名称 |
|---|---|
| AudioMixingType | type |
| int | play_count |
AudioMixingType bytertc::AudioMixingConfig::type;
混音播放类型,详见 AudioMixingType
int bytertc::AudioMixingConfig::play_count;
混音播放次数,
enum bytertc::UserWorkerType
定义linux用户的用户功能
Defined in : bytertc_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| UserWorkerNormal | 0 | 正常用户,没有任何特殊属性 |
| UserWorkerSupportSip | (1 << 0) | 用户支持SIP流,信令只下发SIP流 |
| UserWorkerByteVc1Transcoder | (1 << 1) | 用户支持屏幕流的bytevc1到H264转码 |
| UserWorkerNeedUserListAndCb | (1 << 2) | 用户需要信令服务器下发全量的用户列表和回调函数 |
struct bytertc::VideoPreprocessorConfig
视频前处理配置参数。
Defined in : bytertc_defines.h
| 类型 | 名称 |
|---|---|
| VideoPixelFormat | required_pixel_format |
VideoPixelFormat bytertc::VideoPreprocessorConfig::required_pixel_format = kVideoPixelFormatUnknown;
视频帧像素格式,参看 VideoPixelFormat
struct bytertc::VideoRateInfo
自定义编码流信息
Defined in : bytertc_defines.h
| 类型 | 名称 |
|---|---|
| int | fps |
| int | bitrate_kbps |
int bytertc::VideoRateInfo::fps;
帧率,单位 fps
int bytertc::VideoRateInfo::bitrate_kbps;
码率,单位 kbps
enum bytertc::VideoDecoderConfig
视频解码方式
Defined in : bytertc_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kVideoDecoderConfigRaw | 0 | 开启 SDK 内部解码,只回调解码后的数据 |
| kVideoDecoderConfigEncode | 1 | 开启自定义解码,只回调解码前数据 |
| kVideoDecoderConfigBoth | 2 | 开启 SDK 内部解码,同时回调解码前和解码后的数据 |
struct bytertc::VideoCaptureConfig
视频采集配置参数。
Defined in : bytertc_defines.h
| 类型 | 名称 |
|---|---|
| int | width |
| int | height |
| int | frameRate |
int bytertc::VideoCaptureConfig::width = 0;
视频采集分辨率的宽度,单位:px。
int bytertc::VideoCaptureConfig::height = 0;
视频采集分辨率的高度,单位:px。
int bytertc::VideoCaptureConfig::frameRate = 0;
视频采集帧率,单位:fps。
struct bytertc::AudioPropertiesConfig
音频属性信息提示的相关配置
Defined in : bytertc_defines.h
| 类型 | 名称 |
|---|---|
| int | interval |
int bytertc::AudioPropertiesConfig::interval;
信息提示间隔;
struct bytertc::AudioPropertiesInfo
音频属性信息
Defined in : bytertc_defines.h
| 类型 | 名称 |
|---|---|
| int | volume |
int bytertc::AudioPropertiesInfo::volume;
音量,取值范围为:[0, 255]
struct bytertc::RemoteAudioPropertiesInfo
远端音频属性信息
Defined in : bytertc_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_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
音质档位
Defined in : bytertc_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kAudioProfileTypeDefault | 0 | 默认音质 |
| kAudioProfileTypeFluent | 1 | 流畅音质。 流畅优先、低延迟、低功耗、低流量消耗,适用于大部分游戏场景,如 MMORPG、MOBA、FPS等游戏中的小队语音、组队语音、国战语音等。 |
| kAudioProfileTypeStandard | 2 | 标准音质。 适用于对音质有一定要求的场景,同时延时、功耗和流量消耗相对适中,适合 Sirius 等狼人杀类游戏。 |
| kAudioProfileTypeHD | 3 | 高清音质 超高音质,同时延时、功耗和流量消耗相对较大,适用于连麦 PK、在线教育等场景。 游戏场景不建议使用。 |
enum bytertc::SyncInfoStreamType
媒体流信息同步的流类型
Defined in : bytertc_defines.h
| 类型 | 值 | 说明 |
|---|---|---|
| kSyncInfoStreamTypeAudio = 0 | 0 | 音频流 |
struct bytertc::StreamSycnInfoConfig
媒体流信息同步的相关配置
Defined in : bytertc_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::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::IAudioFrameObserver::AUDIO_FRAME_TYPE
音频帧类型
Defined in : bytertc_engine_lite_interface.h
| 类型 | 值 | 说明 |
|---|---|---|
| FRAME_TYPE_PCM16 | 0 | PCM 16bit |
struct bytertc::IAudioFrameObserver::AudioFrame
音频帧
Defined in : bytertc_engine_lite_interface.h
| 类型 | 名称 |
|---|---|
| AUDIO_FRAME_TYPE | type |
| int | samples |
| int | channels |
| int | samples_per_sec |
| void* | buffer |
| int64_t | render_time_ms |
AUDIO_FRAME_TYPE bytertc::IAudioFrameObserver::AudioFrame::type;
音频帧类型
int bytertc::IAudioFrameObserver::AudioFrame::samples;
音频采样点数量
int bytertc::IAudioFrameObserver::AudioFrame::channels;
音频通道数
int bytertc::IAudioFrameObserver::AudioFrame::samples_per_sec;
音频采样率
void* bytertc::IAudioFrameObserver::AudioFrame::buffer;
音频数据内存地址
int64_t bytertc::IAudioFrameObserver::AudioFrame::render_time_ms;
渲染时间
class bytertc::IAudioProcessor
自定义音频处理器
Defined in : bytertc_engine_lite_interface.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::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;
屏幕分享时共享对象的名称。
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::TranscoderContentControlType
合流输出内容类型
Defined in : bytertc_transcoder_define.h
| 类型 | 值 | 说明 |
|---|---|---|
| kHasAudioAndVideo | 0 | 输出的混流包含音频和视频 |
| kHasAudioOnly | 1 | 输出的混流只包含音频 |
| kHasVideoOnly | 2 | 输出的混流只包含视频 |
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
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_kpbs |
| 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 帧间隔,单位:ms
int32_t bytertc::TranscoderVideoParam::i32_bitrate_kpbs;
合流视频码率,单位:kbps
TranscoderVideoCodecProfile bytertc::TranscoderVideoParam::video_codec_profile;
视频编码规格,参看 TranscoderVideoCodecProfile
bool bytertc::TranscoderVideoParam::lowLatency;
是否使用低延时特性:
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::VideoCodecType
视频的编码类型
Defined in : bytertc_video_frame.h
| 类型 | 值 | 说明 |
|---|---|---|
| kVideoCodecTypeH264 | 1 | 标准 H264 编码器 |
| kVideoCodecTypeByteVC1 | 2 | 标准 ByteVC1 编码器 |
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::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 编码格式 |
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;
视频旋转角度
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
| 返回 | 名称 |
|---|---|
| static IVideoFrame* | build_video_frame |
| 返回 | 名称 |
|---|---|
| virtual int | frame_type |
| virtual int | pixel_format |
| virtual int64_t | timestamp_us |
| virtual int | width |
| virtual int | height |
| virtual int | rotation |
| virtual int | 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 |
static IVideoFrame* bytertc::IVideoFrame::build_video_frame(
const VideoFrameBuilder& builder)
根据视频帧参数创建视频帧并返回指针
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| VideoFrameBuilder | const | 视频帧创建类对象,详见 VideoFrameBuilder:VideoFrameBuilder |
virtual int bytertc::IVideoFrame::frame_type() const
获取视频帧类型
virtual int bytertc::IVideoFrame::pixel_format() const
获取视频帧格式
virtual int64_t bytertc::IVideoFrame::timestamp_us() const
获取视频帧时间戳,单位:微秒
virtual int bytertc::IVideoFrame::width() const
获取视频帧宽度
virtual int bytertc::IVideoFrame::height() const
获取视频帧高度
virtual int bytertc::IVideoFrame::rotation() const
获取视频帧旋转角度
virtual int bytertc::IVideoFrame::color_space() const
获取视频帧颜色空间
virtual int bytertc::IVideoFrame::number_of_planes() const
视频帧颜色 plane 数量
注意 yuv 数据存储格式分为 plane 存储格式和 pack 存储格式,plane 格式中有 y,u,v 分开存储,pack 中 yuv 数据
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()
视频帧数据转为 YUV 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;
视频帧数据指针
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::Position
范围语音中用户的位置,坐标系需要自行建立。
Defined in : position_audio_render_define.h
| 类型 | 名称 |
|---|---|
| int | x |
| int | y |
| int | z |
| 返回 | 名称 |
|---|---|
| bool | isEqual |
int bytertc::Position::x;
x 坐标
int bytertc::Position::y;
y 坐标
int bytertc::Position::z;
z 坐标
bool bytertc::Position::isEqual(
Position pos)
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 };
正上方朝向向量