ByteRtcRenderMode

typedef NS_ENUM(NSUInteger, ByteRtcRenderMode)

视频显示模式

枚举值

类型 值 说明
ByteRtc_Render_Hidden 1 视频尺寸等比缩放,优先保证窗口被填满。当视频尺寸与显示窗口尺寸不一致时,多出的视频将被截掉。
ByteRtc_Render_Fit 2 视频尺寸等比缩放,优先保证视频内容全部显示。当视频尺寸与显示窗口尺寸不一致时,会把窗口未被填满的区域填充成黑色。
ByteRtc_Render_Adaptive 3 (已经废弃,不再兼容该模式)视频尺寸非等比例缩放,把窗口充满。当视频尺寸与显示窗口尺寸不一致时,视频高或宽方向会被拉伸。(已经废弃,不再兼容该模式)

ByteRtcUserOfflineReason

typedef NS_ENUM(NSUInteger, ByteRtcUserOfflineReason)

用户离线原因。 房间内远端用户离开时,本端用户会收到 rtcEngine:didOfflineOfUid:reason: 回调通知,此枚举类型为回调的用户离线原因。

枚举值

类型 值 说明
ByteRtc_UserOffline_Quit 0 用户主动离开。
ByteRtc_UserOffline_Dropped 1 用户掉线。

RtcStreamRemoveReason

typedef NS_ENUM(NSInteger, RtcStreamRemoveReason)

房间内远端流移除原因。
房间内远端音视频流移除时,SDK 会通过 rtcEngine:didStreamRemoved:reason: 回调通知用户。此枚举类型即为通知的远端流移除的原因。

枚举值

类型 值 说明
RtcStreamRemoveUnpublish 0 远端用户停止发布流。
RtcStreamRemovePublishFailed 1 远端用户发布流失败。
RtcStreamRemoveKeepLiveFailed 2 保活失败。
RtcStreamRemoveClientDisconnected 3 远端用户断网。
RtcStreamRemoveRepublish 4 远端用户重新发布流。
RtcStreamRemoveOtherReason 5 其他原因。

ByteChannelProfile

typedef NS_ENUM(NSInteger, ByteChannelProfile)

房间模式。 房间使用的场景模式。

枚举值

类型 值 说明
ByteChannelProfileCommunication 0 通信模式。该房间模式下,房间内所有用户都可以发布和订阅流。适用于 IM 场景。
ByteChannelProfileLiveBroadcasting 1 直播模式。该房间模式下,用户有主播、观众、静默观众三种可选角色,可以通过调用方法 setClientRole:withKey:
设置。主播可以发布和订阅流,观众和静默观众只能订阅流。适用于直播、教育大班课等场景。
ByteChannelProfileGame 2 游戏模式。该房间模式下,用户角色同直播模式。适用于游戏场景。
ByteChannelProfileCloudGame 3 云游戏模式。该房间模式下,用户角色同直播模式。适用于云游戏场景。

ByteRtcClientRole

typedef NS_ENUM(NSInteger, ByteRtcClientRole)

用户角色。 房间模式为直播、游戏、云游戏模式时的用户角色。

枚举值

类型 值 说明
ByteRtc_ClientRole_Broadcaster 1 主播角色,用户既可以发布流到房间中,也可以从房间中订阅流。
ByteRtc_ClientRole_Audience 2 观众角色,用户只能从房间中订阅流,不能向房间中发布流,房间中的其他用户可以感知到该用户在房间中。
ByteRtc_ClientRole_Silent_Audience 4 静默观众模式,除了满足观众角色限制外,房间中的其他用户无法感知到该用户在房间中,即该用户加入退出房间和更新用户属性等行为不会通知给房间中的其他用户。

ByteRtcVideoStreamType

typedef NS_ENUM(NSInteger, ByteRtcVideoStreamType)

视频流类型 目前C++ sdk 只支持 REMOTE_VIDEO_STREAM_HIGH类型

枚举值

类型 值 说明
ByteRtc_VideoStream_High 0 高分辨率视频流
ByteRtc_VideoStream_Low 1 低分辨率视频

ByteRtcNetworkType

typedef NS_ENUM(NSInteger, ByteRtcNetworkType)

SDK 网络连接类型

枚举值

类型 值 说明
ByteRtcNetworkTypeUnknown -1 网络连接类型未知
ByteRtcNetworkTypeDisconnected 0 网络连接已断开
ByteRtcNetworkTypeLAN 1 网络连接类型为 LAN
ByteRtcNetworkTypeWIFI 2 网络连接类型为 Wi-Fi(包含热点)
ByteRtcNetworkTypeMobile2G 3 网络连接类型为 2G 移动网络
ByteRtcNetworkTypeMobile3G 4 网络连接类型为 3G 移动网络
ByteRtcNetworkTypeMobile4G 5 网络连接类型为 4G 移动网络
ByteRtcNetworkTypeMobile5G 6 网络连接类型为 5G 移动网络

