From 8c2b1ef4feae876bf714c07dd73c3821268666bf Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: Tue, 14 Mar 2023 18:46:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=8B=89=E6=B5=81=E4=BB=A3?= =?UTF-8?q?=E7=90=86=20=E4=B8=8B=E7=BA=BF=E6=97=B6=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E6=9C=AA=E6=9B=B4=E6=94=B9=E4=B8=BA=E4=B8=8B=E7=BA=BF=20#770?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../iot/vmp/media/zlm/ZLMHttpHookListener.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java b/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java index a07a47cd..7a8ac98d 100644 --- a/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java +++ b/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java @@ -256,6 +256,7 @@ public class ZLMHttpHookListener { return result; } + /** * rtsp/rtmp流注册或注销时触发此事件;此事件对回复不敏感。 */ @@ -279,9 +280,12 @@ public class ZLMHttpHookListener { subscribe.response(mediaInfo, json); } } - // 流消失移除redis play + List tracks = param.getTracks(); + // TODO 重构此处逻辑 + if (param.isRegist()) { + // 处理流注册的鉴权信息 if (param.getOriginType() == OriginType.RTMP_PUSH.ordinal() || param.getOriginType() == OriginType.RTSP_PUSH.ordinal() || param.getOriginType() == OriginType.RTC_PUSH.ordinal()) { @@ -300,16 +304,15 @@ public class ZLMHttpHookListener { } if ("rtsp".equals(param.getSchema())) { + // 更新流媒体负载信息 if (param.isRegist()) { mediaServerService.addCount(param.getMediaServerId()); } else { mediaServerService.removeCount(param.getMediaServerId()); } - if (param.getOriginType() == OriginType.PULL.ordinal() - || param.getOriginType() == OriginType.FFMPEG_PULL.ordinal()) { - // 设置拉流代理上线/离线 - streamProxyService.updateStatus(param.isRegist(), param.getApp(), param.getStream()); - } + // 设置拉流代理上线/离线 + streamProxyService.updateStatus(param.isRegist(), param.getApp(), param.getStream()); + if ("rtp".equals(param.getApp()) && !param.isRegist()) { StreamInfo streamInfo = redisCatchStorage.queryPlayByStreamId(param.getStream()); if (streamInfo != null) {