Browse Source

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

Wvp 28181 2.0
pull/33/head
648540858 4 years ago
committed by GitHub
parent
commit
872d336ded
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      pom.xml
  2. 28
      src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommander.java
  3. 2
      src/main/java/com/genersoft/iot/vmp/gb28181/transmit/request/impl/MessageRequestProcessor.java
  4. 9
      src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceChannelMapper.java
  5. 1
      src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceMapper.java
  6. 1
      src/main/java/com/genersoft/iot/vmp/vmanager/play/PlayController.java
  7. 8
      web_src/src/components/channelList.vue
  8. 2
      web_src/src/components/gb28181/devicePlayer.vue
  9. 2
      web_src/src/components/platformEdit.vue
  10. 2
      web_src/src/components/videoList.vue
  11. 2
      web_src/src/router/index.js

2
pom.xml

@ -131,7 +131,7 @@
<artifactId>jain-sip-ri</artifactId> <artifactId>jain-sip-ri</artifactId>
<version>1.3.0-92</version> <version>1.3.0-92</version>
<scope>system</scope> <scope>system</scope>
<systemPath>${project.basedir}/libs/jain-sip-ri-1.3.0-92.jar</systemPath> <systemPath>${pom.basedir}/libs/jain-sip-ri-1.3.0-92.jar</systemPath>
</dependency> </dependency>
<dependency> <dependency>
<groupId>log4j</groupId> <groupId>log4j</groupId>

28
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommander.java

