调整停止录像下载
parent
e16ca179a6
commit
3b4818c579
|
@ -1,9 +1,9 @@
|
||||||
package com.genersoft.iot.vmp.gb28181.controller;
|
package com.genersoft.iot.vmp.gb28181.controller;
|
||||||
|
|
||||||
|
import com.genersoft.iot.vmp.common.InviteSessionType;
|
||||||
import com.genersoft.iot.vmp.common.StreamInfo;
|
import com.genersoft.iot.vmp.common.StreamInfo;
|
||||||
import com.genersoft.iot.vmp.conf.UserSetting;
|
import com.genersoft.iot.vmp.conf.UserSetting;
|
||||||
import com.genersoft.iot.vmp.conf.exception.ControllerException;
|
import com.genersoft.iot.vmp.conf.exception.ControllerException;
|
||||||
import com.genersoft.iot.vmp.conf.exception.SsrcTransactionNotFoundException;
|
|
||||||
import com.genersoft.iot.vmp.conf.security.JwtUtils;
|
import com.genersoft.iot.vmp.conf.security.JwtUtils;
|
||||||
import com.genersoft.iot.vmp.gb28181.bean.Device;
|
import com.genersoft.iot.vmp.gb28181.bean.Device;
|
||||||
import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel;
|
import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel;
|
||||||
|
@ -32,9 +32,6 @@ import org.springframework.web.bind.annotation.RestController;
|
||||||
import org.springframework.web.context.request.async.DeferredResult;
|
import org.springframework.web.context.request.async.DeferredResult;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.sip.InvalidArgumentException;
|
|
||||||
import javax.sip.SipException;
|
|
||||||
import java.text.ParseException;
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
@ -170,7 +167,7 @@ public class GBRecordController {
|
||||||
@Parameter(name = "channelId", description = "通道国标编号", required = true)
|
@Parameter(name = "channelId", description = "通道国标编号", required = true)
|
||||||
@Parameter(name = "stream", description = "流ID", required = true)
|
@Parameter(name = "stream", description = "流ID", required = true)
|
||||||
@GetMapping("/download/stop/{deviceId}/{channelId}/{stream}")
|
@GetMapping("/download/stop/{deviceId}/{channelId}/{stream}")
|
||||||
public void playStop(@PathVariable String deviceId, @PathVariable String channelId, @PathVariable String stream) {
|
public void downloadStop(@PathVariable String deviceId, @PathVariable String channelId, @PathVariable String stream) {
|
||||||
|
|
||||||
if (log.isDebugEnabled()) {
|
if (log.isDebugEnabled()) {
|
||||||
log.debug(String.format("设备历史媒体下载停止 API调用,deviceId/channelId:%s_%s", deviceId, channelId));
|
log.debug(String.format("设备历史媒体下载停止 API调用,deviceId/channelId:%s_%s", deviceId, channelId));
|
||||||
|
@ -184,12 +181,11 @@ public class GBRecordController {
|
||||||
if (device == null) {
|
if (device == null) {
|
||||||
throw new ControllerException(ErrorCode.ERROR400.getCode(), "设备:" + deviceId + " 未找到");
|
throw new ControllerException(ErrorCode.ERROR400.getCode(), "设备:" + deviceId + " 未找到");
|
||||||
}
|
}
|
||||||
|
DeviceChannel deviceChannel = channelService.getOneForSource(deviceId, channelId);
|
||||||
try {
|
if (deviceChannel == null) {
|
||||||
cmder.streamByeCmd(device, channelId, stream, null);
|
throw new ControllerException(ErrorCode.ERROR400.getCode(), "通道:" + channelId + " 未找到");
|
||||||
} catch (InvalidArgumentException | ParseException | SipException | SsrcTransactionNotFoundException e) {
|
|
||||||
log.warn("[停止历史媒体下载]停止历史媒体下载,发送BYE失败 {}", e.getMessage());
|
|
||||||
}
|
}
|
||||||
|
playService.stop(InviteSessionType.DOWNLOAD, device, deviceChannel, stream);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Operation(summary = "获取历史媒体下载进度", security = @SecurityRequirement(name = JwtUtils.HEADER))
|
@Operation(summary = "获取历史媒体下载进度", security = @SecurityRequirement(name = JwtUtils.HEADER))
|
||||||
|
|
|
@ -41,8 +41,6 @@ import java.net.URL;
|
||||||
import java.text.ParseException;
|
import java.text.ParseException;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import static sun.audio.AudioDevice.device;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author lin
|
* @author lin
|
||||||
*/
|
*/
|
||||||
|
@ -158,7 +156,7 @@ public class PlaybackController {
|
||||||
}
|
}
|
||||||
DeviceChannel deviceChannel = channelService.getOneForSource(deviceId, channelId);
|
DeviceChannel deviceChannel = channelService.getOneForSource(deviceId, channelId);
|
||||||
if (deviceChannel == null) {
|
if (deviceChannel == null) {
|
||||||
throw new ControllerException(ErrorCode.ERROR400.getCode(), "通道:" + deviceChannel + " 未找到");
|
throw new ControllerException(ErrorCode.ERROR400.getCode(), "通道:" + channelId + " 未找到");
|
||||||
}
|
}
|
||||||
playService.stop(InviteSessionType.PLAYBACK, device, deviceChannel, stream);
|
playService.stop(InviteSessionType.PLAYBACK, device, deviceChannel, stream);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue