typedef NS_ENUM(NSUInteger, ByteRtcRenderMode)
视频显示模式
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRtc_Render_Hidden | 1 | 视频尺寸等比缩放,优先保证窗口被填满。当视频尺寸与显示窗口尺寸不一致时,多出的视频将被截掉。 |
| ByteRtc_Render_Fit | 2 | 视频尺寸等比缩放,优先保证视频内容全部显示。当视频尺寸与显示窗口尺寸不一致时,会把窗口未被填满的区域填充成黑色。 |
| ByteRtc_Render_Adaptive | 3 | (已经废弃,不再兼容该模式)视频尺寸非等比例缩放,把窗口充满。当视频尺寸与显示窗口尺寸不一致时,视频高或宽方向会被拉伸。(已经废弃,不再兼容该模式) |
typedef NS_ENUM(NSUInteger, ByteRtcUserOfflineReason)
用户离线原因。 房间内远端用户离开时,本端用户会收到 rtcEngine:didOfflineOfUid:reason: 回调通知,此枚举类型为回调的用户离线原因。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRtc_UserOffline_Quit | 0 | 用户主动离开。 |
| ByteRtc_UserOffline_Dropped | 1 | 用户掉线。 |
typedef NS_ENUM(NSUInteger, ByteSubscribeMode)
订阅模式选项。业务方在加入房间前,调用 enableAutoSubscribe:videoMode: 接口设置订阅模式。
| 类型 | 值 | 说明 |
|---|---|---|
| kByteAutoSubscribeMode | 0 | 自动订阅模式。SDK 会自动为用户订阅房间中的每一路流。 |
| kByteManualSubscribeMode | 1 | 手动订阅模式。SDK 不为自动订阅流。用户需要自己手动调用 subscribeStream:subscribeConfig: 接口去订阅远端流。 |
typedef NS_ENUM(NSInteger, RtcStreamRemoveReason)
房间内远端流移除原因。
房间内远端音视频流移除时,SDK 会通过 rtcEngine:didStreamRemoved:reason: 回调通知用户。此枚举类型即为通知的远端流移除的原因。
| 类型 | 值 | 说明 |
|---|---|---|
| RtcStreamRemoveUnpublish | 0 | 远端用户停止发布流。 |
| RtcStreamRemovePublishFailed | 1 | 远端用户发布流失败。 |
| RtcStreamRemoveKeepLiveFailed | 2 | 保活失败。 |
| RtcStreamRemoveClientDisconnected | 3 | 远端用户断网。 |
| RtcStreamRemoveRepublish | 4 | 远端用户重新发布流。 |
| RtcStreamRemoveOtherReason | 5 | 其他原因。 |
typedef NS_ENUM(NSInteger, ByteChannelProfile)
房间模式。 房间使用的场景模式。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteChannelProfileCommunication | 0 | 通信模式。该房间模式下,房间内所有用户都可以发布和订阅流。适用于 IM 场景。 |
| ByteChannelProfileLiveBroadcasting | 1 | 直播模式。该房间模式下,用户有主播、观众、静默观众三种可选角色,可以通过调用方法 setClientRole:withKey: 设置。主播可以发布和订阅流,观众和静默观众只能订阅流。适用于直播、教育大班课等场景。 |
| ByteChannelProfileGame | 2 | 游戏模式。该房间模式下,用户角色同直播模式。适用于游戏场景。 |
| ByteChannelProfileCloudGame | 3 | 云游戏模式。该房间模式下,用户角色同直播模式。适用于云游戏场景。 |
typedef NS_ENUM(NSInteger, ByteRtcClientRole)
用户角色。 房间模式为直播、游戏、云游戏模式时的用户角色。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRtc_ClientRole_Broadcaster | 1 | 主播角色,用户既可以发布流到房间中,也可以从房间中订阅流。 |
| ByteRtc_ClientRole_Silent_Audience | 4 | 静默观众模式,除了满足观众角色限制外,房间中的其他用户无法感知到该用户在房间中,即该用户加入退出房间和更新用户属性等行为不会通知给房间中的其他用户。 |
typedef NS_ENUM(NSInteger, ByteRtcVideoStreamType)
视频流类型 目前C++ sdk 只支持 REMOTE_VIDEO_STREAM_HIGH类型
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRtc_VideoStream_High | 0 | 高分辨率视频流 |
| ByteRtc_VideoStream_Low | 1 | 低分辨率视频 |
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 移动网络 |
typedef NS_ENUM(NSUInteger, ByteNetworkQuality)
媒体流网络质量
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRtcNetworkQualityUnknown | 0 | 网络质量未知 |
| ByteRtcNetworkQualityExcellent | 1 | 网络质量极好 |
| ByteRtcNetworkQualityGood | 2 | 网络质量好 |
| ByteRtcNetworkQualityPoor | 3 | 网络质量较差但不影响沟通 |
| ByteRtcNetworkQualityBad | 4 | 网络质量差沟通不顺畅 |
| ByteRtcNetworkQualityVBad | 5 | 网络质量非常差 |
typedef NS_ENUM(NSUInteger, ByteVideoRemoteState)
远端视频流状态
| 类型 | 值 | 说明 |
|---|---|---|
| ByteVideoRemoteStateStopped | 0 | 远端视频流停止状态 |
| ByteVideoRemoteStateRunning | 1 | 远端视频流运行状态 |
| ByteVideoRemoteStateFrozen | 2 | 远端视频流冻结状态 |
typedef NS_ENUM(NSInteger, SubscribeState)
订阅流状态 该结构表示在订阅流或者更新流后获取的结果
| 类型 | 值 | 说明 |
|---|---|---|
| SUBSCRIBE_STATE_SUCCESS | 0 | 订阅流成功 |
| SUBSCRIBE_STATE_FAILED_NOT_IN_ROOM | 1 | 还没有加入房间 |
| SUBSCRIBE_STATE_FAILED_STREAM_NOT_FOUND | 2 | 没有找到流 |
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 |
typedef NS_ENUM(NSInteger, ByteVideoOutputOrientationMode)
| 类型 | 值 | 说明 |
|---|---|---|
| ByteVideoOutputOrientationModeAdaptative | 0 | 自适应布局 |
| ByteVideoOutputOrientationModeFixedLandscape | 1 | 横屏布局 |
| ByteVideoOutputOrientationModeFixedPortrait | 2 | 竖屏布局 |
typedef NS_ENUM(NSUInteger, ByteVideoMirrorMode)
视频镜像模式。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteVideoMirrorModeEnabled | 1 | 开启本地视频镜像 |
| ByteVideoMirrorModeDisabled | 2 | 关闭本地视频镜像 |
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级别信息 |
typedef enum
日志类型
| 类型 | 值 | 说明 |
|---|---|---|
| BYTE_RTC_LOG | 0 | 平台层日志 |
| ORIGIN_RTC_LOG | 1 | Native层日志 |
typedef NS_ENUM(NSInteger, ByteAudioOutputRouting)
音频输出路由
| 类型 | 值 | 说明 |
|---|---|---|
| ByteAudioOutputRoutingDefault | -1 | 默认输出路径 |
| ByteAudioOutputRoutingHeadset | 0 | 从耳机输出 |
| ByteAudioOutputRoutingEarpiece | 1 | 从听筒输出 |
| ByteAudioOutputRoutingSpeakerphone | 3 | 从扬声器输出 |
| ByteAudioOutputRoutingHeadsetBluetooth | 5 | 从蓝牙设备输出 |
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 |
typedef NS_ENUM(NSInteger, ByteVideoRotation)
视频旋转信息,枚举类型,定义了90度为间隔的四种旋转模式。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteVideoRotationNone | 0 | 视频不做旋转 |
| ByteVideoRotation90 | 1 | 视频旋转90度 |
| ByteVideoRotation180 | 2 | 视频旋转180度 |
| ByteVideoRotation270 | 3 | 视频旋转270度 |
typedef NS_ENUM(NSInteger, ByteVideoStreamScaleMode)
视频缩放模式
| 类型 | 值 | 说明 |
|---|---|---|
| ByteVideoStreamScaleModeAuto | 0 | 自动缩放模式,当前等价于ByteVideoStreamScaleModeFitWithCropping |
| ByteVideoStreamScaleModeStretch | 1 | 缩放以适配宽高比 |
| ByteVideoStreamScaleModeFitWithCropping | 2 | 保持纵横比来缩放图像,裁剪长边 |
| ByteVideoStreamScaleModeFitWithFilling | 3 | 保持纵横比来缩放图像,填充短边 |
typedef NS_ENUM(NSInteger, ByteVideoEncoderPreference)
编码质量偏好
| 类型 | 值 | 说明 |
|---|---|---|
| ByteVideoEncoderPreferDisabled | 0 | 关闭 |
| ByteVideoEncoderPreferMaintainFramerate | 1 | 保持帧率 |
| ByteVideoEncoderPreferMaintainQuality | 2 | 保持画质 |
| ByteVideoEncoderPreferBalance | 3 | 平衡模式 |
typedef NS_ENUM(NSInteger, ByteRtcEnv)
设置sdk的环境
| 类型 | 值 | 说明 |
|---|---|---|
| kByteRtcEnvProduct | 0 | 线上环境 |
| kByteRtcEnvBOE | 1 | BOE环境 |
| kByteRtcEnvTest | 2 | 测试环境 |
typedef NS_ENUM(NSUInteger, RtcMode)
设置引擎工作模式
| 类型 | 值 | 说明 |
|---|---|---|
| RTC_MODE_GENERAL | 0 | 通用模式,该模式下只能进行普通会议模式的语音通话,开启自动发布订阅。 |
| RTC_MODE_LOCAL_AUDIO | 1 | 游戏语音模式,该模式下关闭自动发布订阅,会按照游戏业务的策略进行主动发布订阅语音。 |
typedef NS_ENUM(NSUInteger, RangeAudioMode)
语音通话模式 在小队语音里用这个接口设置自己的发送模式
| 类型 | 值 | 说明 |
|---|---|---|
| RANGE_AUDIO_MODE_UNDEFINED | 0 | 默认模式 |
| RANGE_AUDIO_MODE_TEAM | 1 | 小队模式 |
| RANGE_AUDIO_MODE_WORLD | 2 | 世界模式 |
typedef NS_ENUM(NSUInteger, BytePublishFallbackOption)
本地发布的音视频流回退选项
| 类型 | 值 | 说明 |
|---|---|---|
| BytePublishFallbackOptionDisabled | 0 | 上行网络较弱或性能不佳时,不对音视频流作回退处理,默认值 |
| BytePublishFallbackOptionVideoStreamLow | 1 | 上行网络较弱或性能不佳时,只发送视频小流。 |
typedef NS_ENUM(NSUInteger, ByteSubscribeFallbackOptions)
设置订阅的音视频流回退选项
| 类型 | 值 | 说明 |
|---|---|---|
| ByteSubscribeFallbackOptionsDisable | 0 | 下行网络较弱时,不对音视频流作回退处理,默认值。 |
| ByteSubscribeFallbackOptionsVideoStreamLow | 1 | 下行网络较弱时,只接收视频小流。 |
| ByteSubscribeFallbackOptionsAudioOnly | 2 | 下行网络较弱时,先尝试只接收视频小流;如果网络环境无法显示视频,则再回退到只接收远端订阅的音频流。 |
typedef NS_ENUM(NSUInteger, BackgroundMode)
背景模式 开启背景替换功能时生效,详见 replaceBackground:withDivideModel:。
| 类型 | 值 | 说明 |
|---|---|---|
| NONE | 0 | 无 |
| BLUR | 1 | 虚化 |
| BACKGROUND_A | 2 | 背景1 |
| BACKGROUND_B | 3 | 背景2 |
typedef NS_ENUM(NSUInteger, DivideModel)
分割模型 开启背景替换功能时生效,详见 replaceBackground:withDivideModel:。
| 类型 | 值 | 说明 |
|---|---|---|
| DEFAULT | 0 | 自研 |
| EFFECT | 1 | effect |
typedef NS_ENUM(NSUInteger, ByteScreenCaptureSourceType)
屏幕分享时共享对象的类型
| 类型 | 值 | 说明 |
|---|---|---|
| ByteScreenCaptureSourceTypeUnknown | 0 | 类型未知 |
| ByteScreenCaptureSourceTypeWindow | 1 | 应用程序的窗口 |
| ByteScreenCaptureSourceTypeScreen | 2 | 桌面 |
@interface ByteRtcVideoCanvas : NSObject
视频渲染图层结构。app通过该结构将要渲染的窗口和视频流进行绑定
| 类型 | 名称 |
|---|---|
| NSView* | view |
| ByteRtcRenderMode | renderMode |
| NSString* | roomId |
| NSString* | uid |
@property (strong, nonatomic) NSView* _Nullable view;
渲染窗口句柄
@property (assign, nonatomic) ByteRtcRenderMode renderMode;
设置渲染模式,暂时设置无效
@property (strong, nonatomic) NSString* _Nullable roomId;
房间的RoomID
@property (strong, nonatomic) NSString* _Nullable uid;
设置渲染流的用户标识
@interface ByteRtcFrameExtendedData : NSObject
视频帧附加的数据,视频解码后获得的附加数据
| 类型 | 名称 |
|---|---|
| NSData* | extendedData |
| NSInteger | extendedDataLen |
@property (strong, nonatomic) NSData * _Nullable extendedData;
附加数据
@property (assign, nonatomic) NSInteger extendedDataLen;
附加数据长度
@interface VideoStreamDescription: NSObject
视频流描述
| 类型 | 名称 |
|---|---|
| CGSize | videoSize |
| NSInteger | frameRate |
| NSInteger | maxKbps |
| ByteVideoStreamScaleMode | mode |
| ByteVideoEncoderPreference | encoderPreference |
@property (nonatomic, assign) CGSize videoSize;
视频分辨率
@property (nonatomic, assign) NSInteger frameRate;
视频预设帧率
@property (nonatomic, assign) NSInteger maxKbps;
视频预设最大码率(Kbps)
@property (nonatomic, assign) ByteVideoStreamScaleMode mode;
视频伸展模式,详见类型ByteVideoStreamScaleMode
@property (nonatomic, assign) ByteVideoEncoderPreference encoderPreference;
视频编码质量偏好,详见类型ByteVideoEncoderPreference
@protocol ByteStream <NSObject>
音视频流属性 发布到房间中的音视频流的流属性。用户加入房间成功后,房间中所有已发布和未来发布的音视频流和流的相关属性,都会通过 rtcEngine:didStreamAdded: 回调通知用户。
| 类型 | 名称 |
|---|---|
| NSString* | userId |
| BOOL | isScreen |
| BOOL | hasVideo |
| BOOL | hasAudio |
| NSArray |
videoStreamDescriptions |
@property (nonatomic, copy, readonly) NSString * userId;
发布此流的用户的 ID。
@property (nonatomic, assign, readonly) BOOL isScreen;
流是否为共享屏幕流。
@property (nonatomic, assign, readonly) BOOL hasVideo;
流是否包括视频。
@property (nonatomic, assign, readonly) BOOL hasAudio;
流是否包括音频。
@property (nonatomic, copy, readonly) NSArray<VideoStreamDescription *> * videoStreamDescriptions;
视频流的分辨率信息,详见 VideoStreamDescription 类。 用户可以通过调用 setVideoProfilessetVideoProfiles: 方法在一路流中发布多个不同的视频分辨率。此参数即为流中 所有分辨率的相关信息。
@interface ByteAudioFrame : NSObject
音频帧
| 类型 | 名称 |
|---|---|
| NSData* | samples |
| int | numOfSamples |
| int | bytesPerSample |
| int | channels |
| int | samplesPerSec |
@property (strong, nonatomic) NSData * _Nonnull samples;
音频帧数据
@property (assign, nonatomic) int numOfSamples;
此音频帧描述的样点数
@property (assign, nonatomic) int bytesPerSample;
样点平均大小(Bytes)
@property (assign, nonatomic) int channels;
音频通道数
@property (assign, nonatomic) int samplesPerSec;
音频采样率
@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 |
@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)
@property (assign, nonatomic) CMTime time;
time for this frame.
@property (assign, nonatomic) int strideInPixels;
how many pixels between 2 consecutive rows. Note: in pixel, not byte.
@property (assign, nonatomic) int height;
how many rows of pixels, in case of ios texture, it is not used
@property (assign, nonatomic) CVPixelBufferRef _Nullable textureBuf;
texture Buffer
@property (strong, nonatomic) NSData * _Nullable dataBuf;
raw data buffer. in case of ios texture, it is not used
@property (assign, nonatomic) int cropLeft;
how many pixels to crop on the left boundary
@property (assign, nonatomic) int cropTop;
how many pixels to crop on the top boundary
@property (assign, nonatomic) int cropRight;
how many pixels to crop on the right boundary
@property (assign, nonatomic) int cropBottom;
how many pixels to crop on the bottom boundary
@property (assign, nonatomic) ByteVideoRotation rotation;
0, 90, 180, 270. See document for rotation calculation
@property (assign, nonatomic) ByteRtcFrameExtendedData * _Nullable extendedData;
视频帧附加的数据,视频解码后获得的附加数据
typedef NS_ENUM(NSInteger, ByteAACProfile)
AAC编码类型
| 类型 | 值 | 说明 |
|---|---|---|
| ByteAACProfileLC | 0 | LC(默认) |
| ByteAACProfileMain | 1 | MAIN |
| ByteAACProfileHEv1 | 2 | HEv1 |
| ByteAACProfileHEv2 | 3 | HEv2 |
typedef NS_ENUM(NSInteger, ByteVideoCodecType)
编码类型
| 类型 | 值 | 说明 |
|---|---|---|
| kByteVideoCodecUnknown | 0 | 视频编码类型:未知类型 |
| kByteVideoCodecH264 | 1 | 视频编码类型:标准 H264 |
| kByteVideoCodecByteVC1 | 2 | 视频编码类型:标准 ByteVC1 |
@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 |
@property (assign, nonatomic) NSInteger duration;
用户在房间中的总时长(s)
@property (assign, nonatomic) NSInteger txBytes;
用户在通话过程中发送媒体数据总量(bytes)
@property (assign, nonatomic) NSInteger rxBytes;
用户在通话过程中接收媒体数据总量(bytes)
@property (assign, nonatomic) NSInteger txAudioKBitrate;
当前总发送音频码率(kbps)
@property (assign, nonatomic) NSInteger rxAudioKBitrate;
当前总接收音频码率(kbps)
@property (assign, nonatomic) NSInteger txVideoKBitrate;
当前总发送视频码率(kbps)
@property (assign, nonatomic) NSInteger rxVideoKBitrate;
当前总接收视频码率(kbps)
@property (assign, nonatomic) NSInteger lastmileDelay;
往返时延,单位为毫秒
@property (assign, nonatomic) NSInteger userCount;
当前房间内用户总数
@property (assign, nonatomic) double cpuAppUsage;
当前 App 的 CPU 使用率
@property (assign, nonatomic) double cpuTotalUsage;
当前设备的总 CPU 使用率
@interface ByteRtcSysStats : NSObject
App使用的cpu和memory信息
SDK 周期性(2s)的通过rtcEngine:reportSysStats:回调事件通知用户当前App的cpu与memory使用信息。回调的统计信息即为此数据类型。
| 类型 | 名称 |
|---|---|
| double | cpu_app_usage |
| double | cpu_total_usage |
| double | memory_usage |
@property (assign, nonatomic) double cpu_app_usage;
当前App的CPU 使用率
@property (assign, nonatomic) double cpu_total_usage;
当前设备的总CPU使用率
@property (assign, nonatomic) double memory_usage;
当前App的CPU使用率
@interface ByteRtcLocalVideoStats : NSObject
本地视频流统计信息。
本地用户发布视频流成功后,SDK 会周期性(2s)的通过 rtcEngine:localVideoStats: 回调事件通知用户发布的视频流在此次统计周期内的状况。此数据结构即为回调给用户的参数类型。
| 类型 | 名称 |
|---|---|
| float | sentKBitrate |
| NSInteger | inputFrameRate |
| NSInteger | sentFrameRate |
| NSInteger | encoderOutputFrameRate |
| NSInteger | rendererOutputFrameRate |
| NSInteger | sentTargetKBitrate |
| NSInteger | sentTargetFrameRate |
| NSInteger | statsInterval |
| float | videoLossRate |
| NSInteger | rtt |
| NSInteger | encodedBitrate |
| NSInteger | encodedFrameWidth |
| NSInteger | encodedFrameHeight |
| NSInteger | encodedFrameCount |
| ByteVideoCodecType | codecType |
@property (assign, nonatomic) float sentKBitrate;
发送的码率。此次统计周期内的视频发送码率,单位为 kbps 。
@property (assign, nonatomic) NSInteger inputFrameRate;
输入帧率。此次统计周期内的本地视频输入帧率 。
@property (assign, nonatomic) NSInteger sentFrameRate;
发送帧率。此次统计周期内的本地视频发送帧率 。
@property (assign, nonatomic) NSInteger encoderOutputFrameRate;
本地视频目标编码帧率。
@property (assign, nonatomic) NSInteger rendererOutputFrameRate;
本地视频目标渲染输出帧率。
@property (assign, nonatomic) NSInteger sentTargetKBitrate;
本地视频目标发送码率。单位为 kbps 。
@property (assign, nonatomic) NSInteger sentTargetFrameRate;
本地视频目标发送帧率。
@property (assign, nonatomic) NSInteger statsInterval;
统计间隔。此次统计周期的间隔,单位为 ms 。
@property (assign, nonatomic) float videoLossRate;
音频丢包率。统计周期内的视频上行丢包率,取值范围为 [0, 1] 。
@property (assign, nonatomic) NSInteger rtt;
往返时延。单位为 ms 。
@property(assign, nonatomic) NSInteger encodedBitrate;
编码率。
@property(assign, nonatomic) NSInteger encodedFrameWidth;
编码帧宽度。
@property(assign, nonatomic) NSInteger encodedFrameHeight;
编码帧高度。
@property(assign, nonatomic) NSInteger encodedFrameCount;
编码帧数。此次统计周期内编码的帧数。
@property(nonatomic) ByteVideoCodecType codecType;
编码类型。详见 ByteVideoCodecType 类型。
@interface ByteRtcRemoteVideoStats : NSObject
远端视频流统计信息。
本地用户订阅远端视频流成功后,SDK 会周期性(2s)的通过 rtcEngine:remoteVideoStats: 回调事件通知用户订阅的视频流在此次统计周期内的状况。此数据结构即为回调给用户的参数类型。
| 类型 | 名称 |
|---|---|
| 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 |
| NSInteger | frozenRate |
| NSInteger | videoIndex |
@property (copy, nonatomic) NSString * _Nonnull uid;
用户ID 。远端视频流发布用户的用户ID 。
@property (assign, nonatomic) NSInteger width;
远端视频宽度。
@property (assign, nonatomic) NSInteger height;
远端视频高度。
@property (assign, nonatomic) float videoLossRate;
远端视频丢包率。统计周期内的视频下行丢包率,取值范围为 [0, 1] 。
@property (assign, nonatomic) float receivedKBitrate;
接收码率。统计周期内的视频接收码率,单位为 kbps 。
@property (assign, nonatomic) NSInteger receivedFrameRate;
远端视频接收帧率。
@property (assign, nonatomic) NSInteger decoderOutputFrameRate;
远端视频解码输出帧率。
@property (assign, nonatomic) NSInteger renderOutputFrameRate;
远端视频渲染输出帧率。
@property (assign, nonatomic) NSInteger stallCount;
远端视频卡顿次数。
@property (assign, nonatomic) NSInteger stallDuration;
远端视频卡顿时长,单位为 ms 。
@property (assign, nonatomic) NSInteger e2eDelay;
用户体验级别的端到端延时。从发送端采集完成编码开始到接收端解码完成渲染开始的延时,单位为 ms 。
@property (assign, nonatomic) BOOL isScreen;
远端视频流是否是屏幕共享流。
@property (assign, nonatomic) NSInteger statsInterval;
统计间隔。此次统计周期的间隔,单位为 ms 。
@property (assign, nonatomic) NSInteger rtt;
往返时延。单位为 ms 。
@property(assign, nonatomic) NSInteger frozenRate;
远端用户在加入房间后发生视频卡顿的累计时长占音频总有效时长的百分比。
@property (assign, nonatomic) NSInteger videoIndex;
SDK 订阅的远端视频流的分辨率下标。
@interface ByteRtcLocalAudioStats : NSObject
本地音频流统计信息。
本地用户发布音频流成功后,SDK 会周期性(2s)的通过 rtcEngine:localAudioStats: 回调事件通知用户发布的音频流在此次统计周期内的状况。此数据结构即为回调给用户的参数类型。
| 类型 | 名称 |
|---|---|
| float | audioLossRate |
| float | sentKBitrate |
| NSInteger | recordSampleRate |
| NSInteger | statsInterval |
| NSInteger | rtt |
| NSInteger | numChannels |
| NSInteger | sentSampleRate |
@property (assign, nonatomic) float audioLossRate;
音频丢包率。此次统计周期内的音频上行丢包率,取值范围为 [0, 1] 。
@property (assign, nonatomic) float sentKBitrate;
发送的码率。此次统计周期内的音频发送码率,单位为 kbps 。
@property (assign, nonatomic) NSInteger recordSampleRate;
采集采样率。音频采集采样率信息,单位为 Hz 。
@property (assign, nonatomic) NSInteger statsInterval;
统计间隔。此次统计周期的间隔,单位为 ms 。
@property (assign, nonatomic) NSInteger rtt;
往返时延。单位为 ms 。
@property(assign, nonatomic) NSInteger numChannels;
音频声道数。
@property(assign, nonatomic) NSInteger sentSampleRate;
发送采样率。音频发送采样率信息,单位为 Hz 。
@interface ByteRtcRemoteAudioStats : NSObject
远端音频流统计信息。
本地用户订阅远端音频流成功后,SDK 会周期性(2s)的通过 rtcEngine:remoteAudioStats: 回调事件通知用户订阅的音频流在此次统计周期内的状况。此数据结构即为回调给用户的参数类型。
| 类型 | 名称 |
|---|---|
| NSString* | uid |
| float | audioLossRate |
| float | receivedKBitrate |
| NSInteger | stallCount |
| NSInteger | stallDuration |
| NSInteger | playoutSampleRate |
| NSInteger | e2eDelay |
| NSInteger | statsInterval |
| NSInteger | rtt |
| NSInteger | quality |
| NSInteger | jitterBufferDelay |
| NSInteger | numChannels |
| NSInteger | receivedSampleRate |
| NSInteger | frozenRate |
| NSInteger | concealedSamples |
| NSInteger | concealmentEvent |
| NSInteger | decSampleRate |
| NSInteger | decDuration |
@property (copy, nonatomic) NSString * _Nonnull uid;
用户ID 。远端音频流发布用户的用户ID 。
@property (assign, nonatomic) float audioLossRate;
音频丢包率。统计周期内的音频下行丢包率,取值范围为 [0, 1] 。
@property (assign, nonatomic) float receivedKBitrate;
接收码率。统计周期内的音频接收码率,单位为 kbps 。
@property (assign, nonatomic) NSInteger stallCount;
音频卡顿次数。统计周期内的卡顿次数。
@property (assign, nonatomic) NSInteger stallDuration;
音频卡顿时长。统计周期内的卡顿时长,单位为 ms 。
@property (assign, nonatomic) NSInteger playoutSampleRate;
播放采样率。统计周期内的音频播放采样率信息,单位为 Hz 。
@property (assign, nonatomic) NSInteger e2eDelay;
用户体验级别的端到端延时。从发送端采集完成编码开始到接收端解码完成渲染开始的延时,单位为 ms 。
@property (assign, nonatomic) NSInteger statsInterval;
统计间隔。此次统计周期的间隔,单位为 ms 。
@property (assign, nonatomic) NSInteger rtt;
往返时延。单位为 ms 。
@property(assign, nonatomic) NSInteger quality;
远端用户发送的音频流质量。值含义参考 ByteNetworkQuality 。
@property(assign, nonatomic) NSInteger jitterBufferDelay;
音频发送端到接收端的网络延迟。单位为 ms 。
@property(assign, nonatomic) NSInteger numChannels;
音频声道数。
@property(assign, nonatomic) NSInteger receivedSampleRate;
音频接收采样率。统计周期内接收到的远端音频采样率信息,单位为 Hz 。
@property(assign, nonatomic) NSInteger frozenRate;
远端用户在加入房间后发生音频卡顿的累计时长占音频总有效时长的百分比。
@property(assign, nonatomic) NSInteger concealedSamples;
音频 PLC 样点总个数。
@property(assign, nonatomic) NSInteger concealmentEvent;
PLC 累计次数。
@property(assign, nonatomic) NSInteger decSampleRate;
音频解码采样率。统计周期内的音频解码采样率信息,单位为 Hz 。
@property(assign, nonatomic) NSInteger decDuration;
解码时长。单位为 s 。
@interface ByteRtcAudioVolumeInfo : NSObject
音量信息
| 类型 | 名称 |
|---|---|
| NSString* | uid |
| NSUInteger | volume |
@property (copy, nonatomic) NSString * _Nonnull uid;
音量信息所属用户的用户 id
@property (assign, nonatomic) NSUInteger volume;
用户音量大小信息,音量取值范围为 [0, 255]
@interface ByteRtcNetworkQuality : NSObject
网络质量
| 类型 | 名称 |
|---|---|
| NSString* | uid |
| ByteNetworkQuality | txQuality |
| ByteNetworkQuality | rxQuality |
@property (nonatomic, strong) NSString * _Nonnull uid;
网络状况信息所属用户的用户ID
@property (nonatomic) ByteNetworkQuality txQuality;
该用户的上行网络状态。如果该用户为远端用户,则为默认值ByteRtcNetworkQualityUnknown。类型含义详见ByteNetworkQuality
@property (nonatomic) ByteNetworkQuality rxQuality;
该用户的下行网络状态。如果该用户为本地用户,则为默认值ByteRtcNetworkQualityUnknown。类型含义详见ByteNetworkQuality
@interface ByteSourceWantedData : NSObject
性能回退相关数据
| 类型 | 名称 |
|---|---|
| NSInteger | width |
| NSInteger | height |
| NSInteger | frameRate |
@property (nonatomic, assign) NSInteger width;
推荐视频输入宽
@property (nonatomic, assign) NSInteger height;
推荐视频输入高
@property (nonatomic, assign) NSInteger frameRate;
推荐视频输入帧率
typedef NS_ENUM(NSInteger,ByteVideoScaleMode)
视频缩放模式
| 类型 | 值 | 说明 |
|---|---|---|
| Auto | 0 | 自动缩放模式,当前等价于FitWithCropping |
| Stretch | 1 | 缩放以适配宽高比 |
| FitWithCropping | 2 | 保持纵横比来缩放图像,裁剪长边 |
| FitWithFilling | 3 | 保持纵横比来缩放图像,填充短边 |
@interface ByteVideoSolution : NSObject
视频属性
| 类型 | 名称 |
|---|---|
| NSInteger | width |
| NSInteger | height |
| NSInteger | frameRate |
| NSInteger | maxKbps |
| ByteVideoScaleMode | scaleMode |
| ByteVideoEncoderPreference | encoderPreference |
@property (assign, nonatomic) NSInteger width;
视频宽度
@property (assign, nonatomic) NSInteger height;
视频高度
@property (assign, nonatomic) NSInteger frameRate;
视频预设帧率
@property (assign, nonatomic) NSInteger maxKbps;
视频预设最大码率(Kbps)
@property (assign, nonatomic) ByteVideoScaleMode scaleMode;
视频伸展模式,详见类型ByteVideoScaleMode
@property (assign, nonatomic) ByteVideoEncoderPreference encoderPreference;
视频编码质量偏好,详见类型ByteVideoEncoderPreference
@interface ByteRtcByteStream : NSObject
音视频流属性 发布到房间中的音视频流的流属性。用户加入房间成功后,房间中所有已发布和未来发布的音视频流和流的相关属性,都会通过 rtcEngine:didStreamAdded: 回调通知用户。
| 类型 | 名称 |
|---|---|
| NSString* | uid |
| BOOL | isScreen |
| BOOL | hasVideo |
| BOOL | hasAudio |
| NSArray |
streamProfiles |
@property (copy, nonatomic) NSString * _Nonnull uid;
发布此流的用户的 ID。
@property (assign, nonatomic) BOOL isScreen;
流是否为共享屏幕流。
@property (assign, nonatomic) BOOL hasVideo;
流是否包括视频。
@property (assign, nonatomic) BOOL hasAudio;
流是否包括音频。
@property (copy, nonatomic) NSArray<ByteVideoSolution *> * _Nullable streamProfiles;
视频流的分辨率信息,详见 ByteVideoSolution 类。 用户可以通过调用 setVideoProfilessetVideoProfiles: 方法在一路流中发布多个不同的视频分辨率。此参数即为流中 所有分辨率的相关信息。
@interface ByteSubscribeConfig : NSObject
订阅流配置参数。 用户调用 subscribeStream:info: 方法手动订阅音视频流或更新订阅参数时,传入订阅流配置参数。
| 类型 | 名称 |
|---|---|
| BOOL | isScreen |
| BOOL | subVideo |
| BOOL | subAudio |
| NSInteger | videoIndex |
@property (assign, nonatomic) BOOL isScreen;
订阅的流是否是屏幕共享流。
@property (assign, nonatomic) BOOL subVideo;
是否订阅视频。
@property (assign, nonatomic) BOOL subAudio;
是否订阅音频。
@property (assign, nonatomic) NSInteger videoIndex;
订阅的视频流分辨率索引号。 视频流中含多个分辨率的情况下,标识订阅第几个的视频分辨率。如果视频流中仅含一个分辨率,则为0。
typedef NS_ENUM(NSInteger, ByteRtcAudioFrameType)
音频帧类型
| 类型 | 值 | 说明 |
|---|---|---|
| FRAME_TYPE_PCM16 | 0 | PCM16 |
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 |
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) | 回声噪音 |
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进行传输加密 |
@interface ByteRtcAudioFrameData : NSObject
音频帧数据
| 类型 | 名称 |
|---|---|
| ByteRtcAudioFrameType | type |
| SInt64 | timestampMs |
| int | samples |
| int | channels |
| int | sampleRate |
| UInt8* | buffer |
@property (assign, nonatomic) ByteRtcAudioFrameType type;
音频帧类型。详见类型ByteRtcAudioFrameType
@property (assign, nonatomic) SInt64 timestampMs;
音频帧时间戳
@property (assign, nonatomic) int samples;
每个声道音频帧的采样数
@property (assign, nonatomic) int channels;
音频声道数
@property (assign, nonatomic) int sampleRate;
音频数据的采样率
@property (assign, nonatomic) UInt8 * _Nonnull buffer;
数据缓冲
@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 |
@property (assign, nonatomic) ByteRtcVideoFrameType type;
视频帧类型。详见类型ByteRtcVideoFrameType
@property (assign, nonatomic) SInt64 timestampMs;
视频帧时间戳
@property (assign, nonatomic) int width;
视频帧宽
@property (assign, nonatomic) int height;
视频帧高
@property (assign, nonatomic) int yStride;
视频帧y分量stride
@property (assign, nonatomic) int uStride;
视频帧u分量stride
@property (assign, nonatomic) int vStride;
视频帧v分量stride
@property (assign, nonatomic) UInt8 * _Nonnull yBuffer;
视频帧y分量数据缓冲
@property (assign, nonatomic) UInt8 * _Nonnull uBuffer;
视频帧u分量数据缓冲
@property (assign, nonatomic) UInt8 * _Nonnull vBuffer;
视频帧v分量数据缓冲
@property (assign, nonatomic) int rotation;
视频帧选择度数
@interface ByteRtcPacket : NSObject
包信息
| 类型 | 名称 |
|---|---|
| UInt | size |
| const UInt8* | buffer |
@property (assign, nonatomic) UInt size;
数据缓存大小
@property (assign, nonatomic) const UInt8 * _Nonnull buffer;
包数据缓存地址
@interface ByteRtcHighlightConfig: NSObject
屏幕分享时的高亮边框
| 类型 | 名称 |
|---|---|
| BOOL | enableHighlight |
| uint32_t | borderColor |
| int | borderWidth |
@property (assign, nonatomic) BOOL enableHighlight;
是否显示高亮边框 推荐值 YES
@property (assign, nonatomic) uint32_t borderColor;
边框的颜色, 颜色格式为十六进制 ARGB: 0xAARRGGBB 推荐值 0xFF29CCA3
@property (assign, nonatomic) int borderWidth;
边框的宽度 推荐值 4
@interface ByteRtcScreenCaptureParameters : NSObject
屏幕共享的编码参数配置
| 类型 | 名称 |
|---|---|
| int | maxWidth |
| int | maxHeight |
| int | frameRate |
| int | bitrate |
| BOOL | captureMouseCursor |
| NSArray |
excludedWindowList |
| ByteRtcHighlightConfig* | highlightConfig |
@property (assign, nonatomic) int maxWidth;
屏幕采集编码最大宽度
@property (assign, nonatomic) int maxHeight;
屏幕采集编码最大高度
@property (assign, nonatomic) int frameRate;
屏幕采集编码帧率, 单位 fps
@property (assign, nonatomic) int bitrate;
屏幕采集编码码率, -1 为自动码率, SDK 会根据宽高信息选择合适的码率,单位 kbps
@property (assign, nonatomic) BOOL captureMouseCursor;
是否捕获鼠标光标
@property (strong, nonatomic) NSArray<NSNumber *> * _Nullable excludedWindowList;
抓取屏幕时排除窗口列表。这个参数仅在抓取屏幕时生效。
@property (strong, nonatomic) ByteRtcHighlightConfig * _Nonnull highlightConfig;
高亮边框的配置
@interface ByteRtcScreenCaptureSourceInfo : NSObject
屏幕分享时共享对象的信息
| 类型 | 名称 |
|---|---|
| ByteScreenCaptureSourceType | sourceType |
| intptr_t | sourceId |
| NSString* | sourceName |
@property (assign, nonatomic) ByteScreenCaptureSourceType sourceType;
屏幕分享时共享对象的类型。
@property (assign, nonatomic) intptr_t sourceId;
屏幕分享时共享对象的 ID。
@property (copy, nonatomic) NSString * _Nullable sourceName;
屏幕分享时共享对象的名称。
typedef NS_ENUM(NSUInteger, ByteAudioPerformanceProfile)
用户机型等级信息。 在部分应用场景下,需要关注用户机型的配置高低,根据不同的配置,选择不同复杂度的音频处理算法,在能耗、用户体验上进行折中。
| 类型 | 值 | 说明 |
|---|---|---|
| kByteAudioPerformanceProfileAuto | 0 | 自动策略,SDK 会在加入房间时上传机型信息。服务端根据机型信息判断性能级别,下发对应配置。 |
| kByteAudioPerformanceProfileLow | 1 | 低配策略,关闭 AEC、ANS、AGC 算法,播放 sample rate 为 16000。 策略内容可以定制,联系销售咨询具体方案 |
| kByteAudioPerformanceProfileMid | 2 | 中配策略,开启 AEC、ANS、AGC 算法,播放 sample rate 为 16000。 策略内容可以定制,联系销售咨询具体方案 |
| kByteAudioPerformanceProfileHigh | 3 | 高配策略,开启 AEC、ANS、AGC 算法,播放 sample rate 为 48000。 策略内容可以定制,联系销售咨询具体方案 |