ByteNetworkQuality

typedef NS_ENUM(NSUInteger, ByteNetworkQuality)

媒体流网络质量

枚举值

类型 值 说明
ByteRtcNetworkQualityUnknown 0 网络质量未知
ByteRtcNetworkQualityExcellent 1 网络质量极好
ByteRtcNetworkQualityGood 2 网络质量好
ByteRtcNetworkQualityPoor 3 网络质量较差但不影响沟通
ByteRtcNetworkQualityBad 4 网络质量差沟通不顺畅
ByteRtcNetworkQualityVBad 5 网络质量非常差

ByteVideoRemoteState

typedef NS_ENUM(NSUInteger, ByteVideoRemoteState)

远端视频流状态

枚举值

类型 值 说明
ByteVideoRemoteStateStopped 0 远端视频流停止状态
ByteVideoRemoteStateRunning 1 远端视频流运行状态
ByteVideoRemoteStateFrozen 2 远端视频流冻结状态

SubscribeState

typedef NS_ENUM(NSInteger, SubscribeState)

订阅流状态 该结构表示在订阅流或者更新流后获取的结果

枚举值

类型 值 说明
SUBSCRIBE_STATE_SUCCESS 0 订阅流成功
SUBSCRIBE_STATE_FAILED_NOT_IN_ROOM 1 还没有加入房间
SUBSCRIBE_STATE_FAILED_STREAM_NOT_FOUND 2 没有找到流

ByteRtcAudioProfile

typedef NS_ENUM(NSInteger, ByteRtcAudioProfile)

音频采集编码属性 每一项代表一组特定的采样率、编码码率、通道数、编码场景 暂时不支持该参数的设置

枚举值

类型 值 说明
ByteRtc_AudioProfile_Default 0 用户默认设置
ByteRtc_AudioProfile_SpeechStandard 1 32Khz, 18kbps, mono, speech
ByteRtc_AudioProfile_MusicStandard 2 48Khz, 50kbps, mono, music
ByteRtc_AudioProfile_MusicStandardStereo 3 48Khz, 50kbps, stereo, music
ByteRtc_AudioProfile_MusicHighQuality 4 48Khz, 128kbps, mono, music
ByteRtc_AudioProfile_MusicHighQualityStereo 5 48Khz, 192kbps, stereo, music

ByteVideoOutputOrientationMode

typedef NS_ENUM(NSInteger, ByteVideoOutputOrientationMode)

枚举值

类型 值 说明
ByteVideoOutputOrientationModeAdaptative 0 自适应布局
ByteVideoOutputOrientationModeFixedLandscape 1 横屏布局
ByteVideoOutputOrientationModeFixedPortrait 2 竖屏布局

ByteVideoMirrorMode

typedef NS_ENUM(NSUInteger, ByteVideoMirrorMode)

视频镜像模式。

枚举值

类型 值 说明
ByteVideoMirrorModeEnabled 1 开启本地视频镜像
ByteVideoMirrorModeDisabled 2 关闭本地视频镜像

ByteRtcLogLevel

typedef enum

日志级别

枚举值

类型 值 说明
RTC_LOG_LEVEL_TRACE 0 打印trace级别及以上级别信息
RTC_LOG_LEVEL_DEBUG 1 打印debug级别及以上级别信息
RTC_LOG_LEVEL_INFO 2 打印info级别及以上级别信息
RTC_LOG_LEVEL_WARNING 3 打印warning级别及以上级别信息
RTC_LOG_LEVEL_ERROR 4 打印error级别信息

RtcLogType

typedef enum

日志类型

枚举值

类型 值 说明
BYTE_RTC_LOG 0 平台层日志
ORIGIN_RTC_LOG 1 Native层日志

ByteAudioOutputRouting

typedef NS_ENUM(NSInteger, ByteAudioOutputRouting)

音频输出路由

枚举值

类型 值 说明
ByteAudioOutputRoutingDefault -1 默认输出路径
ByteAudioOutputRoutingHeadset 0 从耳机输出
ByteAudioOutputRoutingEarpiece 1 从听筒输出
ByteAudioOutputRoutingSpeakerphone 3 从扬声器输出
ByteAudioOutputRoutingHeadsetBluetooth 5 从蓝牙设备输出

ByteVideoPixelFormat

