From bbf19c79091c46ac5465909429caef6e79c02e55 Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: 星期二, 09 四月 2024 10:40:16 +0800 Subject: [PATCH] 合并主线 --- src/main/java/com/genersoft/iot/vmp/media/event/hook/HookSubscribe.java | 13 +++---------- 1 files changed, 3 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/media/event/hook/HookSubscribe.java b/src/main/java/com/genersoft/iot/vmp/media/event/hook/HookSubscribe.java index 598178f..3353656 100755 --- a/src/main/java/com/genersoft/iot/vmp/media/event/hook/HookSubscribe.java +++ b/src/main/java/com/genersoft/iot/vmp/media/event/hook/HookSubscribe.java @@ -22,7 +22,7 @@ /** * 璁㈤槄鏁版嵁杩囨湡鏃堕棿 */ - private final long subscribeExpire = 5 * 1000; + private final long subscribeExpire = 5 * 60 * 1000; @FunctionalInterface public interface Event{ @@ -35,11 +35,7 @@ @Async("taskExecutor") @EventListener public void onApplicationEvent(MediaArrivalEvent event) { - if ("rtsp".equals(event.getSchema())) { - System.out.println("娴佸埌鏉ョ殑澶勭悊: " + allSubscribes.size()); - for (String s : allSubscribes.keySet()) { - System.out.println("key: " + s); - } + if (event.getSchema() == null || "rtsp".equals(event.getSchema())) { sendNotify(HookType.on_media_arrival, event); } @@ -51,7 +47,7 @@ @Async("taskExecutor") @EventListener public void onApplicationEvent(MediaDepartureEvent event) { - if ("rtsp".equals(event.getSchema())) { + if (event.getSchema() == null || "rtsp".equals(event.getSchema())) { sendNotify(HookType.on_media_departure, event); } @@ -70,7 +66,6 @@ private void sendNotify(HookType hookType, MediaEvent event) { Hook paramHook = Hook.getInstance(hookType, event.getApp(), event.getStream(), event.getMediaServer().getId()); - System.out.println("sendNotify: " + paramHook.toString()); Event hookSubscribeEvent = allSubscribes.get(paramHook.toString()); if (hookSubscribeEvent != null) { HookData data = HookData.getInstance(event); @@ -87,7 +82,6 @@ } public void removeSubscribe(Hook hook) { - System.out.println("removeSubscribe: " + hook.toString()); allSubscribes.remove(hook.toString()); allHook.remove(hook.toString()); } @@ -100,7 +94,6 @@ long expireTime = System.currentTimeMillis() - subscribeExpire; for (Hook hook : allHook.values()) { if (hook.getCreateTime() < expireTime) { - System.out.println("execute removeSubscribe: " + hook.toString()); allSubscribes.remove(hook.toString()); allHook.remove(hook.toString()); } -- Gitblit v1.8.0