关键类型定义

函数

 AudioFrameData (byte[] data, int dataSize, int channelCount, int sampleRate, int bitWidth)
 
 AudioLevelParam (String userId, byte level)
 
 AudioStatistics (double bitrate, double lossRate)
 
 DeviceInfo (String deviceName, String deviceId)
 
 DeviceList (int type, int count, List< DeviceInfo > devices)
 
 DualVideoStreamParam (int maxBitrate, int mediaIndex)
 
 EncodedVideoData (byte[] data, int dataSize, int width, int height, int frameId, long timestampMs, boolean isKeyFrame, int profile)
 
 ImageBuffer (byte[] buffer, int length, int width, int height)
 
 JoinRoomParam (String confE164, int bitrate)
 
 KRtcSdkInitParam (boolean customVideoCapture, boolean customVideoRender, boolean customAudioCapture, boolean customAudioPlayout, boolean customVideoEncode, boolean customVideoDecode)
 
 KRtcSdkLogParam (boolean enableLog, String logPath, LogCallback logCallback)
 
 LoginParam (String serverAddr, String userId, String token, String nickName)
 
 MainVideoStreamParam (int layerCount, RESOLUTION maxResolution, int maxFps, int bitrate, int mediaIndex)
 
 Statistics (int bytesSent, int bytesReceived, double bitrateSend, double bitrateRecv, double lossRateSend, double lossRateRecv)
 
 StreamParam (int type, int mediaIndex, int layerCount, int width, int height, int maxFps, int maxBitrate)
 
 SubscribeStreamParam (STREAM_TYPE type, int mediaIndex, int layerIndex)
 
 VideoCodecParam (int width, int height, int bitrate, int frameRate, int keyframeInterval, int profile)
 
 VideoFrameData (int width, int height, int strideY, int strideU, int strideV, byte[] dataY, byte[] dataU, byte[] dataV, long timestampMs)
 
 VideoStatistics (int width, int height, int frameRate, double bitrate, double lossRate, int freezeCount, int totalFreezesDuration)
 

详细描述

关键类型定义

函数说明

◆ AudioFrameData()

AudioFrameData ( byte[]  data,
int  dataSize,
int  channelCount,
int  sampleRate,
int  bitWidth 
)
参数
data音频数据
dataSize数据长度
channelCount声道数,目前为2
sampleRate采样频率,目前为48khz
bitWidth采样位宽,目前为16位

◆ AudioLevelParam()

AudioLevelParam ( String  userId,
byte  level 
)
参数
userId用户ID
level0~127

◆ AudioStatistics()

AudioStatistics ( double  bitrate,
double  lossRate 
)
参数
bitrate音频码率(bps)
lossRate丢包率()

◆ DeviceInfo()

DeviceInfo ( String  deviceName,
String  deviceId 
)
参数
deviceName设备名称
deviceId设备ID

◆ DeviceList()

DeviceList ( int  type,
int  count,
List< DeviceInfo >  devices 
)
参数
type设备类型
count设备数量
devices设备信息

◆ DualVideoStreamParam()

DualVideoStreamParam ( int  maxBitrate,
int  mediaIndex 
)
参数
maxBitrate最大比特率
mediaIndex发布多条流时每个视频源的索引号

◆ EncodedVideoData()

EncodedVideoData ( byte[]  data,
int  dataSize,
int  width,
int  height,
int  frameId,
long  timestampMs,
boolean  isKeyFrame,
int  profile 
)
参数
data已编码数据
dataSize数据长度(字节数)
width帧宽
height帧高
frameId帧ID
timestampMs采集/渲染时间(毫秒)
isKeyFrame是否关键帧(IDR帧)
profileH264画质级别

◆ ImageBuffer()

ImageBuffer ( byte[]  buffer,
int  length,
int  width,
int  height 
)
参数
buffer图像内容(BGRA)
length图像缓存大小
width图像宽
height图像高

◆ JoinRoomParam()

JoinRoomParam ( String  confE164,
int  bitrate 
)
参数
confE164房间id
bitrate呼叫码率 0表示使用默认值

◆ KRtcSdkInitParam()