typedef NS_ENUM(NSInteger, ByteVideoPixelFormat)

视频帧类型

枚举值

类型 值 说明
ByteVideoPixelFormatI420 1 YUV image with i420 layout, also known as yuv420p
ByteVideoPixelFormatBGRA 2 BGRA image
ByteVideoPixelFormatNV12 8 YUV image with NV12 layout

ByteVideoRotation

typedef NS_ENUM(NSInteger, ByteVideoRotation)

视频旋转信息,枚举类型,定义了90度为间隔的四种旋转模式。

枚举值

类型 值 说明
ByteVideoRotationNone 0 视频不做旋转
ByteVideoRotation90 1 视频旋转90度
ByteVideoRotation180 2 视频旋转180度
ByteVideoRotation270 3 视频旋转270度

ByteVideoStreamScaleMode

typedef NS_ENUM(NSInteger, ByteVideoStreamScaleMode)

视频缩放模式

枚举值

类型 值 说明
ByteVideoStreamScaleModeAuto 0 自动缩放模式,当前等价于ByteVideoStreamScaleModeFitWithCropping
ByteVideoStreamScaleModeStretch 1 缩放以适配宽高比
ByteVideoStreamScaleModeFitWithCropping 2 保持纵横比来缩放图像,裁剪长边
ByteVideoStreamScaleModeFitWithFilling 3 保持纵横比来缩放图像,填充短边

ByteVideoEncoderPreference

typedef NS_ENUM(NSInteger, ByteVideoEncoderPreference)

编码质量偏好

枚举值

类型 值 说明
ByteVideoEncoderPreferDisabled 0 关闭
ByteVideoEncoderPreferMaintainFramerate 1 保持帧率
ByteVideoEncoderPreferMaintainQuality 2 保持画质
ByteVideoEncoderPreferBalance 3 平衡模式

ByteRtcEnv

typedef NS_ENUM(NSInteger, ByteRtcEnv)

设置sdk的环境

枚举值

类型 值 说明
kByteRtcEnvProduct 0 线上环境
kByteRtcEnvBOE 1 BOE环境
kByteRtcEnvTest 2 测试环境

RtcMode

typedef NS_ENUM(NSUInteger, RtcMode)

设置引擎工作模式

枚举值

类型 值 说明
RTC_MODE_GENERAL 0 通用模式,该模式下只能进行普通会议模式的语音通话,开启自动发布订阅。
RTC_MODE_LOCAL_AUDIO 1 游戏语音模式,该模式下关闭自动发布订阅,会按照游戏业务的策略进行主动发布订阅语音。

RangeAudioMode

typedef NS_ENUM(NSUInteger, RangeAudioMode)

语音通话模式 在小队语音里用这个接口设置自己的发送模式

枚举值

类型 值 说明
RANGE_AUDIO_MODE_UNDEFINED 0 默认模式
RANGE_AUDIO_MODE_TEAM 1 小队模式
RANGE_AUDIO_MODE_WORLD 2 世界模式

BytePublishFallbackOption

typedef NS_ENUM(NSUInteger, BytePublishFallbackOption)

本地发布的音视频流回退选项

枚举值

类型 值 说明
BytePublishFallbackOptionDisabled 0 上行网络较弱或性能不佳时,不对音视频流作回退处理,默认值
BytePublishFallbackOptionVideoStreamLow 1 上行网络较弱或性能不佳时,只发送视频小流。

BackgroundMode

typedef NS_ENUM(NSUInteger, BackgroundMode)

背景模式 开启背景替换功能时生效,详见 replaceBackground:withDivideModel:。

枚举值

类型 值 说明
NONE 0 无
BLUR 1 虚化
BACKGROUND_A 2 背景1
BACKGROUND_B 3 背景2

DivideModel

typedef NS_ENUM(NSUInteger, DivideModel)

分割模型 开启背景替换功能时生效,详见 replaceBackground:withDivideModel:。

枚举值

类型 值 说明
DEFAULT 0 自研
EFFECT 1 effect

ByteRtcVideoCanvas

@interface ByteRtcVideoCanvas : NSObject

视频渲染图层结构。app通过该结构将要渲染的窗口和视频流进行绑定

成员变量

类型 名称
NSView* view
ByteRtcRenderMode renderMode
NSString* roomId
NSString* uid

变量说明

view

@property (strong, nonatomic) NSView* _Nullable view;

渲染窗口句柄

renderMode

@property (assign, nonatomic) ByteRtcRenderMode renderMode;

设置渲染模式,暂时设置无效

roomId

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

房间的RoomID

uid

@property (strong, nonatomic) NSString* _Nullable uid;

设置渲染流的用户标识

