From 845ce5331322b18f1514c476c86a0e352f79dde9 Mon Sep 17 00:00:00 2001
From: lovemen <50255147@qq.com>
Date: 星期四, 23 二月 2023 15:35:42 +0800
Subject: [PATCH] 解决上级平台点播proxy代理流时未携带SSRC信息,gbStream采用默认0000000000作为SSRC无法播放问题。以及上级平台点播proxy代理流时回复的SDP本地端口号为0不兼容问题。
---
src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/MobilePosition/MobilePositionController.java | 42 ++++++++++++++++++++++++++++--------------
1 files changed, 28 insertions(+), 14 deletions(-)
diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/MobilePosition/MobilePositionController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/MobilePosition/MobilePositionController.java
index f399f30..305d488 100644
--- a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/MobilePosition/MobilePositionController.java
+++ b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/MobilePosition/MobilePositionController.java
@@ -1,39 +1,30 @@
package com.genersoft.iot.vmp.vmanager.gb28181.MobilePosition;
-import java.text.ParseException;
-import java.util.List;
-import java.util.UUID;
-
import com.genersoft.iot.vmp.conf.exception.ControllerException;
import com.genersoft.iot.vmp.gb28181.bean.Device;
import com.genersoft.iot.vmp.gb28181.bean.MobilePosition;
import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder;
import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage;
import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander;
+import com.genersoft.iot.vmp.service.IDeviceChannelService;
import com.genersoft.iot.vmp.service.IDeviceService;
import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
import com.genersoft.iot.vmp.vmanager.bean.ErrorCode;
-import com.genersoft.iot.vmp.vmanager.bean.WVPResult;
import com.github.pagehelper.util.StringUtil;
-
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-import org.springframework.web.bind.annotation.CrossOrigin;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
import org.springframework.web.context.request.async.DeferredResult;
import javax.sip.InvalidArgumentException;
import javax.sip.SipException;
+import java.text.ParseException;
+import java.util.List;
+import java.util.UUID;
/**
* 浣嶇疆淇℃伅绠$悊
@@ -57,6 +48,9 @@
@Autowired
private IDeviceService deviceService;
+
+ @Autowired
+ private IDeviceChannelService deviceChannelService;
/**
* 鏌ヨ鍘嗗彶杞ㄨ抗
@@ -162,4 +156,24 @@
throw new ControllerException(ErrorCode.ERROR100);
}
}
+
+ /**
+ * 鏁版嵁浣嶇疆淇℃伅鏍煎紡澶勭悊
+ * @param deviceId 璁惧ID
+ * @return true = 鍛戒护鍙戦�佹垚鍔�
+ */
+ @Operation(summary = "鏁版嵁浣嶇疆淇℃伅鏍煎紡澶勭悊")
+ @Parameter(name = "deviceId", description = "璁惧鍥芥爣缂栧彿", required = true)
+ @GetMapping("/transform/{deviceId}")
+ public void positionTransform(@PathVariable String deviceId) {
+
+ Device device = deviceService.getDevice(deviceId);
+ if (device == null) {
+ throw new ControllerException(ErrorCode.ERROR400.getCode(), "鏈壘鍒拌澶囷細 " + deviceId);
+ }
+ boolean result = deviceChannelService.updateAllGps(device);
+ if (!result) {
+ throw new ControllerException(ErrorCode.ERROR100);
+ }
+ }
}
--
Gitblit v1.8.0