From 6b03568c5dd128a3d71c02fb1a3a76a4344a4920 Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: 星期一, 21 十一月 2022 17:07:54 +0800 Subject: [PATCH] 优化rtcp判断 --- src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMRTPServerFactory.java | 29 ++++++----------------------- 1 files changed, 6 insertions(+), 23 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 bb0fa3d..4a6a94a 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 @@ -5,9 +5,9 @@ import com.alibaba.fastjson2.JSONObject; import com.genersoft.iot.vmp.conf.UserSetting; import com.genersoft.iot.vmp.gb28181.bean.SendRtpItem; -import com.genersoft.iot.vmp.media.zlm.dto.MediaItem; +import com.genersoft.iot.vmp.media.zlm.dto.HookSubscribeFactory; +import com.genersoft.iot.vmp.media.zlm.dto.HookSubscribeForRtpServerTimeout; import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem; -import com.genersoft.iot.vmp.media.zlm.dto.*; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -177,7 +177,7 @@ * @param tcp 鏄惁涓簍cp * @return SendRtpItem */ - public SendRtpItem createSendRtpItem(MediaServerItem serverItem, String ip, int port, String ssrc, String platformId, String deviceId, String channelId, boolean tcp){ + public SendRtpItem createSendRtpItem(MediaServerItem serverItem, String ip, int port, String ssrc, String platformId, String deviceId, String channelId, boolean tcp, boolean rtcp){ // 榛樿涓洪殢鏈虹鍙� int localPort = 0; @@ -197,6 +197,7 @@ sendRtpItem.setDeviceId(deviceId); sendRtpItem.setChannelId(channelId); sendRtpItem.setTcp(tcp); + sendRtpItem.setRtcp(rtcp); sendRtpItem.setApp("rtp"); sendRtpItem.setLocalPort(localPort); sendRtpItem.setServerId(userSetting.getServerId()); @@ -214,7 +215,7 @@ * @param tcp 鏄惁涓簍cp * @return SendRtpItem */ - public SendRtpItem createSendRtpItem(MediaServerItem serverItem, String ip, int port, String ssrc, String platformId, String app, String stream, String channelId, boolean tcp){ + public SendRtpItem createSendRtpItem(MediaServerItem serverItem, String ip, int port, String ssrc, String platformId, String app, String stream, String channelId, boolean tcp, boolean rtcp){ // 榛樿涓洪殢鏈虹鍙� int localPort = 0; if (userSetting.getGbSendStreamStrict()) { @@ -235,6 +236,7 @@ sendRtpItem.setLocalPort(localPort); sendRtpItem.setServerId(userSetting.getServerId()); sendRtpItem.setMediaServerId(serverItem.getId()); + sendRtpItem.setRtcp(rtcp); return sendRtpItem; } @@ -346,23 +348,4 @@ return result; } - public void closeAllSendRtpStream() { - - } - - public MediaItem getMediaInfo(MediaServerItem mediaServerItem, String app, String stream) { - JSONObject json = zlmresTfulUtils.getMediaList(mediaServerItem, app, stream); - MediaItem mediaItem = null; - if (json == null || json.getInteger("code") != 0) { - return null; - } else { - JSONArray data = json.getJSONArray("data"); - if (data == null || data.size() == 0) { - return null; - }else { - mediaItem = JSONObject.toJavaObject(data.getJSONObject(0), MediaItem.class); - } - } - return mediaItem; - } } -- Gitblit v1.8.0