From 2127cbeca3c2f2de31b7f70b2841cdb2ee259e1a Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: 星期三, 05 六月 2024 22:45:13 +0800
Subject: [PATCH] 调整收到移动位置订阅后开启定时任务
---
src/main/java/com/genersoft/iot/vmp/service/impl/MediaServiceImpl.java | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/src/main/java/com/genersoft/iot/vmp/service/impl/MediaServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/service/impl/MediaServiceImpl.java
old mode 100644
new mode 100755
index c8e4c01..ead5052
--- a/src/main/java/com/genersoft/iot/vmp/service/impl/MediaServiceImpl.java
+++ b/src/main/java/com/genersoft/iot/vmp/service/impl/MediaServiceImpl.java
@@ -1,6 +1,5 @@
package com.genersoft.iot.vmp.service.impl;
-import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
import com.genersoft.iot.vmp.common.StreamInfo;
@@ -12,12 +11,16 @@
import com.genersoft.iot.vmp.service.IMediaService;
import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
@Service
public class MediaServiceImpl implements IMediaService {
+
+ private final static Logger logger = LoggerFactory.getLogger(MediaServiceImpl.class);
@Autowired
private IRedisCatchStorage redisCatchStorage;
@@ -58,13 +61,14 @@
calld = streamAuthorityInfo.getCallId();
}
JSONObject mediaList = zlmresTfulUtils.getMediaList(mediaInfo, app, stream);
+ logger.info("[zlm getMediaList]缁撴灉锛� /n {}", mediaList);
if (mediaList != null) {
if (mediaList.getInteger("code") == 0) {
JSONArray data = mediaList.getJSONArray("data");
if (data == null) {
return null;
}
- JSONObject mediaJSON = JSON.parseObject(JSON.toJSONString(data.get(0)), JSONObject.class);
+ JSONObject mediaJSON = data.getJSONObject(0);
JSONArray tracks = mediaJSON.getJSONArray("tracks");
if (authority) {
streamInfo = getStreamInfoByAppAndStream(mediaInfo, app, stream, tracks, addr, calld, true);
@@ -91,6 +95,10 @@
if (addr == null) {
addr = mediaInfo.getStreamIp();
}
+ if (!"broadcast".equalsIgnoreCase(app) && !ObjectUtils.isEmpty(mediaInfo.getTranscodeSuffix()) && !"null".equalsIgnoreCase(mediaInfo.getTranscodeSuffix())) {
+ stream = stream + "_" + mediaInfo.getTranscodeSuffix();
+// streamInfoResult.setStream(stream);
+ }
streamInfoResult.setIp(addr);
streamInfoResult.setMediaServerId(mediaInfo.getId());
--
Gitblit v1.8.0