From 60278ee6ad692ed30d9766533345ca764a8870e2 Mon Sep 17 00:00:00 2001
From: 648540858 <456panlinlin>
Date: 星期一, 28 三月 2022 11:03:17 +0800
Subject: [PATCH] 修复国标目录发送缺失的问题

---
 src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java |   17 +++++++++++++----
 1 files changed, 13 insertions(+), 4 deletions(-)

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 7a3c5f5..c3c30a6 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
@@ -188,7 +188,7 @@
 		JSONObject ret = new JSONObject();
 		ret.put("code", 0);
 		ret.put("msg", "success");
-		ret.put("enableHls", true);
+		ret.put("enable_hls", true);
 		String mediaServerId = json.getString("mediaServerId");
 		ZLMHttpHookSubscribe.Event subscribe = this.subscribe.getSubscribe(ZLMHttpHookSubscribe.HookType.on_publish, json);
 		if (subscribe != null) {
@@ -203,9 +203,9 @@
 	 	String app = json.getString("app");
 	 	String stream = json.getString("stream");
 		if ("rtp".equals(app)) {
-			ret.put("enableMP4", userSetup.getRecordSip());
+			ret.put("enable_mp4", userSetup.getRecordSip());
 		}else {
-			ret.put("enableMP4", userSetup.isRecordPushLive());
+			ret.put("enable_mp4", userSetup.isRecordPushLive());
 		}
 		List<SsrcTransaction> ssrcTransactionForAll = sessionManager.getSsrcTransactionForAll(null, null, null, stream);
 		if (ssrcTransactionForAll != null && ssrcTransactionForAll.size() == 1) {
@@ -215,7 +215,16 @@
 			if (deviceChannel != null) {
 				ret.put("enable_audio", deviceChannel.isHasAudio());
 			}
+			// 濡傛灉鏄綍鍍忎笅杞藉氨璁剧疆瑙嗛闂撮殧鍗佺
+			if (ssrcTransactionForAll.get(0).getType() == VideoStreamSessionManager.SessionType.download) {
+				ret.put("mp4_max_second", 10);
+				ret.put("enable_mp4", true);
+				ret.put("enable_audio", true);
+			}
+
 		}
+
+
 		return new ResponseEntity<String>(ret.toString(), HttpStatus.OK);
 	}
 	
@@ -324,7 +333,6 @@
 			if (mediaInfo != null) {
 				subscribe.response(mediaInfo, json);
 			}
-
 		}
 		// 娴佹秷澶辩Щ闄edis play
 		String app = item.getApp();
@@ -441,6 +449,7 @@
 		if ("rtp".equals(app)){
 			ret.put("close", true);
 			StreamInfo streamInfoForPlayCatch = redisCatchStorage.queryPlayByStreamId(streamId);
+			SsrcTransaction ssrcTransaction = sessionManager.getSsrcTransaction(null, null, null, streamId);
 			if (streamInfoForPlayCatch != null) {
 				// 濡傛灉鍦ㄧ粰涓婄骇鎺ㄦ祦锛屼篃涓嶅仠姝€��
 				if (redisCatchStorage.isChannelSendingRTP(streamInfoForPlayCatch.getChannelId())) {

--
Gitblit v1.8.0