This commit is contained in:
shikong 2023-12-14 15:44:04 +08:00
parent 5ae7fc9972
commit db58ea8b95
2 changed files with 4 additions and 6 deletions

View File

@ -85,7 +85,7 @@ public class VideoController {
return gb28181DownloadService.realtimeVideoUrl(req.getDeviceCode()); return gb28181DownloadService.realtimeVideoUrl(req.getDeviceCode());
} }
@Operation(summary = "获取实时视频 (返回视频url)") @Operation(summary = "续签实时视频 +60s")
@GetMapping(value = "/device/realtime/renew") @GetMapping(value = "/device/realtime/renew")
@ResponseBody @ResponseBody
public JsonResponse<Void> renew(@ParameterObject RealtimeVideoReq req) { public JsonResponse<Void> renew(@ParameterObject RealtimeVideoReq req) {
@ -93,7 +93,7 @@ public class VideoController {
return JsonResponse.success(null); return JsonResponse.success(null);
} }
@Operation(summary = "获取实时视频 (返回视频url)") @Operation(summary = "关闭实时视频 60s 后关闭")
@GetMapping(value = "/device/realtime/close") @GetMapping(value = "/device/realtime/close")
@ResponseBody @ResponseBody
public JsonResponse<Void> close(@ParameterObject RealtimeVideoReq req) { public JsonResponse<Void> close(@ParameterObject RealtimeVideoReq req) {

View File

@ -65,8 +65,6 @@ import java.util.Optional;
import java.util.Vector; import java.util.Vector;
import java.util.concurrent.*; import java.util.concurrent.*;
import static cn.skcks.docking.gb28181.wvp.orm.mybatis.dynamic.mapper.WvpProxyDeviceDynamicSqlSupport.deviceCode;
@Slf4j @Slf4j
@Service @Service
@RequiredArgsConstructor @RequiredArgsConstructor
@ -290,12 +288,12 @@ public class Gb28181DownloadService {
if(docking == null){ if(docking == null){
return; return;
} }
closeExistRequest(deviceCode, device, docking);
String cacheKey = CacheUtil.getKey(docking.getGbDeviceId(), device.getGbDeviceChannelId()); String cacheKey = CacheUtil.getKey(docking.getGbDeviceId(), device.getGbDeviceChannelId());
String existCallId = RedisUtil.StringOps.get(cacheKey); String existCallId = RedisUtil.StringOps.get(cacheKey);
realtimeVideoInfoMap.computeIfPresent(cacheKey, (key, videoInfo) -> { realtimeVideoInfoMap.computeIfPresent(cacheKey, (key, videoInfo) -> {
autoCloseReadtimeVideo(docking,device,videoInfo,cacheKey,existCallId); autoCloseReadtimeVideo(docking,device,videoInfo,cacheKey,existCallId);
return null; return videoInfo;
}); });
} }