ByteRtcFrameExtendedData

@interface ByteRtcFrameExtendedData : NSObject

视频帧附加的数据,视频解码后获得的附加数据

成员变量

类型 名称
NSData* extendedData
NSInteger extendedDataLen

变量说明

extendedData

@property (strong, nonatomic) NSData * _Nullable extendedData;

附加数据

extendedDataLen

@property (assign, nonatomic) NSInteger extendedDataLen;

附加数据长度

VideoStreamDescription

@interface VideoStreamDescription: NSObject

视频流描述

成员变量

类型 名称
CGSize videoSize
NSInteger frameRate
NSInteger maxKbps
ByteVideoStreamScaleMode mode
ByteVideoEncoderPreference encoderPreference

变量说明

videoSize

@property (nonatomic, assign) CGSize videoSize;

视频分辨率

frameRate

@property (nonatomic, assign) NSInteger frameRate;

视频预设帧率

maxKbps

@property (nonatomic, assign) NSInteger maxKbps;

视频预设最大码率(Kbps)

mode

@property (nonatomic, assign) ByteVideoStreamScaleMode mode;

视频伸展模式,详见类型ByteVideoStreamScaleMode

encoderPreference

@property (nonatomic, assign) ByteVideoEncoderPreference encoderPreference;

视频编码质量偏好,详见类型ByteVideoEncoderPreference

ByteStream

@protocol ByteStream <NSObject>

音视频流属性 发布到房间中的音视频流的流属性。用户加入房间成功后,房间中所有已发布和未来发布的音视频流和流的相关属性,都会通过 rtcEngine:didStreamAdded: 回调通知用户。

成员变量

类型 名称
NSString* userId
BOOL isScreen
BOOL hasVideo
BOOL hasAudio
NSArray* videoStreamDescriptions

变量说明

userId

@property (nonatomic, copy, readonly) NSString * userId;

发布此流的用户的 ID。

isScreen

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

流是否为共享屏幕流。

hasVideo

@property (nonatomic, assign, readonly) BOOL hasVideo;

流是否包括视频。

hasAudio

@property (nonatomic, assign, readonly) BOOL hasAudio;

流是否包括音频。

videoStreamDescriptions

@property (nonatomic, copy, readonly) NSArray<VideoStreamDescription *> * videoStreamDescriptions;

视频流的分辨率信息,详见 VideoStreamDescription 类。 用户可以通过调用 setVideoProfilessetVideoProfiles: 方法在一路流中发布多个不同的视频分辨率。此参数即为流中 所有分辨率的相关信息。

ByteAudioFrame

@interface ByteAudioFrame : NSObject

音频帧

成员变量

类型 名称
NSData* samples
int numOfSamples
int bytesPerSample
int channels
int samplesPerSec

变量说明

samples

@property (strong, nonatomic) NSData * _Nonnull samples;

音频帧数据

numOfSamples

@property (assign, nonatomic) int numOfSamples;

此音频帧描述的样点数

bytesPerSample

@property (assign, nonatomic) int bytesPerSample;

样点平均大小(Bytes)

channels

@property (assign, nonatomic) int channels;

音频通道数

samplesPerSec

@property (assign, nonatomic) int samplesPerSec;

音频采样率

ByteVideoFrame

@interface ByteVideoFrame : NSObject

视频帧类型

成员变量

类型 名称
NSInteger format
CMTime time
int strideInPixels
int height
CVPixelBufferRef textureBuf
NSData* dataBuf
int cropLeft
int cropTop
int cropRight
int cropBottom
ByteVideoRotation rotation
ByteRtcFrameExtendedData* extendedData

变量说明

format

@property (assign, nonatomic) NSInteger format;

视频帧类型,1: I420、2: BGRA、3: NV21、4: RGBA、5: IMC2、6: BGRA (same as 2)、7: ARGB、8: NV12、 10: android texture (GL_TEXTURE_2D)、11: android texture (OES, typically from camera)、12: ios texture (CVPixelBufferRef)

time

@property (assign, nonatomic) CMTime time;

time for this frame.

strideInPixels

@property (assign, nonatomic) int strideInPixels;

how many pixels between 2 consecutive rows. Note: in pixel, not byte.

height

@property (assign, nonatomic) int height;

how many rows of pixels, in case of ios texture, it is not used

textureBuf

@property (assign, nonatomic) CVPixelBufferRef _Nullable textureBuf;

texture Buffer

dataBuf

@property (strong, nonatomic) NSData * _Nullable dataBuf;

raw data buffer. in case of ios texture, it is not used

cropLeft

@property (assign, nonatomic) int cropLeft;

