Commit 4d9a62339d43e163c3615a52b72a3c3f01cc30ab
1 parent
cc61ed4a
去除lombok框架
添加流传输模式udp/tcp被动支持
Showing
13 changed files
with
739 additions
and
70 deletions
src/main/java/com/genersoft/iot/vmp/common/PageResult.java
| 1 | 1 | package com.genersoft.iot.vmp.common; |
| 2 | 2 | |
| 3 | -import lombok.Data; | |
| 4 | 3 | |
| 5 | 4 | import java.util.List; |
| 6 | 5 | |
| 7 | -@Data | |
| 8 | 6 | public class PageResult<T> { |
| 9 | 7 | |
| 10 | 8 | private int page; |
| ... | ... | @@ -17,4 +15,31 @@ public class PageResult<T> { |
| 17 | 15 | return data; |
| 18 | 16 | } |
| 19 | 17 | |
| 18 | + public int getPage() { | |
| 19 | + return page; | |
| 20 | + } | |
| 21 | + | |
| 22 | + public void setPage(int page) { | |
| 23 | + this.page = page; | |
| 24 | + } | |
| 25 | + | |
| 26 | + public int getCount() { | |
| 27 | + return count; | |
| 28 | + } | |
| 29 | + | |
| 30 | + public void setCount(int count) { | |
| 31 | + this.count = count; | |
| 32 | + } | |
| 33 | + | |
| 34 | + public int getTotal() { | |
| 35 | + return total; | |
| 36 | + } | |
| 37 | + | |
| 38 | + public void setTotal(int total) { | |
| 39 | + this.total = total; | |
| 40 | + } | |
| 41 | + | |
| 42 | + public void setData(List<T> data) { | |
| 43 | + this.data = data; | |
| 44 | + } | |
| 20 | 45 | } | ... | ... |
src/main/java/com/genersoft/iot/vmp/common/StreamInfo.java
| 1 | 1 | package com.genersoft.iot.vmp.common; |
| 2 | 2 | |
| 3 | 3 | import com.alibaba.fastjson.JSONArray; |
| 4 | -import lombok.Data; | |
| 5 | 4 | |
| 6 | -@Data | |
| 7 | 5 | public class StreamInfo { |
| 8 | 6 | |
| 9 | 7 | private String ssrc; |
| ... | ... | @@ -16,4 +14,75 @@ public class StreamInfo { |
| 16 | 14 | private String rtsp; |
| 17 | 15 | private JSONArray tracks; |
| 18 | 16 | |
| 17 | + public String getSsrc() { | |
| 18 | + return ssrc; | |
| 19 | + } | |
| 20 | + | |
| 21 | + public void setSsrc(String ssrc) { | |
| 22 | + this.ssrc = ssrc; | |
| 23 | + } | |
| 24 | + | |
| 25 | + public String getDeviceID() { | |
| 26 | + return deviceID; | |
| 27 | + } | |
| 28 | + | |
| 29 | + public void setDeviceID(String deviceID) { | |
| 30 | + this.deviceID = deviceID; | |
| 31 | + } | |
| 32 | + | |
| 33 | + public String getCahnnelId() { | |
| 34 | + return cahnnelId; | |
| 35 | + } | |
| 36 | + | |
| 37 | + public void setCahnnelId(String cahnnelId) { | |
| 38 | + this.cahnnelId = cahnnelId; | |
| 39 | + } | |
| 40 | + | |
| 41 | + public String getFlv() { | |
| 42 | + return flv; | |
| 43 | + } | |
| 44 | + | |
| 45 | + public void setFlv(String flv) { | |
| 46 | + this.flv = flv; | |
| 47 | + } | |
| 48 | + | |
| 49 | + public String getWs_flv() { | |
| 50 | + return ws_flv; | |
| 51 | + } | |
| 52 | + | |
| 53 | + public void setWs_flv(String ws_flv) { | |
| 54 | + this.ws_flv = ws_flv; | |
| 55 | + } | |
| 56 | + | |
| 57 | + public String getRtmp() { | |
| 58 | + return rtmp; | |
| 59 | + } | |
| 60 | + | |
| 61 | + public void setRtmp(String rtmp) { | |
| 62 | + this.rtmp = rtmp; | |
| 63 | + } | |
| 64 | + | |
| 65 | + public String getHls() { | |
| 66 | + return hls; | |
| 67 | + } | |
| 68 | + | |
| 69 | + public void setHls(String hls) { | |
| 70 | + this.hls = hls; | |
| 71 | + } | |
| 72 | + | |
| 73 | + public String getRtsp() { | |
| 74 | + return rtsp; | |
| 75 | + } | |
| 76 | + | |
| 77 | + public void setRtsp(String rtsp) { | |
| 78 | + this.rtsp = rtsp; | |
| 79 | + } | |
| 80 | + | |
| 81 | + public JSONArray getTracks() { | |
| 82 | + return tracks; | |
| 83 | + } | |
| 84 | + | |
| 85 | + public void setTracks(JSONArray tracks) { | |
| 86 | + this.tracks = tracks; | |
| 87 | + } | |
| 19 | 88 | } | ... | ... |
src/main/java/com/genersoft/iot/vmp/conf/MediaServerConfig.java
| 1 | 1 | package com.genersoft.iot.vmp.conf; |
| 2 | 2 | |
| 3 | 3 | import com.alibaba.fastjson.annotation.JSONField; |
| 4 | -import lombok.Data; | |
| 5 | 4 | |
| 6 | -@Data | |
| 7 | 5 | public class MediaServerConfig { |
| 8 | 6 | |
| 9 | 7 | @JSONField(name = "api.apiDebug") |
| ... | ... | @@ -200,4 +198,525 @@ public class MediaServerConfig { |
| 200 | 198 | |
| 201 | 199 | @JSONField(name = "shell.shell") |
| 202 | 200 | private String shellPhell; |
| 201 | + | |
| 202 | + | |
| 203 | + public String getApiDebug() { | |
| 204 | + return apiDebug; | |
| 205 | + } | |
| 206 | + | |
| 207 | + public void setApiDebug(String apiDebug) { | |
| 208 | + this.apiDebug = apiDebug; | |
| 209 | + } | |
| 210 | + | |
| 211 | + public String getApiSecret() { | |
| 212 | + return apiSecret; | |
| 213 | + } | |
| 214 | + | |
| 215 | + public void setApiSecret(String apiSecret) { | |
| 216 | + this.apiSecret = apiSecret; | |
| 217 | + } | |
| 218 | + | |
| 219 | + public String getFfmpegBin() { | |
| 220 | + return ffmpegBin; | |
| 221 | + } | |
| 222 | + | |
| 223 | + public void setFfmpegBin(String ffmpegBin) { | |
| 224 | + this.ffmpegBin = ffmpegBin; | |
| 225 | + } | |
| 226 | + | |
| 227 | + public String getFfmpegCmd() { | |
| 228 | + return ffmpegCmd; | |
| 229 | + } | |
| 230 | + | |
| 231 | + public void setFfmpegCmd(String ffmpegCmd) { | |
| 232 | + this.ffmpegCmd = ffmpegCmd; | |
| 233 | + } | |
| 234 | + | |
| 235 | + public String getFfmpegLog() { | |
| 236 | + return ffmpegLog; | |
| 237 | + } | |
| 238 | + | |
| 239 | + public void setFfmpegLog(String ffmpegLog) { | |
| 240 | + this.ffmpegLog = ffmpegLog; | |
| 241 | + } | |
| 242 | + | |
| 243 | + public String getGeneralEnableVhost() { | |
| 244 | + return generalEnableVhost; | |
| 245 | + } | |
| 246 | + | |
| 247 | + public void setGeneralEnableVhost(String generalEnableVhost) { | |
| 248 | + this.generalEnableVhost = generalEnableVhost; | |
| 249 | + } | |
| 250 | + | |
| 251 | + public String getGeneralFlowThreshold() { | |
| 252 | + return generalFlowThreshold; | |
| 253 | + } | |
| 254 | + | |
| 255 | + public void setGeneralFlowThreshold(String generalFlowThreshold) { | |
| 256 | + this.generalFlowThreshold = generalFlowThreshold; | |
| 257 | + } | |
| 258 | + | |
| 259 | + public String getGeneralMaxStreamWaitMS() { | |
| 260 | + return generalMaxStreamWaitMS; | |
| 261 | + } | |
| 262 | + | |
| 263 | + public void setGeneralMaxStreamWaitMS(String generalMaxStreamWaitMS) { | |
| 264 | + this.generalMaxStreamWaitMS = generalMaxStreamWaitMS; | |
| 265 | + } | |
| 266 | + | |
| 267 | + public String getGeneralStreamNoneReaderDelayMS() { | |
| 268 | + return generalStreamNoneReaderDelayMS; | |
| 269 | + } | |
| 270 | + | |
| 271 | + public void setGeneralStreamNoneReaderDelayMS(String generalStreamNoneReaderDelayMS) { | |
| 272 | + this.generalStreamNoneReaderDelayMS = generalStreamNoneReaderDelayMS; | |
| 273 | + } | |
| 274 | + | |
| 275 | + public String getLocalIP() { | |
| 276 | + return localIP; | |
| 277 | + } | |
| 278 | + | |
| 279 | + public void setLocalIP(String localIP) { | |
| 280 | + this.localIP = localIP; | |
| 281 | + } | |
| 282 | + | |
| 283 | + public String getHlsFileBufSize() { | |
| 284 | + return hlsFileBufSize; | |
| 285 | + } | |
| 286 | + | |
| 287 | + public void setHlsFileBufSize(String hlsFileBufSize) { | |
| 288 | + this.hlsFileBufSize = hlsFileBufSize; | |
| 289 | + } | |
| 290 | + | |
| 291 | + public String getHlsFilePath() { | |
| 292 | + return hlsFilePath; | |
| 293 | + } | |
| 294 | + | |
| 295 | + public void setHlsFilePath(String hlsFilePath) { | |
| 296 | + this.hlsFilePath = hlsFilePath; | |
| 297 | + } | |
| 298 | + | |
| 299 | + public String getHlsSegDur() { | |
| 300 | + return hlsSegDur; | |
| 301 | + } | |
| 302 | + | |
| 303 | + public void setHlsSegDur(String hlsSegDur) { | |
| 304 | + this.hlsSegDur = hlsSegDur; | |
| 305 | + } | |
| 306 | + | |
| 307 | + public String getHlsSegNum() { | |
| 308 | + return hlsSegNum; | |
| 309 | + } | |
| 310 | + | |
| 311 | + public void setHlsSegNum(String hlsSegNum) { | |
| 312 | + this.hlsSegNum = hlsSegNum; | |
| 313 | + } | |
| 314 | + | |
| 315 | + public String getHookAccessFileExceptHLS() { | |
| 316 | + return hookAccessFileExceptHLS; | |
| 317 | + } | |
| 318 | + | |
| 319 | + public void setHookAccessFileExceptHLS(String hookAccessFileExceptHLS) { | |
| 320 | + this.hookAccessFileExceptHLS = hookAccessFileExceptHLS; | |
| 321 | + } | |
| 322 | + | |
| 323 | + public String getHookAdminParams() { | |
| 324 | + return hookAdminParams; | |
| 325 | + } | |
| 326 | + | |
| 327 | + public void setHookAdminParams(String hookAdminParams) { | |
| 328 | + this.hookAdminParams = hookAdminParams; | |
| 329 | + } | |
| 330 | + | |
| 331 | + public String getHookEnable() { | |
| 332 | + return hookEnable; | |
| 333 | + } | |
| 334 | + | |
| 335 | + public void setHookEnable(String hookEnable) { | |
| 336 | + this.hookEnable = hookEnable; | |
| 337 | + } | |
| 338 | + | |
| 339 | + public String getHookOnFlowReport() { | |
| 340 | + return hookOnFlowReport; | |
| 341 | + } | |
| 342 | + | |
| 343 | + public void setHookOnFlowReport(String hookOnFlowReport) { | |
| 344 | + this.hookOnFlowReport = hookOnFlowReport; | |
| 345 | + } | |
| 346 | + | |
| 347 | + public String getHookOnHttpAccess() { | |
| 348 | + return hookOnHttpAccess; | |
| 349 | + } | |
| 350 | + | |
| 351 | + public void setHookOnHttpAccess(String hookOnHttpAccess) { | |
| 352 | + this.hookOnHttpAccess = hookOnHttpAccess; | |
| 353 | + } | |
| 354 | + | |
| 355 | + public String getHookOnPlay() { | |
| 356 | + return hookOnPlay; | |
| 357 | + } | |
| 358 | + | |
| 359 | + public void setHookOnPlay(String hookOnPlay) { | |
| 360 | + this.hookOnPlay = hookOnPlay; | |
| 361 | + } | |
| 362 | + | |
| 363 | + public String getHookOnPublish() { | |
| 364 | + return hookOnPublish; | |
| 365 | + } | |
| 366 | + | |
| 367 | + public void setHookOnPublish(String hookOnPublish) { | |
| 368 | + this.hookOnPublish = hookOnPublish; | |
| 369 | + } | |
| 370 | + | |
| 371 | + public String getHookOnRecordMp4() { | |
| 372 | + return hookOnRecordMp4; | |
| 373 | + } | |
| 374 | + | |
| 375 | + public void setHookOnRecordMp4(String hookOnRecordMp4) { | |
| 376 | + this.hookOnRecordMp4 = hookOnRecordMp4; | |
| 377 | + } | |
| 378 | + | |
| 379 | + public String getHookOnRtspAuth() { | |
| 380 | + return hookOnRtspAuth; | |
| 381 | + } | |
| 382 | + | |
| 383 | + public void setHookOnRtspAuth(String hookOnRtspAuth) { | |
| 384 | + this.hookOnRtspAuth = hookOnRtspAuth; | |
| 385 | + } | |
| 386 | + | |
| 387 | + public String getHookOnRtspRealm() { | |
| 388 | + return hookOnRtspRealm; | |
| 389 | + } | |
| 390 | + | |
| 391 | + public void setHookOnRtspRealm(String hookOnRtspRealm) { | |
| 392 | + this.hookOnRtspRealm = hookOnRtspRealm; | |
| 393 | + } | |
| 394 | + | |
| 395 | + public String getHookOnShellLogin() { | |
| 396 | + return hookOnShellLogin; | |
| 397 | + } | |
| 398 | + | |
| 399 | + public void setHookOnShellLogin(String hookOnShellLogin) { | |
| 400 | + this.hookOnShellLogin = hookOnShellLogin; | |
| 401 | + } | |
| 402 | + | |
| 403 | + public String getHookOnStreamChanged() { | |
| 404 | + return hookOnStreamChanged; | |
| 405 | + } | |
| 406 | + | |
| 407 | + public void setHookOnStreamChanged(String hookOnStreamChanged) { | |
| 408 | + this.hookOnStreamChanged = hookOnStreamChanged; | |
| 409 | + } | |
| 410 | + | |
| 411 | + public String getHookOnStreamNoneReader() { | |
| 412 | + return hookOnStreamNoneReader; | |
| 413 | + } | |
| 414 | + | |
| 415 | + public void setHookOnStreamNoneReader(String hookOnStreamNoneReader) { | |
| 416 | + this.hookOnStreamNoneReader = hookOnStreamNoneReader; | |
| 417 | + } | |
| 418 | + | |
| 419 | + public String getHookOnStreamNotFound() { | |
| 420 | + return hookOnStreamNotFound; | |
| 421 | + } | |
| 422 | + | |
| 423 | + public void setHookOnStreamNotFound(String hookOnStreamNotFound) { | |
| 424 | + this.hookOnStreamNotFound = hookOnStreamNotFound; | |
| 425 | + } | |
| 426 | + | |
| 427 | + public String getHookTimeoutSec() { | |
| 428 | + return hookTimeoutSec; | |
| 429 | + } | |
| 430 | + | |
| 431 | + public void setHookTimeoutSec(String hookTimeoutSec) { | |
| 432 | + this.hookTimeoutSec = hookTimeoutSec; | |
| 433 | + } | |
| 434 | + | |
| 435 | + public String getHttpCharSet() { | |
| 436 | + return httpCharSet; | |
| 437 | + } | |
| 438 | + | |
| 439 | + public void setHttpCharSet(String httpCharSet) { | |
| 440 | + this.httpCharSet = httpCharSet; | |
| 441 | + } | |
| 442 | + | |
| 443 | + public String getHttpKeepAliveSecond() { | |
| 444 | + return httpKeepAliveSecond; | |
| 445 | + } | |
| 446 | + | |
| 447 | + public void setHttpKeepAliveSecond(String httpKeepAliveSecond) { | |
| 448 | + this.httpKeepAliveSecond = httpKeepAliveSecond; | |
| 449 | + } | |
| 450 | + | |
| 451 | + public String getHttpMaxReqCount() { | |
| 452 | + return httpMaxReqCount; | |
| 453 | + } | |
| 454 | + | |
| 455 | + public void setHttpMaxReqCount(String httpMaxReqCount) { | |
| 456 | + this.httpMaxReqCount = httpMaxReqCount; | |
| 457 | + } | |
| 458 | + | |
| 459 | + public String getHttpMaxReqSize() { | |
| 460 | + return httpMaxReqSize; | |
| 461 | + } | |
| 462 | + | |
| 463 | + public void setHttpMaxReqSize(String httpMaxReqSize) { | |
| 464 | + this.httpMaxReqSize = httpMaxReqSize; | |
| 465 | + } | |
| 466 | + | |
| 467 | + public String getHttpNotFound() { | |
| 468 | + return httpNotFound; | |
| 469 | + } | |
| 470 | + | |
| 471 | + public void setHttpNotFound(String httpNotFound) { | |
| 472 | + this.httpNotFound = httpNotFound; | |
| 473 | + } | |
| 474 | + | |
| 475 | + public String getHttpPort() { | |
| 476 | + return httpPort; | |
| 477 | + } | |
| 478 | + | |
| 479 | + public void setHttpPort(String httpPort) { | |
| 480 | + this.httpPort = httpPort; | |
| 481 | + } | |
| 482 | + | |
| 483 | + public String getHttpRootPath() { | |
| 484 | + return httpRootPath; | |
| 485 | + } | |
| 486 | + | |
| 487 | + public void setHttpRootPath(String httpRootPath) { | |
| 488 | + this.httpRootPath = httpRootPath; | |
| 489 | + } | |
| 490 | + | |
| 491 | + public String getHttpSendBufSize() { | |
| 492 | + return httpSendBufSize; | |
| 493 | + } | |
| 494 | + | |
| 495 | + public void setHttpSendBufSize(String httpSendBufSize) { | |
| 496 | + this.httpSendBufSize = httpSendBufSize; | |
| 497 | + } | |
| 498 | + | |
| 499 | + public String getHttpSSLport() { | |
| 500 | + return httpSSLport; | |
| 501 | + } | |
| 502 | + | |
| 503 | + public void setHttpSSLport(String httpSSLport) { | |
| 504 | + this.httpSSLport = httpSSLport; | |
| 505 | + } | |
| 506 | + | |
| 507 | + public String getMulticastAddrMax() { | |
| 508 | + return multicastAddrMax; | |
| 509 | + } | |
| 510 | + | |
| 511 | + public void setMulticastAddrMax(String multicastAddrMax) { | |
| 512 | + this.multicastAddrMax = multicastAddrMax; | |
| 513 | + } | |
| 514 | + | |
| 515 | + public String getMulticastAddrMin() { | |
| 516 | + return multicastAddrMin; | |
| 517 | + } | |
| 518 | + | |
| 519 | + public void setMulticastAddrMin(String multicastAddrMin) { | |
| 520 | + this.multicastAddrMin = multicastAddrMin; | |
| 521 | + } | |
| 522 | + | |
| 523 | + public String getMulticastUdpTTL() { | |
| 524 | + return multicastUdpTTL; | |
| 525 | + } | |
| 526 | + | |
| 527 | + public void setMulticastUdpTTL(String multicastUdpTTL) { | |
| 528 | + this.multicastUdpTTL = multicastUdpTTL; | |
| 529 | + } | |
| 530 | + | |
| 531 | + public String getRecordAppName() { | |
| 532 | + return recordAppName; | |
| 533 | + } | |
| 534 | + | |
| 535 | + public void setRecordAppName(String recordAppName) { | |
| 536 | + this.recordAppName = recordAppName; | |
| 537 | + } | |
| 538 | + | |
| 539 | + public String getRecordFilePath() { | |
| 540 | + return recordFilePath; | |
| 541 | + } | |
| 542 | + | |
| 543 | + public void setRecordFilePath(String recordFilePath) { | |
| 544 | + this.recordFilePath = recordFilePath; | |
| 545 | + } | |
| 546 | + | |
| 547 | + public String getRecordFileSecond() { | |
| 548 | + return recordFileSecond; | |
| 549 | + } | |
| 550 | + | |
| 551 | + public void setRecordFileSecond(String recordFileSecond) { | |
| 552 | + this.recordFileSecond = recordFileSecond; | |
| 553 | + } | |
| 554 | + | |
| 555 | + public String getRecordFileSampleMS() { | |
| 556 | + return recordFileSampleMS; | |
| 557 | + } | |
| 558 | + | |
| 559 | + public void setRecordFileSampleMS(String recordFileSampleMS) { | |
| 560 | + this.recordFileSampleMS = recordFileSampleMS; | |
| 561 | + } | |
| 562 | + | |
| 563 | + public String getRtmpHandshakeSecond() { | |
| 564 | + return rtmpHandshakeSecond; | |
| 565 | + } | |
| 566 | + | |
| 567 | + public void setRtmpHandshakeSecond(String rtmpHandshakeSecond) { | |
| 568 | + this.rtmpHandshakeSecond = rtmpHandshakeSecond; | |
| 569 | + } | |
| 570 | + | |
| 571 | + public String getRtmpKeepAliveSecond() { | |
| 572 | + return rtmpKeepAliveSecond; | |
| 573 | + } | |
| 574 | + | |
| 575 | + public void setRtmpKeepAliveSecond(String rtmpKeepAliveSecond) { | |
| 576 | + this.rtmpKeepAliveSecond = rtmpKeepAliveSecond; | |
| 577 | + } | |
| 578 | + | |
| 579 | + public String getRtmpModifyStamp() { | |
| 580 | + return rtmpModifyStamp; | |
| 581 | + } | |
| 582 | + | |
| 583 | + public void setRtmpModifyStamp(String rtmpModifyStamp) { | |
| 584 | + this.rtmpModifyStamp = rtmpModifyStamp; | |
| 585 | + } | |
| 586 | + | |
| 587 | + public String getRtmpPort() { | |
| 588 | + return rtmpPort; | |
| 589 | + } | |
| 590 | + | |
| 591 | + public void setRtmpPort(String rtmpPort) { | |
| 592 | + this.rtmpPort = rtmpPort; | |
| 593 | + } | |
| 594 | + | |
| 595 | + public String getRtpAudioMtuSize() { | |
| 596 | + return rtpAudioMtuSize; | |
| 597 | + } | |
| 598 | + | |
| 599 | + public void setRtpAudioMtuSize(String rtpAudioMtuSize) { | |
| 600 | + this.rtpAudioMtuSize = rtpAudioMtuSize; | |
| 601 | + } | |
| 602 | + | |
| 603 | + public String getRtpClearCount() { | |
| 604 | + return rtpClearCount; | |
| 605 | + } | |
| 606 | + | |
| 607 | + public void setRtpClearCount(String rtpClearCount) { | |
| 608 | + this.rtpClearCount = rtpClearCount; | |
| 609 | + } | |
| 610 | + | |
| 611 | + public String getRtpCycleMS() { | |
| 612 | + return rtpCycleMS; | |
| 613 | + } | |
| 614 | + | |
| 615 | + public void setRtpCycleMS(String rtpCycleMS) { | |
| 616 | + this.rtpCycleMS = rtpCycleMS; | |
| 617 | + } | |
| 618 | + | |
| 619 | + public String getRtpMaxRtpCount() { | |
| 620 | + return rtpMaxRtpCount; | |
| 621 | + } | |
| 622 | + | |
| 623 | + public void setRtpMaxRtpCount(String rtpMaxRtpCount) { | |
| 624 | + this.rtpMaxRtpCount = rtpMaxRtpCount; | |
| 625 | + } | |
| 626 | + | |
| 627 | + public String getRtpVideoMtuSize() { | |
| 628 | + return rtpVideoMtuSize; | |
| 629 | + } | |
| 630 | + | |
| 631 | + public void setRtpVideoMtuSize(String rtpVideoMtuSize) { | |
| 632 | + this.rtpVideoMtuSize = rtpVideoMtuSize; | |
| 633 | + } | |
| 634 | + | |
| 635 | + public String getRtpProxyCheckSource() { | |
| 636 | + return rtpProxyCheckSource; | |
| 637 | + } | |
| 638 | + | |
| 639 | + public void setRtpProxyCheckSource(String rtpProxyCheckSource) { | |
| 640 | + this.rtpProxyCheckSource = rtpProxyCheckSource; | |
| 641 | + } | |
| 642 | + | |
| 643 | + public String getRtpProxyDumpDir() { | |
| 644 | + return rtpProxyDumpDir; | |
| 645 | + } | |
| 646 | + | |
| 647 | + public void setRtpProxyDumpDir(String rtpProxyDumpDir) { | |
| 648 | + this.rtpProxyDumpDir = rtpProxyDumpDir; | |
| 649 | + } | |
| 650 | + | |
| 651 | + public String getRtpProxyPort() { | |
| 652 | + return rtpProxyPort; | |
| 653 | + } | |
| 654 | + | |
| 655 | + public void setRtpProxyPort(String rtpProxyPort) { | |
| 656 | + this.rtpProxyPort = rtpProxyPort; | |
| 657 | + } | |
| 658 | + | |
| 659 | + public String getRtpProxyTimeoutSec() { | |
| 660 | + return rtpProxyTimeoutSec; | |
| 661 | + } | |
| 662 | + | |
| 663 | + public void setRtpProxyTimeoutSec(String rtpProxyTimeoutSec) { | |
| 664 | + this.rtpProxyTimeoutSec = rtpProxyTimeoutSec; | |
| 665 | + } | |
| 666 | + | |
| 667 | + public String getRtspAuthBasic() { | |
| 668 | + return rtspAuthBasic; | |
| 669 | + } | |
| 670 | + | |
| 671 | + public void setRtspAuthBasic(String rtspAuthBasic) { | |
| 672 | + this.rtspAuthBasic = rtspAuthBasic; | |
| 673 | + } | |
| 674 | + | |
| 675 | + public String getRtspHandshakeSecond() { | |
| 676 | + return rtspHandshakeSecond; | |
| 677 | + } | |
| 678 | + | |
| 679 | + public void setRtspHandshakeSecond(String rtspHandshakeSecond) { | |
| 680 | + this.rtspHandshakeSecond = rtspHandshakeSecond; | |
| 681 | + } | |
| 682 | + | |
| 683 | + public String getRtspKeepAliveSecond() { | |
| 684 | + return rtspKeepAliveSecond; | |
| 685 | + } | |
| 686 | + | |
| 687 | + public void setRtspKeepAliveSecond(String rtspKeepAliveSecond) { | |
| 688 | + this.rtspKeepAliveSecond = rtspKeepAliveSecond; | |
| 689 | + } | |
| 690 | + | |
| 691 | + public String getRtspPort() { | |
| 692 | + return rtspPort; | |
| 693 | + } | |
| 694 | + | |
| 695 | + public void setRtspPort(String rtspPort) { | |
| 696 | + this.rtspPort = rtspPort; | |
| 697 | + } | |
| 698 | + | |
| 699 | + public String getRtspSSlport() { | |
| 700 | + return rtspSSlport; | |
| 701 | + } | |
| 702 | + | |
| 703 | + public void setRtspSSlport(String rtspSSlport) { | |
| 704 | + this.rtspSSlport = rtspSSlport; | |
| 705 | + } | |
| 706 | + | |
| 707 | + public String getShellMaxReqSize() { | |
| 708 | + return shellMaxReqSize; | |
| 709 | + } | |
| 710 | + | |
| 711 | + public void setShellMaxReqSize(String shellMaxReqSize) { | |
| 712 | + this.shellMaxReqSize = shellMaxReqSize; | |
| 713 | + } | |
| 714 | + | |
| 715 | + public String getShellPhell() { | |
| 716 | + return shellPhell; | |
| 717 | + } | |
| 718 | + | |
| 719 | + public void setShellPhell(String shellPhell) { | |
| 720 | + this.shellPhell = shellPhell; | |
| 721 | + } | |
| 203 | 722 | } | ... | ... |
src/main/java/com/genersoft/iot/vmp/conf/SipConfig.java
| 1 | 1 | package com.genersoft.iot.vmp.conf; |
| 2 | 2 | |
| 3 | -import lombok.Data; | |
| 3 | + | |
| 4 | 4 | import org.springframework.beans.factory.annotation.Value; |
| 5 | 5 | import org.springframework.context.annotation.Configuration; |
| 6 | 6 | |
| 7 | -@Data | |
| 8 | 7 | @Configuration("sipConfig") |
| 9 | 8 | public class SipConfig { |
| 10 | 9 | |
| ... | ... | @@ -22,4 +21,51 @@ public class SipConfig { |
| 22 | 21 | @Value("${sip.ptz.speed:50}") |
| 23 | 22 | Integer speed; |
| 24 | 23 | |
| 24 | + public String getSipIp() { | |
| 25 | + return sipIp; | |
| 26 | + } | |
| 27 | + | |
| 28 | + public void setSipIp(String sipIp) { | |
| 29 | + this.sipIp = sipIp; | |
| 30 | + } | |
| 31 | + | |
| 32 | + public Integer getSipPort() { | |
| 33 | + return sipPort; | |
| 34 | + } | |
| 35 | + | |
| 36 | + public void setSipPort(Integer sipPort) { | |
| 37 | + this.sipPort = sipPort; | |
| 38 | + } | |
| 39 | + | |
| 40 | + public String getSipDomain() { | |
| 41 | + return sipDomain; | |
| 42 | + } | |
| 43 | + | |
| 44 | + public void setSipDomain(String sipDomain) { | |
| 45 | + this.sipDomain = sipDomain; | |
| 46 | + } | |
| 47 | + | |
| 48 | + public String getSipId() { | |
| 49 | + return sipId; | |
| 50 | + } | |
| 51 | + | |
| 52 | + public void setSipId(String sipId) { | |
| 53 | + this.sipId = sipId; | |
| 54 | + } | |
| 55 | + | |
| 56 | + public String getSipPassword() { | |
| 57 | + return sipPassword; | |
| 58 | + } | |
| 59 | + | |
| 60 | + public void setSipPassword(String sipPassword) { | |
| 61 | + this.sipPassword = sipPassword; | |
| 62 | + } | |
| 63 | + | |
| 64 | + public Integer getSpeed() { | |
| 65 | + return speed; | |
| 66 | + } | |
| 67 | + | |
| 68 | + public void setSpeed(Integer speed) { | |
| 69 | + this.speed = speed; | |
| 70 | + } | |
| 25 | 71 | } | ... | ... |
src/main/java/com/genersoft/iot/vmp/conf/VManagerConfig.java
| 1 | 1 | package com.genersoft.iot.vmp.conf; |
| 2 | 2 | |
| 3 | -import lombok.Data; | |
| 4 | 3 | import org.springframework.beans.factory.annotation.Value; |
| 5 | 4 | import org.springframework.context.annotation.Configuration; |
| 6 | 5 | |
| ... | ... | @@ -9,7 +8,6 @@ import org.springframework.context.annotation.Configuration; |
| 9 | 8 | * @author: swwheihei |
| 10 | 9 | * @date: 2020年5月6日 下午2:46:00 |
| 11 | 10 | */ |
| 12 | -@Data | |
| 13 | 11 | @Configuration("vmConfig") |
| 14 | 12 | public class VManagerConfig { |
| 15 | 13 | |
| ... | ... | @@ -17,4 +15,11 @@ public class VManagerConfig { |
| 17 | 15 | private String database; |
| 18 | 16 | |
| 19 | 17 | |
| 18 | + public String getDatabase() { | |
| 19 | + return database; | |
| 20 | + } | |
| 21 | + | |
| 22 | + public void setDatabase(String database) { | |
| 23 | + this.database = database; | |
| 24 | + } | |
| 20 | 25 | } | ... | ... |
src/main/java/com/genersoft/iot/vmp/gb28181/bean/RecordInfo.java
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommander.java
| ... | ... | @@ -212,7 +212,7 @@ public class SIPCommander implements ISIPCommander { |
| 212 | 212 | try { |
| 213 | 213 | |
| 214 | 214 | String ssrc = streamSession.createPlaySsrc(); |
| 215 | - String transport = device.getTransport(); | |
| 215 | + String streamMode = device.getStreamMode().toUpperCase(); | |
| 216 | 216 | MediaServerConfig mediaInfo = storager.getMediaInfo(); |
| 217 | 217 | String mediaPort = null; |
| 218 | 218 | // 使用动态udp端口 |
| ... | ... | @@ -228,20 +228,24 @@ public class SIPCommander implements ISIPCommander { |
| 228 | 228 | content.append("s=Play\r\n"); |
| 229 | 229 | content.append("c=IN IP4 "+mediaInfo.getLocalIP()+"\r\n"); |
| 230 | 230 | content.append("t=0 0\r\n"); |
| 231 | - if("TCP".equals(transport)) { | |
| 231 | + if("TCP-PASSIVE".equals(streamMode)) { | |
| 232 | 232 | content.append("m=video "+ mediaPort +" TCP/RTP/AVP 96 98 97\r\n"); |
| 233 | - } | |
| 234 | - if("UDP".equals(transport)) { | |
| 233 | + }else if ("TCP-ACTIVE".equals(streamMode)) { | |
| 234 | + content.append("m=video "+ mediaPort +" TCP/RTP/AVP 96 98 97\r\n"); | |
| 235 | + }else if("UDP".equals(streamMode)) { | |
| 235 | 236 | content.append("m=video "+ mediaPort +" RTP/AVP 96 98 97\r\n"); |
| 236 | 237 | } |
| 237 | 238 | content.append("a=recvonly\r\n"); |
| 238 | 239 | content.append("a=rtpmap:96 PS/90000\r\n"); |
| 239 | 240 | content.append("a=rtpmap:98 H264/90000\r\n"); |
| 240 | 241 | content.append("a=rtpmap:97 MPEG4/90000\r\n"); |
| 241 | - if("TCP".equals(transport)){ | |
| 242 | - content.append("a=setup:passive\r\n"); | |
| 243 | - content.append("a=connection:new\r\n"); | |
| 244 | - } | |
| 242 | + if("TCP-PASSIVE".equals(streamMode)){ // tcp被动模式 | |
| 243 | + content.append("a=setup:passive\r\n"); | |
| 244 | + content.append("a=connection:new\r\n"); | |
| 245 | + }else if ("TCP-ACTIVE".equals(streamMode)) { // tcp主动模式 | |
| 246 | + content.append("a=setup:active\r\n"); | |
| 247 | + content.append("a=connection:new\r\n"); | |
| 248 | + } | |
| 245 | 249 | content.append("y="+ssrc+"\r\n");//ssrc |
| 246 | 250 | |
| 247 | 251 | Request request = headerProvider.createInviteRequest(device, channelId, content.toString(), null, "live", null); |
| ... | ... | @@ -286,21 +290,34 @@ public class SIPCommander implements ISIPCommander { |
| 286 | 290 | content.append("s=Playback\r\n"); |
| 287 | 291 | content.append("u="+channelId+":0\r\n"); |
| 288 | 292 | content.append("c=IN IP4 "+mediaInfo.getLocalIP()+"\r\n"); |
| 289 | - content.append("t="+DateUtil.yyyy_MM_dd_HH_mm_ssToTimestamp(startTime)+" "+DateUtil.yyyy_MM_dd_HH_mm_ssToTimestamp(endTime) +"\r\n"); | |
| 290 | - if(device.getTransport().equals("TCP")) { | |
| 291 | - content.append("m=video "+mediaInfo.getRtpProxyPort()+" TCP/RTP/AVP 96 98 97\r\n"); | |
| 293 | + content.append("t="+DateUtil.yyyy_MM_dd_HH_mm_ssToTimestamp(startTime)+" " | |
| 294 | + +DateUtil.yyyy_MM_dd_HH_mm_ssToTimestamp(endTime) +"\r\n"); | |
| 295 | + String mediaPort = null; | |
| 296 | + // 使用动态udp端口 | |
| 297 | + if (rtpEnable) { | |
| 298 | + mediaPort = zlmUtils.getNewRTPPort(ssrc) + ""; | |
| 299 | + }else { | |
| 300 | + mediaPort = mediaInfo.getRtpProxyPort(); | |
| 292 | 301 | } |
| 293 | - if(device.getTransport().equals("UDP")) { | |
| 294 | - content.append("m=video "+mediaInfo.getRtpProxyPort()+" RTP/AVP 96 98 97\r\n"); | |
| 302 | + String streamMode = device.getStreamMode().toUpperCase(); | |
| 303 | + if("TCP-PASSIVE".equals(streamMode)) { | |
| 304 | + content.append("m=video "+ mediaPort +" TCP/RTP/AVP 96 98 97\r\n"); | |
| 305 | + }else if ("TCP-ACTIVE".equals(streamMode)) { | |
| 306 | + content.append("m=video "+ mediaPort +" TCP/RTP/AVP 96 98 97\r\n"); | |
| 307 | + }else if("UDP".equals(streamMode)) { | |
| 308 | + content.append("m=video "+ mediaPort +" RTP/AVP 96 98 97\r\n"); | |
| 295 | 309 | } |
| 296 | 310 | content.append("a=recvonly\r\n"); |
| 297 | 311 | content.append("a=rtpmap:96 PS/90000\r\n"); |
| 298 | 312 | content.append("a=rtpmap:98 H264/90000\r\n"); |
| 299 | 313 | content.append("a=rtpmap:97 MPEG4/90000\r\n"); |
| 300 | - if(device.getTransport().equals("TCP")){ | |
| 301 | - content.append("a=setup:passive\r\n"); | |
| 302 | - content.append("a=connection:new\r\n"); | |
| 303 | - } | |
| 314 | + if("TCP-PASSIVE".equals(streamMode)){ // tcp被动模式 | |
| 315 | + content.append("a=setup:passive\r\n"); | |
| 316 | + content.append("a=connection:new\r\n"); | |
| 317 | + }else if ("TCP-ACTIVE".equals(streamMode)) { // tcp主动模式 | |
| 318 | + content.append("a=setup:active\r\n"); | |
| 319 | + content.append("a=connection:new\r\n"); | |
| 320 | + } | |
| 304 | 321 | content.append("y="+ssrc+"\r\n");//ssrc |
| 305 | 322 | |
| 306 | 323 | Request request = headerProvider.createPlaybackInviteRequest(device, channelId, content.toString(), null, "playback", null); | ... | ... |
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/request/impl/MessageRequestProcessor.java
| ... | ... | @@ -245,6 +245,9 @@ public class MessageRequestProcessor extends SIPRequestAbstractProcessor { |
| 245 | 245 | device.setManufacturer(XmlUtil.getText(rootElement,"Manufacturer")); |
| 246 | 246 | device.setModel(XmlUtil.getText(rootElement,"Model")); |
| 247 | 247 | device.setFirmware(XmlUtil.getText(rootElement,"Firmware")); |
| 248 | + if (StringUtils.isEmpty(device.getStreamMode())){ | |
| 249 | + device.setStreamMode("UDP"); | |
| 250 | + } | |
| 248 | 251 | storager.updateDevice(device); |
| 249 | 252 | cmder.catalogQuery(device); |
| 250 | 253 | } catch (DocumentException e) { | ... | ... |
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/request/impl/RegisterRequestProcessor.java
| ... | ... | @@ -113,6 +113,7 @@ public class RegisterRequestProcessor extends SIPRequestAbstractProcessor { |
| 113 | 113 | SipUri uri = (SipUri) address.getURI(); |
| 114 | 114 | String deviceId = uri.getUser(); |
| 115 | 115 | device = new Device(); |
| 116 | + device.setStreamMode("UDP"); | |
| 116 | 117 | device.setDeviceId(deviceId); |
| 117 | 118 | device.setHost(host); |
| 118 | 119 | // 注销成功 | ... | ... |
src/main/java/com/genersoft/iot/vmp/vmanager/device/DeviceController.java
| ... | ... | @@ -151,11 +151,11 @@ public class DeviceController { |
| 151 | 151 | return new ResponseEntity<>(null,HttpStatus.OK); |
| 152 | 152 | } |
| 153 | 153 | |
| 154 | - @GetMapping("/devices/{deviceId}/transport/{transport}") | |
| 155 | - @PostMapping("/devices/{deviceId}/transport/{transport}") | |
| 156 | - public ResponseEntity<PageResult> updateTransport(@PathVariable String deviceId, @PathVariable String transport){ | |
| 154 | + @GetMapping("/devices/{deviceId}/transport/{streamMode}") | |
| 155 | + @PostMapping("/devices/{deviceId}/transport/{streamMode}") | |
| 156 | + public ResponseEntity<PageResult> updateTransport(@PathVariable String deviceId, @PathVariable String streamMode){ | |
| 157 | 157 | Device device = storager.queryVideoDevice(deviceId); |
| 158 | - device.setTransport(transport); | |
| 158 | + device.setStreamMode(streamMode); | |
| 159 | 159 | storager.updateDevice(device); |
| 160 | 160 | return new ResponseEntity<>(null,HttpStatus.OK); |
| 161 | 161 | } | ... | ... |
src/main/java/com/genersoft/iot/vmp/vmanager/play/PlayController.java
| ... | ... | @@ -76,23 +76,8 @@ public class PlayController { |
| 76 | 76 | }else { |
| 77 | 77 | lockFlag = false; |
| 78 | 78 | streamInfo = storager.queryPlay(streamInfo); |
| 79 | - // 获取媒体信息 | |
| 80 | - JSONObject mediaList = zlmresTfulUtils.getMediaList("rtp", "rtmp"); | |
| 81 | - if (mediaList.getInteger("code") == 0) { | |
| 82 | - JSONArray data = mediaList.getJSONArray("data"); | |
| 83 | - if (data!= null) { | |
| 84 | - for (Object datum : data) { | |
| 85 | - JSONObject media = (JSONObject)datum; | |
| 86 | - if (streamId.equals(media.getString("stream"))) { | |
| 87 | - streamInfo.setTracks(media.getJSONArray("tracks")); | |
| 88 | - storager.startPlay(streamInfo); | |
| 89 | - } | |
| 90 | - } | |
| 91 | - } | |
| 92 | - } | |
| 93 | 79 | }; |
| 94 | 80 | } |
| 95 | - streamInfo = storager.queryPlayByDevice(deviceId, channelId); | |
| 96 | 81 | } catch (InterruptedException e) { |
| 97 | 82 | e.printStackTrace(); |
| 98 | 83 | } | ... | ... |
web_src/src/components/gb28181/devicePlayer.vue
| 1 | 1 | <template> |
| 2 | 2 | <div id="devicePlayer"> |
| 3 | 3 | <el-dialog title="视频播放" top="0" :visible.sync="showVideoDialog" :destroy-on-close="true" @close="close()"> |
| 4 | - <LivePlayer v-if="showVideoDialog" ref="videoPlayer" :videoUrl="videoUrl" :error="videoError" :hasaudio="hasaudio" fluent autoplay live ></LivePlayer> | |
| 4 | + <LivePlayer v-if="showVideoDialog && hasaudio" ref="videoPlayer" :videoUrl="videoUrl" :error="videoError" hasaudio fluent autoplay live ></LivePlayer> | |
| 5 | + <LivePlayer v-if="showVideoDialog && !hasaudio" ref="videoPlayer" :videoUrl="videoUrl" :error="videoError" fluent autoplay live ></LivePlayer> | |
| 5 | 6 | <div id="shared" style="text-align: right; margin-top: 1rem;"> |
| 6 | 7 | <el-tabs v-model="tabActiveName"> |
| 7 | 8 | <el-tab-pane label="媒体流信息" name="media"> |
| ... | ... | @@ -122,20 +123,20 @@ |
| 122 | 123 | methods: { |
| 123 | 124 | |
| 124 | 125 | play: function(streamInfo, deviceId, channelId, hasAudio) { |
| 125 | - console.log(hasAudio); | |
| 126 | - this.hasaudio = hasAudio; | |
| 127 | - // 根据媒体流信息二次判断 | |
| 128 | - if( this.hasaudio && !!streamInfo.tracks && streamInfo.tracks.length > 0) { | |
| 129 | - var realHasAudio = false; | |
| 130 | - for (let i = 0; i < streamInfo.tracks; i++) { | |
| 131 | - if (streamInfo.tracks[i].codec_type == 1) { // 判断为音频 | |
| 132 | - realHasAudio = true; | |
| 133 | - } | |
| 134 | - } | |
| 135 | - this.hasaudio = realHasAudio && this.hasaudio; | |
| 126 | + // this.hasaudio = hasAudio; | |
| 127 | + if (!hasAudio) { // hasaudio == false时设置播放器hasaudio false, 否则不设置 | |
| 128 | + this.hasaudio = hasAudio; | |
| 136 | 129 | } |
| 137 | - console.log("111") | |
| 138 | - console.log(this.hasaudio) | |
| 130 | + // 根据媒体流信息二次判断 | |
| 131 | + // if( this.hasaudio && !!streamInfo.tracks && streamInfo.tracks.length > 0) { | |
| 132 | + // var realHasAudio = false; | |
| 133 | + // for (let i = 0; i < streamInfo.tracks; i++) { | |
| 134 | + // if (streamInfo.tracks[i].codec_type == 1) { // 判断为音频 | |
| 135 | + // realHasAudio = true; | |
| 136 | + // } | |
| 137 | + // } | |
| 138 | + // this.hasaudio = realHasAudio && this.hasaudio; | |
| 139 | + // } | |
| 139 | 140 | this.ssrc = streamInfo.ssrc; |
| 140 | 141 | this.deviceId = deviceId; |
| 141 | 142 | this.channelId = channelId; | ... | ... |
web_src/src/components/videoList.vue
| ... | ... | @@ -29,12 +29,12 @@ |
| 29 | 29 | </el-table-column> |
| 30 | 30 | <el-table-column prop="model" label="固件版本" align="center"> |
| 31 | 31 | </el-table-column> |
| 32 | - <el-table-column label="通讯方式" align="center"> | |
| 32 | + <el-table-column label="流传输模式" align="center" width="160"> | |
| 33 | 33 | <template slot-scope="scope"> |
| 34 | - <el-select @change="transportChange(scope.row)" v-model="scope.row.streamMode" placeholder="请选择"> | |
| 34 | + <el-select size="mini" @change="transportChange(scope.row)" v-model="scope.row.streamMode" placeholder="请选择"> | |
| 35 | 35 | <el-option key="UDP" label="UDP" value="UDP"></el-option> |
| 36 | - <el-option key="TCP-ACTIVE" label="TCP主动模式" value="TCP-ACTIVE"></el-option> | |
| 37 | - <el-option key="TCP-PASSIVE" label="TCP被动模式" :disabled="true" value="TCP-PASSIVE"></el-option> | |
| 36 | + <el-option key="TCP-ACTIVE" label="TCP主动模式" :disabled="true" value="TCP-ACTIVE"></el-option> | |
| 37 | + <el-option key="TCP-PASSIVE" label="TCP被动模式" value="TCP-PASSIVE"></el-option> | |
| 38 | 38 | </el-select> |
| 39 | 39 | </template> |
| 40 | 40 | </el-table-column> |
| ... | ... | @@ -189,14 +189,14 @@ |
| 189 | 189 | }); |
| 190 | 190 | }, |
| 191 | 191 | transportChange: function (row) { |
| 192 | - console.log(`修改传输方式为 ${row.transport}:${row.deviceId} `); | |
| 192 | + console.log(row); | |
| 193 | + console.log(`修改传输方式为 ${row.streamMode}:${row.deviceId} `); | |
| 193 | 194 | let that = this; |
| 194 | 195 | this.$axios({ |
| 195 | 196 | method: 'get', |
| 196 | - url: '/api/devices/' + row.deviceId + '/transport/' + row.transport | |
| 197 | + url: '/api/devices/' + row.deviceId + '/transport/' + row.streamMode | |
| 197 | 198 | }).then(function(res) { |
| 198 | - let ssrc = res.data.ssrc; | |
| 199 | - that.$refs.devicePlayer.play(ssrc,deviceId,channelId); | |
| 199 | + | |
| 200 | 200 | }).catch(function(e) { |
| 201 | 201 | }); |
| 202 | 202 | } | ... | ... |