支持发送流没找到事件
parent
1ce30e6656
commit
f218d7bbd6
|
@ -0,0 +1,64 @@
|
|||
package com.genersoft.iot.vmp.media.event;
|
||||
|
||||
import com.genersoft.iot.vmp.media.zlm.dto.MediaServer;
|
||||
import com.genersoft.iot.vmp.media.zlm.dto.hook.OnStreamChangedHookParam;
|
||||
import com.genersoft.iot.vmp.media.zlm.dto.hook.OnStreamNotFoundHookParam;
|
||||
import org.springframework.context.ApplicationEvent;
|
||||
|
||||
/**
|
||||
* 流未找到
|
||||
*/
|
||||
public class MediaNotFoundEvent extends ApplicationEvent {
|
||||
public MediaNotFoundEvent(Object source) {
|
||||
super(source);
|
||||
}
|
||||
|
||||
private String app;
|
||||
|
||||
private String stream;
|
||||
|
||||
private MediaServer mediaServer;
|
||||
|
||||
private String schema;
|
||||
|
||||
public static MediaNotFoundEvent getInstance(Object source, OnStreamNotFoundHookParam hookParam, MediaServer mediaServer){
|
||||
MediaNotFoundEvent mediaDepartureEven = new MediaNotFoundEvent(source);
|
||||
mediaDepartureEven.setApp(hookParam.getApp());
|
||||
mediaDepartureEven.setStream(hookParam.getStream());
|
||||
mediaDepartureEven.setSchema(hookParam.getSchema());
|
||||
mediaDepartureEven.setMediaServer(mediaServer);
|
||||
return mediaDepartureEven;
|
||||
}
|
||||
|
||||
public String getApp() {
|
||||
return app;
|
||||
}
|
||||
|
||||
public void setApp(String app) {
|
||||
this.app = app;
|
||||
}
|
||||
|
||||
public String getStream() {
|
||||
return stream;
|
||||
}
|
||||
|
||||
public void setStream(String stream) {
|
||||
this.stream = stream;
|
||||
}
|
||||
|
||||
public MediaServer getMediaServer() {
|
||||
return mediaServer;
|
||||
}
|
||||
|
||||
public void setMediaServer(MediaServer mediaServer) {
|
||||
this.mediaServer = mediaServer;
|
||||
}
|
||||
|
||||
public String getSchema() {
|
||||
return schema;
|
||||
}
|
||||
|
||||
public void setSchema(String schema) {
|
||||
this.schema = schema;
|
||||
}
|
||||
}
|
|
@ -18,6 +18,7 @@ import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander;
|
|||
import com.genersoft.iot.vmp.media.bean.ResultForOnPublish;
|
||||
import com.genersoft.iot.vmp.media.event.MediaArrivalEvent;
|
||||
import com.genersoft.iot.vmp.media.event.MediaDepartureEvent;
|
||||
import com.genersoft.iot.vmp.media.event.MediaNotFoundEvent;
|
||||
import com.genersoft.iot.vmp.media.service.IMediaServerService;
|
||||
import com.genersoft.iot.vmp.media.zlm.dto.HookType;
|
||||
import com.genersoft.iot.vmp.media.zlm.dto.MediaServer;
|
||||
|
@ -262,6 +263,10 @@ public class ZLMHttpHookListener {
|
|||
defaultResult.setResult(new HookResult(ErrorCode.ERROR404.getCode(), ErrorCode.ERROR404.getMsg()));
|
||||
return defaultResult;
|
||||
}
|
||||
MediaNotFoundEvent mediaNotFoundEvent = MediaNotFoundEvent.getInstance(this, param, mediaServer);
|
||||
applicationEventPublisher.publishEvent(mediaNotFoundEvent);
|
||||
|
||||
|
||||
|
||||
if ("rtp".equals(param.getApp())) {
|
||||
String[] s = param.getStream().split("_");
|
||||
|
|
Loading…
Reference in New Issue