how many pixels to crop on the left boundary

cropTop

@property (assign, nonatomic) int cropTop;

how many pixels to crop on the top boundary

cropRight

@property (assign, nonatomic) int cropRight;

how many pixels to crop on the right boundary

cropBottom

@property (assign, nonatomic) int cropBottom;

how many pixels to crop on the bottom boundary

rotation

@property (assign, nonatomic) ByteVideoRotation rotation;

0, 90, 180, 270. See document for rotation calculation

extendedData

@property (assign, nonatomic) ByteRtcFrameExtendedData *extendedData;

视频帧附加的数据,视频解码后获得的附加数据

ByteAACProfile

typedef NS_ENUM(NSInteger, ByteAACProfile)

AAC编码类型

枚举值

类型 值 说明
ByteAACProfileLC 0 LC(默认)
ByteAACProfileMain 1 MAIN
ByteAACProfileHEv1 2 HEv1
ByteAACProfileHEv2 3 HEv2

ByteRtcStats

@interface ByteRtcStats : NSObject

统计信息

成员变量

类型 名称
NSInteger duration
NSInteger txBytes
NSInteger rxBytes
NSInteger txAudioKBitrate
NSInteger rxAudioKBitrate
NSInteger txVideoKBitrate
NSInteger rxVideoKBitrate
NSInteger lastmileDelay
NSInteger userCount
double cpuAppUsage
double cpuTotalUsage

变量说明

duration

@property (assign, nonatomic) NSInteger duration;

用户在房间中的总时长(s)

txBytes

@property (assign, nonatomic) NSInteger txBytes;

用户在通话过程中发送媒体数据总量(bytes)

rxBytes

@property (assign, nonatomic) NSInteger rxBytes;

用户在通话过程中接收媒体数据总量(bytes)

txAudioKBitrate

@property (assign, nonatomic) NSInteger txAudioKBitrate;

当前总发送音频码率(kbps)

rxAudioKBitrate

@property (assign, nonatomic) NSInteger rxAudioKBitrate;

当前总接收音频码率(kbps)

txVideoKBitrate

@property (assign, nonatomic) NSInteger txVideoKBitrate;

当前总发送视频码率(kbps)

rxVideoKBitrate

@property (assign, nonatomic) NSInteger rxVideoKBitrate;

当前总接收视频码率(kbps)

lastmileDelay

@property (assign, nonatomic) NSInteger lastmileDelay;

往返时延,单位为毫秒

userCount

@property (assign, nonatomic) NSInteger userCount;

当前房间内用户总数

cpuAppUsage

@property (assign, nonatomic) double cpuAppUsage;

当前 App 的 CPU 使用率

cpuTotalUsage

@property (assign, nonatomic) double cpuTotalUsage;

当前设备的总 CPU 使用率

ByteRtcLocalVideoStats

@interface ByteRtcLocalVideoStats : NSObject

本地视频统计

成员变量

类型 名称
float sentKBitrate
NSInteger inputFrameRate
NSInteger sentFrameRate
NSInteger encoderOutputFrameRate
NSInteger rendererOutputFrameRate
NSInteger sentTargetBitrate
NSInteger sentTargetFrameRate
NSInteger statsInterval
float videoLossRate
NSInteger rtt

变量说明

sentKBitrate

@property (assign, nonatomic) float sentKBitrate;

本地视频发送码率(kbps)

inputFrameRate

@property (assign, nonatomic) NSInteger inputFrameRate;

本地视频输入帧率

sentFrameRate

@property (assign, nonatomic) NSInteger sentFrameRate;

本地视频发送帧率

encoderOutputFrameRate

@property (assign, nonatomic) NSInteger encoderOutputFrameRate;

本地视频目标编码帧率

rendererOutputFrameRate

@property (assign, nonatomic) NSInteger rendererOutputFrameRate;

本地视频目标渲染输出帧率

sentTargetBitrate

@property (assign, nonatomic) NSInteger sentTargetBitrate;

本地视频目标发送码率(kbps)

sentTargetFrameRate

@property (assign, nonatomic) NSInteger sentTargetFrameRate;

本地视频目标发送帧率

statsInterval

@property (assign, nonatomic) NSInteger statsInterval;

统计周期时长(ms)

videoLossRate

@property (assign, nonatomic) float videoLossRate;

视频丢包率

rtt

@property (assign, nonatomic) NSInteger rtt;

视频包往返延时(ms)

ByteRtcRemoteVideoStats

@interface ByteRtcRemoteVideoStats : NSObject

远端视频统计

成员变量

类型 名称
NSString* uid
NSInteger width
NSInteger height
float videoLossRate
float receivedKBitrate
NSInteger receivedFrameRate
NSInteger decoderOutputFrameRate
NSInteger renderOutputFrameRate
NSInteger stallCount
NSInteger stallDuration
NSInteger e2eDelay
BOOL isScreen
NSInteger statsInterval
NSInteger rtt

变量说明

uid

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

远端用户用户 id,指定视频来自哪个远端用户

width

@property (assign, nonatomic) NSInteger width;

远端视频宽度

height

@property (assign, nonatomic) NSInteger height;

远端视频高度

videoLossRate

@property (assign, nonatomic) float videoLossRate;

远端视频丢包率

receivedKBitrate

@property (assign, nonatomic) float receivedKBitrate;

远端视频接收码率(kbps)

receivedFrameRate

@property (assign, nonatomic) NSInteger receivedFrameRate;

远端视频接收帧率

decoderOutputFrameRate

@property (assign, nonatomic) NSInteger decoderOutputFrameRate;

远端视频解码输出帧率

renderOutputFrameRate

@property (assign, nonatomic) NSInteger renderOutputFrameRate;

远端视频渲染输出帧率

stallCount

@property (assign, nonatomic) NSInteger stallCount;

远端视频卡顿次数

stallDuration

@property (assign, nonatomic) NSInteger stallDuration;

远端视频卡顿时长,单位毫秒

e2eDelay

@property (assign, nonatomic) NSInteger e2eDelay;

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

isScreen

@property (assign, nonatomic) BOOL isScreen;

远端视频流是否是屏幕共享流。YES:是;NO:否

statsInterval

@property (assign, nonatomic) NSInteger statsInterval;

统计周期时长(ms)

rtt

@property (assign, nonatomic) NSInteger rtt;

音频包往返延时(ms)

ByteRtcLocalAudioStats

@interface ByteRtcLocalAudioStats : NSObject

音频流质量

成员变量

类型 名称
float audioLossRate
float sentKBitrate
NSInteger statsInterval
NSInteger rtt

变量说明

audioLossRate

@property (assign, nonatomic) float audioLossRate;

音频上行丢包率

sentKBitrate

@property (assign, nonatomic) float sentKBitrate;

音频上行发送码率(kbps)

statsInterval

@property (assign, nonatomic) NSInteger statsInterval;

统计周期时长(ms)

rtt

@property (assign, nonatomic) NSInteger rtt;

音频包往返延时(ms)

ByteRtcRemoteAudioStats

@interface ByteRtcRemoteAudioStats : NSObject

远端音频统计

成员变量

类型 名称
NSString* uid
float audioLossRate
float receivedKBitrate
NSInteger stallCount
NSInteger stallDuration
NSInteger e2eDelay
NSInteger statsInterval
NSInteger rtt

变量说明

uid

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

远端用户用户 id,指明音频来自哪个远端用户

audioLossRate

@property (assign, nonatomic) float audioLossRate;

远端音频丢包率

receivedKBitrate

@property (assign, nonatomic) float receivedKBitrate;

远端音频接收码率(kbps)

stallCount

@property (assign, nonatomic) NSInteger stallCount;

远端音频卡顿次数

stallDuration

@property (assign, nonatomic) NSInteger stallDuration;

远端音频卡顿时长,单位毫秒

e2eDelay

@property (assign, nonatomic) NSInteger e2eDelay;

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

statsInterval

@property (assign, nonatomic) NSInteger statsInterval;

统计周期时长(ms)

rtt

@property (assign, nonatomic) NSInteger rtt;

音频包往返延时(ms)

ByteRtcAudioVolumeInfo

@interface ByteRtcAudioVolumeInfo : NSObject

音量信息

成员变量

类型 名称
NSString* uid
NSUInteger volume

变量说明

uid

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

音量信息所属用户的用户 id

volume

@property (assign, nonatomic) NSUInteger volume;

用户音量大小信息,音量取值范围为 [0, 255]

ByteRtcNetworkQuality

@interface ByteRtcNetworkQuality : NSObject

网络质量

成员变量

类型 名称
NSString* uid
ByteNetworkQuality txQuality
ByteNetworkQuality rxQuality

变量说明

uid

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

网络状况信息所属用户的用户ID

txQuality

@property (nonatomic) ByteNetworkQuality txQuality;

该用户的上行网络状态。如果该用户为远端用户,则为默认值ByteRtcNetworkQualityUnknown。类型含义详见ByteNetworkQuality

rxQuality

@property (nonatomic) ByteNetworkQuality rxQuality;

该用户的下行网络状态。如果该用户为本地用户,则为默认值ByteRtcNetworkQualityUnknown。类型含义详见ByteNetworkQuality

