From 681351d74040d64024c924a6d7da4e17b96d6a38 Mon Sep 17 00:00:00 2001
From: Dectinc Chen <github@dectinc.cc>
Date: 星期五, 16 四月 2021 17:22:44 +0800
Subject: [PATCH] fix typo and broken url
---
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommander.java | 25 ++++++++++++++++++-------
1 files changed, 18 insertions(+), 7 deletions(-)
diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommander.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommander.java
index 313348e..84c0898 100644
--- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommander.java
+++ b/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");
--
Gitblit v1.8.0