From f458c9b79334b88683044ae7ccaab29504700e73 Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: 星期三, 10 四月 2024 22:38:12 +0800 Subject: [PATCH] 优化代码调用 --- src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMServerFactory.java | 98 ------------------------------------------------- 1 files changed, 0 insertions(+), 98 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMServerFactory.java b/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMServerFactory.java index 1d150d5..3ba48d3 100755 --- a/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMServerFactory.java +++ b/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMServerFactory.java @@ -153,72 +153,6 @@ /** - * 鍒涘缓涓�涓浗鏍囨帹娴� - * @param ip 鎺ㄦ祦ip - * @param port 鎺ㄦ祦绔彛 - * @param ssrc 鎺ㄦ祦鍞竴鏍囪瘑 - * @param platformId 骞冲彴id - * @param channelId 閫氶亾id - * @param tcp 鏄惁涓簍cp - * @return SendRtpItem - */ - public SendRtpItem createSendRtpItem(MediaServer serverItem, String ip, int port, String ssrc, String platformId, - String deviceId, String channelId, boolean tcp, boolean rtcp){ - - int localPort = sendRtpPortManager.getNextPort(serverItem); - if (localPort == 0) { - return null; - } - SendRtpItem sendRtpItem = new SendRtpItem(); - sendRtpItem.setIp(ip); - sendRtpItem.setPort(port); - sendRtpItem.setSsrc(ssrc); - sendRtpItem.setPlatformId(platformId); - sendRtpItem.setDeviceId(deviceId); - sendRtpItem.setChannelId(channelId); - sendRtpItem.setTcp(tcp); - sendRtpItem.setRtcp(rtcp); - sendRtpItem.setApp("rtp"); - sendRtpItem.setLocalPort(localPort); - sendRtpItem.setServerId(userSetting.getServerId()); - sendRtpItem.setMediaServerId(serverItem.getId()); - return sendRtpItem; - } - - /** - * 鍒涘缓涓�涓洿鎾帹娴� - * @param ip 鎺ㄦ祦ip - * @param port 鎺ㄦ祦绔彛 - * @param ssrc 鎺ㄦ祦鍞竴鏍囪瘑 - * @param platformId 骞冲彴id - * @param channelId 閫氶亾id - * @param tcp 鏄惁涓簍cp - * @return SendRtpItem - */ - public SendRtpItem createSendRtpItem(MediaServer serverItem, String ip, int port, String ssrc, String platformId, - String app, String stream, String channelId, boolean tcp, boolean rtcp){ - - int localPort = sendRtpPortManager.getNextPort(serverItem); - if (localPort == 0) { - return null; - } - SendRtpItem sendRtpItem = new SendRtpItem(); - sendRtpItem.setIp(ip); - sendRtpItem.setPort(port); - sendRtpItem.setSsrc(ssrc); - sendRtpItem.setApp(app); - sendRtpItem.setStream(stream); - sendRtpItem.setPlatformId(platformId); - sendRtpItem.setChannelId(channelId); - sendRtpItem.setTcp(tcp); - sendRtpItem.setLocalPort(localPort); - sendRtpItem.setServerId(userSetting.getServerId()); - sendRtpItem.setMediaServerId(serverItem.getId()); - sendRtpItem.setRtcp(rtcp); - return sendRtpItem; - } - - /** * 璋冪敤zlm RESTFUL API 鈥斺�� startSendRtp */ public JSONObject startSendRtpStream(MediaServer mediaServerItem, Map<String, Object>param) { @@ -234,17 +168,6 @@ public JSONObject startSendRtpPassive(MediaServer mediaServerItem, Map<String, Object>param, ZLMRESTfulUtils.RequestCallback callback) { return zlmresTfulUtils.startSendRtpPassive(mediaServerItem, param, callback); - } - - /** - * 鏌ヨ寰呰浆鎺ㄧ殑娴佹槸鍚﹀氨缁� - */ - public Boolean isRtpReady(MediaServer mediaServerItem, String streamId) { - JSONObject mediaInfo = zlmresTfulUtils.getMediaInfo(mediaServerItem,"rtp", "rtsp", streamId); - if (mediaInfo.getInteger("code") == -2) { - return null; - } - return (mediaInfo.getInteger("code") == 0 && mediaInfo.getBoolean("online")); } /** @@ -280,27 +203,6 @@ return -1; } return mediaInfo.getInteger("totalReaderCount"); - } - - /** - * 璋冪敤zlm RESTful API 鈥斺�� stopSendRtp - */ - public Boolean stopSendRtpStream(MediaServer mediaServerItem, Map<String, Object>param) { - if (mediaServerItem == null) { - logger.error("[鍋滄RTP鎺ㄦ祦] 澶辫触: 濯掍綋鑺傜偣涓篘ULL"); - return false; - } - Boolean result = false; - JSONObject jsonObject = zlmresTfulUtils.stopSendRtp(mediaServerItem, param); - if (jsonObject == null) { - logger.error("[鍋滄RTP鎺ㄦ祦] 澶辫触: 璇锋鏌LM鏈嶅姟"); - } else if (jsonObject.getInteger("code") == 0) { - result= true; - logger.info("[鍋滄RTP鎺ㄦ祦] 鎴愬姛"); - } else { - logger.warn("[鍋滄RTP鎺ㄦ祦] 澶辫触: {}, 鍙傛暟锛歿}->\r\n{}",jsonObject.getString("msg"), JSON.toJSON(param), jsonObject); - } - return result; } public JSONObject startSendRtp(MediaServer mediaInfo, SendRtpItem sendRtpItem) { -- Gitblit v1.8.0