| | |
| | | import com.ruoyi.media.service.IMediaService; |
| | | import com.ruoyi.utils.forest.MediaClient; |
| | | import com.ruoyi.utils.tools.ArdTool; |
| | | import io.swagger.models.auth.In; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.boot.ApplicationArguments; |
| | |
| | | if (StringUtils.isNotEmpty(conf.getRunOnDemand())) { |
| | | runOn = conf.getRunOnDemand(); |
| | | info.setMode("0"); |
| | | } else { |
| | | info.setMode("1"); |
| | | } |
| | | //RTSP源地址 |
| | | Matcher matcher = Pattern.compile("rtsp://[^\\s\"]+").matcher(runOn); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<StreamInfo> paths() { |
| | | Paths paths = mediaClient.paths(); |
| | | public List<StreamInfo> paths(Integer pageNum, Integer pageSize) { |
| | | Paths paths = mediaClient.paths(pageNum - 1, pageSize); |
| | | List<Items> items = paths.getItems(); |
| | | List<StreamInfo> pathInfoList = new ArrayList<>(); |
| | | for (Items item : items) { |
| | |
| | | |
| | | @Override |
| | | public RtspSession getRtspSessionById(String sessionId) { |
| | | String list = mediaClient.getRtspsessionById(sessionId); |
| | | RtspSession rtspSession = JSONObject.parseObject(list, RtspSession.class); |
| | | return rtspSession; |
| | | return mediaClient.getRtspsessionById(sessionId); |
| | | } |
| | | |
| | | @Override |
| | | public WebrtcSession getWebrtcSessionById(String sessionId) { |
| | | String list = mediaClient.getWebrtcsessionById(sessionId); |
| | | WebrtcSession webrtcSession = JSONObject.parseObject(list, WebrtcSession.class); |
| | | return webrtcSession; |
| | | return mediaClient.getWebrtcsessionById(sessionId); |
| | | } |
| | | |
| | | @Override |
| | | public RtmpSession getRtmpSessionById(String sessionId) { |
| | | String list = mediaClient.getRtmpsessionById(sessionId); |
| | | RtmpSession rtmpSession = JSONObject.parseObject(list, RtmpSession.class); |
| | | return rtmpSession; |
| | | return mediaClient.getRtmpsessionById(sessionId); |
| | | } |
| | | |
| | | /** |
| | |
| | | * 2023/8/29 9:37:05 |
| | | */ |
| | | @Override |
| | | public List<StreamInfo> getPushStreamList() { |
| | | public List<StreamInfo> getPushStreamList(Integer pageNum, Integer pageSize) { |
| | | List<StreamInfo> PushStreamInfoList = new ArrayList<>(); |
| | | Paths paths = mediaClient.paths(); |
| | | Paths paths = mediaClient.paths(pageNum - 1, pageSize); |
| | | List<Items> items = paths.getItems(); |
| | | for (Items item : items) { |
| | | StreamInfo info = new StreamInfo(); |
| | |
| | | * 2023/8/29 9:37:05 |
| | | */ |
| | | @Override |
| | | public List<StreamInfo> getPullStreamList() { |
| | | public List<StreamInfo> getPullStreamList(Integer pageNum, Integer pageSize) { |
| | | List<StreamInfo> PullStreamInfoList = new ArrayList<>(); |
| | | Paths paths = mediaClient.paths(); |
| | | Paths paths = mediaClient.paths(pageNum - 1, pageSize); |
| | | List<Items> items = paths.getItems(); |
| | | for (Items item : items) { |
| | | List<Readers> readers = item.getReaders(); |
| | |
| | | public List<String> getNameList() { |
| | | List<String> nameList = new ArrayList<>(); |
| | | try { |
| | | Paths paths = mediaClient.paths(); |
| | | Paths paths = mediaClient.paths(0, 1000); |
| | | List<Items> items = paths.getItems(); |
| | | for (Items item : items) { |
| | | nameList.add(item.getName()); |