Skip to content

Commit

Permalink
更新rtc模式通话和p2p通话接口
Browse files Browse the repository at this point in the history
Change-Id: I39867f63f902cf9004484bed2c8aafe6d7c29e71
  • Loading branch information
SundoggyNew committed May 8, 2023
1 parent 6745744 commit 5bfd312
Show file tree
Hide file tree
Showing 8 changed files with 575 additions and 273 deletions.
4 changes: 2 additions & 2 deletions sdk/video-advanced-app-android/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
需先通过 [云API]( https://github.com/tencentyun/iot-link-android/blob/video-v2.6.x/sdk/video-advanced-app-android/src/main/java/com/tencent/iot/video/link/service/VideoBaseService.kt#L197-L209) 获取到链接通话参数转换成RoomKey模型,RoomKey是TIoTCoreXP2PBridge中initWithRoomKey所需链接通话参数,
由于云API需要配置SecretId、SecretKey,该参数直接放在客户端,会有泄漏风险,故建议通过自建服务访问该API获取到链接通话参数,再将链接通话参数传进SDK。

#### com.tencent.iot.video.link.rtc.impl.TIoTCoreXP2PBridge
#### com.tencent.iot.video.link.rtc.impl.IoTVideoCloud

1、初始化 TIoTCoreXP2PBridge#startAppWith(Context context)

Expand Down Expand Up @@ -129,7 +129,7 @@

### iot-video-advanced-app-android SDK 回调callback 设计说明

com.tencent.iot.video.link.rtc.XP2PCallback 回调callback说明如下:
com.tencent.iot.video.link.rtc.IoTVideoCloudListener 回调callback说明如下:

| 回调接口 | 功能 |
| ----------------------- | ---------- |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import java.util.Map;

public interface XP2PCallback {
public interface IoTVideoCloudListener {

/**
* sdk内部发生了错误
Expand Down Expand Up @@ -55,6 +55,20 @@ public interface XP2PCallback {
*/
void onRecvCustomCmdMsg(String rtc_uid, String message);

/**
* 裸流接口使用方式 客户端拉取到的裸流数据对应 data 参数 谨慎!!! === 此接口切勿执行耗时操作,耗时操作请切换线程,切勿卡住当前线程
* @param id 用户标识
* @param data 裸流数据
*/
void getVideoPacketWithID(String id, byte[] data, int len);

/**
* 收到自定义消息的事件回调
* @param id 用户标识
* @param data 消息数据
*/
String reviceDeviceMsgWithID(String id, byte[] data);

/**
* SDK 开始渲染自己本地或远端用户的首帧画面
* @param rtc_uid 用户标识
Expand All @@ -63,4 +77,11 @@ public interface XP2PCallback {
*/
void onFirstVideoFrame(String rtc_uid, int width, int height);

/**
* sdk 事件消息,事件对应类型与意义详见 XP2PType 类型说明
* @param id 对端标识
* @param eventType XP2PType 类型说明
*/
void reviceEventMsgWithID(String id, int eventType);

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
package com.tencent.iot.video.link.rtc;

public class IoTVideoParams {
//设置p2p模式 必传参数xp2pinfo、productid、devicename
private String xp2pInfo;
private String productId;
private String deviceName;

//设置rtc模式 必传参数RTCParams
private RTCParams rtcParams;

public String getXp2pInfo() {
return xp2pInfo;
}

public void setXp2pInfo(String xp2pInfo) {
this.xp2pInfo = xp2pInfo;
}

public String getProductId() {
return productId;
}

public void setProductId(String productId) {
this.productId = productId;
}

public String getDeviceName() {
return deviceName;
}

public void setDeviceName(String deviceName) {
this.deviceName = deviceName;
}

public RTCParams getRtcParams() {
return rtcParams;
}

public void setRtcParams(RTCParams rtcParams) {
this.rtcParams = rtcParams;
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.tencent.iot.video.link.rtc

open class RoomKey {
open class RTCParams {
var SdkAppId = 0
var StrRoomId = ""
var callType = RTCCalling.TYPE_AUDIO_CALL
Expand Down
Loading

0 comments on commit 5bfd312

Please sign in to comment.