From 0a404e23896b566a4dc017431951f8b73578ed73 Mon Sep 17 00:00:00 2001
From: 百鸣 <94030128+ixingqiao@users.noreply.github.com>
Date: 星期五, 26 八月 2022 11:49:43 +0800
Subject: [PATCH] Merge branch '648540858:wvp-28181-2.0' into wvp-28181-2.0
---
src/main/java/com/genersoft/iot/vmp/service/impl/RedisGbPlayMsgListener.java | 28 ++++++++++++----------------
1 files changed, 12 insertions(+), 16 deletions(-)
diff --git a/src/main/java/com/genersoft/iot/vmp/service/impl/RedisGbPlayMsgListener.java b/src/main/java/com/genersoft/iot/vmp/service/impl/RedisGbPlayMsgListener.java
index 638ea41..0f5f57c 100644
--- a/src/main/java/com/genersoft/iot/vmp/service/impl/RedisGbPlayMsgListener.java
+++ b/src/main/java/com/genersoft/iot/vmp/service/impl/RedisGbPlayMsgListener.java
@@ -8,6 +8,9 @@
import com.genersoft.iot.vmp.media.zlm.ZLMHttpHookSubscribe;
import com.genersoft.iot.vmp.media.zlm.ZLMMediaListManager;
import com.genersoft.iot.vmp.media.zlm.ZLMRTPServerFactory;
+import com.genersoft.iot.vmp.media.zlm.dto.HookSubscribeFactory;
+import com.genersoft.iot.vmp.media.zlm.dto.HookSubscribeForStreamChange;
+import com.genersoft.iot.vmp.media.zlm.dto.HookType;
import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem;
import com.genersoft.iot.vmp.service.IMediaServerService;
import com.genersoft.iot.vmp.service.bean.*;
@@ -63,8 +66,6 @@
@Autowired
private UserSetting userSetting;
- @Autowired
- private RedisUtil redis;
@Autowired
private ZLMMediaListManager zlmMediaListManager;
@@ -224,7 +225,7 @@
WvpRedisMsg response = WvpRedisMsg.getResponseInstance(userSetting.getServerId(), toId,
WvpRedisMsgCmd.REQUEST_PUSH_STREAM, serial, result);
JSONObject jsonObject = (JSONObject)JSON.toJSON(response);
- redis.convertAndSend(WVP_PUSH_STREAM_KEY, jsonObject);
+ RedisUtil.convertAndSend(WVP_PUSH_STREAM_KEY, jsonObject);
}
/**
@@ -243,7 +244,7 @@
WvpRedisMsgCmd.GET_SEND_ITEM, serial, result);
JSONObject jsonObject = (JSONObject)JSON.toJSON(response);
- redis.convertAndSend(WVP_PUSH_STREAM_KEY, jsonObject);
+ RedisUtil.convertAndSend(WVP_PUSH_STREAM_KEY, jsonObject);
return;
}
// 纭畾娴佹槸鍚﹀湪绾�
@@ -266,18 +267,13 @@
userSetting.getServerId(), toId, WvpRedisMsgCmd.GET_SEND_ITEM, serial, result
);
JSONObject jsonObject = (JSONObject)JSON.toJSON(response);
- redis.convertAndSend(WVP_PUSH_STREAM_KEY, jsonObject);
+ RedisUtil.convertAndSend(WVP_PUSH_STREAM_KEY, jsonObject);
}, userSetting.getPlatformPlayTimeout());
// 娣诲姞璁㈤槄
- JSONObject subscribeKey = new JSONObject();
- subscribeKey.put("app", content.getApp());
- subscribeKey.put("stream", content.getStream());
- subscribeKey.put("regist", true);
- subscribeKey.put("schema", "rtmp");
- subscribeKey.put("mediaServerId", mediaServerItem.getId());
- subscribe.addSubscribe(ZLMHttpHookSubscribe.HookType.on_stream_changed, subscribeKey,
- (MediaServerItem mediaServerItemInUse, JSONObject json)->{
+ HookSubscribeForStreamChange hookSubscribe = HookSubscribeFactory.on_stream_changed(content.getApp(), content.getStream(), true, "rtmp", mediaServerItem.getId());
+
+ subscribe.addSubscribe(hookSubscribe, (MediaServerItem mediaServerItemInUse, JSONObject json)->{
dynamicTask.stop(taskKey);
responseSendItem(mediaServerItem, content, toId, serial);
});
@@ -310,7 +306,7 @@
userSetting.getServerId(), toId, WvpRedisMsgCmd.GET_SEND_ITEM, serial, result
);
JSONObject jsonObject = (JSONObject)JSON.toJSON(response);
- redis.convertAndSend(WVP_PUSH_STREAM_KEY, jsonObject);
+ RedisUtil.convertAndSend(WVP_PUSH_STREAM_KEY, jsonObject);
}
/**
@@ -347,7 +343,7 @@
wvpResult.setMsg("timeout");
errorCallback.handler(wvpResult);
}, userSetting.getPlatformPlayTimeout());
- redis.convertAndSend(WVP_PUSH_STREAM_KEY, jsonObject);
+ RedisUtil.convertAndSend(WVP_PUSH_STREAM_KEY, jsonObject);
}
/**
@@ -372,6 +368,6 @@
callbacksForStartSendRtpStream.remove(key);
callbacksForError.remove(key);
});
- redis.convertAndSend(WVP_PUSH_STREAM_KEY, jsonObject);
+ RedisUtil.convertAndSend(WVP_PUSH_STREAM_KEY, jsonObject);
}
}
--
Gitblit v1.8.0