移除多余的节点启动事件分发
parent
0c2180c07f
commit
6de0c329ea
|
@ -277,14 +277,6 @@ public class ZLMHttpHookListener {
|
||||||
ZLMServerConfig zlmServerConfig = JSON.to(ZLMServerConfig.class, jsonObject);
|
ZLMServerConfig zlmServerConfig = JSON.to(ZLMServerConfig.class, jsonObject);
|
||||||
zlmServerConfig.setIp(request.getRemoteAddr());
|
zlmServerConfig.setIp(request.getRemoteAddr());
|
||||||
logger.info("[ZLM HOOK] zlm 启动 " + zlmServerConfig.getGeneralMediaServerId());
|
logger.info("[ZLM HOOK] zlm 启动 " + zlmServerConfig.getGeneralMediaServerId());
|
||||||
taskExecutor.execute(() -> {
|
|
||||||
List<ZlmHttpHookSubscribe.Event> subscribes = this.subscribe.getSubscribes(HookType.on_server_started);
|
|
||||||
if (subscribes != null && !subscribes.isEmpty()) {
|
|
||||||
for (ZlmHttpHookSubscribe.Event subscribe : subscribes) {
|
|
||||||
subscribe.response(null, zlmServerConfig);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
try {
|
try {
|
||||||
HookZlmServerStartEvent event = new HookZlmServerStartEvent(this);
|
HookZlmServerStartEvent event = new HookZlmServerStartEvent(this);
|
||||||
MediaServer mediaServerItem = mediaServerService.getOne(zlmServerConfig.getMediaServerId());
|
MediaServer mediaServerItem = mediaServerService.getOne(zlmServerConfig.getMediaServerId());
|
||||||
|
|
|
@ -49,14 +49,6 @@ public class HookSubscribeFactory {
|
||||||
return hookSubscribe;
|
return hookSubscribe;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static HookSubscribeForServerStarted on_server_started() {
|
|
||||||
HookSubscribeForServerStarted hookSubscribe = new HookSubscribeForServerStarted();
|
|
||||||
hookSubscribe.setContent(new JSONObject());
|
|
||||||
|
|
||||||
return hookSubscribe;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static HookSubscribeForRecordMp4 on_record_mp4(String mediaServerId, String app, String stream) {
|
public static HookSubscribeForRecordMp4 on_record_mp4(String mediaServerId, String app, String stream) {
|
||||||
HookSubscribeForRecordMp4 hookSubscribe = new HookSubscribeForRecordMp4();
|
HookSubscribeForRecordMp4 hookSubscribe = new HookSubscribeForRecordMp4();
|
||||||
JSONObject subscribeKey = new com.alibaba.fastjson2.JSONObject();
|
JSONObject subscribeKey = new com.alibaba.fastjson2.JSONObject();
|
||||||
|
|
|
@ -1,44 +0,0 @@
|
||||||
package com.genersoft.iot.vmp.media.zlm.dto;
|
|
||||||
|
|
||||||
import com.alibaba.fastjson2.JSONObject;
|
|
||||||
import com.alibaba.fastjson2.annotation.JSONField;
|
|
||||||
|
|
||||||
import java.time.Instant;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* hook订阅-流变化
|
|
||||||
* @author lin
|
|
||||||
*/
|
|
||||||
public class HookSubscribeForServerStarted implements IHookSubscribe{
|
|
||||||
|
|
||||||
private HookType hookType = HookType.on_server_started;
|
|
||||||
|
|
||||||
private JSONObject content;
|
|
||||||
|
|
||||||
@JSONField(format="yyyy-MM-dd HH:mm:ss")
|
|
||||||
private Instant expires;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public HookType getHookType() {
|
|
||||||
return hookType;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public JSONObject getContent() {
|
|
||||||
return content;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setContent(JSONObject content) {
|
|
||||||
this.content = content;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Instant getExpires() {
|
|
||||||
return expires;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setExpires(Instant expires) {
|
|
||||||
this.expires = expires;
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue