Commit 872d336dedb501f83e403dfb43f590ce3bc5e4cb

Authored by 648540858
Committed by GitHub
2 parents 658bec3e e0eb295a

Merge pull request #29 from lawrencehj/wvp-28181-2.0

Wvp 28181 2.0
... ... @@ -131,7 +131,7 @@
131 131 <artifactId>jain-sip-ri</artifactId>
132 132 <version>1.3.0-92</version>
133 133 <scope>system</scope>
134   - <systemPath>${project.basedir}/libs/jain-sip-ri-1.3.0-92.jar</systemPath>
  134 + <systemPath>${pom.basedir}/libs/jain-sip-ri-1.3.0-92.jar</systemPath>
135 135 </dependency>
136 136 <dependency>
137 137 <groupId>log4j</groupId>
... ... @@ -141,7 +141,7 @@
141 141  
142 142 <!-- xml解析库 -->
143 143 <dependency>
144   - <groupId>org.dom4j</groupId>
  144 + <groupId>org.dom4j</groupId>
145 145 <artifactId>dom4j</artifactId>
146 146 <version>2.1.3</version>
147 147 </dependency>
... ...
src/main/java/com/genersoft/iot/vmp/VManageBootstrap.java
... ... @@ -8,7 +8,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
8 8  
9 9 @SpringBootApplication
10 10 public class VManageBootstrap extends LogManager {
11   - public static void main(String[] args) {
  11 + public static void main(String[] args) {
12 12 SpringApplication.run(VManageBootstrap.class, args);
13 13 }
14 14 }
... ...
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommander.java
... ... @@ -185,11 +185,11 @@ public class SIPCommander implements ISIPCommander {
185 185 /**
186 186 * 云台指令码计算
187 187 *
188   - * @param cmdCode 指令码
189   - * @param parameter1 数据1
190   - * @param parameter2 数据2
191   - * @param combineCode2 组合码2
192   - */
  188 + * @param cmdCode 指令码
  189 + * @param parameter1 数据1
  190 + * @param parameter2 数据2
  191 + * @param combineCode2 组合码2
  192 + */
193 193 public static String frontEndCmdString(int cmdCode, int parameter1, int parameter2, int combineCode2) {
194 194 StringBuilder builder = new StringBuilder("A50F01");
195 195 String strTmp;
... ... @@ -211,13 +211,13 @@ public class SIPCommander implements ISIPCommander {
211 211 /**
212 212 * 云台控制,支持方向与缩放控制
213 213 *
214   - * @param device 控制设备
215   - * @param channelId 预览通道
216   - * @param leftRight 镜头左移右移 0:停止 1:左移 2:右移
217   - * @param upDown 镜头上移下移 0:停止 1:上移 2:下移
218   - * @param inOut 镜头放大缩小 0:停止 1:缩小 2:放大
219   - * @param moveSpeed 镜头移动速度
220   - * @param zoomSpeed 镜头缩放速度
  214 + * @param device 控制设备
  215 + * @param channelId 预览通道
  216 + * @param leftRight 镜头左移右移 0:停止 1:左移 2:右移
  217 + * @param upDown 镜头上移下移 0:停止 1:上移 2:下移
  218 + * @param inOut 镜头放大缩小 0:停止 1:缩小 2:放大
  219 + * @param moveSpeed 镜头移动速度
  220 + * @param zoomSpeed 镜头缩放速度
221 221 */
222 222 @Override
223 223 public boolean ptzCmd(Device device, String channelId, int leftRight, int upDown, int inOut, int moveSpeed,
... ... @@ -333,13 +333,14 @@ public class SIPCommander implements ISIPCommander {
333 333  
334 334 if (seniorSdp) {
335 335 if("TCP-PASSIVE".equals(streamMode)) {
336   - content.append("m=video "+ mediaPort +" TCP/RTP/AVP 126 125 99 34 98 97 96\r\n");
  336 + content.append("m=video "+ mediaPort +" TCP/RTP/AVP 96 126 125 99 34 98 97\r\n");
337 337 }else if ("TCP-ACTIVE".equals(streamMode)) {
338   - content.append("m=video "+ mediaPort +" TCP/RTP/AVP 126 125 99 34 98 97 96\r\n");
  338 + content.append("m=video "+ mediaPort +" TCP/RTP/AVP 96 126 125 99 34 98 97\r\n");
339 339 }else if("UDP".equals(streamMode)) {
340   - content.append("m=video "+ mediaPort +" RTP/AVP 126 125 99 34 98 97 96\r\n");
  340 + content.append("m=video "+ mediaPort +" RTP/AVP 96 126 125 99 34 98 97\r\n");
341 341 }
342 342 content.append("a=recvonly\r\n");
  343 + content.append("a=rtpmap:96 PS/90000\r\n");
343 344 content.append("a=fmtp:126 profile-level-id=42e01e\r\n");
344 345 content.append("a=rtpmap:126 H264/90000\r\n");
345 346 content.append("a=rtpmap:125 H264S/90000\r\n");
... ... @@ -348,7 +349,6 @@ public class SIPCommander implements ISIPCommander {
348 349 content.append("a=fmtp:99 profile-level-id=3\r\n");
349 350 content.append("a=rtpmap:98 H264/90000\r\n");
350 351 content.append("a=rtpmap:97 MPEG4/90000\r\n");
351   - content.append("a=rtpmap:96 PS/90000\r\n");
352 352 if("TCP-PASSIVE".equals(streamMode)){ // tcp被动模式
353 353 content.append("a=setup:passive\r\n");
354 354 content.append("a=connection:new\r\n");
... ... @@ -387,9 +387,6 @@ public class SIPCommander implements ISIPCommander {
387 387  
388 388 content.append("y="+ssrc+"\r\n");//ssrc
389 389  
390   -// String fromTag = UUID.randomUUID().toString();
391   -// Request request = headerProvider.createInviteRequest(device, channelId, content.toString(), null, fromTag, null, ssrc);
392   -
393 390 Request request = headerProvider.createInviteRequest(device, channelId, content.toString(), null, "live", null, ssrc);
394 391  
395 392 ClientTransaction transaction = transmitRequest(device, request, errorEvent);
... ... @@ -416,12 +413,15 @@ public class SIPCommander implements ISIPCommander {
416 413 try {
417 414 MediaServerConfig mediaInfo = redisCatchStorage.getMediaInfo();
418 415 String ssrc = null;
  416 + String streamId = null;
419 417 if (rtpEnable) {
420 418 ssrc = String.format("gb_playback_%s_%s", device.getDeviceId(), channelId);
  419 + streamId = ssrc;
421 420 }else {
422 421 ssrc = streamSession.createPlayBackSsrc();
  422 + streamId = String.format("%08x", Integer.parseInt(ssrc)).toUpperCase();
423 423 }
424   - String streamId = String.format("%08x", Integer.parseInt(ssrc)).toUpperCase();
  424 +
425 425 // 添加订阅
426 426 JSONObject subscribeKey = new JSONObject();
427 427 subscribeKey.put("app", "rtp");
... ... @@ -429,7 +429,6 @@ public class SIPCommander implements ISIPCommander {
429 429  
430 430 subscribe.addSubscribe(ZLMHttpHookSubscribe.HookType.on_publish, subscribeKey, event);
431 431  
432   - //
433 432 StringBuffer content = new StringBuffer(200);
434 433 content.append("v=0\r\n");
435 434 content.append("o="+sipConfig.getSipId()+" 0 0 IN IP4 "+sipConfig.getSipIp()+"\r\n");
... ... @@ -449,13 +448,14 @@ public class SIPCommander implements ISIPCommander {
449 448  
450 449 if (seniorSdp) {
451 450 if("TCP-PASSIVE".equals(streamMode)) {
452   - content.append("m=video "+ mediaPort +" TCP/RTP/AVP 126 125 99 34 98 97 96\r\n");
  451 + content.append("m=video "+ mediaPort +" TCP/RTP/AVP 96 126 125 99 34 98 97\r\n");
453 452 }else if ("TCP-ACTIVE".equals(streamMode)) {
454   - content.append("m=video "+ mediaPort +" TCP/RTP/AVP 126 125 99 34 98 97 96\r\n");
  453 + content.append("m=video "+ mediaPort +" TCP/RTP/AVP 96 126 125 99 34 98 97\r\n");
455 454 }else if("UDP".equals(streamMode)) {
456   - content.append("m=video "+ mediaPort +" RTP/AVP 126 125 99 34 98 97 96\r\n");
  455 + content.append("m=video "+ mediaPort +" RTP/AVP 96 126 125 99 34 98 97\r\n");
457 456 }
458 457 content.append("a=recvonly\r\n");
  458 + content.append("a=rtpmap:96 PS/90000\r\n");
459 459 content.append("a=fmtp:126 profile-level-id=42e01e\r\n");
460 460 content.append("a=rtpmap:126 H264/90000\r\n");
461 461 content.append("a=rtpmap:125 H264S/90000\r\n");
... ... @@ -464,7 +464,6 @@ public class SIPCommander implements ISIPCommander {
464 464 content.append("a=fmtp:99 profile-level-id=3\r\n");
465 465 content.append("a=rtpmap:98 H264/90000\r\n");
466 466 content.append("a=rtpmap:97 MPEG4/90000\r\n");
467   - content.append("a=rtpmap:96 PS/90000\r\n");
468 467 if("TCP-PASSIVE".equals(streamMode)){ // tcp被动模式
469 468 content.append("a=setup:passive\r\n");
470 469 content.append("a=connection:new\r\n");
... ... @@ -533,9 +532,6 @@ public class SIPCommander implements ISIPCommander {
533 532 if (dialog == null) {
534 533 return;
535 534 }
536   -
537   -
538   -
539 535 Request byeRequest = dialog.createRequest(Request.BYE);
540 536 SipURI byeURI = (SipURI) byeRequest.getRequestURI();
541 537 String vh = transaction.getRequest().getHeader(ViaHeader.NAME).toString();
... ...
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/request/impl/MessageRequestProcessor.java
... ... @@ -297,7 +297,7 @@ public class MessageRequestProcessor extends SIPRequestAbstractProcessor {
297 297 device.setStreamMode("UDP");
298 298 }
299 299 storager.updateDevice(device);
300   - cmder.catalogQuery(device, null);
  300 + //cmder.catalogQuery(device, null);
301 301 // 回复200 OK
302 302 responseAck(evt);
303 303 if (offLineDetector.isOnline(deviceId)) {
... ...
src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceChannelMapper.java
... ... @@ -21,15 +21,6 @@ public interface DeviceChannelMapper {
21 21 "'${ipAddress}', ${port}, '${password}', ${PTZType}, ${status})")
22 22 int add(DeviceChannel channel);
23 23  
24   -// @Update("UPDATE device_channel " +
25   -// "SET name=#{name}, manufacture=#{manufacture}, model=#{model}, owner=#{owner}, civilCode=#{civilCode}, " +
26   -// "block=#{block}, address=#{address}, parental=#{parental}, parentId=#{parentId}, safetyWay=#{safetyWay}, " +
27   -// "registerWay=#{registerWay}, certNum=#{certNum}, certifiable=#{certifiable}, errCode=#{errCode}, secrecy=#{secrecy}, " +
28   -// "ipAddress=#{ipAddress}, port=#{port}, password=#{password}, PTZType=#{PTZType}, status=#{status}, streamId=#{streamId}, " +
29   -// "hasAudio=#{hasAudio}" +
30   -// "WHERE deviceId=#{deviceId} AND channelId=#{channelId}")
31   -
32   -
33 24 @Update(value = {" <script>" +
34 25 "UPDATE device_channel " +
35 26 "SET deviceId='${deviceId}'" +
... ...
src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceMapper.java
... ... @@ -44,7 +44,6 @@ public interface DeviceMapper {
44 44 ")")
45 45 int add(Device device);
46 46  
47   -
48 47 @Update(value = {" <script>" +
49 48 "UPDATE device " +
50 49 "SET deviceId='${deviceId}'" +
... ...
src/main/java/com/genersoft/iot/vmp/vmanager/play/PlayController.java
... ... @@ -169,7 +169,6 @@ public class PlayController {
169 169 // 超时处理
170 170 result.onTimeout(()->{
171 171 logger.warn(String.format("设备预览/回放停止超时,streamId:%s ", streamId));
172   -
173 172 RequestMessage msg = new RequestMessage();
174 173 msg.setId(DeferredResultHolder.CALLBACK_CMD_STOP + uuid);
175 174 msg.setData("Timeout");
... ...
web_src/src/components/channelList.vue
... ... @@ -46,8 +46,8 @@
46 46 <el-table-column label="状态" width="180" align="center">
47 47 <template slot-scope="scope">
48 48 <div slot="reference" class="name-wrapper">
49   - <el-tag size="medium" v-if="scope.row.status == 1">在线</el-tag>
50   - <el-tag size="medium" type="info" v-if="scope.row.status == 0">离线</el-tag>
  49 + <el-tag size="medium" v-if="scope.row.status == 1">开启</el-tag>
  50 + <el-tag size="medium" type="info" v-if="scope.row.status == 0">关闭</el-tag>
51 51 </div>
52 52 </template>
53 53 </el-table-column>
... ... @@ -101,7 +101,7 @@ export default {
101 101 total: 0,
102 102 beforeUrl: "/videoList",
103 103 isLoging: false,
104   - autoList: false
  104 + autoList: true
105 105 };
106 106 },
107 107  
... ... @@ -181,7 +181,7 @@ export default {
181 181  
182 182 //通知设备上传媒体流
183 183 sendDevicePush: function (itemData) {
184   - console.log(itemData)
  184 + console.log(itemData);
185 185 let deviceId = this.deviceId;
186 186 this.isLoging = true;
187 187 let channelId = itemData.channelId;
... ...
web_src/src/components/gb28181/devicePlayer.vue
... ... @@ -67,7 +67,7 @@
67 67 <div style="position: absolute; left: 7.25rem; top: 1.25rem" @mousedown="ptzCamera(0, 0, 1)" @mouseup="ptzCamera(0, 0, 0)"><i class="el-icon-zoom-in control-zoom-btn" style="font-size: 1.875rem;"></i></div>
68 68 <div style="position: absolute; left: 7.25rem; top: 3.25rem; font-size: 1.875rem;" @mousedown="ptzCamera(0, 0, 2)" @mouseup="ptzCamera(0, 0, 0)"><i class="el-icon-zoom-out control-zoom-btn"></i></div>
69 69 <div class="contro-speed" style="position: absolute; left: 4px; top: 7rem; width: 9rem;">
70   - <el-slider v-model="controSpeed"></el-slider>
  70 + <el-slider v-model="controSpeed" :max="255"></el-slider>
71 71 </div>
72 72 </div>
73 73  
... ...
web_src/src/components/platformEdit.vue
... ... @@ -250,7 +250,7 @@ export default {
250 250 </script>
251 251  
252 252 <style>
253   -.control-wrapper {
  253 +.control-wrapper-not-used {
254 254 position: relative;
255 255 width: 6.25rem;
256 256 height: 6.25rem;
... ...
web_src/src/components/videoList.vue
... ... @@ -52,7 +52,7 @@
52 52 <el-table-column label="操作" width="240" align="center" fixed="right">
53 53 <template slot-scope="scope">
54 54 <el-button size="mini" :ref="scope.row.deviceId + 'refbtn' " icon="el-icon-refresh" @click="refDevice(scope.row)">刷新通道</el-button>
55   - <el-button size="mini" icon="el-icon-s-open" type="primary" @click="showChannelList(scope.row)">查看通道</el-button>
  55 + <el-button size="mini" icon="el-icon-s-open" v-bind:disabled="scope.row.online==0" type="primary" @click="showChannelList(scope.row)">查看通道</el-button>
56 56 </template>
57 57 </el-table-column>
58 58 </el-table>
... ...
web_src/src/router/index.js
... ... @@ -35,7 +35,7 @@ export default new VueRouter({
35 35 path: '/channelList/:deviceId/:parentChannelId/:count/:page',
36 36 name: 'channelList',
37 37 component: channelList,
38   - },,
  38 + },
39 39 {
40 40 path: '/parentPlatformList/:count/:page',
41 41 name: 'parentPlatformList',
... ...