Commit d7623b5ca864d98ab954a458b049641eb82f4f75

Authored by 648540858
2 parents 80d96042 fa2ccb4e

Merge branch 'wvp-28181-2.0'

# Conflicts:
#	src/main/java/com/genersoft/iot/vmp/common/StreamInfo.java
#	src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/InviteRequestProcessor.java
#	src/main/java/com/genersoft/iot/vmp/service/bean/RequestSendItemMsg.java
src/main/java/com/genersoft/iot/vmp/common/StreamInfo.java
... ... @@ -169,25 +169,31 @@ public class StreamInfo implements Serializable, Cloneable{
169 169  
170 170 public void setRtmp(String host, int port, int sslPort, String app, String stream, String callIdParam) {
171 171 String file = String.format("%s/%s/%s", app, stream, callIdParam);
172   - this.rtmp = new StreamURL("rtmp", host, port, file);
173   - if (sslPort != 0) {
  172 + if (port > 0) {
  173 + this.rtmp = new StreamURL("rtmp", host, port, file);
  174 + }
  175 + if (sslPort > 0) {
174 176 this.rtmps = new StreamURL("rtmps", host, sslPort, file);
175 177 }
176 178 }
177 179  
178 180 public void setRtsp(String host, int port, int sslPort, String app, String stream, String callIdParam) {
179 181 String file = String.format("%s/%s/%s", app, stream, callIdParam);
180   - this.rtsp = new StreamURL("rtsp", host, port, file);
181   - if (sslPort != 0) {
  182 + if (port > 0) {
  183 + this.rtsp = new StreamURL("rtsp", host, port, file);
  184 + }
  185 + if (sslPort > 0) {
182 186 this.rtsps = new StreamURL("rtsps", host, sslPort, file);
183 187 }
184 188 }
185 189  
186 190 public void setFlv(String host, int port, int sslPort, String app, String stream, String callIdParam) {
187 191 String file = String.format("%s/%s.live.flv%s", app, stream, callIdParam);
188   - this.flv = new StreamURL("http", host, port, file);
  192 + if (port > 0) {
  193 + this.flv = new StreamURL("http", host, port, file);
  194 + }
189 195 this.ws_flv = new StreamURL("ws", host, port, file);
190   - if (sslPort != 0) {
  196 + if (sslPort > 0) {
191 197 this.https_flv = new StreamURL("https", host, sslPort, file);
192 198 this.wss_flv = new StreamURL("wss", host, sslPort, file);
193 199 }
... ... @@ -195,9 +201,11 @@ public class StreamInfo implements Serializable, Cloneable{
195 201  
196 202 public void setFmp4(String host, int port, int sslPort, String app, String stream, String callIdParam) {
197 203 String file = String.format("%s/%s.live.mp4%s", app, stream, callIdParam);
198   - this.fmp4 = new StreamURL("http", host, port, file);
199   - this.ws_fmp4 = new StreamURL("ws", host, port, file);
200   - if (sslPort != 0) {
  204 + if (port > 0) {
  205 + this.fmp4 = new StreamURL("http", host, port, file);
  206 + this.ws_fmp4 = new StreamURL("ws", host, port, file);
  207 + }
  208 + if (sslPort > 0) {
201 209 this.https_fmp4 = new StreamURL("https", host, sslPort, file);
202 210 this.wss_fmp4 = new StreamURL("wss", host, sslPort, file);
203 211 }
... ... @@ -205,9 +213,11 @@ public class StreamInfo implements Serializable, Cloneable{
205 213  
206 214 public void setHls(String host, int port, int sslPort, String app, String stream, String callIdParam) {
207 215 String file = String.format("%s/%s/hls.m3u8%s", app, stream, callIdParam);
208   - this.hls = new StreamURL("http", host, port, file);
209   - this.ws_hls = new StreamURL("ws", host, port, file);
210   - if (sslPort != 0) {
  216 + if (port > 0) {
  217 + this.hls = new StreamURL("http", host, port, file);
  218 + this.ws_hls = new StreamURL("ws", host, port, file);
  219 + }
  220 + if (sslPort > 0) {
211 221 this.https_hls = new StreamURL("https", host, sslPort, file);
212 222 this.wss_hls = new StreamURL("wss", host, sslPort, file);
213 223 }
... ... @@ -215,51 +225,91 @@ public class StreamInfo implements Serializable, Cloneable{
215 225  
216 226 public void setTs(String host, int port, int sslPort, String app, String stream, String callIdParam) {
217 227 String file = String.format("%s/%s.live.ts%s", app, stream, callIdParam);
218   - this.ts = new StreamURL("http", host, port, file);
219   - this.ws_ts = new StreamURL("ws", host, port, file);
220   - if (sslPort != 0) {
  228 +
  229 + if (port > 0) {
  230 + this.ts = new StreamURL("http", host, port, file);
  231 + this.ws_ts = new StreamURL("ws", host, port, file);
  232 + }
  233 + if (sslPort > 0) {
221 234 this.https_ts = new StreamURL("https", host, sslPort, file);
222 235 this.wss_ts = new StreamURL("wss", host, sslPort, file);
223 236 }
224 237 }
225 238  
226   - public void setRtc(String host, int port, int sslPort, String app, String stream, String callIdParam, boolean isPlay) {
227   - String file = String.format("index/api/webrtc?app=%s&stream=%s&type=%s%s", app, stream, callIdParam, isPlay?"play":"push");
228   - this.rtc = new StreamURL("http", host, port, file);
229   - if (sslPort != 0) {
  239 + public void setRtc(String host, int port, int sslPort, String app, String stream, String callIdParam) {
  240 + String file = String.format("index/api/webrtc?app=%s&stream=%s&type=play%s", app, stream, callIdParam);
  241 + if (port > 0) {
  242 + this.rtc = new StreamURL("http", host, port, file);
  243 + }
  244 + if (sslPort > 0) {
230 245 this.rtcs = new StreamURL("https", host, sslPort, file);
231 246 }
232 247 }
233 248  
234 249 public void channgeStreamIp(String localAddr) {
235   - this.flv.setHost(localAddr);
236   - this.ws_flv.setHost(localAddr);
237   - this.hls.setHost(localAddr);
238   - this.ws_hls.setHost(localAddr);
239   - this.ts.setHost(localAddr);
240   - this.ws_ts.setHost(localAddr);
241   - this.fmp4.setHost(localAddr);
242   - this.ws_fmp4.setHost(localAddr);
243   - this.rtc.setHost(localAddr);
  250 + if (this.flv != null) {
  251 + this.flv.setHost(localAddr);
  252 + }
  253 + if (this.ws_flv != null ){
  254 + this.ws_flv.setHost(localAddr);
  255 + }
  256 + if (this.hls != null ) {
  257 + this.hls.setHost(localAddr);
  258 + }
  259 + if (this.ws_hls != null ) {
  260 + this.ws_hls.setHost(localAddr);
  261 + }
  262 + if (this.ts != null ) {
  263 + this.ts.setHost(localAddr);
  264 + }
  265 + if (this.ws_ts != null ) {
  266 + this.ws_ts.setHost(localAddr);
  267 + }
  268 + if (this.fmp4 != null ) {
  269 + this.fmp4.setHost(localAddr);
  270 + }
  271 + if (this.ws_fmp4 != null ) {
  272 + this.ws_fmp4.setHost(localAddr);
  273 + }
  274 + if (this.rtc != null ) {
  275 + this.rtc.setHost(localAddr);
  276 + }
244 277 if (this.https_flv != null) {
245 278 this.https_flv.setHost(localAddr);
  279 + }
  280 + if (this.wss_flv != null) {
246 281 this.wss_flv.setHost(localAddr);
  282 + }
  283 + if (this.https_hls != null) {
247 284 this.https_hls.setHost(localAddr);
  285 + }
  286 + if (this.wss_hls != null) {
248 287 this.wss_hls.setHost(localAddr);
  288 + }
  289 + if (this.wss_ts != null) {
249 290 this.wss_ts.setHost(localAddr);
  291 + }
  292 + if (this.https_fmp4 != null) {
250 293 this.https_fmp4.setHost(localAddr);
  294 + }
  295 + if (this.wss_fmp4 != null) {
251 296 this.wss_fmp4.setHost(localAddr);
  297 + }
  298 + if (this.rtcs != null) {
252 299 this.rtcs.setHost(localAddr);
253 300 }
254   - this.rtsp.setHost(localAddr);
  301 + if (this.rtsp != null) {
  302 + this.rtsp.setHost(localAddr);
  303 + }
255 304 if (this.rtsps != null) {
256 305 this.rtsps.setHost(localAddr);
257 306 }
258   - this.rtmp.setHost(localAddr);
  307 + if (this.rtmp != null) {
  308 + this.rtmp.setHost(localAddr);
  309 + }
259 310 if (this.rtmps != null) {
260 311 this.rtmps.setHost(localAddr);
261 312 }
262   -
263 313 }
264 314  
265 315  
... ...
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/InviteRequestProcessor.java
... ... @@ -386,8 +386,7 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements
386 386 return;
387 387 }
388 388 SendRtpItem sendRtpItem = zlmrtpServerFactory.createSendRtpItem(mediaServerItem, addressStr, port, ssrc, requesterId,
389   - device.getDeviceId(), channelId,
390   - mediaTransmissionTCP, platform.isRtcp());
  389 + device.getDeviceId(), channelId, mediaTransmissionTCP, platform.isRtcp());
391 390  
392 391 if (tcpActive != null) {
393 392 sendRtpItem.setTcpActive(tcpActive);
... ... @@ -582,8 +581,7 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements
582 581 if (streamReady) {
583 582 // ่‡ชๅนณๅฐๅ†…ๅฎน
584 583 SendRtpItem sendRtpItem = zlmrtpServerFactory.createSendRtpItem(mediaServerItem, addressStr, port, ssrc, requesterId,
585   - gbStream.getApp(), gbStream.getStream(), channelId,
586   - mediaTransmissionTCP, platform.isRtcp());
  584 + gbStream.getApp(), gbStream.getStream(), channelId, mediaTransmissionTCP, platform.isRtcp());
587 585  
588 586 if (sendRtpItem == null) {
589 587 logger.warn("ๆœๅŠกๅ™จ็ซฏๅฃ่ต„ๆบไธ่ถณ");
... ... @@ -622,8 +620,7 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements
622 620 if (streamReady) {
623 621 // ่‡ชๅนณๅฐๅ†…ๅฎน
624 622 SendRtpItem sendRtpItem = zlmrtpServerFactory.createSendRtpItem(mediaServerItem, addressStr, port, ssrc, requesterId,
625   - gbStream.getApp(), gbStream.getStream(), channelId,
626   - mediaTransmissionTCP, platform.isRtcp());
  623 + gbStream.getApp(), gbStream.getStream(), channelId, mediaTransmissionTCP, platform.isRtcp());
627 624  
628 625 if (sendRtpItem == null) {
629 626 logger.warn("ๆœๅŠกๅ™จ็ซฏๅฃ่ต„ๆบไธ่ถณ");
... ... @@ -802,7 +799,7 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements
802 799 // ๅ‘้€redisๆถˆๆฏ
803 800 redisGbPlayMsgListener.sendMsg(streamPushItem.getServerId(), streamPushItem.getMediaServerId(),
804 801 streamPushItem.getApp(), streamPushItem.getStream(), addressStr, port, ssrc, requesterId,
805   - channelId, mediaTransmissionTCP, platform.isRtcp(), null, responseSendItemMsg -> {
  802 + channelId, mediaTransmissionTCP, platform.isRtcp(),null, responseSendItemMsg -> {
806 803 SendRtpItem sendRtpItem = responseSendItemMsg.getSendRtpItem();
807 804 if (sendRtpItem == null || responseSendItemMsg.getMediaServerItem() == null) {
808 805 logger.warn("ๆœๅŠกๅ™จ็ซฏๅฃ่ต„ๆบไธ่ถณ");
... ...
web_src/src/components/dialog/devicePlayer.vue
... ... @@ -50,91 +50,91 @@
50 50 ๆ›ดๅคšๅœฐๅ€<i class="el-icon-arrow-down el-icon--right"></i>
51 51 </el-button>
52 52 <el-dropdown-menu slot="dropdown" >
53   - <el-dropdown-item :command="streamInfo.flv.url">
  53 + <el-dropdown-item v-if="streamInfo.flv" :command="streamInfo.flv.url">
54 54 <el-tag >FLV:</el-tag>
55 55 <span>{{ streamInfo.flv.url }}</span>
56 56 </el-dropdown-item>
57   - <el-dropdown-item :command="streamInfo.https_flv.url">
  57 + <el-dropdown-item v-if="streamInfo.https_flv" :command="streamInfo.https_flv.url">
58 58 <el-tag >FLV(https):</el-tag>
59 59 <span>{{ streamInfo.https_flv.url }}</span>
60 60 </el-dropdown-item>
61   - <el-dropdown-item :command="streamInfo.ws_flv.url">
  61 + <el-dropdown-item v-if="streamInfo.ws_flv" :command="streamInfo.ws_flv.url">
62 62 <el-tag >FLV(ws):</el-tag>
63 63 <span >{{ streamInfo.ws_flv.url }}</span>
64 64 </el-dropdown-item>
65   - <el-dropdown-item :command="streamInfo.wss_flv.url">
  65 + <el-dropdown-item v-if="streamInfo.wss_flv" :command="streamInfo.wss_flv.url">
66 66 <el-tag >FLV(wss):</el-tag>
67 67 <span>{{ streamInfo.wss_flv.url }}</span>
68 68 </el-dropdown-item>
69   - <el-dropdown-item :command="streamInfo.fmp4.url">
  69 + <el-dropdown-item v-if="streamInfo.fmp4" :command="streamInfo.fmp4.url">
70 70 <el-tag >FMP4:</el-tag>
71 71 <span>{{ streamInfo.fmp4.url }}</span>
72 72 </el-dropdown-item>
73   - <el-dropdown-item :command="streamInfo.https_fmp4.url">
  73 + <el-dropdown-item v-if="streamInfo.https_fmp4" :command="streamInfo.https_fmp4.url">
74 74 <el-tag >FMP4(https):</el-tag>
75 75 <span>{{ streamInfo.https_fmp4.url }}</span>
76 76 </el-dropdown-item>
77   - <el-dropdown-item :command="streamInfo.ws_fmp4.url">
  77 + <el-dropdown-item v-if="streamInfo.ws_fmp4" :command="streamInfo.ws_fmp4.url">
78 78 <el-tag >FMP4(ws):</el-tag>
79 79 <span>{{ streamInfo.ws_fmp4.url }}</span>
80 80 </el-dropdown-item>
81   - <el-dropdown-item :command="streamInfo.wss_fmp4.url">
  81 + <el-dropdown-item v-if="streamInfo.wss_fmp4" :command="streamInfo.wss_fmp4.url">
82 82 <el-tag >FMP4(wss):</el-tag>
83 83 <span>{{ streamInfo.wss_fmp4.url }}</span>
84 84 </el-dropdown-item>
85   - <el-dropdown-item :command="streamInfo.hls.url">
  85 + <el-dropdown-item v-if="streamInfo.hls" :command="streamInfo.hls.url">
86 86 <el-tag>HLS:</el-tag>
87 87 <span>{{ streamInfo.hls.url }}</span>
88 88 </el-dropdown-item>
89   - <el-dropdown-item :command="streamInfo.https_hls.url">
  89 + <el-dropdown-item v-if="streamInfo.https_hls" :command="streamInfo.https_hls.url">
90 90 <el-tag >HLS(https):</el-tag>
91 91 <span>{{ streamInfo.https_hls.url }}</span>
92 92 </el-dropdown-item>
93   - <el-dropdown-item :command="streamInfo.ws_hls.url">
  93 + <el-dropdown-item v-if="streamInfo.ws_hls" :command="streamInfo.ws_hls.url">
94 94 <el-tag >HLS(ws):</el-tag>
95 95 <span>{{ streamInfo.ws_hls.url }}</span>
96 96 </el-dropdown-item>
97   - <el-dropdown-item :command="streamInfo.wss_hls.url">
  97 + <el-dropdown-item v-if="streamInfo.wss_hls" :command="streamInfo.wss_hls.url">
98 98 <el-tag >HLS(wss):</el-tag>
99 99 <span>{{ streamInfo.wss_hls.url }}</span>
100 100 </el-dropdown-item>
101   - <el-dropdown-item :command="streamInfo.ts.url">
  101 + <el-dropdown-item v-if="streamInfo.ts" :command="streamInfo.ts.url">
102 102 <el-tag>TS:</el-tag>
103 103 <span>{{ streamInfo.ts.url }}</span>
104 104 </el-dropdown-item>
105   - <el-dropdown-item :command="streamInfo.https_ts.url">
  105 + <el-dropdown-item v-if="streamInfo.https_ts" :command="streamInfo.https_ts.url">
106 106 <el-tag>TS(https):</el-tag>
107 107 <span>{{ streamInfo.https_ts.url }}</span>
108 108 </el-dropdown-item>
109   - <el-dropdown-item :command="streamInfo.ws_ts.url">
  109 + <el-dropdown-item v-if="streamInfo.ws_ts" :command="streamInfo.ws_ts.url">
110 110 <el-tag>TS(ws):</el-tag>
111 111 <span>{{ streamInfo.ws_ts.url }}</span>
112 112 </el-dropdown-item>
113   - <el-dropdown-item :command="streamInfo.wss_ts.url">
  113 + <el-dropdown-item v-if="streamInfo.wss_ts" :command="streamInfo.wss_ts.url">
114 114 <el-tag>TS(wss):</el-tag>
115 115 <span>{{ streamInfo.wss_ts.url }}</span>
116 116 </el-dropdown-item>
117   - <el-dropdown-item :command="streamInfo.rtc.url">
  117 + <el-dropdown-item v-if="streamInfo.rtc" :command="streamInfo.rtc.url">
118 118 <el-tag >RTC:</el-tag>
119 119 <span>{{ streamInfo.rtc.url }}</span>
120 120 </el-dropdown-item>
121   - <el-dropdown-item :command="streamInfo.rtcs.url">
  121 + <el-dropdown-item v-if="streamInfo.rtcs" :command="streamInfo.rtcs.url">
122 122 <el-tag >RTCS:</el-tag>
123 123 <span>{{ streamInfo.rtcs }}</span>
124 124 </el-dropdown-item>
125   - <el-dropdown-item :command="streamInfo.rtmp.url">
  125 + <el-dropdown-item v-if="streamInfo.rtmp" :command="streamInfo.rtmp.url">
126 126 <el-tag >RTMP:</el-tag>
127 127 <span>{{ streamInfo.rtmp.url }}</span>
128 128 </el-dropdown-item>
129   - <el-dropdown-item :command="streamInfo.rtmps.url">
  129 + <el-dropdown-item v-if="streamInfo.rtmps" :command="streamInfo.rtmps.url">
130 130 <el-tag >RTMPS:</el-tag>
131 131 <span>{{ streamInfo.rtmps.url }}</span>
132 132 </el-dropdown-item>
133   - <el-dropdown-item :command="streamInfo.rtsp.url">
  133 + <el-dropdown-item v-if="streamInfo.rtsp" :command="streamInfo.rtsp.url">
134 134 <el-tag >RTSP:</el-tag>
135 135 <span>{{ streamInfo.rtsp.url }}</span>
136 136 </el-dropdown-item>
137   - <el-dropdown-item :command="streamInfo.rtsps.url">
  137 + <el-dropdown-item v-if="streamInfo.rtsps" :command="streamInfo.rtsps.url">
138 138 <el-tag >RTSPS:</el-tag>
139 139 <span>{{ streamInfo.rtsps.url }}</span>
140 140 </el-dropdown-item>
... ...