Commit 81f1b8ee25114452b3d8c86c6cbf8820f5689db3

Authored by 648540858
1 parent f10b458f

修复停止推流的参数组织方式

src/main/java/com/genersoft/iot/vmp/gb28181/event/platformNotRegister/PlatformNotRegisterEventLister.java
... ... @@ -64,23 +64,13 @@ public class PlatformNotRegisterEventLister implements ApplicationListener<Platf
64 64 logger.info("[ 平台未注册事件 ] 停止[ {} ]的所有推流size", sendRtpItems.size());
65 65 if (sendRtpItems != null && sendRtpItems.size() > 0) {
66 66 logger.info("[ 平台未注册事件 ] 停止[ {} ]的所有推流", event.getPlatformGbID());
67   - StringBuilder app = new StringBuilder();
68   - StringBuilder stream = new StringBuilder();
69 67 for (SendRtpItem sendRtpItem : sendRtpItems) {
70   - if (app.length() != 0) {
71   - app.append(",");
72   - }
73   - app.append(sendRtpItem.getApp());
74   - if (stream.length() != 0) {
75   - stream.append(",");
76   - }
77   - stream.append(sendRtpItem.getStreamId());
78 68 redisCatchStorage.deleteSendRTPServer(event.getPlatformGbID(), sendRtpItem.getChannelId(), null, null);
79 69 MediaServerItem mediaInfo = mediaServerService.getOne(sendRtpItem.getMediaServerId());
80 70 Map<String, Object> param = new HashMap<>();
81 71 param.put("vhost", "__defaultVhost__");
82   - param.put("app", app.toString());
83   - param.put("stream", stream.toString());
  72 + param.put("app", sendRtpItem.getApp());
  73 + param.put("stream", sendRtpItem.getStreamId());
84 74 zlmrtpServerFactory.stopSendRtpStream(mediaInfo, param);
85 75 }
86 76  
... ...
src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMRESTfulUtils.java
... ... @@ -269,6 +269,11 @@ public class ZLMRESTfulUtils {
269 269 param.put("url", url);
270 270 param.put("enable_hls", enable_hls?1:0);
271 271 param.put("enable_mp4", enable_mp4?1:0);
  272 + param.put("enable_rtmp", 1);
  273 + param.put("enable_fmp4", 1);
  274 + param.put("enable_audio", 1);
  275 + param.put("enable_rtsp", 1);
  276 + param.put("add_mute_audio", 1);
272 277 param.put("rtp_type", rtp_type);
273 278 return sendPost(mediaServerItem, "addStreamProxy",param, null);
274 279 }
... ...
src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMRTPServerFactory.java
... ... @@ -85,7 +85,7 @@ public class ZLMRTPServerFactory {
85 85 int result = -1;
86 86 // 查询此rtp server 是否已经存在
87 87 JSONObject rtpInfo = zlmresTfulUtils.getRtpInfo(mediaServerItem, streamId);
88   - if (rtpInfo.getInteger("code ") == 0 && rtpInfo.getBoolean("exist")) {
  88 + if (rtpInfo != null && rtpInfo.getInteger("code") == 0 && rtpInfo.getBoolean("exist")) {
89 89 result = rtpInfo.getInteger("local_port");
90 90 return result;
91 91 }
... ...