临时提交

This commit is contained in:
648540858
2024-06-26 18:36:32 +08:00
parent 81049b5a9e
commit f32eb14125
10 changed files with 269 additions and 181 deletions

View File

@@ -2,7 +2,6 @@ package com.genersoft.iot.vmp.media.event.mediaServer;
import com.genersoft.iot.vmp.service.IPlayService;
import com.genersoft.iot.vmp.service.IStreamProxyService;
import com.genersoft.iot.vmp.service.IStreamPushService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -23,9 +22,6 @@ public class MediaServerStatusEventListener {
private final static Logger logger = LoggerFactory.getLogger(MediaServerStatusEventListener.class);
@Autowired
private IStreamPushService streamPushService;
@Autowired
private IStreamProxyService streamProxyService;
@@ -36,7 +32,6 @@ public class MediaServerStatusEventListener {
@EventListener
public void onApplicationEvent(MediaServerOnlineEvent event) {
logger.info("[媒体节点] 上线 ID" + event.getMediaServerId());
streamPushService.zlmServerOnline(event.getMediaServerId());
streamProxyService.zlmServerOnline(event.getMediaServerId());
playService.zlmServerOnline(event.getMediaServerId());
}
@@ -48,7 +43,6 @@ public class MediaServerStatusEventListener {
logger.info("[媒体节点] 离线ID" + event.getMediaServerId());
// 处理ZLM离线
streamProxyService.zlmServerOffline(event.getMediaServerId());
streamPushService.zlmServerOffline(event.getMediaServerId());
playService.zlmServerOffline(event.getMediaServerId());
}
}

View File

@@ -8,6 +8,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.jetbrains.annotations.NotNull;
import org.springframework.util.ObjectUtils;
@Data
@@ -102,6 +103,16 @@ public class StreamPush extends CommonGBChannel implements Comparable<StreamPush
return streamPushItem;
}
public CommonGBChannel getCommonGBChannel() {
if (ObjectUtils.isEmpty(this.getGbDeviceId())) {
return null;
}
if (ObjectUtils.isEmpty(this.getGbName())) {
this.setGbName( app+ "-" +stream);
}
return this;
}
}