函数 | |
int | init (KRtcCallback callback) |
void | Login (LoginParam param) |
void | Logout () |
int | renewToken (String token) |
void | JoinRoom (JoinRoomParam param) |
void | leaveRoom () |
void | replyCall (boolean answerOrHanup, String roomId) |
int | startLocalPreview (GLSurfaceView view) |
void | stopLocalPreview () |
int | setMirrorMode (GLSurfaceView displayWindowId, boolean mirror) |
void | publishMainVideoStream (int mediaIndex) |
void | publishDualVideoStream () |
void | publishAudioStream () |
void | setMainVideoStreamParam (MainVideoStreamParam param) |
void | setDualVideoStreamParam (DualVideoStreamParam param) |
void | subscribeStream (String userId, SubscribeStreamParam param, GLSurfaceView holder) |
void | updateStreamLayer (String userid, STREAM_TYPE type, int mediaIndex, int layerIndex) |
void | unpublishStream (STREAM_TYPE type, int mediaIndex) |
void | unsubscribeStream (String userid, STREAM_TYPE type, int mediaIndex) |
int | setPauseImage (ImageBuffer image) |
void | pausePublishStream (STREAM_TYPE type, int mediaIndex, boolean pauseOrResume) |
void | pauseSubscribeStream (String userId, STREAM_TYPE type, int mediaIndex, boolean pauseOrResume) |
void | requestKeyFrame (String userId, STREAM_TYPE type, int mediaIndex) |
void | enableAudioLevelIndication (int interval) |
int | sendVideoFrameData (STREAM_TYPE type, int mediaIndex, VideoFrameData data) |
int | sendAudioFrameData (AudioFrameData data) |
int | sendEncodedVideoData (STREAM_TYPE type, int mediaIndex, int layerIndex, EncodedVideoData data) |
void | enableLocalAudioCallback (boolean enable, int channelCount, int sampleRate) |
void | enableRemoteAudioCallback (boolean enable, int channelCount, int sampleRate) |
void | enableRemoteMixedAudioCallback (boolean enable, int channelCount, int sampleRate) |
void | setAudioDeviceCapability (AudioDeviceCapability micCapability) |
void | snapshotVideo (String userId, STREAM_TYPE type, int mediaIndex) |
void | setAudioControlPlayoutMute (boolean playoutMute) |
void | setAudioControlRecordMute (boolean recordMute) |
int | doDestroy () |
int | doDestroySubscribeView () |
KRtcClient是SDK的核心方法类,包括登录,入会,开启音视频。
int doDestroy | ( | ) |
销毁KrtcClient实例对象。
int doDestroySubscribeView | ( | ) |
销毁底层的窗口引用
void enableAudioLevelIndication | ( | int | interval | ) |
设置远端用户音频能量回调
interval | 音频能量回调间隔 |
void enableLocalAudioCallback | ( | boolean | enable, |
int | channelCount, | ||
int | sampleRate | ||
) |
启用或关闭本地采集音频回调(PCM格式)
enable | true:开启 false:关闭 |
channelCount | 1代表单声道,2代表双声道 |
sampleRate | 音频采样率 |
void enableRemoteAudioCallback | ( | boolean | enable, |
int | channelCount, | ||
int | sampleRate | ||
) |
启用或关闭远端每一路音频数据回调(PCM格式)
enable | true:开启 false:关闭 |
channelCount | 1代表单声道,2代表双声道 |
sampleRate | 音频采样率 |
void enableRemoteMixedAudioCallback | ( | boolean | enable, |
int | channelCount, | ||
int | sampleRate | ||
) |
启用或关闭远端混音后音频数据回调(PCM格式)
enable | true:开启 false:关闭 |
channelCount | 1代表单声道,2代表双声道 |
sampleRate | 音频采样率 |
int init | ( | KRtcCallback | callback | ) |
初始化回调函数实例
callback | 初始化回调接口,用于接收SDK的事件响应。 |
void JoinRoom | ( | JoinRoomParam | param | ) |
加入房间
param | 加入房间参数 |
void leaveRoom | ( | ) |
离开房间
void Login | ( | LoginParam | param | ) |
登录平台
param | 登录参数 |
void Logout | ( | ) |
登出平台
void pausePublishStream | ( | STREAM_TYPE | type, |
int | mediaIndex, | ||
boolean | pauseOrResume | ||
) |
暂停、恢复发布码流(只影响本地)
type | 码流类型 |
mediaIndex | 码流索引,音频和辅流填0即可 |
pauseOrResume | true:暂停 false:恢复 |
void pauseSubscribeStream | ( | String | userId, |
STREAM_TYPE | type, | ||
int | mediaIndex, | ||
boolean | pauseOrResume | ||
) |
暂停、恢复发布(将通知平台暂停发送码流)
userId | 远端用户id |
type | 码流类型 |
mediaIndex | 码流索引,音频和辅流填0即可 |
pauseOrResume | true:暂停 false:恢复 |
void publishAudioStream | ( | ) |
发布音频流
void publishDualVideoStream | ( | ) |
发布辅视频流
void publishMainVideoStream | ( | int | mediaIndex | ) |
发布主视频流
mediaIndex | 发布多条主流时每个视频源的索引号 |
int renewToken | ( | String | token | ) |
更新Token
token | 新的 Token |
void replyCall | ( | boolean | answerOrHanup, |
String | roomId | ||
) |
响应平台呼叫
answerOrHanup | true:应答 false:挂断 |
roomId | 房间id |
void requestKeyFrame | ( | String | userId, |
STREAM_TYPE | type, | ||
int | mediaIndex | ||
) |
手动请求关键帧
userId | 远端用户id |
type | 码流类型 |
mediaIndex | 码流索引,音频和辅流填0即可 |
int sendAudioFrameData | ( | AudioFrameData | data | ) |
发送音频数据
data | 音频帧数据(PCM格式) |
int sendEncodedVideoData | ( | STREAM_TYPE | type, |
int | mediaIndex, | ||
int | layerIndex, | ||
EncodedVideoData | data | ||
) |
发送编码后的视频数据
type | 码流类型 |
mediaIndex | 码流索引,音频和辅流填0即可 |
layerIndex | 分辨率层 |
data | 编码后的视频数据 |
int sendVideoFrameData | ( | STREAM_TYPE | type, |
int | mediaIndex, | ||
VideoFrameData | data | ||
) |
发送视频帧数据
type | 码流类型 |
mediaIndex | 码流索引,辅流填0即可 |
data | 帧数据(YUV420格式) |
void setAudioControlPlayoutMute | ( | boolean | playoutMute | ) |
设置终端静音状态
playoutMute | true为静音 |
void setAudioControlRecordMute | ( | boolean | recordMute | ) |
设置终端哑音状态
recordMute | true为哑音 |
void setAudioDeviceCapability | ( | AudioDeviceCapability | micCapability | ) |
设置音频设备能力
micCapability | 麦克风设备能力 |
void setDualVideoStreamParam | ( | DualVideoStreamParam | param | ) |
自定义辅视频流参数
param | 发布辅流参数 |
void setMainVideoStreamParam | ( | MainVideoStreamParam | param | ) |
自定义主视频流参数
param | 发布主流参数 |
int setMirrorMode | ( | GLSurfaceView | displayWindowId, |
boolean | mirror | ||
) |
设置预览图像时的镜像模式
displayWindowId | 回显窗口id |
mirror | true:镜像显示 false:取消镜像显示 |
int setPauseImage | ( | ImageBuffer | image | ) |
设置暂停发布主流时的静态图像(暂停流时远端将显示静态图像,不设置则远端显示黑屏)
image | 图像缓存(BGRA格式) |
void snapshotVideo | ( | String | userId, |
STREAM_TYPE | type, | ||
int | mediaIndex | ||
) |
设置截图事件的抽象接口
userId | 用户id |
type | 码流类型(主流,辅流,画面合成) |
mediaIndex | 视频源索引号 |
int startLocalPreview | ( | GLSurfaceView | view | ) |
开启本地预览
view | 需要渲染的窗口, |
void stopLocalPreview | ( | ) |
停止本地预览
void subscribeStream | ( | String | userId, |
SubscribeStreamParam | param, | ||
GLSurfaceView | holder | ||
) |
订阅远端用户码流
userId | 远端用户id 订阅合成器时无需此参数 |
param | 订阅流参数 |
holder | 本地回显窗口id,不需要可以设置为null |
void unpublishStream | ( | STREAM_TYPE | type, |
int | mediaIndex | ||
) |
停止发布码流
type | 码流类型 |
mediaIndex | 码流索引,音频及辅流填0即可 |
void unsubscribeStream | ( | String | userid, |
STREAM_TYPE | type, | ||
int | mediaIndex | ||
) |
取消订阅
userid | 远端用户id |
type | 码流类型 |
mediaIndex | 码流索引 |
void updateStreamLayer | ( | String | userid, |
STREAM_TYPE | type, | ||
int | mediaIndex, | ||
int | layerIndex | ||
) |
设置订阅码流的优选分辨率层
userid | 用户id |
type | 码流类型 |
mediaIndex | 码流索引 |
layerIndex | 分辨率层 |