Merge branch '2.6.9' into wvp-28181-2.0

# Conflicts:
#	pom.xml
This commit is contained in:
648540858
2024-01-22 10:37:13 +08:00
8 changed files with 78 additions and 15565 deletions

View File

@@ -33,7 +33,8 @@ public interface ICloudRecordService {
/**
* 添加合并任务
*/
String addTask(String app, String stream, MediaServerItem mediaServerItem, String startTime, String endTime, String callId, String remoteHost);
String addTask(String app, String stream, MediaServerItem mediaServerItem, String startTime,
String endTime, String callId, String remoteHost, boolean filterMediaServer);
/**

View File

@@ -2,6 +2,7 @@ package com.genersoft.iot.vmp.service.impl;
import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.genersoft.iot.vmp.conf.exception.ControllerException;
import com.genersoft.iot.vmp.gb28181.session.VideoStreamSessionManager;
import com.genersoft.iot.vmp.media.zlm.AssistRESTfulUtils;
@@ -29,6 +30,7 @@ import java.time.*;
import java.util.*;
@Service
@DS("share")
public class CloudRecordServiceImpl implements ICloudRecordService {
private final static Logger logger = LoggerFactory.getLogger(CloudRecordServiceImpl.class);
@@ -109,7 +111,8 @@ public class CloudRecordServiceImpl implements ICloudRecordService {
}
@Override
public String addTask(String app, String stream, MediaServerItem mediaServerItem, String startTime, String endTime, String callId, String remoteHost) {
public String addTask(String app, String stream, MediaServerItem mediaServerItem, String startTime, String endTime,
String callId, String remoteHost, boolean filterMediaServer) {
// 参数校验
assert app != null;
assert stream != null;
@@ -128,7 +131,8 @@ public class CloudRecordServiceImpl implements ICloudRecordService {
List<MediaServerItem> mediaServers = new ArrayList<>();
mediaServers.add(mediaServerItem);
// 检索相关的录像文件
List<String> filePathList = cloudRecordServiceMapper.queryRecordFilePathList(app, stream, startTimeStamp, endTimeStamp, callId, mediaServers);
List<String> filePathList = cloudRecordServiceMapper.queryRecordFilePathList(app, stream, startTimeStamp,
endTimeStamp, callId, filterMediaServer ? mediaServers : null);
if (filePathList == null || filePathList.isEmpty()) {
throw new ControllerException(ErrorCode.ERROR100.getCode(), "未检索到视频文件");
}

View File

@@ -167,10 +167,6 @@ public class CloudRecordController {
@RequestParam(required = false) String callId,
@RequestParam(required = false) String remoteHost
){
System.out.println(request.getScheme());
System.out.println(request.getLocalAddr());
System.out.println(request.getRemoteAddr());
System.out.println(request.getRequestURI());
MediaServerItem mediaServerItem;
if (mediaServerId == null) {
mediaServerItem = mediaServerService.getDefaultMediaServer();
@@ -184,7 +180,7 @@ public class CloudRecordController {
remoteHost = request.getScheme() + "://" + request.getLocalAddr() + ":" + mediaServerItem.getRecordAssistPort();
}
}
return cloudRecordService.addTask(app, stream, mediaServerItem, startTime, endTime, callId, remoteHost);
return cloudRecordService.addTask(app, stream, mediaServerItem, startTime, endTime, callId, remoteHost, mediaServerId != null);
}
@ResponseBody