[集群] 增加远程重启/录像控制/布防(或撤防)/重置报警, 增加关闭推流接口

This commit is contained in:
lin
2025-02-08 17:29:31 +08:00
parent 8ca982485c
commit 71390a7b51
9 changed files with 271 additions and 85 deletions

View File

@@ -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);
}
}

View File

@@ -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);
}

View File

@@ -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);
}
}