From ff6a5484e327c19acf79e66cd5262de7f27eddc8 Mon Sep 17 00:00:00 2001 From: shikong <919411476@qq.com> Date: Wed, 13 Mar 2024 10:13:37 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=20on=5Fstream=5Fnone=5Freade?= =?UTF-8?q?r=20=E4=BB=85=E5=AF=B9=20rtmp=20=E5=81=9A=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../skcks/docking/gb28181/mocking/api/zlm/ZlmHookApi.java | 6 ++++-- .../gb28181/mocking/service/device/DeviceProxyService.java | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/gb28181-mocking-api/src/main/java/cn/skcks/docking/gb28181/mocking/api/zlm/ZlmHookApi.java b/gb28181-mocking-api/src/main/java/cn/skcks/docking/gb28181/mocking/api/zlm/ZlmHookApi.java index 4338547..166802e 100644 --- a/gb28181-mocking-api/src/main/java/cn/skcks/docking/gb28181/mocking/api/zlm/ZlmHookApi.java +++ b/gb28181-mocking-api/src/main/java/cn/skcks/docking/gb28181/mocking/api/zlm/ZlmHookApi.java @@ -32,14 +32,16 @@ public class ZlmHookApi { @PostJson("/on_stream_changed") public void onStreamChanged(@RequestBody ZlmStreamChangeDTO dto){ log.debug("on_stream_changed {}", dto); - if(StringUtils.equalsIgnoreCase(dto.getSchema(), "rtsp")){ + if(StringUtils.equalsIgnoreCase(dto.getSchema(), "rtmp")){ zlmStreamChangeHookService.processEvent(dto.getApp(),dto.getStream(), dto.getRegist()); } } @PostJson("/on_stream_none_reader") public void onStreamNoneReader(@RequestBody ZlmStreamNoneReaderDTO dto){ - zlmStreamNoneReaderHookService.processEvent(dto.getApp(),dto.getStream()); + if(StringUtils.equalsIgnoreCase(dto.getSchema(), "rtmp")){ + zlmStreamNoneReaderHookService.processEvent(dto.getApp(),dto.getStream()); + } } @SneakyThrows 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 ab895cf..bc9e13f 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 @@ -428,7 +428,7 @@ public class DeviceProxyService { .withStopStrategy(StopStrategies.stopAfterAttempt(3)) .build(); - String toUrl = "rtsp://" + zlmMediaConfig.getIp() + ":" + zlmRtmpConfig.getPort() + "/" + ZLM_FFMPEG_PROXY_APP +"/" + callId; + String toUrl = "rtmp://" + zlmMediaConfig.getIp() + ":" + zlmRtmpConfig.getPort() + "/" + ZLM_FFMPEG_PROXY_APP +"/" + callId; String key = GenericSubscribe.Helper.getKey(Request.BYE, callId); try { ZlmResponse sourceResp = retryer.call(() -> zlmMediaService.addFfmpegSource(AddFFmpegSource.builder()