From c7d15150237c946fbb4f5547dab0018a5f573d88 Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: 星期二, 27 六月 2023 15:34:38 +0800 Subject: [PATCH] 增加redis通道 --- src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/ptz/PtzController.java | 3 + src/main/java/com/genersoft/iot/vmp/vmanager/rtp/RtpController.java | 76 ++++++++++++++++++++++++++++++++++++++ src/main/java/com/genersoft/iot/vmp/service/bean/MessageForPushChannel.java | 17 +++++++- src/main/java/com/genersoft/iot/vmp/common/VideoManagerConstants.java | 15 +++++++ 4 files changed, 108 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/common/VideoManagerConstants.java b/src/main/java/com/genersoft/iot/vmp/common/VideoManagerConstants.java index ccfe77e..8105c0b 100644 --- a/src/main/java/com/genersoft/iot/vmp/common/VideoManagerConstants.java +++ b/src/main/java/com/genersoft/iot/vmp/common/VideoManagerConstants.java @@ -101,6 +101,21 @@ */ public static final String VM_MSG_STREAM_PUSH_REQUESTED = "VM_MSG_STREAM_PUSH_REQUESTED"; + /** + * redis 娑堟伅閫氱煡涓婄骇骞冲彴寮�濮嬭鐪嬫祦 + */ + public static final String VM_MSG_STREAM_START_PLAY_NOTIFY = "VM_MSG_STREAM_START_PLAY_NOTIFY"; + + /** + * redis 娑堟伅閫氱煡涓婄骇骞冲彴鍋滄瑙傜湅娴� + */ + public static final String VM_MSG_STREAM_STOP_PLAY_NOTIFY = "VM_MSG_STREAM_STOP_PLAY_NOTIFY"; + + /** + * redis 娑堟伅鎺ユ敹鍏抽棴涓�涓帹娴� + */ + public static final String VM_MSG_STREAM_PUSH_CLOSE_REQUESTED = "VM_MSG_STREAM_PUSH_CLOSE_REQUESTED"; + /** * redis 娑堟伅閫氱煡骞冲彴閫氱煡璁惧鎺ㄦ祦缁撴灉 diff --git a/src/main/java/com/genersoft/iot/vmp/service/bean/MessageForPushChannel.java b/src/main/java/com/genersoft/iot/vmp/service/bean/MessageForPushChannel.java index 8491fc5..886f8c2 100644 --- a/src/main/java/com/genersoft/iot/vmp/service/bean/MessageForPushChannel.java +++ b/src/main/java/com/genersoft/iot/vmp/service/bean/MessageForPushChannel.java @@ -1,7 +1,5 @@ package com.genersoft.iot.vmp.service.bean; -import java.util.stream.Stream; - /** * 褰撲笂绾у钩鍙� * @author lin @@ -29,9 +27,14 @@ private String gbId; /** - * 璇锋眰鐨勫钩鍙癐D + * 璇锋眰鐨勫钩鍙板浗鏍囩紪鍙� */ private String platFormId; + + /** + * 璇锋眰鐨勫钩鍙拌嚜澧濱D + */ + private String platFormIndex; /** * 璇锋眰骞冲彴鍚嶇О @@ -128,4 +131,12 @@ public void setMediaServerId(String mediaServerId) { this.mediaServerId = mediaServerId; } + + public String getPlatFormIndex() { + return platFormIndex; + } + + public void setPlatFormIndex(String platFormIndex) { + this.platFormIndex = platFormIndex; + } } diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/ptz/PtzController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/ptz/PtzController.java index e9ea457..283cfe3 100644 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/ptz/PtzController.java +++ b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/ptz/PtzController.java @@ -97,6 +97,9 @@ cmdCode = 32; break; case "stop": + horizonSpeed = 0; + verticalSpeed = 0; + zoomSpeed = 0; break; default: break; diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/rtp/RtpController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/rtp/RtpController.java new file mode 100644 index 0000000..304ccf9 --- /dev/null +++ b/src/main/java/com/genersoft/iot/vmp/vmanager/rtp/RtpController.java @@ -0,0 +1,76 @@ +package com.genersoft.iot.vmp.vmanager.rtp; + +import com.genersoft.iot.vmp.conf.SipConfig; +import com.genersoft.iot.vmp.conf.UserSetting; +import com.genersoft.iot.vmp.conf.VersionInfo; +import com.genersoft.iot.vmp.conf.exception.ControllerException; +import com.genersoft.iot.vmp.media.zlm.ZlmHttpHookSubscribe; +import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem; +import com.genersoft.iot.vmp.service.*; +import com.genersoft.iot.vmp.storager.IRedisCatchStorage; +import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +@SuppressWarnings("rawtypes") +@Tag(name = "绗笁鏂规湇鍔″鎺�") + +@RestController +@RequestMapping("/api/rtp") +public class RtpController { + + @Autowired + private ZlmHttpHookSubscribe zlmHttpHookSubscribe; + + @Autowired + private IMediaServerService mediaServerService; + + @Autowired + private VersionInfo versionInfo; + + @Autowired + private SipConfig sipConfig; + + @Autowired + private UserSetting userSetting; + + @Autowired + private IDeviceService deviceService; + + @Autowired + private IDeviceChannelService channelService; + + @Autowired + private IStreamPushService pushService; + + + @Autowired + private IStreamProxyService proxyService; + + + @Value("${server.port}") + private int serverPort; + + + @Autowired + private IRedisCatchStorage redisCatchStorage; + + + @GetMapping(value = "/send/ready") + @ResponseBody + @Operation(summary = "涓哄彂閫佽棰戞祦鑾峰彇淇℃伅") + public List<MediaServerItem> getMediaServerList(Boolean onlySender, ) { + MediaServerItem mediaServerItem = mediaServerService.getMediaServerForMinimumLoad(null); + if (mediaServerItem == null) { + throw new ControllerException(ErrorCode.ERROR100.getCode(),"娌℃湁鍙敤鐨凪ediaServer"); + } + mediaServerService.openRTPServer() + return mediaServerService.getAll(); + } + +} -- Gitblit v1.8.0