From 576feec514ff9cea054e17a43a097e36604431db Mon Sep 17 00:00:00 2001 From: lin <648540858@qq.com> Date: Mon, 15 Sep 2025 18:01:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=B4=E6=97=B6=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../iot/vmp/media/zlm/ZLMServerFactory.java | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 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 a2e61c102..b57563722 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 @@ -85,12 +85,12 @@ public class ZLMServerFactory { param.put("ssrc", ssrc); } - JSONObject openRtpServerResultJson = zlmresTfulUtils.openRtpServer(mediaServerItem, param); - if (openRtpServerResultJson != null) { - if (openRtpServerResultJson.getInteger("code") == 0) { - result= openRtpServerResultJson.getInteger("port"); + ZLMResult zlmResult = zlmresTfulUtils.openRtpServer(mediaServerItem, param); + if (zlmResult != null) { + if (zlmResult.getCode() == 0) { + result= zlmResult.getPort(); }else { - log.error("创建RTP Server 失败 {}: ", openRtpServerResultJson.getString("msg")); + log.error("创建RTP Server 失败 {}: ", zlmResult.getMsg()); } }else { // 检查ZLM状态 @@ -104,13 +104,12 @@ public class ZLMServerFactory { if (serverItem !=null){ Map param = new HashMap<>(); param.put("stream_id", streamId); - JSONObject jsonObject = zlmresTfulUtils.closeRtpServer(serverItem, param); - log.info("关闭RTP Server " + jsonObject); - if (jsonObject != null ) { - if (jsonObject.getInteger("code") == 0) { - result = jsonObject.getInteger("hit") >= 1; + ZLMResult zlmResult = zlmresTfulUtils.closeRtpServer(serverItem, param); + if (zlmResult != null ) { + if (zlmResult.getCode() == 0) { + result = zlmResult.getHit() >= 1; }else { - log.error("关闭RTP Server 失败: " + jsonObject.getString("msg")); + log.error("关闭RTP Server 失败: " + zlmResult.getMsg()); } }else { // 检查ZLM状态