ByteSourceWantedData

@interface ByteSourceWantedData : NSObject

性能回退相关数据

成员变量

类型 名称
NSInteger width
NSInteger height
NSInteger frameRate

变量说明

width

@property (nonatomic, assign) NSInteger width;

推荐视频输入宽

height

@property (nonatomic, assign) NSInteger height;

推荐视频输入高

frameRate

@property (nonatomic, assign) NSInteger frameRate;

推荐视频输入帧率

ByteVideoScaleMode

typedef NS_ENUM(NSInteger,ByteVideoScaleMode)

视频缩放模式

枚举值

类型 值 说明
Auto 0 自动缩放模式,当前等价于FitWithCropping
Stretch 1 缩放以适配宽高比
FitWithCropping 2 保持纵横比来缩放图像,裁剪长边
FitWithFilling 3 保持纵横比来缩放图像,填充短边

ByteVideoSolution

@interface ByteVideoSolution : NSObject

视频属性

成员变量

类型 名称
NSInteger width
NSInteger height
NSInteger frameRate
NSInteger maxKbps
ByteVideoScaleMode scaleMode
ByteVideoEncoderPreference encoderPreference

变量说明

width

@property (assign, nonatomic) NSInteger width;

视频宽度

height

@property (assign, nonatomic) NSInteger height;

视频高度

frameRate

@property (assign, nonatomic) NSInteger frameRate;

视频预设帧率

maxKbps

@property (assign, nonatomic) NSInteger maxKbps;

视频预设最大码率(Kbps)

scaleMode

@property (assign, nonatomic) ByteVideoScaleMode scaleMode;

视频伸展模式,详见类型ByteVideoScaleMode

encoderPreference

@property (assign, nonatomic) ByteVideoEncoderPreference encoderPreference;

视频编码质量偏好,详见类型ByteVideoEncoderPreference

ByteRtcByteStream

@interface ByteRtcByteStream : NSObject

音视频流属性 发布到房间中的音视频流的流属性。用户加入房间成功后,房间中所有已发布和未来发布的音视频流和流的相关属性,都会通过 rtcEngine:didStreamAdded: 回调通知用户。

成员变量

类型 名称
NSString* uid
BOOL isScreen
BOOL hasVideo
BOOL hasAudio
NSArray* streamProfiles

变量说明

uid

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

发布此流的用户的 ID。

isScreen

@property (assign, nonatomic) BOOL isScreen;

流是否为共享屏幕流。

hasVideo

@property (assign, nonatomic) BOOL hasVideo;

流是否包括视频。

hasAudio

@property (assign, nonatomic) BOOL hasAudio;

流是否包括音频。

streamProfiles

@property (copy, nonatomic) NSArray<ByteVideoSolution *> * _Nullable streamProfiles;

视频流的分辨率信息,详见 ByteVideoSolution 类。 用户可以通过调用 setVideoProfilessetVideoProfiles: 方法在一路流中发布多个不同的视频分辨率。此参数即为流中 所有分辨率的相关信息。

ByteSubscribeConfig

@interface ByteSubscribeConfig : NSObject

订阅流配置参数。 用户调用 subscribeStream:info: 方法手动订阅音视频流或更新订阅参数时,传入订阅流配置参数。

成员变量

类型 名称
BOOL isScreen
BOOL subVideo
BOOL subAudio
NSInteger videoIndex

变量说明

isScreen

@property (assign, nonatomic) BOOL isScreen;

订阅的流是否是屏幕共享流。

subVideo

@property (assign, nonatomic) BOOL subVideo;

是否订阅视频。

subAudio

@property (assign, nonatomic) BOOL subAudio;

是否订阅音频。

videoIndex

@property (assign, nonatomic) NSInteger videoIndex;

订阅的视频流分辨率索引号。 视频流中含多个分辨率的情况下,标识订阅第几个的视频分辨率。如果视频流中仅含一个分辨率,则为0。

ByteRtcAudioFrameType

typedef NS_ENUM(NSInteger, ByteRtcAudioFrameType)

音频帧类型

枚举值

类型 值 说明
FRAME_TYPE_PCM16 0 PCM16

ByteRtcVideoFrameType

typedef NS_ENUM(NSInteger, ByteRtcVideoFrameType)

视频帧类型

枚举值

类型 值 说明
FRAME_TYPE_UNKNOWN 0 unknown
FRAME_TYPE_ARGB 1 ARGB image
FRAME_TYPE_BGRA 2 BGRA image
FRAME_TYPE_RGBA 3 RGBA image
FRAME_TYPE_I420 4 YUV image with i420 layout, also known as yuv420p
FRAME_TYPE_NV12 5 YUV image with NV12 layout
FRAME_TYPE_NV21 6 YUV image with NV21 layout
FRAME_TYPE_RGB24 7 24 bit RGB image

