648540858
2022-08-31 2de4c322f6dc79ecfb120106af07e3335994657a
src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java
@@ -18,8 +18,11 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.PostMapping;
@@ -91,6 +94,10 @@
   @Autowired
   private AssistRESTfulUtils assistRESTfulUtils;
   @Qualifier("taskExecutor")
   @Autowired
   private ThreadPoolTaskExecutor taskExecutor;
   /**
    * 服务器定时上报时间,上报间隔可配置,默认10s上报一次
@@ -238,9 +245,12 @@
         // 鉴权通过
         redisCatchStorage.updateStreamAuthorityInfo(param.getApp(), param.getStream(), streamAuthorityInfo);
         // 通知assist新的callId
         taskExecutor.execute(()->{
         if (mediaInfo != null && mediaInfo.getRecordAssistPort() > 0) {
            assistRESTfulUtils.addStreamCallInfo(mediaInfo, param.getApp(), param.getStream(), callId, null);
         }
         });
      }else {
         zlmMediaListManager.sendStreamEvent(param.getApp(),param.getStream(), param.getMediaServerId());
      }
@@ -416,6 +426,9 @@
      String schema = item.getSchema();
      List<MediaItem.MediaTrack> tracks = item.getTracks();
      boolean regist = item.isRegist();
      if (item.getOriginType() == OriginType.RTMP_PUSH.ordinal()
            || item.getOriginType() == OriginType.RTSP_PUSH.ordinal()
            || item.getOriginType() == OriginType.RTC_PUSH.ordinal()) {
      if (regist) {
         StreamAuthorityInfo streamAuthorityInfo = redisCatchStorage.getStreamAuthorityInfo(app, stream);
         if (streamAuthorityInfo == null) {
@@ -428,6 +441,8 @@
      }else {
         redisCatchStorage.removeStreamAuthorityInfo(app, stream);
      }
      }
      if ("rtsp".equals(schema)){
         logger.info("on_stream_changed:注册->{}, app->{}, stream->{}", regist, app, stream);
         if (regist) {