数据类型
本章节列出了iOS/macOS SDK的所有数据类型,您可以结合HWRtcEngine接口和回调进行开发。
类型 | 描述 |
|---|---|
用户信息 | |
入会信息 | |
视频编码 | |
设备信息 | |
日志级别 | |
用户角色 | |
媒体类型 | |
视频渲染模式 | |
流类型 | |
声音播放模式 | |
视频角度 | |
音频路由 | |
设备类型 | |
设备状态 | |
网络连接状态改变原因 | |
网络连接状态 | |
预览视图 | |
卡顿统计信息 | |
视频镜像类型 | |
远端音频流状态 | |
远端音频流状态改变的原因 | |
远端视频流状态 | |
远端视频流状态改变的原因 | |
离开房间的原因 | |
发言人音量信息 | |
媒体方向 | |
音频播放类型 | |
音频格式 | |
视频帧图片存储格式 | |
视频帧缓冲区存储类型 | |
视频帧图片格式 | |
音频数据信息 | |
视频数据信息 | |
音频文件信息 | |
入会前网络检测配置 | |
入会前网络检测回调结果 | |
入会前网络检测回调网络状态 | |
入会前网络检测回调网络质量信息 | |
入会前网络检测回调网络质量等级 | |
视频信息 | |
音频信息 | |
大小流类型 | |
视频编码比例模式 | |
重力感应模式选择 | |
本地音频流状态 | |
本地音频流状态发生变化原因 | |
本地视频流状态 | |
本地视频流状态发生变化原因 | |
网络质量信息 | |
远端音频模式 | |
会话统计信息 | |
音频文件播放状态 | |
音频文件播放状态变化原因 | |
本端视频统计回调 | |
远端视频统计回调 | |
本端音频统计回调 | |
远端音频统计回调 | |
媒体选参 | |
美颜参数 | |
端到端加密参数 | |
rtmp推流回调url状态列表 | |
方向(横竖屏) | |
媒体连接状态 | |
代理参数的配置 | |
采集数据回调的处理模式 | |
RTMP推流设置参数模型 | |
RTMP推流流类型模型 | |
RTMP推流模型 | |
音频文件参数 | |
音量测试回调 | |
RTMP url数据模型 | |
摄像头配置参数 | |
摄像头方向 | |
辅流编码能力 | |
音频设备测试回调数据 | |
代理配置 | |
共享资源信息 | |
共享对象参数 | |
共享类型枚举 | |
带宽设置参数 | |
麦克风设备状态 | |
跨房配置 | |
源房间信息 | |
目标房间信息 | |
跨房状态 | |
跨房状态码 |
HWRtcUserInfo
属性 | 类型 | 描述 |
|---|---|---|
userId | NSString | 用户ID |
userName | NSString | 用户昵称 |
signature | NSString | 鉴权签名,具体生成方法请参见17-接入鉴权 |
ctime | long long | 鉴权时间戳 |
optionInfo | NSString | 其他信息 |
role | 用户角色 |
HWRtcJoinParam
属性 | 类型 | 描述 |
|---|---|---|
userId | NSString | 用户ID,支持最大长度64,支持数字、字母大小写、下划线、中线、"."字符 |
userName | NSString | 用户昵称,支持最大长度128 |
ctime | long long | 签名时间戳,单位秒,有signature时必选 |
authorization | NSString | |
role | 角色 | |
optionalInfo | NSString | 其他信息 |
roomId | NSString | 房间Id,支持最大长度64,支持数字、字母大小写、下划线、中线字符 |
autoSubscribeVideo | bool | 是否自动订阅视频 |
autoSubscribeAudio | bool | 是否自动订阅音频 |
scenario | 使用的场景
|
HWRtcVideoEncode
属性 | 类型 | 描述 |
|---|---|---|
streamFlag | 视频编码类型,根据HWRtcStreamType和表57 不同分辨率下帧率和码率的推荐值设置需要的分辨率和宽高比 | |
width | int | 视频分辨率宽 |
height | int | 视频分辨率高 |
frameRate | int | |
minFrameRate | int | 视频最小帧率,大于0,小于frameRate |
bitrate | int | |
minBitrate | int | 视频最小码率,大于0,小于bitrate |
disableAdjustRes | bool | 上行流是否自适应,推荐开启自适应(即disableAdjustRes赋NO) |
HWRtcAudioQualityLevel
枚举值 | 描述 |
|---|---|
HWRtcAudioQualityLevelDefault | 默认值,表示使用采样率16KHZ、单声道、编码码率,最大值为30Kbps |
HWRtcLogLevel
枚举值 | 描述 |
|---|---|
HWRtcLogLevelError | 输出ERROR级别日志 |
HWRtcLogLevelWarning | 输出WARNING级别日志 |
HWRtcLogLevelInfo | 输出INFO级别日志 |
HWRtcLogLevelDebug | 输出DEBUG级别日志 |
HWRtcEngineConfig
属性 | 类型 | 描述 |
|---|---|---|
appId | NSString | 应用ID,只有App ID相同的应用程序才能进入同一个房间进行互动。appId获取方法请参见应用管理 |
countryCode | NSString | 国家码,具体值请参见国家码对照表 |
enableHaTrace | BOOL | 打点开关 |
muteAudioRoute | BOOL | 是否禁音频路由 |
enableLog | BOOL | 是否记录日志 |
logLevel | HWRtcLogLevel | 日志级别,具体请参见HWRtcLogLevel,默认值为HWRtcLogLevelDebug,推荐使用HWRtcLogLevelDebug |
logPath | NSString | 日志路径,需调用方保证路径合法可用,rtc仅做基础校验 |
logSize | int | 日志大小,默认值10M,推荐10M |
HWRtcVideoDisplayMode
枚举值 | 描述 |
|---|---|
HWRtcVideoDisplayModeFit | 优先保证视频内容全部显示,视频尺寸等比缩放,直至视频窗口的一边与视窗边框对齐。如果视频长宽与显示窗口不同,视窗上未被填满的区域将被涂黑 |
HWRtcVideoDisplayModeHIDDEN, | 优先保证视窗被填满,视频尺寸等比缩放,直至整个视窗被视频填满。如果视频长宽与显示窗口不同,多出的视频将被截掉 |
HWRtcVideoDisplayModeFill, | 视频尺寸进行缩放和拉伸以充满显示视窗 |
HWRtcVideoRotation
枚举值 | 描述 |
|---|---|
HWRtcVideoRotation0 | 视频角度0度 |
HWRtcVideoRotation90 | 视频角度90度 |
HWRtcVideoRotation180 | 视频角度180度 |
HWRtcVideoRotation270 | 视频角度270度 |
HWRtcAudioRoute
枚举值 | 描述 |
|---|---|
HWRtcAudioRouteSpeaker | 扬声器 |
HWRtcAudioRouteBluetooth | 蓝牙 |
HWRtcAudioRouteReceiver | 听筒 |
HWRtcAudioRouteHeadset | 耳机 |
HWRtcDeviceType
设备类型,MAC SDK使用。
枚举值 | 描述 |
|---|---|
HWRtcDeviceTypePlayback | 音频播放设备 |
HWRtcDeviceTypeRecording | 音频录制设备 |
HWRtcDeviceTypeVideoCapture | 视频采集设备 |
HWRtcDeviceState
设备状态,MAC SDK使用。
枚举值 | 描述 |
|---|---|
HWRtcDeviceStateActicve | 设备状态活跃的 |
HWRtcDeviceStateDisabled | 设备状态不使能的 |
HWRtcDeviceStateUnplugged | 设备状态断开的 |
HWRtcConnChangeReason
枚举值 | 描述 |
|---|---|
HWRtcConnChangeConnecting | 正在连接 |
HWRtcConnChangeJoinSuccess | 加入房间成功 |
HWRtcConnChangeReconnecting | 重连中 |
HWRtcConnChangeReconnectSuccess | 重连成功 |
HWRtcConnChangeJoinFailed | 加入房间失败 |
HWRtcConnChangeReconncetFailed | 重连失败 |
HWRtcConnChangeInterrupted | 连接中断 |
HWRtcConnChangeKeepAliveTimeout | 心跳超时 |
HWRtcConnChangeLeaveRoom | 主动离开房间 |
HWRtcConnChangeJoinServerError | 服务器异常 |
HWRtcConnChangeSFUBreakdown | sfu服务故障 |
HWRtcConnChangeJoinRoomAuthFailed | 鉴权失败,appid或者签名错误 |
HWRtcConnChangeJoinRoomAuthRetry | 鉴权重试 |
HWRtcConnChangeJoinRoomAuthClockSync | 时钟同步 |
HWRtcConnChangeUrlNotRight | URL错误400 |
HWRtcConnChangeJoinRoomServiceUnreachable | 服务不可达503 |
HWRtcConnChangeInternalError | 内部错误 |
HWRtcConnChangeKickedOff | 被踢 |
HWRtcConnChangeSignatureExpired | 签名过期 |
HWRtcConnStateType
枚举值 | 描述 |
|---|---|
HWRtcConnStateTypeDisconnected | 连接断开 |
HWRtcConnStateTypeConnecting | 建立网络连接中 |
HWRtcConnStateTypeConnected | 网络连接成功 |
HWRtcConnStateTypeReconnecting | 重新建立网络连接中 |
HWRtcConnStateTypeFailed | 网络连接失败 |
HWRtcConnStateTypeLost | 失去网络10秒 |
HWRtcConnStateTypeInterrupted | SDK在和服务器建立连接后,失去网络连接超过4秒 |
HWRtcVideoCanvas
属性 | 描述 |
|---|---|
@property (strong, nonatomic) UIView* _Nullable view; | 视频显示视图,使用跟系统的UIView/NSView一样 |
@property (assign, nonatomic) NSString uid; | 视图的用户标识 |
HWRtcStatsInfo
属性 | 描述 |
|---|---|
@property (strong, nonatomic) NSString *roomId; | 房间ID |
@property (strong, nonatomic) NSString *userId; | 用户ID |
@property (assign, nonatomic) long long mildlyFrozenCounts; | 400ms卡顿次数 |
@property (assign, nonatomic) long long severelyFrozenCounts; | 超过1s卡顿次数 |
@property (assign, nonatomic) long long totalMildlyFrozenTime; | 400ms卡顿总时长 |
@property (assign, nonatomic) long long totalSeverelyFrozenTime; | 1s卡顿总时长 |
@property (assign, nonatomic) long long totalActiveTime; | 总时间,包括每一路选看时间总和 |
HWRtcVideoMirrorType
枚举值 | 描述 |
|---|---|
HWRtcVideoMirrorTypeAuto | SDK决定镜像方式:前置摄像头镜像,后置摄像头不镜像 |
HWRtcVideoMirrorTypeEnable | 前置摄像头和后置摄像头都镜像 |
HWRtcVideoMirrorTypeDisable | 前置摄像头和后置摄像头都不镜像 |
HWRtcRemoteAudioState
枚举值 | 描述 |
|---|---|
HWRtcRemoteAudioStateStopped | 远端音频流关闭发送 |
HWRtcRemoteAudioStateDecoding | 远端音频流正常编码发送 |
HWRtcRemoteAudioStateFirstDecoded | 远端音频流首包解码 |
HWRtcRemoteAudioStateReason
枚举 | 描述 |
|---|---|
HWRtcRemoteAudioStateReasonRemoteOffline | 远端用户离线 |
HWRtcRemoteAudioStateReasonRemoteMuted | 远端用户停止音频流发送 |
HWRtcRemoteAudioStateReasonRemoteUnmuted | 远端用户开启音频流发送 |
HWRtcRemoteAudioStateReasonRemoteFirstDecoded | 远端用户音频首包解码 |
HWRtcRemoteVideoState
枚举值 | 描述 |
|---|---|
HWRtcRemoteVideoStateStopped | 远端视频流关闭发送 |
HWRtcRemoteVideoStateDecoding | 远端视频流正常编码发送 |
HWRtcRemoteVideoStateReason
枚举值 | 描述 |
|---|---|
HWRtcRemoteVideoStateReasonRemoteOffline | 远端用户离线 |
HWRtcRemoteVideoStateReasonRemoteMuted | 远端用户停止视频流发送 |
HWRtcRemoteVideoStateReasonRemoteUnmuted | 远端用户开启视频流发送 |
HWRtcLeaveReason
枚举值 | 描述 |
|---|---|
HWRtcLeaveReasonUserLeaveRoom | 用户主动离开 |
HWRtcLeaveReasonServerError | 服务器异常 |
HWRtcLeaveReasonBreakdown | sfu服务故障 |
HWRtcLeaveReasonServiceUnreachable | 服务不可达 |
HWRtcLeaveReasonInternalError | 内部错误 |
HWRtcLeaveReasonKickedOff | 被踢 |
HWRtcLeaveReasonAuthorizationExpired | 签名过期 |
HWRtcLeaveReasonReconnectFailed | 重连超时 |
HWRtcMediaUsersVolumeInfo
属性 | 描述 |
|---|---|
@property (strong, nonatomic) NSString *userId; | 用户ID |
@property (assign, nonatomic) int volume; | 音量 |
HWRtcAudioFilePlayMode
枚举 | 描述 |
|---|---|
HWRtcAudioFileLocalPlayMode | 本地播放模式 |
HWRtcAudioFileRemotePlayMode | 远端播放模式 |
HWRtcVideoImageFormat
枚举 | 描述 |
|---|---|
HWRtcVideoImageFormatYUV420P | 采样比例为4:2:0,存储方式为I420 |
HWRtcVideoImageFormatYUV422I | 采样比例4:2:0 |
HWRtcVideoImageFormatRGB24 | 格式为RGB |
HWRtcVideoImageFormatRGBA | 格式为RGBA |
HWRtcVideoImageBufferType
枚举 | 描述 |
|---|---|
HWRtcVideoImageBufferByteArray | Byte Array类型,对应HWRtcVideoImageFormat中的YUV、RGBA格式 |
HwRtcImageBufferFormat
属性 | 描述 |
|---|---|
@property HWRtcVideoImageFormat format; | 视频帧图片存储格式,具体请参见HWRtcVideoImageFormat |
@property HWRtcVideoImageBufferType bufferType; | 视频帧缓冲区存储类型,具体请参见HWRtcVideoImageBufferType |
HWRtcAudioFrame
属性 | 描述 |
|---|---|
@property (nonatomic, assign) HWRtcAudioFrameType frameType; | 音频帧类型,具体请参见HWRtcAudioFrameType |
@property (nonatomic, assign) NSUInteger samples; | 每个声道的采样点数,iSamples=iSamplesPerSec * 10ms /1000 |
@property (nonatomic, assign) NSUInteger samplesPerSec; | 采样率 |
@property (nonatomic, assign) NSUInteger bytesPerSample; // bitsPerSample | 每个采样点的字节数,pcm数据一般2字节 |
@property (nonatomic, assign) NSUInteger channels; | 声道数 |
@property (strong, nonatomic) NSData * _Nullable data; | 数据缓冲区,长度=samples*bytesPerSample*channels |
HWRtcVideoFrame
属性 | 描述 |
|---|---|
@property (assign, nonatomic) HWRtcVideoImageFormat format; | 图像格式 ,具体请参见HWRtcVideoImageFormat |
@property (assign, nonatomic) NSUInteger width; | 图像宽度,作为输入时,范围为[90,1920],必须是4的整数倍 |
@property (assign, nonatomic) NSUInteger height; | 图像高度,作为输入时,范围为[90,1200],必须是2的整数倍 |
@property (strong, nonatomic) NSData * _Nullable data; | 存储视频数据的buf地址 |
@property (assign, nonatomic) NSUInteger dataLen; | 视频数据的长度,单位为Byte |
@property (strong, nonatomic) NSString *userId; | 被选看的远端用户本地推流不需要赋值 |
HWRtcStartAudioFileParam
属性 | 描述 |
|---|---|
@property (nonatomic, strong) NSString * _Nonnull fullFilePath; | 文件路径 |
@property (nonatomic, assign) HWRtcAudioFilePlayMode playMode; | 播放类型,具体请参见HWRtcAudioFilePlayMode |
@property (nonatomic, assign) NSUInteger cycle; | 循环次数 |
@property (nonatomic, assign) NSUInteger replace; | 远端模式下面是否需要和麦克风做混音 |
HWRtcNetworkTestConfig
属性 | 描述 |
|---|---|
@property (strong, nonatomic) NSString * _Nonnull userId | 用户id |
@property (strong, nonatomic) NSString * _Nonnull roomId | 房间ID,roomid建议由userid+随机数组成 |
@property (strong, nonatomic) NSString *signature | 必选,签名信息 |
@property (nonatomic, assign) long long ctime | 必选,系统时间 |
@property (assign, nonatomic) BOOL enableUplinkTest | 启动上行网络检测开关 |
@property (assign, nonatomic) BOOL enableDownlinkTest | 启动下行网络检测开关 |
@property (nonatomic, assign) NSUInteger expectedUplinkBitrate | 用户期望的最高发送码率,单位为bps,范围为0以及[100000, 5000000],设为0表示由SDK指定最高码率 |
@property (nonatomic, assign) NSUInteger expectedDownlinkBitrate | 用户期望的最高接收码率,单位为bps,范围为0以及[100000, 5000000],设为0表示由SDK指定最高码率 |
HWRtcNetworkTestResult
属性 | 描述 |
|---|---|
@property (assign, nonatomic) HWRtcNetworkTestState state | 检测网络状态,具体请参见HWRtcNetworkTestState |
@property (nonatomic, strong) HWRtcNetworkTestResultParam *uplinkResult | 上行网络检测状态,具体请参见HWRtcNetworkTestResultParam |
@property (nonatomic, strong) HWRtcNetworkTestResultParam * downlinkResult | 下行网络检测状态,具体请参见HWRtcNetworkTestResultParam |
HWRtcNetworkTestResultParam
属性 | 描述 |
|---|---|
@property (nonatomic, assign) NSInteger bitRate | 码率 |
@property (nonatomic, assign) NSInteger packetLoss | 丢包 |
@property (nonatomic, assign) NSInteger delay | 延时 |
@property (nonatomic, assign) NSInteger jitter | 抖动 |
HWRtcVideoStatsInfo
属性 | 描述 |
|---|---|
@(strong, nonatomic) NSString *userId; | 用户ID(本地视频信息为空) |
@ (assign, nonatomic) NSUInteger width; | 视频宽 |
@ (assign, nonatomic) NSUInteger height; | 视频高 |
@ (assign, nonatomic) NSUInteger bitRate; | 视频码率 |
@ (assign, nonatomic) NSUInteger frameRate; | 视频帧率 |
@ (assign, nonatomic) NSUInteger packetLoss; | 视频丢包率 |
@ (assign, nonatomic) NSUInteger delay; | 视频时延 |
@ (assign, nonatomic) NSUInteger jitter; | 视频抖动 |
HWRtcAudioStatsInfo
属性 | 描述 |
|---|---|
@(strong, nonatomic) NSString *userId; | 用户ID(本地音频信息为空) |
@ (assign, nonatomic) NSUInteger sampleRate; | 音频采样率 |
@ (assign, nonatomic) NSUInteger channels; | 音频声道数 |
@ (assign, nonatomic) NSUInteger bitRate; | 音频码率 |
@ (assign, nonatomic) NSUInteger packetLoss; | 音频丢包率 |
@ (assign, nonatomic) NSUInteger delay; | 音频时延 |
@ (assign, nonatomic) NSUInteger jitter; | 音频抖动 |
HWRtcNetworkQualityLevel
属性 | 描述 |
|---|---|
HWRtcNetworkQualityUnknown | 网络质量未知 |
HWRtcNetworkQualityExcellent | 网络质量非常好 |
HWRtcNetworkQualityGood | 网络质量好 |
HWRtcNetworkQualityPoor | 网络质量一般 |
HWRtcNetworkQualityBad | 网络质量差 |
HWRtcNetworkQualityVbad | 网络质量非常差 |
HWRtcVideoEncodeResolutionMode
属性 | 描述 |
|---|---|
HWRtcVideoEncodeResolutionModeNone | 不固定比例 |
HWRtcVideoEncodeResolutionModeConstRatio | 固定比例 |
HWRtcGSensorMode
属性 | 描述 |
|---|---|
HWRtcGSensorModeDisable | 关闭重力感应 |
HWRtcGSensorModeUIAutoLayout | 开启重力感应 注意:SDK不会根据陀螺仪自动调整本地View的画面方向,而是需要您的APP开启了重力感应进行适配 |
HWRtcLocalAudioState
属性 | 描述 |
|---|---|
HWRtcLocalAudioStateStopped | 本地音频流默认初始状态 |
HWRtcLocalAudioStateRecording | 本地音频流录制设备启动成功 |
HWRtcLocalAudioStateFailed | 本地音频流启动失败 |
HWRtcLocalAudioStateReason
属性 | 描述 |
|---|---|
HWRtcLocalAudioReasonErrorOk | 本地音频流状态正常 |
HWRtcLocalAudioReasonErrorFailure | 本地音频流出错原因不明确 |
HWRtcLocalAudioReasonErrorRecordFailure | 本地音频流录制失败,建议您检查录制设备是否正常工作 |
HWRtcLocalAudioReasonErrorStopFailure | 关闭采集失败 |
HWRtcLocalAudioReasonErrorAccessDenied | 音频设备API无法访问,可能是设备隐私权限设置问题 |
HWRtcLocalAudioReasonErrorOnExclusiveMode | 音频设备处于独占模式,且被其他应用独占 |
HWRtcLocalAudioReasonErrorMmsyserrInvalparam | 音频设备API非法参数(仅适用于windows) |
HWRtcLocalAudioReasonErrorMmsyserrNodriver | 音频设备API返回无驱动,需要用户升级驱动(仅适用于windows) |
HWRtcLocalAudioReasonErrorAudioServerNotRunning | 用户windows audio服务未启动,或者启动失败(仅适用于windows) |
HWRtcLocalAudioReasonErrorNoDevice | 没有设备(仅适用于windows) |
HWRtcLocalAudioReasonErrorRestartFailed | 扬声器播放无数据,重启失败 |
HWRtcLocalVideoState
属性 | 描述 |
|---|---|
HWRtcLocalVideoStateStopped | 本地视频流默认初始状态 |
HWRtcLocalVideoStateCapturing | 本地视频流采集设备启动成功 |
HWRtcLocalVideoStateFailed | 本地视频流启动失败 |
HWRtcLocalVideoStateReason
属性 | 描述 |
|---|---|
HWRtcLocalVideoReasonErrorOk | 本地视频流状态正常 |
HWRtcLocalVideoReasonErrorFailure | 本地视频流出错原因不明确 |
HWRtcLocalVideoReasonErrorCaptureFailure | 本地视频流录制失败,建议您检查录制设备是否正常工作 |
HWRtcLocalVideoReasonErrorStopFailure | 关闭采集失败 |
HWRtcLocalVideoReasonErrorCaptureDeviceNoPermission | 没有摄像头权限 |
HWRtcLocalVideoReasonErrorCaptureDeviceBusy | 摄像头设备已占用 |
HWRtcLocalVideoReasonErrorCaptureAppInBackground | 应用处于后台 |
HWRtcLocalVideoReasonErrorCaptureOpenCameraFailed | 打开摄像头设备失败(仅支持iOS) |
HWRtcLocalVideoReasonErrorCaptureMultipleForegroundApp | 应用窗口处于侧拉、分屏、画中画模式(仅支持iOS) |
HWRtcLocalVideoReasonErrorCaptureMultipleDeviceDisconnected | 本地视频采集设备未连接(仅支持macOS) |
HWRtcQualityInfo
属性 | 描述 |
|---|---|
@property (strong, nonatomic) NSString *userId; | 用户ID |
@property (assign, nonatomic) HWRtcNetworkQualityLevel level; | 网络质量等级 |
@property (assign, nonatomic) NSUInteger width; | 宽度 |
@property (assign, nonatomic) NSUInteger height; | 高度 |
HWRtcNetworkQualityLevel
属性 | 描述 |
|---|---|
HWRtcNetworkQualityUnknown | 网络质量未知 |
HWRtcNetworkQualityExcellent | 网络质量非常好 |
HWRtcNetworkQualityGood | 网络质量好 |
HWRtcNetworkQualityPoor | 网络质量一般 |
HWRtcNetworkQualityBad | 网络质量差 |
HWRtcNetworkQualityVbad | 网络质量非常差 |
HWRtcRemoteAudioMode
枚举值 | 描述 |
|---|---|
HWRtcRemoteAudioSubscribe=0 | 订阅模式(自主订阅) |
HWRtcRemoteAudioTopThre=1 | TopN模式(收音量最大的三路流) |
HRTC_REMOTE_AUDIO_P2P=2 | P2P模式 |
HRTC_REMOTE_AUDIO_RTSA_CMD =3 | RTSA-CMD模式 |
分辨率 | 分辨率类型 | 比例 | 最小帧率(fps) | 最大帧率(fps) | 最小码率 | 最大码率 |
|---|---|---|---|---|---|---|
320 X 180 | SD | 16:9 | 10 | 30 | 80 | 600 |
480 X 270 | HD | 16:9 | 10 | 30 | 160 | 1050 |
640 X 360 | HD | 16:9 | 10 | 30 | 200 | 1700 |
800 X 450 | FHD | 16:9 | 10 | 30 | 300 | 2100 |
960 X 540 | FHD | 16:9 | 10 | 30 | 400 | 2400 |
1120 X 630 | FHD | 16:9 | 10 | 30 | 450 | 2800 |
1280 X 720 | FHD | 16:9 | 10 | 30 | 500 | 4000 |
120 X 90 | LD | 4:3 | 10 | 30 | 64 | 240 |
160 X 120 | SD | 4:3 | 10 | 30 | 64 | 270 |
240 X 180 | SD | 4:3 | 10 | 30 | 80 | 450 |
320 X 240 | HD | 4:3 | 10 | 30 | 100 | 600 |
400 X 300 | HD | 4:3 | 10 | 30 | 200 | 900 |
480 X 360 | HD | 4:3 | 10 | 30 | 200 | 1000 |
640 X 480 | FHD | 4:3 | 10 | 30 | 250 | 1800 |
960 X 720 | FHD | 4:3 | 10 | 30 | 450 | 3000 |
分辨率 | 推荐帧率 | 通信场景推荐码率 | 直播场景推荐码率 |
|---|---|---|---|
160 X 90 | 15 | 90 | 180 |
320 X 180 | 15 | 200 | 400 |
480 X 270 | 15 | 350 | 700 |
640 X 360 | 15 | 450 | 900 |
640 X 360 | 30 | 850 | 1700 |
800 X 450 | 15 | 700 | 1400 |
800 X 450 | 30 | 1050 | 2100 |
960 X 540 | 15 | 850 | 1700 |
960 X 540 | 30 | 1200 | 2400 |
1120 X 630 | 15 | 950 | 1900 |
1120 X 630 | 30 | 1400 | 2800 |
1280 X 720 | 15 | 1200 | 2400 |
1280 X 720 | 30 | 2000 | 4000 |
120 X 90 | 15 | 80 | 160 |
160 X 120 | 15 | 90 | 180 |
240 X 180 | 15 | 150 | 300 |
320 X 240 | 15 | 200 | 400 |
400 X 300 | 15 | 300 | 600 |
480 X 360 | 15 | 350 | 700 |
480 X 360 | 30 | 500 | 1000 |
640 X 480 | 15 | 600 | 1200 |
640 X 480 | 30 | 900 | 1800 |
960 X 720 | 15 | 1000 | 2000 |
960 X 720 | 30 | 1500 | 3000 |
HRTCOnStats
属性 | 类型 | 描述 |
|---|---|---|
cpuAppUsage | double | app的cpu利用率,单位(%) |
cpuTotalUsage | double | cpu总利用率,单位(%) |
memoryAppUsageInKbytes | int | app占用内存,单位KB |
memoryAppUsageRatio | double | app占用的内存率,单位(%) |
memoryTotalUsageRatio | double | 总的内存利用率,单位(%) |
gatewayRtt | int | 到本地网关的延迟,单位ms |
sendBytes | long | 总的发送字节数,单位bytes |
sendVideoBytes | long | 视频的发送字节数,单位bytes |
sendAudioBytes | long | 音频的发送字节数,单位bytes |
receiveBytes | long | 总的接收字节数,单位bytes |
receiveVideoBytes | long | 视频的接收字节数,单位bytes |
receiveAudioBytes | long | 音频的接收字节数,单位bytes |
sendBitRate | int | 总的发送比特率,单位Kbps |
sendVideoBitRate | int | 视频的发送比特率,单位Kbps |
sendAudioBitRate | int | 音频的发送比特率,单位Kbps |
receiveBitRate | int | 总的接收比特率,单位Kbps |
receiveVideoBitRate | int | 视频的接收比特率,单位Kbps |
receiveAudioBitRate | int | 音频的接收比特率,单位Kbps |
sendLossRate | int | 发送丢包率,单位(%) |
receiveLossRate | int | 接收丢包率,单位(%) |
lastmileDelay | int | 到服务器的延迟,单位ms |
HWRtcAudioFileState
属性 | 描述 |
|---|---|
HWRtcAudioFileOpenCompleted | 成功打开音频文件 |
HWRtcAudioFileOpening | 正在打开音频文件 |
HWRtcAudioFileIdle | 音频文件播放就绪 |
HWRtcAudioFilePlaying | 音频文件播放中 |
HWRtcAudioFilePlayCompleted | 音频文件播放完成 |
HWRtcAudioFilePaused | 音频文件暂停播放 |
HWRtcAudioFileStopped | 音频文件停止播放 |
HWRtcAudioFileFailed | 音频文件播放失败 |
HWRtcAudioFilePositionUpdate | 音频文件播放进度更新 |
HWRtcAudioFileStateUnknown | 音频文件播放状态未知 |
HWRtcAudioFileReason
枚举值 | 描述 |
|---|---|
HWRtcAudioFileReasonNone | 没有错误 |
HWRtcAudioFileReasonUrlNotFound | 未找到URL |
HWRtcAudioFileReasonCodecNotSupported | 解码器不支持该编码 |
HWRtcAudioFileReasonInvalidArguments | 非法参数 |
HWRtcAudioFileReasonSrcBufferUnderflow | 播放缓冲区数据不足 |
HWRtcAudioFileReasonInterval | 内部错误 |
HWRtcAudioFileReasonInvalidState | 播放器内部状态错误 |
HWRtcAudioFileReasonNoResource | 没有该资源 |
HWRtcAudioFileReasonObjNotInitialized | 对象未初始化 |
HWRtcAudioFileReasonInvalidConnectionState | 播放器与服务器连接无效 |
HWRtcAudioFileReasonUnknowdStreamType | 未知的媒体流类型 |
HWRtcAudioFileReasonVideoRenderFailed | 渲染失败 |
HWRtcAudioFileReasonInvalidMediaSource | 无效的媒体资源 |
HWRtcAudioFileReasonUnknown | 状态未知 |
HWRtcLocalVideoStats
枚举值 | 描述 |
|---|---|
@(strong, nonatomic) NSString *userId; | 用户ID(本地视频信息为空) |
@ (assign, nonatomic) NSUInteger width; | 视频宽 |
@ (assign, nonatomic) NSUInteger height; | 视频高 |
@ (assign, nonatomic) NSUInteger bitRate; | 视频码率 |
@ (assign, nonatomic) NSUInteger frameRate; | 视频帧率 |
@ (assign, nonatomic) NSUInteger packetLoss; | 视频丢包率 |
@ (assign, nonatomic) NSUInteger delay; | 视频时延 |
@ (assign, nonatomic) NSUInteger jitter; | 视频抖动 |
@ (assign, nonatomic) long long bytes; | 字节数 |
@ (assign, nonatomic) NSUInteger sendFrameRate; | 实际发送帧率,单位:fps |
HWRtcRemoteVideoStats
枚举值 | 描述 |
|---|---|
@(strong, nonatomic) NSString *userId; | 用户ID(本地视频信息为空) |
@ (assign, nonatomic) NSUInteger width; | 视频宽 |
@ (assign, nonatomic) NSUInteger height; | 视频高 |
@ (assign, nonatomic) NSUInteger bitRate; | 视频码率 |
@ (assign, nonatomic) NSUInteger frameRate; | 视频帧率 |
@ (assign, nonatomic) NSUInteger packetLoss; | 视频丢包率 |
@ (assign, nonatomic) NSUInteger delay; | 视频时延 |
@ (assign, nonatomic) NSUInteger jitter; | 视频抖动 |
@ (assign, nonatomic) long long bytes; | 字节数 |
@ (assign, nonatomic) NSUInteger sendFrameRate; | 实际发送帧率,单位:fps |
@ (assign, nonatomic) NSUInteger rendererOutputFrameRate; | 渲染帧率,单位:fps |
@ (assign, nonatomic) NSUInteger totalFrozenTime; | 远端用户在加入房间后到离开房间前,发生视频卡顿的累计时长,单位:ms |
@ (assign, nonatomic) NSUInteger frozenRate; | 远端用户在加入房间后到离开房间前,发生视频卡顿的累计时长占视频总有效时长的百分比,单位:% |
HWRtcLocalAudioStats
属性 | 描述 |
|---|---|
@(strong, nonatomic) NSString *userId; | 用户ID(本地音频信息为空) |
@ (assign, nonatomic) NSUInteger sampleRate; | 音频采样率 |
@ (assign, nonatomic) NSUInteger channels; | 音频声道数 |
@ (assign, nonatomic) NSUInteger bitRate; | 音频码率 |
@ (assign, nonatomic) NSUInteger packetLoss; | 音频丢包率 |
@ (assign, nonatomic) NSUInteger delay; | 音频时延 |
@ (assign, nonatomic) NSUInteger jitter; | 音频抖动 |
HWRtcRemoteAudioStats
属性 | 描述 |
|---|---|
@(strong, nonatomic) NSString *userId; | 用户ID(本地音频信息为空) |
@ (assign, nonatomic) NSUInteger sampleRate; | 音频采样率 |
@ (assign, nonatomic) NSUInteger channels; | 音频声道数 |
@ (assign, nonatomic) NSUInteger bitRate; | 音频码率 |
@ (assign, nonatomic) NSUInteger packetLoss; | 音频丢包率 |
@ (assign, nonatomic) NSUInteger delay; | 音频时延 |
@ (assign, nonatomic) NSUInteger jitter; | 音频抖动 |
@ (assign, nonatomic) NSUInteger totalFrozenTime; | 远端用户在加入房间后到离开房间前,发生音频卡顿的累计时长,单位:ms 说明:仅onRemoteAudioStatsNotify回调中携带此数据 |
@ (assign, nonatomic) NSUInteger frozenRate; | 远端用户在加入房间后到离开房间前,发生音频卡顿的累计时长占音频总有效时长的百分比,单位:% 说明:仅onRemoteAudioStatsNotify回调中携带此数据 |
HRTCSfuType
枚举值 | 描述 |
|---|---|
HRTC_SFU_TYPE_PUBLIC_NETWORK | 公网sfu资源 |
HWRtcBeautyOptions
属性 | 类型 | 描述 |
|---|---|---|
buffingLevel | float | 磨皮档位,取0-1浮点数。默认值0.5,推荐使用默认值0.5 |
complexionAlpha | float | 肤色档位,取0-1浮点数。默认值0.5,推荐使用默认值0.5 |
HWRTCEncryptionConfig
函数&属性 | 描述 |
|---|---|
@(strong, nonatomic) HWRTCCryptionMode cryptionMode; | HWRTCCryptionMode加密模式 |
@(assign, nonatomic) HWRTCSuiteType suitType; | HWRTCSuiteType加密算法,仅模式HWRTCCryptionModeAuthenticationSdk需要 |
@ (assign, nonatomic) NSString *cryptionSec; | 加密密钥,仅模式HWRTCCryptionModeAuthenticationSdk需要设置 |
@ (assign, nonatomic) HWRTCCryptionSecFormat cryptionSecFormat | HWRTCCryptionSecFormat ,密钥格式,当前只支持16进制字符串 |
HWRTCCryptionMode
枚举值 | 描述 |
|---|---|
HWRTCCryptionModeDefault | 不开启端到端加密,此时srtp认证(包校验)+加密 |
HWRTCCryptionModeAuthenticationSdk | 开启端到端加密,srtp只认证(包校验),sdk内部加密, 必现配置key |
HWRTCCryptionModeAuthenticationApp | 开启端到端加密,srtp只认证(包校验),应用层加密,需注册回调 |
HWRTCSuiteType
函数&属性 | 描述 |
|---|---|
HWRTCSuiteType128Ctr | 加密密钥,仅模式HWRTCCryptionModeAuthenticationSdk需要设置 |
HWRTCCryptionSecFormat
枚举值 | 描述 |
|---|---|
HWRTC_HEX_STRING | 16进制字符串格式。当前只支持此格式。 |
HRTCUrlStatusList
属性 | 描述 |
|---|---|
char url[1025] | url字符串 |
int status | 状态码 |
int errCode | 错误码 |
HWRtcMediaConnChangeReason
属性 | 描述 |
|---|---|
HWRtcMediaConnChangedConnected | 连接成功 |
HWRtcMediaConnChangedNATFailed | NAT未打通 |
HWRtcVideoOrientaion
枚举值 | 描述 |
|---|---|
HRTC_VIDEO_ORIENTATION__LANSCAPE | 横屏 |
HRTC_VIDEO_ORIENTATION__PORTRAIT | 竖屏 |
HwRtcNetProxyConfig
属性 | 类型 | 描述 |
|---|---|---|
autoNetProxy | BOOL | 是否开启自动代理 |
address | NSString | 代理的地址 |
port | NSInteger | 代理端口 |
name | NSString | 代理认证的账号名 |
pwd | NSString | 代理认证的账号密码 |
HWRTCAudioOperateMode
属性 | 描述 |
|---|---|
enum HWRTCAudioOperateMode.HWRTC_AUDIO_OPERATE_READ_AND_WRITE | 可读可写模式 |
RtmpConfigModel
属性 | 类型 | 描述 |
|---|---|---|
width | int | 旁路推流的输出视频流的总宽度,单位为px。360为默认值,取值范围为[64-1920] |
height | int | 旁路推流的输出视频流的总高度,单位为px。640为默认值,取值范围为[64-1920] |
videoBitrate | int | 旁路推流的输出视频的码率,单位为Kbps。默认值为400Kbps,取值范围[32-2760], |
videoFramerate | int | 旁路推流的输出视频的帧率,单位为fps。默认值为15,取值范围为 [10,30] |
videoGop | int | 用于旁路直播的输出视频的GOP,单位为帧。默认值为30帧,取值范围为[1-300] |
audioSampleRate | int | 用于旁路直播的输出音频的采样率,默认16000,取值范围为[16000-96000] |
audioBitrate | int | 旁路直播的输出音频的码率。单位为Kbps,默认值为48,最大值为128,取值范围为[1-128] |
audioChannels | int | 旁路直播的输出音频的声道数,默认1,取值范围为[1-5] |
tmplate | int | 0表示悬浮,1表示九宫格,2表示屏幕分享,默认为0 |
PublishStreamTypeModel
属性 | 类型 | 描述 |
|---|---|---|
main | bool | 是否推大流 |
slides | bool | 是否推小流 |
desktop | bool | 是否推桌面流 |
audio | bool | 是否推音频流 |
TranscodeConfigModel
属性 | 类型 | 描述 |
|---|---|---|
config | RtmpConfigModel | 混流的配置信息 |
mapPublishStreamTypes | NSDictionary<NSString *, PublishStreamTypeModel *> | 混流用户的流信息 |
userInfos | NSArray<NSString *> | 混流用户信息 |
HWRtcStartAudioFileParam
属性 | 类型 | 描述 |
|---|---|---|
fullFilePath | NSString | 音频文件路径 |
playMode | 播放模式 | |
cycle | NSUInteger | 音频播放次数,0表示无限循环 |
replace | NSUInteger | 是否用音频文件替换麦克风采集的声音。1表示只使用音频文件发送到远端,0表示将本地麦克风采集并和音频文件混音后发送到远端 |
HWRtcAudioDeviceTestVolumeNotify
属性 | 类型 | 描述 |
|---|---|---|
recordVolume | NSInteger | 麦克风音量值0-100 |
playbackVolume | NSInteger | 扬声器音量值0-100 |
HWRtcAudioDeviceTestVolumeNotify
属性 | 类型 | 描述 |
|---|---|---|
recordVolume | NSInteger | 麦克风音量 |
playbackVolume | NSInteger | 扬声器音量 |
HwRtcNetProxyConfig
属性 | 类型 | 描述 |
|---|---|---|
autoNetProxy | BOOL | 是否开启自动代理 |
address | NSString | 代理的地址 |
port | NSInteger | 代理端口 |
name | NSString | 代理认证的账号名 |
pwd | NSString | 代理认证的账号密码 |
HWRtcScreenShareSourceInfo
属性 | 类型 | 描述 |
|---|---|---|
sourceId | NSInteger | 采集源ID |
sourceName | NSString | 采集源名称 |
type | HWRtcScreenShareType | 共享类型,具体请参见HWRtcScreenShareType |
icon | void* | 预留字段,暂不支持 |
rect | NSRect | 采集源区域 |
HWRtcScreenShareParam
属性 | 类型 | 描述 |
|---|---|---|
type | HWRtcScreenShareType | 共享类型,具体请参见HWRtcScreenShareType |
viewID | NSInteger | 采集源ID |
bCaptureMouse | BOOL | MAC不支持 |
rect | NSRect | 采集源区域 |
sourceName | NSString | 采集源名称 |
HWRtcVideoRemoteView
属性 | 类型 | 描述 |
|---|---|---|
videoCanvas | 视频画布对象属性 | |
streamType | 要订阅的编码类型 | |
disableAdjustRes | int | 下行码率自适应,默认关闭 |
minResolution | HWRtcStreamType | 最小编码类型 |
HRTCMultiRoomMediaRelayConfiguration
属性 | 类型 | 描述 |
|---|---|---|
srcRoomMediaInfo | 源房间的鉴权信息 | |
destRoomMediaInfo | 目的跨房的房间信息以及鉴权信息 |
HRTCSrcMultiRoomMediaInfo
属性 | 类型 | 描述 |
|---|---|---|
authorization | const char* | 源房间的鉴权信息 |
userId | const char* | 源房间的用户名 |
roomId | const char* | 源房间的房间号 |
ctime | long long | 鉴权时间信息 |
HRTCDstMultiRoomMediaInfo
属性 | 类型 | 描述 |
|---|---|---|
authorization | const char* | 目标跨房的鉴权信息 |
userId | const char* | 目标跨房的虚拟用户名 |
roomId | const char* | 目标跨房房间号 |
userRole | 跨房角色 | |
ctime | long long | 鉴权时间信息 |
HRTCMultiRoomMediaRelayState
属性 | 描述 |
|---|---|
HRTC_MULTI_ROOM_MEDIA_RELAY_STATE_IDLE | 就绪状态 |
HRTC_MULTI_ROOM_MEDIA_RELAY_STATE_CONNECTING | 正在连接 |
HRTC_MULTI_ROOM_MEDIA_RELAY_STATE_RUNNING | 主播成功加入目标房间 |
HRTC_MULTI_ROOM_MEDIA_RELAY_STATE_FAILURE | 发生异常 |
HRTCMultiRoomMediaRelayStateCode
属性 | 描述 |
|---|---|
HRTC_MULTI_ROOM_MEDIA_RELAY_OK | 正常状态 |
HRTC_MULTI_ROOM_MEDIA_RELAY_ERROR_SERVER_NO_RESPONSE | 服务端无响应 |
HRTC_MULTI_ROOM_MEDIA_RELAY_ERROR_INTERNAL_ERROR | 服务器内部出错 |
HRTC_MULTI_ROOM_MEDIA_RELAY_ERROR_USER_OVER_LIMIT | 用户跨房超出限制数 |
HRTC_MULTI_ROOM_MEDIA_RELAY_ERROR_ROOM_OVER_LIMIT | 房间跨房用户超出限制数 |
HRTC_MULTI_ROOM_MEDIA_RELAY_ERROR_ROOM_REQ_EMPTY | 跨房请求消息体为空 |
HRTC_MULTI_ROOM_MEDIA_RELAY_ERROR_ROOM_OPERATION_CONFLICT | 跨房请求,加入和退出存在冲突 |
HRTC_MULTI_ROOM_MEDIA_RELAY_ERROR_ROOM_SRC_USERINFO_INVALID | 跨房请求原用户信息无效 |
HRTC_MULTI_ROOM_MEDIA_RELAY_ERROR_ROOM_WITH_ORI | 跨房房间与原用户房间相同 |
HRTC_MULTI_ROOM_MEDIA_RELAY_ERROR_ROOM_REPEAT | 跨房请求房间重复 |
HRTC_MULTI_ROOM_MEDIA_RELAY_ERROR_ROOM_USER_EXISTED | 跨房用户已存在 |
HRTC_MULTI_ROOM_MEDIA_RELAY_ERROR_INVALID_REQUEST | 无效请求 |
HRTC_MULTI_ROOM_MEDIA_RELAY_ERROR_ROOM_IS_NOT_EXIST | 房间不存在 |
HRTC_MULTI_ROOM_MEDIA_RELAY_ERROR_FRAME_TYPE_NOT_EQUAL | 跨房源房间和目的房间加密模式不一致 |
HRTC_MULTI_ROOM_MEDIA_RELAY_ERROR_AUTHENTICATION_FAILURE | 鉴权失败 |
HRTC_MULTI_ROOM_MEDIA_RELAY_ERROR_REMOVE_INFO_NOT_EXIST | 退出跨房信息不存在 |
HRTC_MULTI_ROOM_MEDIA_RELAY_ERROR_EXCEPTION_STOP | 异常退出跨房 |

