From 71030ca6bc2a4a2eb05f4b63fa83dda5e89ac68b Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: 星期四, 13 四月 2023 17:50:33 +0800
Subject: [PATCH] 更新readme
---
src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/media/MediaController.java | 25 +++++++++++++------------
1 files changed, 13 insertions(+), 12 deletions(-)
diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/media/MediaController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/media/MediaController.java
index 6f7132e..8e0e201 100644
--- a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/media/MediaController.java
+++ b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/media/MediaController.java
@@ -5,11 +5,11 @@
import com.genersoft.iot.vmp.conf.security.SecurityUtils;
import com.genersoft.iot.vmp.conf.security.dto.LoginUser;
import com.genersoft.iot.vmp.media.zlm.dto.StreamAuthorityInfo;
-import com.genersoft.iot.vmp.service.IStreamProxyService;
import com.genersoft.iot.vmp.service.IMediaService;
+import com.genersoft.iot.vmp.service.IStreamProxyService;
import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
import com.genersoft.iot.vmp.vmanager.bean.ErrorCode;
-import com.genersoft.iot.vmp.vmanager.bean.WVPResult;
+import com.genersoft.iot.vmp.vmanager.bean.StreamContent;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
@@ -24,7 +24,7 @@
@Tag(name = "濯掍綋娴佺浉鍏�")
@Controller
-@CrossOrigin
+
@RequestMapping(value = "/api/media")
public class MediaController {
@@ -53,16 +53,18 @@
@Parameter(name = "useSourceIpAsStreamIp", description = "鏄惁浣跨敤璇锋眰IP浣滀负杩斿洖鐨勫湴鍧�IP")
@GetMapping(value = "/stream_info_by_app_and_stream")
@ResponseBody
- public StreamInfo getStreamInfoByAppAndStream(HttpServletRequest request, @RequestParam String app,
- @RequestParam String stream,
- @RequestParam(required = false) String mediaServerId,
- @RequestParam(required = false) String callId,
- @RequestParam(required = false) Boolean useSourceIpAsStreamIp){
+ public StreamContent getStreamInfoByAppAndStream(HttpServletRequest request, @RequestParam String app,
+ @RequestParam String stream,
+ @RequestParam(required = false) String mediaServerId,
+ @RequestParam(required = false) String callId,
+ @RequestParam(required = false) Boolean useSourceIpAsStreamIp){
boolean authority = false;
if (callId != null) {
// 鏉冮檺鏍¢獙
StreamAuthorityInfo streamAuthorityInfo = redisCatchStorage.getStreamAuthorityInfo(app, stream);
- if (streamAuthorityInfo.getCallId().equals(callId)) {
+ if (streamAuthorityInfo != null
+ && streamAuthorityInfo.getCallId() != null
+ && streamAuthorityInfo.getCallId().equals(callId)) {
authority = true;
}else {
throw new ControllerException(ErrorCode.ERROR400);
@@ -86,9 +88,8 @@
streamInfo = mediaService.getStreamInfoByAppAndStreamWithCheck(app, stream, mediaServerId, authority);
}
- WVPResult<StreamInfo> result = new WVPResult<>();
if (streamInfo != null){
- return streamInfo;
+ return new StreamContent(streamInfo);
}else {
//鑾峰彇娴佸け璐ワ紝閲嶅惎鎷夋祦鍚庨噸璇曚竴娆�
streamProxyService.stop(app,stream);
@@ -107,7 +108,7 @@
streamInfo = mediaService.getStreamInfoByAppAndStreamWithCheck(app, stream, mediaServerId, authority);
}
if (streamInfo != null){
- return streamInfo;
+ return new StreamContent(streamInfo);
}else {
throw new ControllerException(ErrorCode.ERROR100);
}
--
Gitblit v1.8.0