ProblemFeedback

typedef NS_OPTIONS(NSUInteger, ProblemFeedback)

问题反馈列表

枚举值

类型 值 说明
PROBLEM_NONE 0 没有问题
PROBLEM_OTHER_MSG (1 << 0) 其他问题
PROBLEM_AUDIO_NOT_CLEAR (1 << 1) 声音不清晰
PROBLEM_VIDEO_NOT_CLEAR (1 << 2) 视频不清晰
PROBLEM_SYNC (1 << 3) 音视频不同步
PROBLEM_AUDIO_LAGGING (1 << 4) 音频卡顿
PROBLEM_VIDEO_LAGGING (1 << 5) 视频卡顿
PROBLEM_CONNECT_FAILED (1 << 6) 无法连接
PROBLEM_AUDIO_DELAY (1 << 7) 音频延迟
PROBLEM_VIDEO_DELAY (1 << 8) 视频延迟
PROBLEM_DISCONNECT (1 << 9) 连接断开
PROBLEM_NO_AUDIO (1 << 10) 无声音
PROBLEM_NO_VIDEO (1 << 11) 无画面
PROBLEM_AUDIO_STRENGTH (1 << 12) 声音过大或过小
PROBLEM_ECHO (1 << 13) 回声噪音

ByteEncryptType

typedef NS_OPTIONS(NSUInteger, ByteEncryptType)

加密类型

枚举值

类型 值 说明
ByteEncryptTypeAES128CBC 1 使用AES-128-CBC进行传输加密
ByteEncryptTypeAES256CBC 2 使用AES-256-CBC进行传输加密
ByteEncryptTypeAES128ECB 3 使用AES-128-ECB进行传输加密
ByteEncryptTypeAES256ECB 4 使用AES-256-ECB进行传输加密

ByteRtcAudioFrameData

@interface ByteRtcAudioFrameData : NSObject

音频帧数据

成员变量

类型 名称
ByteRtcAudioFrameType type
SInt64 timestampMs
int samples
int channels
int sampleRate
UInt8* buffer

变量说明

type

@property (assign, nonatomic) ByteRtcAudioFrameType type;

音频帧类型。详见类型ByteRtcAudioFrameType

timestampMs

@property (assign, nonatomic) SInt64 timestampMs;

音频帧时间戳

samples

@property (assign, nonatomic) int samples;

每个声道音频帧的采样数

channels

@property (assign, nonatomic) int channels;

音频声道数

sampleRate

@property (assign, nonatomic) int sampleRate;

音频数据的采样率

buffer

@property (assign, nonatomic) UInt8 * _Nonnull buffer;

数据缓冲

ByteRtcVideoFrameData

@interface ByteRtcVideoFrameData : NSObject

视频帧数据

成员变量

类型 名称
ByteRtcVideoFrameType type
SInt64 timestampMs
int width
int height
int yStride
int uStride
int vStride
UInt8* yBuffer
UInt8* uBuffer
UInt8* vBuffer
int rotation

变量说明

type

@property (assign, nonatomic) ByteRtcVideoFrameType type;

视频帧类型。详见类型ByteRtcVideoFrameType

timestampMs

@property (assign, nonatomic) SInt64 timestampMs;

视频帧时间戳

width

@property (assign, nonatomic) int width;

视频帧宽

height

@property (assign, nonatomic) int height;

视频帧高

yStride

@property (assign, nonatomic) int yStride;

视频帧y分量stride

uStride

@property (assign, nonatomic) int uStride;

视频帧u分量stride

vStride

@property (assign, nonatomic) int vStride;

视频帧v分量stride

yBuffer

@property (assign, nonatomic) UInt8 * _Nonnull yBuffer;

视频帧y分量数据缓冲

uBuffer

@property (assign, nonatomic) UInt8 * _Nonnull uBuffer;

视频帧u分量数据缓冲

vBuffer

@property (assign, nonatomic) UInt8 * _Nonnull vBuffer;

视频帧v分量数据缓冲

rotation

@property (assign, nonatomic) int rotation;

视频帧选择度数

ByteRtcPacket

@interface ByteRtcPacket : NSObject

包信息

成员变量

类型 名称
UInt size
const UInt8* buffer

变量说明

size

@property (assign, nonatomic) UInt size;

数据缓存大小

buffer

@property (assign, nonatomic) const UInt8 * _Nonnull buffer;

包数据缓存地址