From 9914186862dfbd8fd29b8f88ba46695b19f9abaf Mon Sep 17 00:00:00 2001 From: shikong <919411476@qq.com> Date: Wed, 13 Mar 2024 21:58:14 +0800 Subject: [PATCH] =?UTF-8?q?zlm=20=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mocking/service/device/DeviceProxyService.java | 8 ++++---- .../gb28181/mocking/service/zlm/ZlmInitService.java | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/gb28181-mocking-service/src/main/java/cn/skcks/docking/gb28181/mocking/service/device/DeviceProxyService.java b/gb28181-mocking-service/src/main/java/cn/skcks/docking/gb28181/mocking/service/device/DeviceProxyService.java index 72dae22..91c8e2b 100644 --- a/gb28181-mocking-service/src/main/java/cn/skcks/docking/gb28181/mocking/service/device/DeviceProxyService.java +++ b/gb28181-mocking-service/src/main/java/cn/skcks/docking/gb28181/mocking/service/device/DeviceProxyService.java @@ -170,18 +170,18 @@ public class DeviceProxyService { log.info("结束 zlm rtp 推流, app {}, stream {}, ssrc {}", app, callId, ssrc); zlmMediaService.stopSendRtp(stopSendRtp); - }, 3, TimeUnit.SECONDS); + }, 5, TimeUnit.SECONDS); - // 如果 流 在 3秒内 重新注册, 则 取消停止RTP推流 + // 如果 流 在 5秒内 重新注册, 则 取消停止RTP推流 zlmStreamChangeHookService.getRegistHandler(app).put(callId,()->{ schedule.cancel(true); zlmStreamRegistHookEvent(app, callId, ssrc); }); - // 如果 注销 后 3.5 秒内 没有再注册, 就彻底取消相关事件的订阅 + // 如果 注销 后 5.5 秒内 没有再注册, 就彻底取消相关事件的订阅 scheduledExecutorService.schedule(()->{ zlmStreamChangeHookService.getRegistHandler(app).remove(callId); - },3500, TimeUnit.MILLISECONDS); + },5500, TimeUnit.MILLISECONDS); }); }); } diff --git a/gb28181-mocking-service/src/main/java/cn/skcks/docking/gb28181/mocking/service/zlm/ZlmInitService.java b/gb28181-mocking-service/src/main/java/cn/skcks/docking/gb28181/mocking/service/zlm/ZlmInitService.java index f7bcf7c..192291b 100644 --- a/gb28181-mocking-service/src/main/java/cn/skcks/docking/gb28181/mocking/service/zlm/ZlmInitService.java +++ b/gb28181-mocking-service/src/main/java/cn/skcks/docking/gb28181/mocking/service/zlm/ZlmInitService.java @@ -29,7 +29,7 @@ public class ZlmInitService { hook.setOnStreamChanged(zlmHookConfig.getHook() + "/on_stream_changed"); hook.setOnStreamNoneReader(zlmHookConfig.getHook() + "/on_stream_none_reader"); hook.setOnPublish(zlmHookConfig.getHook() + "/on_publish"); - config.getRtmp().setHandshakeSecond(10); + config.getRtmp().setHandshakeSecond(15); config.getRtmp().setKeepAliveSecond(10); zlmMediaService.setServerConfig(config); }