Commit c7d15150237c946fbb4f5547dab0018a5f573d88
1 parent
72496332
增加redis通道
Showing
4 changed files
with
108 additions
and
3 deletions
src/main/java/com/genersoft/iot/vmp/common/VideoManagerConstants.java
| ... | ... | @@ -101,6 +101,21 @@ public class VideoManagerConstants { |
| 101 | 101 | */ |
| 102 | 102 | public static final String VM_MSG_STREAM_PUSH_REQUESTED = "VM_MSG_STREAM_PUSH_REQUESTED"; |
| 103 | 103 | |
| 104 | + /** | |
| 105 | + * redis 消息通知上级平台开始观看流 | |
| 106 | + */ | |
| 107 | + public static final String VM_MSG_STREAM_START_PLAY_NOTIFY = "VM_MSG_STREAM_START_PLAY_NOTIFY"; | |
| 108 | + | |
| 109 | + /** | |
| 110 | + * redis 消息通知上级平台停止观看流 | |
| 111 | + */ | |
| 112 | + public static final String VM_MSG_STREAM_STOP_PLAY_NOTIFY = "VM_MSG_STREAM_STOP_PLAY_NOTIFY"; | |
| 113 | + | |
| 114 | + /** | |
| 115 | + * redis 消息接收关闭一个推流 | |
| 116 | + */ | |
| 117 | + public static final String VM_MSG_STREAM_PUSH_CLOSE_REQUESTED = "VM_MSG_STREAM_PUSH_CLOSE_REQUESTED"; | |
| 118 | + | |
| 104 | 119 | |
| 105 | 120 | /** |
| 106 | 121 | * redis 消息通知平台通知设备推流结果 | ... | ... |
src/main/java/com/genersoft/iot/vmp/service/bean/MessageForPushChannel.java
| 1 | 1 | package com.genersoft.iot.vmp.service.bean; |
| 2 | 2 | |
| 3 | -import java.util.stream.Stream; | |
| 4 | - | |
| 5 | 3 | /** |
| 6 | 4 | * 当上级平台 |
| 7 | 5 | * @author lin |
| ... | ... | @@ -29,11 +27,16 @@ public class MessageForPushChannel { |
| 29 | 27 | private String gbId; |
| 30 | 28 | |
| 31 | 29 | /** |
| 32 | - * 请求的平台ID | |
| 30 | + * 请求的平台国标编号 | |
| 33 | 31 | */ |
| 34 | 32 | private String platFormId; |
| 35 | 33 | |
| 36 | 34 | /** |
| 35 | + * 请求的平台自增ID | |
| 36 | + */ | |
| 37 | + private String platFormIndex; | |
| 38 | + | |
| 39 | + /** | |
| 37 | 40 | * 请求平台名称 |
| 38 | 41 | */ |
| 39 | 42 | private String platFormName; |
| ... | ... | @@ -128,4 +131,12 @@ public class MessageForPushChannel { |
| 128 | 131 | public void setMediaServerId(String mediaServerId) { |
| 129 | 132 | this.mediaServerId = mediaServerId; |
| 130 | 133 | } |
| 134 | + | |
| 135 | + public String getPlatFormIndex() { | |
| 136 | + return platFormIndex; | |
| 137 | + } | |
| 138 | + | |
| 139 | + public void setPlatFormIndex(String platFormIndex) { | |
| 140 | + this.platFormIndex = platFormIndex; | |
| 141 | + } | |
| 131 | 142 | } | ... | ... |
src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/ptz/PtzController.java
src/main/java/com/genersoft/iot/vmp/vmanager/rtp/RtpController.java
0 → 100644
| 1 | +package com.genersoft.iot.vmp.vmanager.rtp; | |
| 2 | + | |
| 3 | +import com.genersoft.iot.vmp.conf.SipConfig; | |
| 4 | +import com.genersoft.iot.vmp.conf.UserSetting; | |
| 5 | +import com.genersoft.iot.vmp.conf.VersionInfo; | |
| 6 | +import com.genersoft.iot.vmp.conf.exception.ControllerException; | |
| 7 | +import com.genersoft.iot.vmp.media.zlm.ZlmHttpHookSubscribe; | |
| 8 | +import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem; | |
| 9 | +import com.genersoft.iot.vmp.service.*; | |
| 10 | +import com.genersoft.iot.vmp.storager.IRedisCatchStorage; | |
| 11 | +import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; | |
| 12 | +import io.swagger.v3.oas.annotations.Operation; | |
| 13 | +import io.swagger.v3.oas.annotations.tags.Tag; | |
| 14 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 15 | +import org.springframework.beans.factory.annotation.Value; | |
| 16 | +import org.springframework.web.bind.annotation.*; | |
| 17 | + | |
| 18 | +import java.util.List; | |
| 19 | + | |
| 20 | +@SuppressWarnings("rawtypes") | |
| 21 | +@Tag(name = "第三方服务对接") | |
| 22 | + | |
| 23 | +@RestController | |
| 24 | +@RequestMapping("/api/rtp") | |
| 25 | +public class RtpController { | |
| 26 | + | |
| 27 | + @Autowired | |
| 28 | + private ZlmHttpHookSubscribe zlmHttpHookSubscribe; | |
| 29 | + | |
| 30 | + @Autowired | |
| 31 | + private IMediaServerService mediaServerService; | |
| 32 | + | |
| 33 | + @Autowired | |
| 34 | + private VersionInfo versionInfo; | |
| 35 | + | |
| 36 | + @Autowired | |
| 37 | + private SipConfig sipConfig; | |
| 38 | + | |
| 39 | + @Autowired | |
| 40 | + private UserSetting userSetting; | |
| 41 | + | |
| 42 | + @Autowired | |
| 43 | + private IDeviceService deviceService; | |
| 44 | + | |
| 45 | + @Autowired | |
| 46 | + private IDeviceChannelService channelService; | |
| 47 | + | |
| 48 | + @Autowired | |
| 49 | + private IStreamPushService pushService; | |
| 50 | + | |
| 51 | + | |
| 52 | + @Autowired | |
| 53 | + private IStreamProxyService proxyService; | |
| 54 | + | |
| 55 | + | |
| 56 | + @Value("${server.port}") | |
| 57 | + private int serverPort; | |
| 58 | + | |
| 59 | + | |
| 60 | + @Autowired | |
| 61 | + private IRedisCatchStorage redisCatchStorage; | |
| 62 | + | |
| 63 | + | |
| 64 | + @GetMapping(value = "/send/ready") | |
| 65 | + @ResponseBody | |
| 66 | + @Operation(summary = "为发送视频流获取信息") | |
| 67 | + public List<MediaServerItem> getMediaServerList(Boolean onlySender, ) { | |
| 68 | + MediaServerItem mediaServerItem = mediaServerService.getMediaServerForMinimumLoad(null); | |
| 69 | + if (mediaServerItem == null) { | |
| 70 | + throw new ControllerException(ErrorCode.ERROR100.getCode(),"没有可用的MediaServer"); | |
| 71 | + } | |
| 72 | + mediaServerService.openRTPServer() | |
| 73 | + return mediaServerService.getAll(); | |
| 74 | + } | |
| 75 | + | |
| 76 | +} | ... | ... |