|
@@ -427,7 +427,7 @@ public class PlayServiceImpl implements IPlayService {
|
|
|
|
|
|
|
|
|
// 检查无法连接zlm的情况
|
|
|
- if (streamInfo != null) {
|
|
|
+ if (streamInfo != null && false) {
|
|
|
GBHookSubscribe.removeSubscribe(broadcastForInviteHook);
|
|
|
String streamId = streamInfo.getStream();
|
|
|
if (streamId == null){
|
|
@@ -480,26 +480,50 @@ public class PlayServiceImpl implements IPlayService {
|
|
|
streamInfo = null;
|
|
|
}
|
|
|
}
|
|
|
- SSRCInfo ssrcInfo;
|
|
|
if(streamInfo == null){
|
|
|
- String streamId = null;
|
|
|
- if (mediaServerItem.isRtpEnable()) {
|
|
|
- streamId = String.format("broadcast_%s", device.getDeviceId());
|
|
|
- }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ // rtp语音通道创建完成,开始发送broadcast
|
|
|
+ broadcastEventHandle(device,
|
|
|
+ (int code,String tipMsg)->{
|
|
|
+ if(code == 1){
|
|
|
+ WVPResult wvpResult = new WVPResult();
|
|
|
+ wvpResult.setCode(ErrorCode.ERROR100.getCode());
|
|
|
+ wvpResult.setMsg(tipMsg);
|
|
|
+ msg.setData(wvpResult);
|
|
|
+ // 回复之前所有的点播请求
|
|
|
+ resultHolder.invokeAllResult(msg);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ );
|
|
|
+
|
|
|
// 开始创建 rtp/tcp 推流通道
|
|
|
- logger.info("[语音广播] 尝试创建rtp语音推流通道");
|
|
|
- ssrcInfo = mediaServerService.startSendRtpServer(mediaServerItem, streamId, audioStreamId);
|
|
|
- logger.info(JSONObject.toJSONString(ssrcInfo));
|
|
|
+
|
|
|
|
|
|
// 注册subScript事件
|
|
|
GBHookSubscribe.addSubscribe(broadcastForInviteHook,(int code,JSONObject json)->{
|
|
|
- logger.info("[语音广播] 接收到设备invite信息___订阅事件触发");
|
|
|
+ logger.info("[语音广播] 接收到设备invite信息___订阅事件触发 JSONDATA: {}",json.toJSONString());
|
|
|
+ String streamId = null;
|
|
|
+ SSRCInfo ssrcInfo;
|
|
|
+ if (mediaServerItem.isRtpEnable()) {
|
|
|
+ streamId = String.format("broadcast_%s", device.getDeviceId());
|
|
|
+ }
|
|
|
+ logger.info("[语音广播] 尝试创建rtp语音推流通道");
|
|
|
+ ssrcInfo = mediaServerService.startSendRtpServer(mediaServerItem, streamId, audioStreamId,
|
|
|
+ json.getString("addr"),
|
|
|
+ json.getString("port"),
|
|
|
+ json.getString("ssrc")
|
|
|
+ );
|
|
|
+ logger.info(JSONObject.toJSONString(ssrcInfo));
|
|
|
+
|
|
|
+
|
|
|
resultHolder.invokeAllResult(msg);
|
|
|
WVPResult wvpResult = new WVPResult();
|
|
|
wvpResult.setCode(ErrorCode.SUCCESS.getCode());
|
|
|
wvpResult.setMsg("okokokokooo");
|
|
|
wvpResult.setData(ssrcInfo);
|
|
|
- logger.debug(json.toJSONString());
|
|
|
+
|
|
|
msg.setData(wvpResult);
|
|
|
resultHolder.invokeAllResult(msg);
|
|
|
// TODO: 2023/3/7 开始下发invite信息给设备
|
|
@@ -518,20 +542,6 @@ public class PlayServiceImpl implements IPlayService {
|
|
|
// errorEvent.response(eventResult);
|
|
|
}
|
|
|
});
|
|
|
-
|
|
|
- // rtp语音通道创建完成,开始发送broadcast
|
|
|
- broadcastEventHandle(device,
|
|
|
- (int code,String tipMsg)->{
|
|
|
- if(code == 1){
|
|
|
- WVPResult wvpResult = new WVPResult();
|
|
|
- wvpResult.setCode(ErrorCode.ERROR100.getCode());
|
|
|
- wvpResult.setMsg(tipMsg);
|
|
|
- msg.setData(wvpResult);
|
|
|
- // 回复之前所有的点播请求
|
|
|
- resultHolder.invokeAllResult(msg);
|
|
|
- }
|
|
|
- }
|
|
|
- );
|
|
|
}
|
|
|
|
|
|
|