From 9b1af8ef1396de45884fe86c56844714045b82ec Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: 星期二, 07 十二月 2021 21:13:55 +0800 Subject: [PATCH] 适配zlm的hook保活 --- src/main/java/com/genersoft/iot/vmp/gb28181/event/EventPublisher.java | 16 ++++++++++++---- 1 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/event/EventPublisher.java b/src/main/java/com/genersoft/iot/vmp/gb28181/event/EventPublisher.java index 58b03dd..fd0cfdc 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/event/EventPublisher.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/event/EventPublisher.java @@ -1,18 +1,20 @@ package com.genersoft.iot.vmp.gb28181.event; +import com.genersoft.iot.vmp.gb28181.bean.Device; +import com.genersoft.iot.vmp.gb28181.event.offline.OfflineEvent; import com.genersoft.iot.vmp.gb28181.event.platformKeepaliveExpire.PlatformKeepaliveExpireEvent; import com.genersoft.iot.vmp.gb28181.event.platformNotRegister.PlatformNotRegisterEvent; +import com.genersoft.iot.vmp.media.zlm.event.ZLMOfflineEvent; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.ApplicationEventPublisher; import org.springframework.stereotype.Component; import com.genersoft.iot.vmp.gb28181.bean.DeviceAlarm; import com.genersoft.iot.vmp.gb28181.event.alarm.AlarmEvent; -import com.genersoft.iot.vmp.gb28181.event.offline.OfflineEvent; import com.genersoft.iot.vmp.gb28181.event.online.OnlineEvent; /** - * @Description:Event浜嬩欢閫氱煡鎺ㄩ�佸櫒锛屾敮鎸佹帹閫佸湪绾夸簨浠躲�佺绾夸簨浠� + * @description:Event浜嬩欢閫氱煡鎺ㄩ�佸櫒锛屾敮鎸佹帹閫佸湪绾夸簨浠躲�佺绾夸簨浠� * @author: swwheihei * @date: 2020骞�5鏈�6鏃� 涓婂崍11:30:50 */ @@ -22,9 +24,9 @@ @Autowired private ApplicationEventPublisher applicationEventPublisher; - public void onlineEventPublish(String deviceId, String from) { + public void onlineEventPublish(Device device, String from) { OnlineEvent onEvent = new OnlineEvent(this); - onEvent.setDeviceId(deviceId); + onEvent.setDevice(device); onEvent.setFrom(from); applicationEventPublisher.publishEvent(onEvent); } @@ -65,5 +67,11 @@ alarmEvent.setAlarmInfo(deviceAlarm); applicationEventPublisher.publishEvent(alarmEvent); } + + public void zlmOfflineEventPublish(String mediaServerId){ + ZLMOfflineEvent outEvent = new ZLMOfflineEvent(this); + outEvent.setMediaServerId(mediaServerId); + applicationEventPublisher.publishEvent(outEvent); + } } -- Gitblit v1.8.0