[集群] 增加远程重启/录像控制/布防(或撤防)/重置报警, 增加关闭推流接口
This commit is contained in:
@@ -260,4 +260,12 @@ public class StreamPushController {
|
||||
}, null, null);
|
||||
return result;
|
||||
}
|
||||
|
||||
@GetMapping(value = "/forceClose")
|
||||
@ResponseBody
|
||||
@Operation(summary = "强制停止推流", security = @SecurityRequirement(name = JwtUtils.HEADER))
|
||||
public void stop(String app, String stream){
|
||||
|
||||
streamPushPlayService.stop(app, stream);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,5 +6,6 @@ import com.genersoft.iot.vmp.service.bean.ErrorCallback;
|
||||
public interface IStreamPushPlayService {
|
||||
void start(Integer id, ErrorCallback<StreamInfo> callback, String platformDeviceId, String platformName );
|
||||
|
||||
void stop(Integer streamPushId);
|
||||
void stop(String app, String stream);
|
||||
|
||||
}
|
||||
|
||||
@@ -117,7 +117,14 @@ public class StreamPushPlayServiceImpl implements IStreamPushPlayService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stop(Integer streamPushId) {
|
||||
// 推流无需主动停止
|
||||
public void stop(String app, String stream) {
|
||||
StreamPush streamPush = streamPushMapper.selectByAppAndStream(app, stream);
|
||||
if (streamPush == null || !streamPush.isPushing()) {
|
||||
return;
|
||||
}
|
||||
String mediaServerId = streamPush.getMediaServerId();
|
||||
MediaServer mediaServer = mediaServerService.getOne(mediaServerId);
|
||||
Assert.notNull(mediaServer, "未找到使用的节点");
|
||||
mediaServerService.closeStreams(mediaServer, app, stream);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user