From 9aa9b15b627d11837e4c4746f2894cc8bd335a55 Mon Sep 17 00:00:00 2001 From: panlinlin <648540858@qq.com> Date: Wed, 6 Jan 2021 10:01:28 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E7=9A=84=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../transmit/cmd/impl/SIPCommander.java | 39 +++++++------------ .../impl/VideoManagerStoragerImpl.java | 2 - 2 files changed, 14 insertions(+), 27 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommander.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommander.java index e1d474ff..5da4b8dd 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommander.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommander.java @@ -182,35 +182,24 @@ public class SIPCommander implements ISIPCommander { /** * 云台指令码计算 * - * @param leftRight 镜头左移右移 0:停止 1:左移 2:右移 - * @param upDown 镜头上移下移 0:停止 1:上移 2:下移 - * @param inOut 镜头放大缩小 0:停止 1:缩小 2:放大 - * @param moveSpeed 镜头移动速度 默认 0XFF (0-255) - * @param zoomSpeed 镜头缩放速度 默认 0X1 (0-255) + * @param cmdCode 指令码 + * @param parameter1 数据1 + * @param parameter2 数据2 + * @param combineCode2 组合码2 */ - - /** - * 云台指令码计算 - * - * @param cmdCode 指令码 - * @param horizonSpeed 水平移动速度 - * @param verticalSpeed 垂直移动速度 - * @param zoomSpeed 缩放速度 - * @return - */ - public static String frontEndCmdString(int cmdCode, int horizonSpeed, int verticalSpeed, int zoomSpeed) { + public static String frontEndCmdString(int cmdCode, int parameter1, int parameter2, int combineCode2) { StringBuilder builder = new StringBuilder("A50F01"); String strTmp; strTmp = String.format("%02X", cmdCode); builder.append(strTmp, 0, 2); - strTmp = String.format("%02X", horizonSpeed); + strTmp = String.format("%02X", parameter1); builder.append(strTmp, 0, 2); - strTmp = String.format("%02X", verticalSpeed); + strTmp = String.format("%02X", parameter2); builder.append(strTmp, 0, 2); - strTmp = String.format("%X", zoomSpeed); + strTmp = String.format("%X", combineCode2); builder.append(strTmp, 0, 1).append("0"); //计算校验码 - int checkCode = (0XA5 + 0X0F + 0X01 + cmdCode + horizonSpeed + verticalSpeed + (zoomSpeed & 0XF0)) % 0X100; + int checkCode = (0XA5 + 0X0F + 0X01 + cmdCode + parameter1 + parameter2 + (combineCode2 & 0XF0)) % 0X100; strTmp = String.format("%02X", checkCode); builder.append(strTmp, 0, 2); return builder.toString(); @@ -259,14 +248,14 @@ public class SIPCommander implements ISIPCommander { * @param device 控制设备 * @param channelId 预览通道 * @param cmdCode 指令码 - * @param horizonSpeed 水平移动速度 - * @param verticalSpeed 垂直移动速度 - * @param zoomSpeed 缩放速度 + * @param parameter1 数据1 + * @param parameter2 数据2 + * @param combineCode2 组合码2 */ @Override - public boolean frontEndCmd(Device device, String channelId, int cmdCode, int horizonSpeed, int verticalSpeed, int zoomSpeed) { + public boolean frontEndCmd(Device device, String channelId, int cmdCode, int parameter1, int parameter2, int combineCode2) { try { - String cmdStr= frontEndCmdString(cmdCode, horizonSpeed, verticalSpeed, zoomSpeed); + String cmdStr= frontEndCmdString(cmdCode, parameter1, parameter2, combineCode2); System.out.println("控制字符串:" + cmdStr); StringBuffer ptzXml = new StringBuffer(200); ptzXml.append("\r\n"); diff --git a/src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStoragerImpl.java b/src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStoragerImpl.java index 01ed247e..af05168c 100644 --- a/src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStoragerImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStoragerImpl.java @@ -102,8 +102,6 @@ public class VideoManagerStoragerImpl implements IVideoManagerStorager { return new PageInfo<>(all); } - - @Override public List queryChannelsByDeviceId(String deviceId) { return deviceChannelMapper.queryChannelsByDeviceId(deviceId, null,null, null, null); From 05960d357318a62ecfe1e9c29beafae2251c72a4 Mon Sep 17 00:00:00 2001 From: panlinlin <648540858@qq.com> Date: Thu, 7 Jan 2021 15:29:58 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=87=8D=E5=90=AFzlm?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=E7=9A=84=E7=82=B9=E6=92=AD=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java | 5 +++++ 1 file changed, 5 insertions(+) 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 cb8ad055..afd969ad 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.Autowired; 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; @@ -68,6 +69,9 @@ public class ZLMHttpHookListener { @Value("${media.ip}") private String mediaIp; + @Value("${media.wanIp}") + private String mediaWanIp; + @Value("${media.port}") private int mediaPort; @@ -358,6 +362,7 @@ public class ZLMHttpHookListener { // List 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