1#ifndef __KRTCTYPEDEF_H__
2#define __KRTCTYPEDEF_H__
7#ifdef KDV_RTC_SDK_EXPORTS
8#define KDV_RTC_SDK_API __declspec(dllexport)
10#define KDV_RTC_SDK_API __declspec(dllimport)
13#ifdef KDV_RTC_SDK_EXPORTS
14#define KDV_RTC_SDK_API __attribute__((visibility("default")))
18#ifndef KDV_RTC_SDK_API
19#define KDV_RTC_SDK_API
43 typedef const char* userId;
47 typedef void (*onLog)(
const char* module, KRTC_LOG_LEVEL logLevel,
const char* log);
127 RESOLUTION_1920x1080,
147 STREAM_TYPE_MAIN_VIDEO,
197 H264_PROFILE_BASELINE,
248 const char* deviceName;
249 const char* deviceId;
259 enum CAMERA_CAPTURE_ORIENTATION
261 CAMERA_CAPTURE_ORIENTATION_0,
262 CAMERA_CAPTURE_ORIENTATION_90,
263 CAMERA_CAPTURE_ORIENTATION_180,
264 CAMERA_CAPTURE_ORIENTATION_270,
265 CAMERA_CAPTURE_ORIENTATION_SYSTEM,
301 typedef void (*onLocalVideoData)(
const char* deviceId,
VideoFrameData* data);
303 typedef void (*onLocalAudioData)(
const char* deviceId,
AudioFrameData* data);
305 typedef void (*onLocalAudioLevel)(
const char* deviceId, int8_t level);
312enum KRTC_CUSTOM_CALLBACK
314 KRTC_CUSTOM_CALLBACK_NONE = 0,
315 KRTC_CUSTOM_CALLBACK_SIMPLECONFINFO = 1,
316 KRTC_CUSTOM_CALLBACK_DELAYCONFITIME,
317 KRTC_CUSTOM_CALLBACK_TERMSTATUSLIST_NOTIFY,
318 KRTC_CUSTOM_CALLBACK_CONFINFO_IND,
319 KRTC_CUSTOM_CALLBACK_CONFWILLEND_IND,
321 KRTC_CUSTOM_CALLBACK_APPLYSPEAKER_RSP,
322 KRTC_CUSTOM_CALLBACK_APPLYSPEADER_IND,
323 KRTC_CUSTOM_CALLBACK_SPECSPEAKER_RSP,
324 KRTC_CUSTOM_CALLBACK_SPECSPEAKER_IND,
325 KRTC_CUSTOM_CALLBACK_INVITETERMINAL_ERROR,
326 KRTC_CUSTOM_CALLBACK_MAKETERMUTE_CMD,
327 KRTC_CUSTOM_CALLBACK_TRANSPARENTMSG_IND,
330typedef void(*ONCUSTOMIZEDCALLBACK)(KRTC_CUSTOM_CALLBACK emEvent,
const char* pszData,
unsigned int dwSize,
void* lpUser);
WINDOW_TYPE
Definition: KRtcTypeDef.h:101
STREAM_TYPE
Definition: KRtcTypeDef.h:146
@ WINDOW_TYPE_WINDOW
应用窗口
Definition: KRtcTypeDef.h:102
@ WINDOW_TYPE_SCREEN
屏幕
Definition: KRtcTypeDef.h:103
@ STREAM_TYPE_AUDIO
1< 辅流视频
Definition: KRtcTypeDef.h:149
@ STREAM_TYPE_MIX_AUDIO
3< 画面合成码流
Definition: KRtcTypeDef.h:151
@ STREAM_TYPE_DUAL_VIDEO
0< 主流视频
Definition: KRtcTypeDef.h:148
@ STREAM_TYPE_VMP
2< 音频
Definition: KRtcTypeDef.h:150
Definition: KRtcTypeDef.h:286
uint32_t channelCount
声道数
Definition: KRtcTypeDef.h:287
uint32_t sampleRate
采样率
Definition: KRtcTypeDef.h:288
Definition: KRtcTypeDef.h:187
uint32_t channelCount
声道数
Definition: KRtcTypeDef.h:190
uint32_t bitWidth
采样位宽
Definition: KRtcTypeDef.h:192
uint32_t sampleRate
采样频率
Definition: KRtcTypeDef.h:191
uint32_t dataSize
数据长度
Definition: KRtcTypeDef.h:189
uint8_t * data
音频数据
Definition: KRtcTypeDef.h:188
Definition: KRtcTypeDef.h:269
int8_t level
0~127
Definition: KRtcTypeDef.h:271
Definition: KRtcTypeDef.h:224
double lossRate
丢包率()
Definition: KRtcTypeDef.h:226
double bitrate
音频码率(bps)
Definition: KRtcTypeDef.h:225
Definition: KRtcTypeDef.h:94
const char * roomName
房间别名
Definition: KRtcTypeDef.h:96
uint32_t bitrate
房间码率
Definition: KRtcTypeDef.h:97
Definition: KRtcTypeDef.h:247
Definition: KRtcTypeDef.h:253
Definition: KRtcTypeDef.h:140
uint32_t maxBitrate
最大码率(bps)
Definition: KRtcTypeDef.h:141
uint32_t minBitrate
最小码率(bps)
Definition: KRtcTypeDef.h:142
Definition: KRtcTypeDef.h:201
H264_PROFILE profile
H264画质级别
Definition: KRtcTypeDef.h:209
uint32_t dataSize
数据长度(字节数)
Definition: KRtcTypeDef.h:203
uint8_t * data
已编码数据
Definition: KRtcTypeDef.h:202
uint32_t frameId
帧ID
Definition: KRtcTypeDef.h:206
uint32_t height
帧高
Definition: KRtcTypeDef.h:205
uint32_t width
帧宽
Definition: KRtcTypeDef.h:204
bool isKeyFrame
是否关键帧(IDR帧)
Definition: KRtcTypeDef.h:208
int64_t timestampMs
采集/渲染时间(毫秒)
Definition: KRtcTypeDef.h:207
Definition: KRtcTypeDef.h:107
const char * buffer
图像内容(BGRA)
Definition: KRtcTypeDef.h:108
uint32_t width
图像宽
Definition: KRtcTypeDef.h:110
uint32_t height
图像高
Definition: KRtcTypeDef.h:111
uint32_t length
图像缓存大小
Definition: KRtcTypeDef.h:109
Definition: KRtcTypeDef.h:87
const char * roomId
房间id
Definition: KRtcTypeDef.h:88
const char * roomPwd
房间密码
Definition: KRtcTypeDef.h:90
uint32_t bitrate
呼叫码率 0表示使用默认值,单位bps
Definition: KRtcTypeDef.h:89
Definition: KRtcTypeDef.h:58
bool customAudioCapture
启用或关闭自定义音频采集,启用后需用户手动调用sendRecordVideoData发送音频帧,发送间隔必须为20ms
Definition: KRtcTypeDef.h:61
bool customVideoDecode
启用或关闭自定义视频解码
Definition: KRtcTypeDef.h:64
bool customVideoCapture
启用或关闭自定义视频采集
Definition: KRtcTypeDef.h:59
bool customVideoEncode
启用或关闭自定义视频编码
Definition: KRtcTypeDef.h:63
bool customAudioPlayout
启用或关闭自定义音频输出
Definition: KRtcTypeDef.h:62
bool customVideoRender
启用或关闭自定义视频渲染
Definition: KRtcTypeDef.h:60
Definition: KRtcTypeDef.h:72
const char * logPath
log路径,设nullptr表示不写入log文件
Definition: KRtcTypeDef.h:74
onLog callback
log回调,设nullptr不需要回调
Definition: KRtcTypeDef.h:75
Definition: KRtcTypeDef.h:79
const char * nickName
用户别名(utf-8)
Definition: KRtcTypeDef.h:83
const char * serverAddr
ipv4, ipv6, domain name
Definition: KRtcTypeDef.h:80
userId id
用户id,匿名登录时填nullptr即可
Definition: KRtcTypeDef.h:81
const char * token
token:appKey + userId + ExpiredTs + assignment
Definition: KRtcTypeDef.h:82
Definition: KRtcTypeDef.h:131
uint8_t layerCount
同一条主流最多允许同时发送三层分辨率,双流仅允许发一层
Definition: KRtcTypeDef.h:132
uint32_t bitrate[3]
每层流的码率(bps),0 1 2 分别代表 低 中 高
Definition: KRtcTypeDef.h:135
RESOLUTION maxResolution
最高层分辨率,中低层分辨率为 maxResolution/2,maxResolution/4
Definition: KRtcTypeDef.h:133
uint8_t maxFps
最大帧率
Definition: KRtcTypeDef.h:134
uint8_t mediaIndex
发布多条主流时每个视频源的索引号
Definition: KRtcTypeDef.h:136
Definition: KRtcTypeDef.h:115
uint32_t * screenId
屏幕id
Definition: KRtcTypeDef.h:117
int32_t count
屏幕个数
Definition: KRtcTypeDef.h:116
Definition: KRtcTypeDef.h:230
uint32_t bytesReceived
累计接收(Byte)
Definition: KRtcTypeDef.h:232
double bitrateRecv
下行总码率(bps)
Definition: KRtcTypeDef.h:234
double lossRateSend
上行总丢包率(%)
Definition: KRtcTypeDef.h:235
uint32_t bytesSent
累计发送(Byte)
Definition: KRtcTypeDef.h:231
double bitrateSend
上行总码率(bps)
Definition: KRtcTypeDef.h:233
double lossRateRecv
下行总丢包率(%)
Definition: KRtcTypeDef.h:236
Definition: KRtcTypeDef.h:162
uint32_t maxBitrate
最大码率
Definition: KRtcTypeDef.h:169
uint8_t maxFps
最大帧率
Definition: KRtcTypeDef.h:168
uint8_t layerCount
分辨率层数
Definition: KRtcTypeDef.h:165
uint8_t mediaIndex
发布多条辅流时每个视频源的索引号
Definition: KRtcTypeDef.h:164
int32_t height
最大分辨率高度
Definition: KRtcTypeDef.h:167
int32_t width
最大分辨率宽度
Definition: KRtcTypeDef.h:166
Definition: KRtcTypeDef.h:155
uint8_t mediaIndex
多流时每个视频源的索引号,音频填0即可
Definition: KRtcTypeDef.h:157
uint8_t layerIndex
订阅的分辨率层,辅流及音频填0即可
Definition: KRtcTypeDef.h:158
Definition: KRtcTypeDef.h:293
uint8_t * data
采集数据
Definition: KRtcTypeDef.h:294
VIDEO_TYPE videoType
视频类型
Definition: KRtcTypeDef.h:298
int32_t width
帧宽
Definition: KRtcTypeDef.h:296
int32_t height
帧高
Definition: KRtcTypeDef.h:297
uint32_t dataSize
数据长度(字节数)
Definition: KRtcTypeDef.h:295
Definition: KRtcTypeDef.h:276
H264_PROFILE profile
H264画质级别
Definition: KRtcTypeDef.h:282
uint32_t bitrate
码率,kbps
Definition: KRtcTypeDef.h:279
uint32_t frameRate
帧率
Definition: KRtcTypeDef.h:280
uint32_t height
帧高
Definition: KRtcTypeDef.h:278
uint32_t width
帧宽
Definition: KRtcTypeDef.h:277
uint32_t keyframeInterval
关键帧间隔
Definition: KRtcTypeDef.h:281
Definition: KRtcTypeDef.h:174
uint8_t * dataU
U数据
Definition: KRtcTypeDef.h:181
uint8_t * dataY
Y数据
Definition: KRtcTypeDef.h:180
int32_t height
帧高
Definition: KRtcTypeDef.h:176
int32_t strideU
U跨距
Definition: KRtcTypeDef.h:178
int32_t width
帧宽
Definition: KRtcTypeDef.h:175
uint8_t * dataV
V数据
Definition: KRtcTypeDef.h:182
int32_t strideV
V跨距
Definition: KRtcTypeDef.h:179
int64_t timestampMs
采集时间
Definition: KRtcTypeDef.h:183
int32_t strideY
Y跨距
Definition: KRtcTypeDef.h:177
Definition: KRtcTypeDef.h:213
uint32_t width
视频宽度
Definition: KRtcTypeDef.h:214
uint32_t frameRate
视频帧率(fps)
Definition: KRtcTypeDef.h:216
uint32_t freezeCount
视频卡顿帧数
Definition: KRtcTypeDef.h:219
double lossRate
丢包率()
Definition: KRtcTypeDef.h:218
uint32_t totalFreezesDuration
视频卡顿时长
Definition: KRtcTypeDef.h:220
uint32_t height
视频高度
Definition: KRtcTypeDef.h:215
double bitrate
视频码率(bps)
Definition: KRtcTypeDef.h:217