Merge branch 'master' into dev/springBoot3
# Conflicts: # src/main/java/com/genersoft/iot/vmp/gb28181/controller/MediaController.java # src/main/java/com/genersoft/iot/vmp/jt1078/config/JT1078Controller.java
This commit is contained in:
@@ -11,6 +11,7 @@ public enum ErrorCode {
|
||||
ERROR403(403, "无权限操作"),
|
||||
ERROR486(486, "超时或无响应"),
|
||||
ERROR401(401, "请登录后重新请求"),
|
||||
ERROR408(408, "请求超时"),
|
||||
ERROR500(500, "系统异常");
|
||||
|
||||
private final int code;
|
||||
|
||||
@@ -4,7 +4,9 @@ import com.genersoft.iot.vmp.common.StreamInfo;
|
||||
import com.genersoft.iot.vmp.media.bean.MediaInfo;
|
||||
import com.genersoft.iot.vmp.service.bean.DownloadFileInfo;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@Schema(description = "流信息")
|
||||
public class StreamContent {
|
||||
|
||||
@@ -95,6 +97,9 @@ public class StreamContent {
|
||||
@Schema(description = "结束时间")
|
||||
private String endTime;
|
||||
|
||||
@Schema(description = "时长(回放时使用)")
|
||||
private Double duration;
|
||||
|
||||
@Schema(description = "文件下载地址(录像下载使用)")
|
||||
private DownloadFileInfo downLoadFilePath;
|
||||
|
||||
@@ -103,6 +108,9 @@ public class StreamContent {
|
||||
|
||||
private double progress;
|
||||
|
||||
@Schema(description = "拉流代理返回的KEY")
|
||||
private String key;
|
||||
|
||||
public StreamContent(StreamInfo streamInfo) {
|
||||
if (streamInfo == null) {
|
||||
return;
|
||||
@@ -180,6 +188,8 @@ public class StreamContent {
|
||||
this.startTime = streamInfo.getStartTime();
|
||||
this.endTime = streamInfo.getEndTime();
|
||||
this.progress = streamInfo.getProgress();
|
||||
this.duration = streamInfo.getDuration();
|
||||
this.key = streamInfo.getKey();
|
||||
|
||||
if (streamInfo.getDownLoadFilePath() != null) {
|
||||
this.downLoadFilePath = streamInfo.getDownLoadFilePath();
|
||||
@@ -189,259 +199,4 @@ public class StreamContent {
|
||||
}
|
||||
}
|
||||
|
||||
public StreamContent getTranscodeStream() {
|
||||
return transcodeStream;
|
||||
}
|
||||
|
||||
public void setTranscodeStream(StreamContent transcodeStream) {
|
||||
this.transcodeStream = transcodeStream;
|
||||
}
|
||||
|
||||
public String getApp() {
|
||||
return app;
|
||||
}
|
||||
|
||||
public void setApp(String app) {
|
||||
this.app = app;
|
||||
}
|
||||
|
||||
public String getStream() {
|
||||
return stream;
|
||||
}
|
||||
|
||||
public void setStream(String stream) {
|
||||
this.stream = stream;
|
||||
}
|
||||
|
||||
public String getIp() {
|
||||
return ip;
|
||||
}
|
||||
|
||||
public void setIp(String ip) {
|
||||
this.ip = ip;
|
||||
}
|
||||
|
||||
public String getFlv() {
|
||||
return flv;
|
||||
}
|
||||
|
||||
public void setFlv(String flv) {
|
||||
this.flv = flv;
|
||||
}
|
||||
|
||||
public String getHttps_flv() {
|
||||
return https_flv;
|
||||
}
|
||||
|
||||
public void setHttps_flv(String https_flv) {
|
||||
this.https_flv = https_flv;
|
||||
}
|
||||
|
||||
public String getWs_flv() {
|
||||
return ws_flv;
|
||||
}
|
||||
|
||||
public void setWs_flv(String ws_flv) {
|
||||
this.ws_flv = ws_flv;
|
||||
}
|
||||
|
||||
public String getWss_flv() {
|
||||
return wss_flv;
|
||||
}
|
||||
|
||||
public void setWss_flv(String wss_flv) {
|
||||
this.wss_flv = wss_flv;
|
||||
}
|
||||
|
||||
public String getFmp4() {
|
||||
return fmp4;
|
||||
}
|
||||
|
||||
public void setFmp4(String fmp4) {
|
||||
this.fmp4 = fmp4;
|
||||
}
|
||||
|
||||
public String getHttps_fmp4() {
|
||||
return https_fmp4;
|
||||
}
|
||||
|
||||
public void setHttps_fmp4(String https_fmp4) {
|
||||
this.https_fmp4 = https_fmp4;
|
||||
}
|
||||
|
||||
public String getWs_fmp4() {
|
||||
return ws_fmp4;
|
||||
}
|
||||
|
||||
public void setWs_fmp4(String ws_fmp4) {
|
||||
this.ws_fmp4 = ws_fmp4;
|
||||
}
|
||||
|
||||
public String getWss_fmp4() {
|
||||
return wss_fmp4;
|
||||
}
|
||||
|
||||
public void setWss_fmp4(String wss_fmp4) {
|
||||
this.wss_fmp4 = wss_fmp4;
|
||||
}
|
||||
|
||||
public String getHls() {
|
||||
return hls;
|
||||
}
|
||||
|
||||
public void setHls(String hls) {
|
||||
this.hls = hls;
|
||||
}
|
||||
|
||||
public String getHttps_hls() {
|
||||
return https_hls;
|
||||
}
|
||||
|
||||
public void setHttps_hls(String https_hls) {
|
||||
this.https_hls = https_hls;
|
||||
}
|
||||
|
||||
public String getWs_hls() {
|
||||
return ws_hls;
|
||||
}
|
||||
|
||||
public void setWs_hls(String ws_hls) {
|
||||
this.ws_hls = ws_hls;
|
||||
}
|
||||
|
||||
public String getWss_hls() {
|
||||
return wss_hls;
|
||||
}
|
||||
|
||||
public void setWss_hls(String wss_hls) {
|
||||
this.wss_hls = wss_hls;
|
||||
}
|
||||
|
||||
public String getTs() {
|
||||
return ts;
|
||||
}
|
||||
|
||||
public void setTs(String ts) {
|
||||
this.ts = ts;
|
||||
}
|
||||
|
||||
public String getHttps_ts() {
|
||||
return https_ts;
|
||||
}
|
||||
|
||||
public void setHttps_ts(String https_ts) {
|
||||
this.https_ts = https_ts;
|
||||
}
|
||||
|
||||
public String getWs_ts() {
|
||||
return ws_ts;
|
||||
}
|
||||
|
||||
public void setWs_ts(String ws_ts) {
|
||||
this.ws_ts = ws_ts;
|
||||
}
|
||||
|
||||
public String getWss_ts() {
|
||||
return wss_ts;
|
||||
}
|
||||
|
||||
public void setWss_ts(String wss_ts) {
|
||||
this.wss_ts = wss_ts;
|
||||
}
|
||||
|
||||
public String getRtmp() {
|
||||
return rtmp;
|
||||
}
|
||||
|
||||
public void setRtmp(String rtmp) {
|
||||
this.rtmp = rtmp;
|
||||
}
|
||||
|
||||
public String getRtmps() {
|
||||
return rtmps;
|
||||
}
|
||||
|
||||
public void setRtmps(String rtmps) {
|
||||
this.rtmps = rtmps;
|
||||
}
|
||||
|
||||
public String getRtsp() {
|
||||
return rtsp;
|
||||
}
|
||||
|
||||
public void setRtsp(String rtsp) {
|
||||
this.rtsp = rtsp;
|
||||
}
|
||||
|
||||
public String getRtsps() {
|
||||
return rtsps;
|
||||
}
|
||||
|
||||
public void setRtsps(String rtsps) {
|
||||
this.rtsps = rtsps;
|
||||
}
|
||||
|
||||
public String getRtc() {
|
||||
return rtc;
|
||||
}
|
||||
|
||||
public void setRtc(String rtc) {
|
||||
this.rtc = rtc;
|
||||
}
|
||||
|
||||
public String getRtcs() {
|
||||
return rtcs;
|
||||
}
|
||||
|
||||
public void setRtcs(String rtcs) {
|
||||
this.rtcs = rtcs;
|
||||
}
|
||||
|
||||
public String getMediaServerId() {
|
||||
return mediaServerId;
|
||||
}
|
||||
|
||||
public void setMediaServerId(String mediaServerId) {
|
||||
this.mediaServerId = mediaServerId;
|
||||
}
|
||||
|
||||
public MediaInfo getMediaInfo() {
|
||||
return mediaInfo;
|
||||
}
|
||||
|
||||
public void setMediaInfo(MediaInfo mediaInfo) {
|
||||
this.mediaInfo = mediaInfo;
|
||||
}
|
||||
|
||||
public String getStartTime() {
|
||||
return startTime;
|
||||
}
|
||||
|
||||
public void setStartTime(String startTime) {
|
||||
this.startTime = startTime;
|
||||
}
|
||||
|
||||
public String getEndTime() {
|
||||
return endTime;
|
||||
}
|
||||
|
||||
public void setEndTime(String endTime) {
|
||||
this.endTime = endTime;
|
||||
}
|
||||
|
||||
public double getProgress() {
|
||||
return progress;
|
||||
}
|
||||
|
||||
public void setProgress(double progress) {
|
||||
this.progress = progress;
|
||||
}
|
||||
|
||||
public DownloadFileInfo getDownLoadFilePath() {
|
||||
return downLoadFilePath;
|
||||
}
|
||||
|
||||
public void setDownLoadFilePath(DownloadFileInfo downLoadFilePath) {
|
||||
this.downLoadFilePath = downLoadFilePath;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.genersoft.iot.vmp.vmanager.bean;
|
||||
import com.genersoft.iot.vmp.common.VersionPo;
|
||||
import com.genersoft.iot.vmp.conf.SipConfig;
|
||||
import com.genersoft.iot.vmp.conf.UserSetting;
|
||||
import com.genersoft.iot.vmp.jt1078.config.JT1078Config;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@@ -12,6 +13,7 @@ public class SystemConfigInfo {
|
||||
private SipConfig sip;
|
||||
private UserSetting addOn;
|
||||
private VersionPo version;
|
||||
private JT1078Config jt1078Config;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -253,17 +253,17 @@ public class CloudRecordController {
|
||||
@Operation(summary = "加载录像文件形成播放地址")
|
||||
@Parameter(name = "app", description = "应用名", required = true)
|
||||
@Parameter(name = "stream", description = "流ID", required = true)
|
||||
@Parameter(name = "date", description = "日期, 例如 2025-04-10", required = true)
|
||||
@Parameter(name = "cloudRecordId", description = "云端录像ID", required = true)
|
||||
public DeferredResult<WVPResult<StreamContent>> loadRecord(
|
||||
HttpServletRequest request,
|
||||
@RequestParam(required = true) String app,
|
||||
@RequestParam(required = true) String stream,
|
||||
@RequestParam(required = true) String date
|
||||
@RequestParam(required = true) int cloudRecordId
|
||||
) {
|
||||
DeferredResult<WVPResult<StreamContent>> result = new DeferredResult<>();
|
||||
|
||||
result.onTimeout(()->{
|
||||
log.info("[加载录像文件超时] app={}, stream={}, date={}", app, stream, date);
|
||||
log.info("[加载录像文件超时] app={}, stream={}, cloudRecordId={}", app, stream, cloudRecordId);
|
||||
WVPResult<StreamContent> wvpResult = new WVPResult<>();
|
||||
wvpResult.setCode(ErrorCode.ERROR100.getCode());
|
||||
wvpResult.setMsg("加载录像文件超时");
|
||||
@@ -304,7 +304,7 @@ public class CloudRecordController {
|
||||
result.setResult(wvpResult);
|
||||
};
|
||||
|
||||
cloudRecordService.loadRecord(app, stream, date, callback);
|
||||
cloudRecordService.loadMP4File(app, stream, cloudRecordId, callback);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -312,6 +312,7 @@ public class CloudRecordController {
|
||||
@GetMapping("/seek")
|
||||
@Operation(summary = "定位录像播放到制定位置")
|
||||
@Parameter(name = "mediaServerId", description = "使用的节点Id", required = true)
|
||||
@Parameter(name = "app", description = "应用名", required = true)
|
||||
@Parameter(name = "stream", description = "流ID", required = true)
|
||||
@Parameter(name = "seek", description = "要定位的时间位置,从录像开始的时间算起", required = true)
|
||||
public void seekRecord(
|
||||
@@ -331,6 +332,7 @@ public class CloudRecordController {
|
||||
@GetMapping("/speed")
|
||||
@Operation(summary = "设置录像播放速度")
|
||||
@Parameter(name = "mediaServerId", description = "使用的节点Id", required = true)
|
||||
@Parameter(name = "app", description = "应用名", required = true)
|
||||
@Parameter(name = "stream", description = "流ID", required = true)
|
||||
@Parameter(name = "speed", description = "要设置的录像倍速", required = true)
|
||||
public void setRecordSpeed(
|
||||
|
||||
@@ -4,7 +4,6 @@ import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.genersoft.iot.vmp.common.SystemAllInfo;
|
||||
import com.genersoft.iot.vmp.common.VersionPo;
|
||||
import com.genersoft.iot.vmp.common.enums.ChannelDataType;
|
||||
import com.genersoft.iot.vmp.conf.SipConfig;
|
||||
import com.genersoft.iot.vmp.conf.UserSetting;
|
||||
import com.genersoft.iot.vmp.conf.VersionInfo;
|
||||
@@ -12,6 +11,7 @@ import com.genersoft.iot.vmp.conf.exception.ControllerException;
|
||||
import com.genersoft.iot.vmp.conf.security.JwtUtils;
|
||||
import com.genersoft.iot.vmp.gb28181.service.IDeviceChannelService;
|
||||
import com.genersoft.iot.vmp.gb28181.service.IDeviceService;
|
||||
import com.genersoft.iot.vmp.jt1078.config.JT1078Config;
|
||||
import com.genersoft.iot.vmp.media.bean.MediaInfo;
|
||||
import com.genersoft.iot.vmp.media.bean.MediaServer;
|
||||
import com.genersoft.iot.vmp.media.event.mediaServer.MediaServerChangeEvent;
|
||||
@@ -45,7 +45,10 @@ import oshi.software.os.OperatingSystem;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import java.io.File;
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
@Tag(name = "服务控制")
|
||||
@@ -67,6 +70,9 @@ public class ServerController {
|
||||
@Autowired
|
||||
private UserSetting userSetting;
|
||||
|
||||
@Autowired
|
||||
private JT1078Config jt1078Config;
|
||||
|
||||
@Autowired
|
||||
private IDeviceService deviceService;
|
||||
|
||||
@@ -196,6 +202,7 @@ public class ServerController {
|
||||
systemConfigInfo.setSip(sipConfig);
|
||||
systemConfigInfo.setAddOn(userSetting);
|
||||
systemConfigInfo.setServerPort(serverPort);
|
||||
systemConfigInfo.setJt1078Config(jt1078Config);
|
||||
return systemConfigInfo;
|
||||
}
|
||||
|
||||
@@ -334,20 +341,6 @@ public class ServerController {
|
||||
return result;
|
||||
}
|
||||
|
||||
@GetMapping(value = "/channel/datatype")
|
||||
@ResponseBody
|
||||
@Operation(summary = "获取系统接入的数据类型", security = @SecurityRequirement(name = JwtUtils.HEADER))
|
||||
public List<Map<String, Object>> getDataType() {
|
||||
List<Map<String, Object>> result = new LinkedList<>();
|
||||
for (ChannelDataType item : ChannelDataType.values()) {
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("key", item.desc);
|
||||
map.put("value", item.value);
|
||||
result.add(map);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 单位转换
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user