From c48def08cf607c9c106965f55d54afe24f1bef85 Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: Mon, 18 Jul 2022 20:33:47 +0800 Subject: [PATCH] =?UTF-8?q?MediaItem=E5=A2=9E=E5=8A=A0callId?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../iot/vmp/media/zlm/ZLMHttpHookListener.java | 2 +- .../iot/vmp/media/zlm/dto/MediaItem.java | 16 ++++++++++++++++ .../vmp/storager/impl/RedisCatchStorageImpl.java | 5 +++++ 3 files changed, 22 insertions(+), 1 deletion(-) 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 4b51d7ce..055cccbd 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 @@ -461,7 +461,7 @@ public class ZLMHttpHookListener { StreamInfo streamInfoByAppAndStream = mediaService.getStreamInfoByAppAndStream(mediaServerItem, app, stream, tracks, streamAuthorityInfo.getCallId()); item.setStreamInfo(streamInfoByAppAndStream); - + item.setSeverId(userSetting.getServerId()); redisCatchStorage.addStream(mediaServerItem, type, app, stream, item); if (item.getOriginType() == OriginType.RTSP_PUSH.ordinal() || item.getOriginType() == OriginType.RTMP_PUSH.ordinal() diff --git a/src/main/java/com/genersoft/iot/vmp/media/zlm/dto/MediaItem.java b/src/main/java/com/genersoft/iot/vmp/media/zlm/dto/MediaItem.java index 8abac5b0..96cbfbd8 100644 --- a/src/main/java/com/genersoft/iot/vmp/media/zlm/dto/MediaItem.java +++ b/src/main/java/com/genersoft/iot/vmp/media/zlm/dto/MediaItem.java @@ -4,6 +4,9 @@ import com.genersoft.iot.vmp.common.StreamInfo; import java.util.List; +/** + * @author lin + */ public class MediaItem { /** @@ -21,6 +24,11 @@ public class MediaItem { */ private String stream; + /** + * 推流鉴权Id + */ + private String callId; + /** * 观看总人数,包括hls/rtsp/rtmp/http-flv/ws-flv */ @@ -427,4 +435,12 @@ public class MediaItem { public void setSeverId(String severId) { this.severId = severId; } + + public String getCallId() { + return callId; + } + + public void setCallId(String callId) { + this.callId = callId; + } } diff --git a/src/main/java/com/genersoft/iot/vmp/storager/impl/RedisCatchStorageImpl.java b/src/main/java/com/genersoft/iot/vmp/storager/impl/RedisCatchStorageImpl.java index 8e98059c..b8b97cee 100644 --- a/src/main/java/com/genersoft/iot/vmp/storager/impl/RedisCatchStorageImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/storager/impl/RedisCatchStorageImpl.java @@ -485,7 +485,12 @@ public class RedisCatchStorageImpl implements IRedisCatchStorage { @Override public void addStream(MediaServerItem mediaServerItem, String type, String app, String streamId, MediaItem mediaItem) { + // 查找是否使用了callID + StreamAuthorityInfo streamAuthorityInfo = getStreamAuthorityInfo(app, streamId); String key = VideoManagerConstants.WVP_SERVER_STREAM_PREFIX + userSetting.getServerId() + "_" + type + "_" + app + "_" + streamId + "_" + mediaServerItem.getId(); + if (streamAuthorityInfo != null) { + mediaItem.setCallId(streamAuthorityInfo.getCallId()); + } redis.set(key, mediaItem); }