From eb2a4139fa7e1ed066c03c73ffb1ac92633d2703 Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: 星期三, 09 十一月 2022 10:18:42 +0800
Subject: [PATCH] 添加缺少的导入
---
src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/play/PlayController.java | 20 +++++++++++++++-----
1 files changed, 15 insertions(+), 5 deletions(-)
diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/play/PlayController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/play/PlayController.java
index d22e56b..ae76b95 100644
--- a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/play/PlayController.java
+++ b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/play/PlayController.java
@@ -1,7 +1,8 @@
package com.genersoft.iot.vmp.vmanager.gb28181.play;
-import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson2.JSONArray;
import com.genersoft.iot.vmp.common.StreamInfo;
+import com.genersoft.iot.vmp.conf.UserSetting;
import com.genersoft.iot.vmp.conf.exception.ControllerException;
import com.genersoft.iot.vmp.conf.exception.SsrcTransactionNotFoundException;
import com.genersoft.iot.vmp.gb28181.bean.SsrcTransaction;
@@ -32,11 +33,13 @@
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
-import com.alibaba.fastjson.JSONObject;
+import com.alibaba.fastjson2.JSONObject;
import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander;
import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
import org.springframework.web.context.request.async.DeferredResult;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
import javax.sip.InvalidArgumentException;
import javax.sip.SipException;
import java.text.ParseException;
@@ -78,18 +81,25 @@
@Autowired
private IMediaServerService mediaServerService;
+ @Autowired
+ private UserSetting userSetting;
+
@Operation(summary = "寮�濮嬬偣鎾�")
@Parameter(name = "deviceId", description = "璁惧鍥芥爣缂栧彿", required = true)
@Parameter(name = "channelId", description = "閫氶亾鍥芥爣缂栧彿", required = true)
@GetMapping("/start/{deviceId}/{channelId}")
- public DeferredResult<WVPResult<StreamInfo>> play(@PathVariable String deviceId,
- @PathVariable String channelId) {
+ public DeferredResult<WVPResult<StreamInfo>> play(HttpServletRequest request, @PathVariable String deviceId,
+ @PathVariable String channelId) {
// 鑾峰彇鍙敤鐨剒lm
Device device = storager.queryVideoDevice(deviceId);
MediaServerItem newMediaServerItem = playService.getNewMediaServerItem(device);
PlayResult playResult = playService.play(newMediaServerItem, deviceId, channelId, null, null, null);
-
+ playResult.getResult().onCompletion(()->{
+ WVPResult<StreamInfo> result = (WVPResult<StreamInfo>)playResult.getResult().getResult();
+ result.getData().channgeStreamIp(request.getLocalAddr());
+ playResult.getResult().setResult(result);
+ });
return playResult.getResult();
}
--
Gitblit v1.8.0