KRtcSdkInitParam ( boolean  customVideoCapture,
boolean  customVideoRender,
boolean  customAudioCapture,
boolean  customAudioPlayout,
boolean  customVideoEncode,
boolean  customVideoDecode 
)
参数
customVideoCapture启用或关闭自定义视频采集
customVideoRender启用或关闭自定义视频渲染
customAudioCapture启用或关闭自定义音频采集,启用后需用户手动调用sendRecordVideoData发送音频帧,发送间隔必须为20ms
customAudioPlayout启用或关闭自定义音频输出
customVideoEncode启用或关闭自定义视频编码
customVideoDecode启用或关闭自定义视频解码

◆ KRtcSdkLogParam()

KRtcSdkLogParam ( boolean  enableLog,
String  logPath,
LogCallback  logCallback 
)
参数
enableLog是否开启Log功能
logPathlog路径,设nullptr表示不写入log文件
logCallbacklog回调,设nullptr不需要回调
注解
enableLog 为false,不打日志
enableLog 为true,logPath不为空,callback为空,JNI侧初始化android api的log,路径为logPath不为空,并设置JNI侧的log callback给c++
enableLog 为true,logPath为空,callback不为空,直接将用户的callback设置给c++,此时c++和jni的log都通过callback输出

◆ LoginParam()

LoginParam ( String  serverAddr,
String  userId,
String  token,
String  nickName 
)
参数
serverAddripv4, ipv6, domain name
userId用户id,匿名登录时填nullptr即可
tokentoken:appKey + userId + ExpiredTs + assignment
nickName用户别名

◆ MainVideoStreamParam()

MainVideoStreamParam ( int  layerCount,
RESOLUTION  maxResolution,
int  maxFps,
int  bitrate,
int  mediaIndex 
)
参数
layerCount同一条主流最多允许同时发送三层分辨率,双流仅允许发一层
maxResolution最高层分辨率,中低层分辨率为 maxResolution/2,maxResolution/4
maxFps最大FPS
bitrate最大比特率
mediaIndex发布多条主流时每个视频源的索引号

◆ Statistics()

Statistics ( int  bytesSent,
int  bytesReceived,
double  bitrateSend,
double  bitrateRecv,
double  lossRateSend,
double  lossRateRecv 
)
参数
bytesSent累计发送(Byte)
bytesReceived累计接收(Byte)
bitrateSend上行总码率(bps)
bitrateRecv下行总码率(bps)
lossRateSend上行总丢包率(%)
lossRateRecv下行总丢包率(%)

◆ StreamParam()

StreamParam ( int  type,
int  mediaIndex,
int  layerCount,
int  width,
int  height,
int  maxFps,
int  maxBitrate 
)
参数
type流类型
mediaIndex发布多条辅流时每个视频源的索引号
layerCount分辨率层数
width最大分辨率宽度
height最大分辨率高度
maxFps最大帧率
maxBitrate最大码率

◆ SubscribeStreamParam()

SubscribeStreamParam ( STREAM_TYPE  type,
int  mediaIndex,
int  layerIndex 
)
参数
type流类型
mediaIndex多流时每个视频源的索引号,音频填0即可
layerIndex订阅的分辨率层,辅流及音频填0即可

◆ VideoCodecParam()

VideoCodecParam ( int  width,
int  height,
int  bitrate,
int  frameRate,
int  keyframeInterval,
int  profile 
)
参数
width帧宽
height帧高
bitrate码率,kbps
frameRate帧率
keyframeInterval关键帧间隔
profileH264画质级别

◆ VideoFrameData()

VideoFrameData ( int  width,
int  height,
int  strideY,
int  strideU,
int  strideV,
byte[]  dataY,
byte[]  dataU,
byte[]  dataV,
long  timestampMs 
)
参数
width帧宽
height帧高
strideYY跨距
strideUU跨距
strideVV跨距
dataYY数据
dataUU数据
dataVV数据
timestampMs采集时间

◆ VideoStatistics()

VideoStatistics ( int  width,
int  height,
int  frameRate,
double  bitrate,
double  lossRate,
int  freezeCount,
int  totalFreezesDuration 
)
参数
width视频宽度
height视频高度
frameRate视频帧率(fps)
bitrate视频码率(bps)
lossRate丢包率()
freezeCount视频卡顿帧数
totalFreezesDuration视频卡顿时长