Parcourir la source

MediaItem增加callId

648540858 il y a 3 ans
Parent
commit
c48def08cf

+ 1 - 1
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()

+ 16 - 0
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;
+    }
 }

+ 5 - 0
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);
     }