From 8b66abfbfc6c1da327d201223197faaf1e04a569 Mon Sep 17 00:00:00 2001 From: Lawrence <1934378145@qq.com> Date: 星期一, 11 一月 2021 20:40:54 +0800 Subject: [PATCH] 设备注册更新设备信息 --- src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java b/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java index cb8ad05..66ee1b0 100644 --- a/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java +++ b/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java @@ -21,6 +21,7 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; +import org.springframework.util.StringUtils; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; @@ -67,6 +68,9 @@ @Value("${media.ip}") private String mediaIp; + + @Value("${media.wanIp}") + private String mediaWanIp; @Value("${media.port}") private int mediaPort; @@ -257,6 +261,7 @@ if ("rtp".equals(app) && !regist ) { if (streamInfo!=null){ redisCatchStorage.stopPlay(streamInfo); + storager.stopPlay(streamInfo.getDeviceID(), streamInfo.getChannelId()); }else{ streamInfo = redisCatchStorage.queryPlaybackByStreamId(streamId); redisCatchStorage.stopPlayback(streamInfo); @@ -288,6 +293,7 @@ StreamInfo streamInfo = redisCatchStorage.queryPlayByStreamId(streamId); if (streamInfo!=null){ redisCatchStorage.stopPlay(streamInfo); + storager.stopPlay(streamInfo.getDeviceID(), streamInfo.getChannelId()); }else{ streamInfo = redisCatchStorage.queryPlaybackByStreamId(streamId); redisCatchStorage.stopPlayback(streamInfo); @@ -358,6 +364,7 @@ // List<MediaServerConfig> mediaServerConfigs = JSON.parseArray(JSON.toJSONString(json), MediaServerConfig.class); // MediaServerConfig mediaServerConfig = mediaServerConfigs.get(0); MediaServerConfig mediaServerConfig = JSON.toJavaObject(json, MediaServerConfig.class); + mediaServerConfig.setWanIp(StringUtils.isEmpty(mediaWanIp)? mediaIp: mediaWanIp); mediaServerConfig.setLocalIP(mediaIp); redisCatchStorage.updateMediaInfo(mediaServerConfig); // TODO Auto-generated method stub -- Gitblit v1.8.0