Commit 2d492c5b6b33554d9512753e92dd1d89a489e3f2
1 parent
df717135
国标回放超时时间使用点播超时一样的字段
Showing
2 changed files
with
7 additions
and
3 deletions
src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/playback/PlaybackController.java
| 1 | package com.genersoft.iot.vmp.vmanager.gb28181.playback; | 1 | package com.genersoft.iot.vmp.vmanager.gb28181.playback; |
| 2 | 2 | ||
| 3 | import com.genersoft.iot.vmp.common.StreamInfo; | 3 | import com.genersoft.iot.vmp.common.StreamInfo; |
| 4 | +import com.genersoft.iot.vmp.conf.UserSetting; | ||
| 4 | import com.genersoft.iot.vmp.conf.exception.ControllerException; | 5 | import com.genersoft.iot.vmp.conf.exception.ControllerException; |
| 5 | import com.genersoft.iot.vmp.conf.exception.ServiceException; | 6 | import com.genersoft.iot.vmp.conf.exception.ServiceException; |
| 6 | import com.genersoft.iot.vmp.conf.exception.SsrcTransactionNotFoundException; | 7 | import com.genersoft.iot.vmp.conf.exception.SsrcTransactionNotFoundException; |
| @@ -64,13 +65,16 @@ public class PlaybackController { | @@ -64,13 +65,16 @@ public class PlaybackController { | ||
| 64 | @Autowired | 65 | @Autowired |
| 65 | private DeferredResultHolder resultHolder; | 66 | private DeferredResultHolder resultHolder; |
| 66 | 67 | ||
| 68 | + @Autowired | ||
| 69 | + private UserSetting userSetting; | ||
| 70 | + | ||
| 67 | @Operation(summary = "开始视频回放") | 71 | @Operation(summary = "开始视频回放") |
| 68 | @Parameter(name = "deviceId", description = "设备国标编号", required = true) | 72 | @Parameter(name = "deviceId", description = "设备国标编号", required = true) |
| 69 | @Parameter(name = "channelId", description = "通道国标编号", required = true) | 73 | @Parameter(name = "channelId", description = "通道国标编号", required = true) |
| 70 | @Parameter(name = "startTime", description = "开始时间", required = true) | 74 | @Parameter(name = "startTime", description = "开始时间", required = true) |
| 71 | @Parameter(name = "endTime", description = "结束时间", required = true) | 75 | @Parameter(name = "endTime", description = "结束时间", required = true) |
| 72 | @GetMapping("/start/{deviceId}/{channelId}") | 76 | @GetMapping("/start/{deviceId}/{channelId}") |
| 73 | - public DeferredResult<WVPResult<StreamContent>> play(@PathVariable String deviceId, @PathVariable String channelId, | 77 | + public DeferredResult<WVPResult<StreamContent>> start(@PathVariable String deviceId, @PathVariable String channelId, |
| 74 | String startTime, String endTime) { | 78 | String startTime, String endTime) { |
| 75 | 79 | ||
| 76 | if (logger.isDebugEnabled()) { | 80 | if (logger.isDebugEnabled()) { |
| @@ -79,7 +83,7 @@ public class PlaybackController { | @@ -79,7 +83,7 @@ public class PlaybackController { | ||
| 79 | 83 | ||
| 80 | String uuid = UUID.randomUUID().toString(); | 84 | String uuid = UUID.randomUUID().toString(); |
| 81 | String key = DeferredResultHolder.CALLBACK_CMD_PLAYBACK + deviceId + channelId; | 85 | String key = DeferredResultHolder.CALLBACK_CMD_PLAYBACK + deviceId + channelId; |
| 82 | - DeferredResult<WVPResult<StreamContent>> result = new DeferredResult<>(30000L); | 86 | + DeferredResult<WVPResult<StreamContent>> result = new DeferredResult<>(userSetting.getPlayTimeout().longValue()); |
| 83 | resultHolder.put(key, uuid, result); | 87 | resultHolder.put(key, uuid, result); |
| 84 | 88 | ||
| 85 | WVPResult<StreamContent> wvpResult = new WVPResult<>(); | 89 | WVPResult<StreamContent> wvpResult = new WVPResult<>(); |
src/main/resources/all-application.yml
| @@ -167,7 +167,7 @@ user-settings: | @@ -167,7 +167,7 @@ user-settings: | ||
| 167 | senior-sdp: false | 167 | senior-sdp: false |
| 168 | # 保存移动位置历史轨迹:true:保留历史数据,false:仅保留最后的位置(默认) | 168 | # 保存移动位置历史轨迹:true:保留历史数据,false:仅保留最后的位置(默认) |
| 169 | save-position-history: false | 169 | save-position-history: false |
| 170 | - # 点播等待超时时间,单位:毫秒 | 170 | + # 点播/录像回放 等待超时时间,单位:毫秒 |
| 171 | play-timeout: 18000 | 171 | play-timeout: 18000 |
| 172 | # 上级点播等待超时时间,单位:毫秒 | 172 | # 上级点播等待超时时间,单位:毫秒 |
| 173 | platform-play-timeout: 60000 | 173 | platform-play-timeout: 60000 |