From ed0269a930eb34767f186458c3428b165a8611b9 Mon Sep 17 00:00:00 2001 From: yinhuaiwei Date: Thu, 30 Jul 2026 09:21:01 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E8=A7=86=E9=A2=91=E6=B5=81=E4=BB=8Esys=5Fconfig=E8=A1=A8?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=EF=BC=8C=E8=A6=81=E6=B1=82=E6=95=B0=E6=8D=AE?= =?UTF-8?q?key=E5=80=BC=E4=B8=BArtsp=5FXXX=EF=BC=8Cvalue=E5=80=BC=E4=B8=BA?= =?UTF-8?q?=E5=AE=9E=E9=99=85=E8=A7=86=E9=A2=91=E6=B5=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ivs/controller/IvsStreamController.java | 33 ++++++++++--------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/inspect-ivs/src/main/java/com/inspect/ivs/controller/IvsStreamController.java b/inspect-ivs/src/main/java/com/inspect/ivs/controller/IvsStreamController.java index 24f2165..7ae1f38 100644 --- a/inspect-ivs/src/main/java/com/inspect/ivs/controller/IvsStreamController.java +++ b/inspect-ivs/src/main/java/com/inspect/ivs/controller/IvsStreamController.java @@ -9,10 +9,10 @@ import com.inspect.ivs.enums.RtspType; import com.inspect.ivs.service.IvsCommonService; import com.inspect.ivs.service.XinTongComponent; import com.inspect.ivs.service.ZlMediaComponent; -import com.inspect.ivs.view.IvsVideoRtspView; import com.inspect.ivs.view.IvsStreamStartView; -import com.inspect.ivs.vo.IvsVideoRtspVo; +import com.inspect.ivs.view.IvsVideoRtspView; import com.inspect.ivs.vo.IvsStreamStartVo; +import com.inspect.ivs.vo.IvsVideoRtspVo; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Value; @@ -27,17 +27,13 @@ import javax.annotation.Resource; @RequestMapping({"/api/v1/stream"}) public class IvsStreamController { private static final Logger log = LoggerFactory.getLogger(IvsStreamController.class); - + private final IvsCommonService ivsCommonService; + private final ZlMediaComponent zlMediaComponent; + private final XinTongComponent xinTongComponent; @Value("${ivs.test:false}") private Boolean bIvsTestMode; - @Value("${rtsp.type:xintong}") private RtspType rtspType; - - private final IvsCommonService ivsCommonService; - private final ZlMediaComponent zlMediaComponent; - private final XinTongComponent xinTongComponent; - @Resource private RedisService redisService; @@ -61,12 +57,19 @@ public class IvsStreamController { ivsVideoRtspView = new IvsVideoRtspView(); ivsVideoRtspView.setRtspURL("rtsp://admin:htjc2018@192.168.1.134:554/cam/realmonitor?channel=3&subtype=0"); } else { - String label = java.util.UUID.randomUUID().toString().trim().replaceAll(StringUtils.DASH, StringUtils.EMPTY); - ivsVideoRtspView = ivsCommonService.postJson( - label, - ivsVideoRtspVo, - IvsConst.URI_VIDEO_RTSP, - IvsVideoRtspView.class); + String rtspUrl = (String) this.redisService.redisTemplate.opsForValue().get("sys_config:rtsp_" + ivsStreamStartVo.getSerial()); + if (StringUtils.isNotEmpty(rtspUrl)) { + log.info("IVS_STREAM_START SYS_CONFIG_RTSP: {}", rtspUrl); + ivsVideoRtspView = new IvsVideoRtspView(); + ivsVideoRtspView.setRtspURL(rtspUrl); + } else { + String label = java.util.UUID.randomUUID().toString().trim().replaceAll(StringUtils.DASH, StringUtils.EMPTY); + ivsVideoRtspView = ivsCommonService.postJson( + label, + ivsVideoRtspVo, + IvsConst.URI_VIDEO_RTSP, + IvsVideoRtspView.class); + } } log.debug("[IVS] {}", ivsVideoRtspView);