From 39c3274294bce4f9dd4a231d2a74ed379af8ee34 Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: 星期四, 25 四月 2024 17:53:24 +0800 Subject: [PATCH] 合并分支 --- src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMMediaNodeServerService.java | 20 ++++++++++++++++++-- 1 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMMediaNodeServerService.java b/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMMediaNodeServerService.java index 707ea01..74a6fce 100644 --- a/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMMediaNodeServerService.java +++ b/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMMediaNodeServerService.java @@ -131,7 +131,11 @@ param.put("ssrc", ssrc); } JSONObject jsonObject = zlmresTfulUtils.stopSendRtp(mediaInfo, param); - return (jsonObject != null && jsonObject.getInteger("code") == 0); + if (jsonObject == null || jsonObject.getInteger("code") != 0 ) { + logger.error("鍋滄鍙戞祦澶辫触: {}, 鍙傛暟锛歿}", jsonObject.getString("msg"), JSON.toJSONString(param)); + throw new ControllerException(jsonObject.getInteger("code"), jsonObject.getString("msg")); + } + return true; } @@ -316,11 +320,23 @@ if (timeout != null) { param.put("close_delay_ms", timeout); } + if (!sendRtpItem.isTcp()) { + // 寮�鍚痳tcp淇濇椿 + param.put("udp_rtcp_timeout", sendRtpItem.isRtcp()? "1":"0"); + } + if (!sendRtpItem.isTcpActive()) { + param.put("dst_url",sendRtpItem.getIp()); + param.put("dst_port", sendRtpItem.getPort()); + } JSONObject jsonObject = zlmServerFactory.startSendRtpPassive(mediaServer, param, null); if (jsonObject == null || jsonObject.getInteger("code") != 0 ) { + logger.error("鍚姩鐩戝惉TCP琚姩鎺ㄦ祦澶辫触: {}, 鍙傛暟锛歿}", jsonObject.getString("msg"), JSON.toJSONString(param)); throw new ControllerException(jsonObject.getInteger("code"), jsonObject.getString("msg")); } + logger.info("璋冪敤ZLM-TCP琚姩鎺ㄦ祦鎺ュ彛, 缁撴灉锛� {}", jsonObject); + logger.info("鍚姩鐩戝惉TCP琚姩鎺ㄦ祦鎴愬姛[ {}/{} ]锛寋}->{}:{}, " , sendRtpItem.getApp(), sendRtpItem.getStream(), + jsonObject.getString("local_port"), param.get("dst_url"), param.get("dst_port")); } @Override @@ -341,7 +357,7 @@ } param.put("dst_url", sendRtpItem.getIp()); param.put("dst_port", sendRtpItem.getPort()); - JSONObject jsonObject = zlmServerFactory.startSendRtpStream(mediaServer, param); + JSONObject jsonObject = zlmresTfulUtils.startSendRtp(mediaServer, param); if (jsonObject == null || jsonObject.getInteger("code") != 0 ) { throw new ControllerException(jsonObject.getInteger("code"), jsonObject.getString("msg")); } -- Gitblit v1.8.0