From 80f6ecc6174f271a94bcc2593ac7db41e9a4b178 Mon Sep 17 00:00:00 2001 From: Lawrence <1934378145@qq.com> Date: Mon, 11 Jan 2021 09:10:56 +0800 Subject: [PATCH 1/9] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=9C=AC=E5=9C=B0jar?= =?UTF-8?q?=E5=8C=85=E8=B7=AF=E5=BE=84=E6=8F=8F=E8=BF=B0=EF=BC=8C=E9=81=BF?= =?UTF-8?q?=E5=85=8Dmarven=E7=BC=96=E8=AF=91Warning?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 2f45a6d4..b3acceac 100644 --- a/pom.xml +++ b/pom.xml @@ -131,7 +131,7 @@ jain-sip-ri 1.3.0-92 system - ${project.basedir}/libs/jain-sip-ri-1.3.0-92.jar + ${pom.basedir}/libs/jain-sip-ri-1.3.0-92.jar log4j @@ -141,7 +141,7 @@ - org.dom4j + org.dom4j dom4j 2.1.3 From b0b924ee711030fc54ac5b4493aa27ac64897d5a Mon Sep 17 00:00:00 2001 From: Lawrence <1934378145@qq.com> Date: Mon, 11 Jan 2021 09:11:56 +0800 Subject: [PATCH 2/9] =?UTF-8?q?=E7=A6=BB=E7=BA=BF=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E7=A6=81=E7=94=A8=E9=80=9A=E9=81=93=E6=9F=A5=E7=9C=8B=EF=BC=8C?= =?UTF-8?q?=E9=81=BF=E5=85=8D=E5=90=8E=E7=BB=AD=E6=97=A0=E6=95=88=E6=93=8D?= =?UTF-8?q?=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web_src/src/components/videoList.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web_src/src/components/videoList.vue b/web_src/src/components/videoList.vue index 46b4aacf..002a5813 100644 --- a/web_src/src/components/videoList.vue +++ b/web_src/src/components/videoList.vue @@ -52,7 +52,7 @@ From a47a7ccb5475d288e64939fce5a0f35e55a9de53 Mon Sep 17 00:00:00 2001 From: Lawrence <1934378145@qq.com> Date: Mon, 11 Jan 2021 09:13:03 +0800 Subject: [PATCH 3/9] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E4=B8=AA=E5=88=AB?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web_src/src/components/gb28181/devicePlayer.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web_src/src/components/gb28181/devicePlayer.vue b/web_src/src/components/gb28181/devicePlayer.vue index ef82ae87..c99ce795 100644 --- a/web_src/src/components/gb28181/devicePlayer.vue +++ b/web_src/src/components/gb28181/devicePlayer.vue @@ -67,7 +67,7 @@
- +
From 42450af8853bb001e422392387b2c5da3de4ee89 Mon Sep 17 00:00:00 2001 From: Lawrence <1934378145@qq.com> Date: Mon, 11 Jan 2021 09:14:22 +0800 Subject: [PATCH 4/9] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=80=9A=E9=81=93?= =?UTF-8?q?=E5=9C=A8=E7=BA=BF/=E7=A6=BB=E7=BA=BF=E6=8F=8F=E8=BF=B0?= =?UTF-8?q?=EF=BC=8C=E9=81=BF=E5=85=8D=E6=AD=A7=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web_src/src/components/channelList.vue | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/web_src/src/components/channelList.vue b/web_src/src/components/channelList.vue index e221974b..a8392d09 100644 --- a/web_src/src/components/channelList.vue +++ b/web_src/src/components/channelList.vue @@ -44,8 +44,8 @@ @@ -99,14 +99,14 @@ export default { total: 0, beforeUrl: "/videoList", isLoging: false, - autoList: false + autoList: true }; }, mounted() { this.initData(); if (this.autoList) { - this.updateLooper = setInterval(this.initData, 1500); + this.updateLooper = setInterval(this.initData, 5000); } }, @@ -179,7 +179,7 @@ export default { //通知设备上传媒体流 sendDevicePush: function (itemData) { - console.log(itemData) + console.log(itemData); let deviceId = this.deviceId; this.isLoging = true; let channelId = itemData.channelId; From fb69312642e211c19855aeee096735a7a6270fcc Mon Sep 17 00:00:00 2001 From: Lawrence <1934378145@qq.com> Date: Mon, 11 Jan 2021 09:16:16 +0800 Subject: [PATCH 5/9] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E5=BD=95=E5=83=8F?= =?UTF-8?q?=E5=9B=9E=E6=94=BE=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../transmit/cmd/impl/SIPCommander.java | 70 +++++++++++-------- 1 file changed, 39 insertions(+), 31 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 dd6ac9d2..d3aceb10 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 @@ -77,6 +77,9 @@ public class SIPCommander implements ISIPCommander { @Value("${media.seniorSdp}") private boolean seniorSdp; + @Value("${media.autoApplyPlay}") + private boolean autoApplyPlay; + @Autowired private ZLMHttpHookSubscribe subscribe; @@ -182,11 +185,11 @@ public class SIPCommander implements ISIPCommander { /** * 云台指令码计算 * - * @param cmdCode 指令码 - * @param parameter1 数据1 - * @param parameter2 数据2 - * @param combineCode2 组合码2 - */ + * @param cmdCode 指令码 + * @param parameter1 数据1 + * @param parameter2 数据2 + * @param combineCode2 组合码2 + */ public static String frontEndCmdString(int cmdCode, int parameter1, int parameter2, int combineCode2) { StringBuilder builder = new StringBuilder("A50F01"); String strTmp; @@ -208,13 +211,13 @@ public class SIPCommander implements ISIPCommander { /** * 云台控制,支持方向与缩放控制 * - * @param device 控制设备 - * @param channelId 预览通道 - * @param leftRight 镜头左移右移 0:停止 1:左移 2:右移 - * @param upDown 镜头上移下移 0:停止 1:上移 2:下移 - * @param inOut 镜头放大缩小 0:停止 1:缩小 2:放大 - * @param moveSpeed 镜头移动速度 - * @param zoomSpeed 镜头缩放速度 + * @param device 控制设备 + * @param channelId 预览通道 + * @param leftRight 镜头左移右移 0:停止 1:左移 2:右移 + * @param upDown 镜头上移下移 0:停止 1:上移 2:下移 + * @param inOut 镜头放大缩小 0:停止 1:缩小 2:放大 + * @param moveSpeed 镜头移动速度 + * @param zoomSpeed 镜头缩放速度 */ @Override public boolean ptzCmd(Device device, String channelId, int leftRight, int upDown, int inOut, int moveSpeed, @@ -287,8 +290,12 @@ public class SIPCommander implements ISIPCommander { @Override public void playStreamCmd(Device device, String channelId, ZLMHttpHookSubscribe.Event event, SipSubscribe.Event errorEvent) { try { - - String ssrc = streamSession.createPlaySsrc(); + String ssrc = ""; + if (rtpEnable) { + ssrc = String.format("gb_play_%s_%s", device.getDeviceId(), channelId); + }else { + ssrc = streamSession.createPlaySsrc(); + } String streamId = null; if (rtpEnable) { streamId = String.format("gb_play_%s_%s", device.getDeviceId(), channelId); @@ -326,13 +333,14 @@ public class SIPCommander implements ISIPCommander { if (seniorSdp) { if("TCP-PASSIVE".equals(streamMode)) { - content.append("m=video "+ mediaPort +" TCP/RTP/AVP 126 125 99 34 98 97 96\r\n"); + content.append("m=video "+ mediaPort +" TCP/RTP/AVP 96 126 125 99 34 98 97\r\n"); }else if ("TCP-ACTIVE".equals(streamMode)) { - content.append("m=video "+ mediaPort +" TCP/RTP/AVP 126 125 99 34 98 97 96\r\n"); + content.append("m=video "+ mediaPort +" TCP/RTP/AVP 96 126 125 99 34 98 97\r\n"); }else if("UDP".equals(streamMode)) { - content.append("m=video "+ mediaPort +" RTP/AVP 126 125 99 34 98 97 96\r\n"); + content.append("m=video "+ mediaPort +" RTP/AVP 96 126 125 99 34 98 97\r\n"); } content.append("a=recvonly\r\n"); + content.append("a=rtpmap:96 PS/90000\r\n"); content.append("a=fmtp:126 profile-level-id=42e01e\r\n"); content.append("a=rtpmap:126 H264/90000\r\n"); content.append("a=rtpmap:125 H264S/90000\r\n"); @@ -341,7 +349,6 @@ public class SIPCommander implements ISIPCommander { content.append("a=fmtp:99 profile-level-id=3\r\n"); content.append("a=rtpmap:98 H264/90000\r\n"); content.append("a=rtpmap:97 MPEG4/90000\r\n"); - content.append("a=rtpmap:96 PS/90000\r\n"); if("TCP-PASSIVE".equals(streamMode)){ // tcp被动模式 content.append("a=setup:passive\r\n"); content.append("a=connection:new\r\n"); @@ -380,9 +387,6 @@ public class SIPCommander implements ISIPCommander { content.append("y="+ssrc+"\r\n");//ssrc -// String fromTag = UUID.randomUUID().toString(); -// Request request = headerProvider.createInviteRequest(device, channelId, content.toString(), null, fromTag, null, ssrc); - Request request = headerProvider.createInviteRequest(device, channelId, content.toString(), null, "live", null, ssrc); ClientTransaction transaction = transmitRequest(device, request, errorEvent); @@ -408,8 +412,16 @@ public class SIPCommander implements ISIPCommander { , SipSubscribe.Event errorEvent) { try { MediaServerConfig mediaInfo = redisCatchStorage.getMediaInfo(); - String ssrc = streamSession.createPlayBackSsrc(); - String streamId = String.format("%08x", Integer.parseInt(ssrc)).toUpperCase(); + String ssrc = null; + String streamId = null; + if (rtpEnable) { + ssrc = String.format("gb_playback_%s_%s", device.getDeviceId(), channelId); + streamId = ssrc; + }else { + ssrc = streamSession.createPlayBackSsrc(); + streamId = String.format("%08x", Integer.parseInt(ssrc)).toUpperCase(); + } + // 添加订阅 JSONObject subscribeKey = new JSONObject(); subscribeKey.put("app", "rtp"); @@ -417,7 +429,6 @@ public class SIPCommander implements ISIPCommander { subscribe.addSubscribe(ZLMHttpHookSubscribe.HookType.on_publish, subscribeKey, event); - // StringBuffer content = new StringBuffer(200); content.append("v=0\r\n"); content.append("o="+sipConfig.getSipId()+" 0 0 IN IP4 "+sipConfig.getSipIp()+"\r\n"); @@ -437,13 +448,14 @@ public class SIPCommander implements ISIPCommander { if (seniorSdp) { if("TCP-PASSIVE".equals(streamMode)) { - content.append("m=video "+ mediaPort +" TCP/RTP/AVP 126 125 99 34 98 97 96\r\n"); + content.append("m=video "+ mediaPort +" TCP/RTP/AVP 96 126 125 99 34 98 97\r\n"); }else if ("TCP-ACTIVE".equals(streamMode)) { - content.append("m=video "+ mediaPort +" TCP/RTP/AVP 126 125 99 34 98 97 96\r\n"); + content.append("m=video "+ mediaPort +" TCP/RTP/AVP 96 126 125 99 34 98 97\r\n"); }else if("UDP".equals(streamMode)) { - content.append("m=video "+ mediaPort +" RTP/AVP 126 125 99 34 98 97 96\r\n"); + content.append("m=video "+ mediaPort +" RTP/AVP 96 126 125 99 34 98 97\r\n"); } content.append("a=recvonly\r\n"); + content.append("a=rtpmap:96 PS/90000\r\n"); content.append("a=fmtp:126 profile-level-id=42e01e\r\n"); content.append("a=rtpmap:126 H264/90000\r\n"); content.append("a=rtpmap:125 H264S/90000\r\n"); @@ -452,7 +464,6 @@ public class SIPCommander implements ISIPCommander { content.append("a=fmtp:99 profile-level-id=3\r\n"); content.append("a=rtpmap:98 H264/90000\r\n"); content.append("a=rtpmap:97 MPEG4/90000\r\n"); - content.append("a=rtpmap:96 PS/90000\r\n"); if("TCP-PASSIVE".equals(streamMode)){ // tcp被动模式 content.append("a=setup:passive\r\n"); content.append("a=connection:new\r\n"); @@ -521,9 +532,6 @@ public class SIPCommander implements ISIPCommander { if (dialog == null) { return; } - - - Request byeRequest = dialog.createRequest(Request.BYE); SipURI byeURI = (SipURI) byeRequest.getRequestURI(); String vh = transaction.getRequest().getHeader(ViaHeader.NAME).toString(); From e739c379aed9975fa538048737e462b14e5d1776 Mon Sep 17 00:00:00 2001 From: Lawrence <1934378145@qq.com> Date: Mon, 11 Jan 2021 09:17:15 +0800 Subject: [PATCH 6/9] =?UTF-8?q?=E6=8A=A5=E8=AD=A6=E5=93=8D=E5=BA=94?= =?UTF-8?q?=E5=A4=84=E7=90=86=E5=8E=BB=E9=99=A4catalog=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gb28181/transmit/request/impl/MessageRequestProcessor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/request/impl/MessageRequestProcessor.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/request/impl/MessageRequestProcessor.java index cab4a9bb..aa2f2823 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/request/impl/MessageRequestProcessor.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/request/impl/MessageRequestProcessor.java @@ -297,7 +297,7 @@ public class MessageRequestProcessor extends SIPRequestAbstractProcessor { device.setStreamMode("UDP"); } storager.updateDevice(device); - cmder.catalogQuery(device, null); + //cmder.catalogQuery(device, null); // 回复200 OK responseAck(evt); if (offLineDetector.isOnline(deviceId)) { From 8801c7741bc0828425251327a62f6e20dada4132 Mon Sep 17 00:00:00 2001 From: Lawrence <1934378145@qq.com> Date: Mon, 11 Jan 2021 09:18:00 +0800 Subject: [PATCH 7/9] =?UTF-8?q?=E4=B8=8E2.0=E5=90=8C=E6=AD=A5=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../iot/vmp/storager/dao/DeviceChannelMapper.java | 9 --------- .../iot/vmp/vmanager/device/DeviceController.java | 7 ------- .../genersoft/iot/vmp/vmanager/play/PlayController.java | 1 - .../com/genersoft/iot/vmp/web/ApiStreamController.java | 2 -- 4 files changed, 19 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceChannelMapper.java b/src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceChannelMapper.java index 24a3f848..57dc96d6 100644 --- a/src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceChannelMapper.java +++ b/src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceChannelMapper.java @@ -19,15 +19,6 @@ public interface DeviceChannelMapper { "'${ipAddress}', ${port}, '${password}', ${PTZType}, ${status})") int add(DeviceChannel channel); -// @Update("UPDATE device_channel " + -// "SET name=#{name}, manufacture=#{manufacture}, model=#{model}, owner=#{owner}, civilCode=#{civilCode}, " + -// "block=#{block}, address=#{address}, parental=#{parental}, parentId=#{parentId}, safetyWay=#{safetyWay}, " + -// "registerWay=#{registerWay}, certNum=#{certNum}, certifiable=#{certifiable}, errCode=#{errCode}, secrecy=#{secrecy}, " + -// "ipAddress=#{ipAddress}, port=#{port}, password=#{password}, PTZType=#{PTZType}, status=#{status}, streamId=#{streamId}, " + -// "hasAudio=#{hasAudio}" + -// "WHERE deviceId=#{deviceId} AND channelId=#{channelId}") - - @Update(value = {"