@ -333,13 +333,14 @@ public class SIPCommander implements ISIPCommander {
if (seniorSdp) { if (seniorSdp) {
if("TCP-PASSIVE".equals(streamMode)) { 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)) { }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)) { }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=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=fmtp:126 profile-level-id=42e01e\r\n");
content.append("a=rtpmap:126 H264/90000\r\n"); content.append("a=rtpmap:126 H264/90000\r\n");
content.append("a=rtpmap:125 H264S/90000\r\n"); content.append("a=rtpmap:125 H264S/90000\r\n");
@ -348,7 +349,6 @@ public class SIPCommander implements ISIPCommander {
content.append("a=fmtp:99 profile-level-id=3\r\n"); content.append("a=fmtp:99 profile-level-id=3\r\n");
content.append("a=rtpmap:98 H264/90000\r\n"); content.append("a=rtpmap:98 H264/90000\r\n");
content.append("a=rtpmap:97 MPEG4/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被动模式 if("TCP-PASSIVE".equals(streamMode)){ // tcp被动模式
content.append("a=setup:passive\r\n"); content.append("a=setup:passive\r\n");
content.append("a=connection:new\r\n"); content.append("a=connection:new\r\n");
@ -387,9 +387,6 @@ public class SIPCommander implements ISIPCommander {
content.append("y="+ssrc+"\r\n");//ssrc 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); Request request = headerProvider.createInviteRequest(device, channelId, content.toString(), null, "live", null, ssrc);
ClientTransaction transaction = transmitRequest(device, request, errorEvent); ClientTransaction transaction = transmitRequest(device, request, errorEvent);
@ -416,12 +413,15 @@ public class SIPCommander implements ISIPCommander {
try { try {
MediaServerConfig mediaInfo = redisCatchStorage.getMediaInfo(); MediaServerConfig mediaInfo = redisCatchStorage.getMediaInfo();
String ssrc = null; String ssrc = null;
String streamId = null;
if (rtpEnable) { if (rtpEnable) {
ssrc = String.format("gb_playback_%s_%s", device.getDeviceId(), channelId); ssrc = String.format("gb_playback_%s_%s", device.getDeviceId(), channelId);
streamId = ssrc;
}else { }else {
ssrc = streamSession.createPlayBackSsrc(); ssrc = streamSession.createPlayBackSsrc();
streamId = String.format("%08x", Integer.parseInt(ssrc)).toUpperCase();
} }
String streamId = String.format("%08x", Integer.parseInt(ssrc)).toUpperCase();
// 添加订阅 // 添加订阅
JSONObject subscribeKey = new JSONObject(); JSONObject subscribeKey = new JSONObject();
subscribeKey.put("app", "rtp"); subscribeKey.put("app", "rtp");
@ -429,7 +429,6 @@ public class SIPCommander implements ISIPCommander {
subscribe.addSubscribe(ZLMHttpHookSubscribe.HookType.on_publish, subscribeKey, event); subscribe.addSubscribe(ZLMHttpHookSubscribe.HookType.on_publish, subscribeKey, event);
//
StringBuffer content = new StringBuffer(200); StringBuffer content = new StringBuffer(200);
content.append("v=0\r\n"); content.append("v=0\r\n");
content.append("o="+sipConfig.getSipId()+" 0 0 IN IP4 "+sipConfig.getSipIp()+"\r\n"); content.append("o="+sipConfig.getSipId()+" 0 0 IN IP4 "+sipConfig.getSipIp()+"\r\n");
@ -449,13 +448,14 @@ public class SIPCommander implements ISIPCommander {
if (seniorSdp) { if (seniorSdp) {
if("TCP-PASSIVE".equals(streamMode)) { 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)) { }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)) { }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=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=fmtp:126 profile-level-id=42e01e\r\n");
content.append("a=rtpmap:126 H264/90000\r\n"); content.append("a=rtpmap:126 H264/90000\r\n");
content.append("a=rtpmap:125 H264S/90000\r\n"); content.append("a=rtpmap:125 H264S/90000\r\n");
@ -464,7 +464,6 @@ public class SIPCommander implements ISIPCommander {
content.append("a=fmtp:99 profile-level-id=3\r\n"); content.append("a=fmtp:99 profile-level-id=3\r\n");
content.append("a=rtpmap:98 H264/90000\r\n"); content.append("a=rtpmap:98 H264/90000\r\n");
content.append("a=rtpmap:97 MPEG4/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被动模式 if("TCP-PASSIVE".equals(streamMode)){ // tcp被动模式
content.append("a=setup:passive\r\n"); content.append("a=setup:passive\r\n");
content.append("a=connection:new\r\n"); content.append("a=connection:new\r\n");
@ -533,9 +532,6 @@ public class SIPCommander implements ISIPCommander {
if (dialog == null) { if (dialog == null) {
return; return;
} }
Request byeRequest = dialog.createRequest(Request.BYE); Request byeRequest = dialog.createRequest(Request.BYE);
SipURI byeURI = (SipURI) byeRequest.getRequestURI(); SipURI byeURI = (SipURI) byeRequest.getRequestURI();
String vh = transaction.getRequest().getHeader(ViaHeader.NAME).toString(); String vh = transaction.getRequest().getHeader(ViaHeader.NAME).toString();

2
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"); device.setStreamMode("UDP");
} }
storager.updateDevice(device); storager.updateDevice(device);
cmder.catalogQuery(device, null); //cmder.catalogQuery(device, null);
// 回复200 OK // 回复200 OK
responseAck(evt); responseAck(evt);
if (offLineDetector.isOnline(deviceId)) { if (offLineDetector.isOnline(deviceId)) {

9
src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceChannelMapper.java

@ -21,15 +21,6 @@ public interface DeviceChannelMapper {
"'${ipAddress}', ${port}, '${password}', ${PTZType}, ${status})") "'${ipAddress}', ${port}, '${password}', ${PTZType}, ${status})")
int add(DeviceChannel channel); 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 = {" <script>" + @Update(value = {" <script>" +
"UPDATE device_channel " + "UPDATE device_channel " +
"SET deviceId='${deviceId}'" + "SET deviceId='${deviceId}'" +

1
src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceMapper.java

@ -44,7 +44,6 @@ public interface DeviceMapper {
")") ")")
int add(Device device); int add(Device device);
@Update(value = {" <script>" + @Update(value = {" <script>" +
"UPDATE device " + "UPDATE device " +
"SET deviceId='${deviceId}'" + "SET deviceId='${deviceId}'" +

1
src/main/java/com/genersoft/iot/vmp/vmanager/play/PlayController.java

@ -169,7 +169,6 @@ public class PlayController {
// 超时处理 // 超时处理
result.onTimeout(()->{ result.onTimeout(()->{
logger.warn(String.format("设备预览/回放停止超时,streamId:%s ", streamId)); logger.warn(String.format("设备预览/回放停止超时,streamId:%s ", streamId));
RequestMessage msg = new RequestMessage(); RequestMessage msg = new RequestMessage();
msg.setId(DeferredResultHolder.CALLBACK_CMD_STOP + uuid); msg.setId(DeferredResultHolder.CALLBACK_CMD_STOP + uuid);
msg.setData("Timeout"); msg.setData("Timeout");

8
web_src/src/components/channelList.vue

@ -46,8 +46,8 @@
<el-table-column label="状态" width="180" align="center"> <el-table-column label="状态" width="180" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<div slot="reference" class="name-wrapper"> <div slot="reference" class="name-wrapper">
<el-tag size="medium" v-if="scope.row.status == 1">在线</el-tag> <el-tag size="medium" v-if="scope.row.status == 1">开启</el-tag>
<el-tag size="medium" type="info" v-if="scope.row.status == 0">离线</el-tag> <el-tag size="medium" type="info" v-if="scope.row.status == 0">关闭</el-tag>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
@ -101,7 +101,7 @@ export default {
total: 0, total: 0,
beforeUrl: "/videoList", beforeUrl: "/videoList",
isLoging: false, isLoging: false,
autoList: false autoList: true
}; };
}, },
@ -181,7 +181,7 @@ export default {
// //
sendDevicePush: function (itemData) { sendDevicePush: function (itemData) {
console.log(itemData) console.log(itemData);
let deviceId = this.deviceId; let deviceId = this.deviceId;
this.isLoging = true; this.isLoging = true;
let channelId = itemData.channelId; let channelId = itemData.channelId;

2
web_src/src/components/gb28181/devicePlayer.vue

@ -67,7 +67,7 @@
<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> <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>
<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> <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>
<div class="contro-speed" style="position: absolute; left: 4px; top: 7rem; width: 9rem;"> <div class="contro-speed" style="position: absolute; left: 4px; top: 7rem; width: 9rem;">
<el-slider v-model="controSpeed"></el-slider> <el-slider v-model="controSpeed" :max="255"></el-slider>
</div> </div>
</div> </div>

2
web_src/src/components/platformEdit.vue

@ -250,7 +250,7 @@ export default {
</script> </script>
<style> <style>
.control-wrapper { .control-wrapper-not-used {
position: relative; position: relative;
width: 6.25rem; width: 6.25rem;
height: 6.25rem; height: 6.25rem;

2
web_src/src/components/videoList.vue

@ -52,7 +52,7 @@
<el-table-column label="操作" width="240" align="center" fixed="right"> <el-table-column label="操作" width="240" align="center" fixed="right">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="mini" :ref="scope.row.deviceId + 'refbtn' " icon="el-icon-refresh" @click="refDevice(scope.row)">刷新通道</el-button> <el-button size="mini" :ref="scope.row.deviceId + 'refbtn' " icon="el-icon-refresh" @click="refDevice(scope.row)">刷新通道</el-button>
<el-button size="mini" icon="el-icon-s-open" type="primary" @click="showChannelList(scope.row)">查看通道</el-button> <el-button size="mini" icon="el-icon-s-open" v-bind:disabled="scope.row.online==0" type="primary" @click="showChannelList(scope.row)">查看通道</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>

2
web_src/src/router/index.js

@ -35,7 +35,7 @@ export default new VueRouter({
path: '/channelList/:deviceId/:parentChannelId/:count/:page', path: '/channelList/:deviceId/:parentChannelId/:count/:page',
name: 'channelList', name: 'channelList',
component: channelList, component: channelList,
},, },
{ {
path: '/parentPlatformList/:count/:page', path: '/parentPlatformList/:count/:page',
name: 'parentPlatformList', name: 'parentPlatformList',

Loading…
Cancel
Save