From a0537d74df5b9c8ee65dba7c4e5bc6da7fc3d031 Mon Sep 17 00:00:00 2001 From: mk1990 <37614016+mk1990@users.noreply.github.com> Date: 星期四, 28 四月 2022 16:32:09 +0800 Subject: [PATCH] Merge branch '648540858:wvp-28181-2.0' into wvp-28181-2.0 --- src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMRTPServerFactory.java | 14 ++++++++++---- 1 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMRTPServerFactory.java b/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMRTPServerFactory.java index 57afd93..cf8e006 100644 --- a/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMRTPServerFactory.java +++ b/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMRTPServerFactory.java @@ -81,14 +81,20 @@ return result; } - public int createRTPServer(MediaServerItem mediaServerItem, String streamId) { - - Map<String, Object> param = new HashMap<>(); + public int createRTPServer(MediaServerItem mediaServerItem, String streamId, int ssrc) { int result = -1; + // 鏌ヨ姝tp server 鏄惁宸茬粡瀛樺湪 + JSONObject rtpInfo = zlmresTfulUtils.getRtpInfo(mediaServerItem, streamId); + if (rtpInfo != null && rtpInfo.getInteger("code") == 0 && rtpInfo.getBoolean("exist")) { + result = rtpInfo.getInteger("local_port"); + return result; + } + Map<String, Object> param = new HashMap<>(); // 鎺ㄦ祦绔彛璁剧疆0鍒欎娇鐢ㄩ殢鏈虹鍙� param.put("enable_tcp", 1); param.put("stream_id", streamId); param.put("port", 0); + param.put("ssrc", ssrc); JSONObject openRtpServerResultJson = zlmresTfulUtils.openRtpServer(mediaServerItem, param); if (openRtpServerResultJson != null) { @@ -301,7 +307,7 @@ result= true; logger.info("鍋滄RTP鎺ㄦ祦鎴愬姛"); } else { - logger.error("RTP鎺ㄦ祦澶辫触: {}, 鍙傛暟锛歿}",jsonObject.getString("msg"),JSONObject.toJSON(param)); + logger.error("鍋滄RTP鎺ㄦ祦澶辫触: {}, 鍙傛暟锛歿}",jsonObject.getString("msg"),JSONObject.toJSON(param)); } return result; } -- Gitblit v1.8.0