panlinlin
2021-04-16 1f07f4ab4ceeb6029d3717cc4cb597d1ad6e7e67
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommander.java
@@ -23,7 +23,6 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
// import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.DependsOn;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component;
@@ -91,7 +90,9 @@
   @Autowired
   private SipSubscribe sipSubscribe;
   public SipConfig getSipConfig() {
      return sipConfig;
   }
   /**
    * 云台方向放控制,使用配置文件中的默认镜头移动速度
@@ -339,7 +340,7 @@
   @Override
   public void playStreamCmd(Device device, String channelId, ZLMHttpHookSubscribe.Event event, SipSubscribe.Event errorEvent) {
      try {
         if (device == null) return;
         String ssrc = streamSession.createPlaySsrc();
         String streamId = null;
         if (rtpEnable) {
@@ -364,9 +365,14 @@
         // 添加订阅
         JSONObject subscribeKey = new JSONObject();
         subscribeKey.put("app", "rtp");
         subscribeKey.put("id", streamId);
         subscribeKey.put("stream", streamId);
         subscribeKey.put("regist", true);
         subscribe.addSubscribe(ZLMHttpHookSubscribe.HookType.on_publish, subscribeKey, event);
         subscribe.addSubscribe(ZLMHttpHookSubscribe.HookType.on_stream_changed, subscribeKey, json->{
            if (json.getJSONArray("tracks") == null) return;
            event.response(json);
            subscribe.removeSubscribe(ZLMHttpHookSubscribe.HookType.on_stream_changed, subscribeKey);
         });
         //
         StringBuffer content = new StringBuffer(200);
         content.append("v=0\r\n");
@@ -464,9 +470,14 @@
         // 添加订阅
         JSONObject subscribeKey = new JSONObject();
         subscribeKey.put("app", "rtp");
         subscribeKey.put("id", streamId);
         subscribeKey.put("stream", streamId);
         subscribeKey.put("regist", true);
         subscribe.addSubscribe(ZLMHttpHookSubscribe.HookType.on_publish, subscribeKey, event);
         subscribe.addSubscribe(ZLMHttpHookSubscribe.HookType.on_stream_changed, subscribeKey, json->{
            if (json.getJSONArray("tracks") == null) return;
            event.response(json);
            subscribe.removeSubscribe(ZLMHttpHookSubscribe.HookType.on_stream_changed, subscribeKey);
         });
         StringBuffer content = new StringBuffer(200);
           content.append("v=0\r\n");