From bc431e429026d5efb9d404767f76a0724978d40d Mon Sep 17 00:00:00 2001 From: Cloud User <liaobin143@gmail.com> Date: 星期五, 15 九月 2023 22:39:08 +0800 Subject: [PATCH] fix-use-source-ip-as-stream-ip --- src/main/java/com/genersoft/iot/vmp/gb28181/bean/SubscribeHolder.java | 23 ++++++++--------------- 1 files changed, 8 insertions(+), 15 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/bean/SubscribeHolder.java b/src/main/java/com/genersoft/iot/vmp/gb28181/bean/SubscribeHolder.java old mode 100644 new mode 100755 index 4a900c1..d385d9a --- a/src/main/java/com/genersoft/iot/vmp/gb28181/bean/SubscribeHolder.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/bean/SubscribeHolder.java @@ -2,11 +2,9 @@ import com.genersoft.iot.vmp.common.VideoManagerConstants; import com.genersoft.iot.vmp.conf.DynamicTask; +import com.genersoft.iot.vmp.conf.UserSetting; import com.genersoft.iot.vmp.gb28181.task.ISubscribeTask; import com.genersoft.iot.vmp.gb28181.task.impl.MobilePositionSubscribeHandlerTask; -import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform; -import com.genersoft.iot.vmp.storager.IRedisCatchStorage; -import com.genersoft.iot.vmp.storager.IVideoManagerStorage; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -14,6 +12,9 @@ import java.util.List; import java.util.concurrent.ConcurrentHashMap; +/** + * @author lin + */ @Component public class SubscribeHolder { @@ -21,13 +22,7 @@ private DynamicTask dynamicTask; @Autowired - private IRedisCatchStorage redisCatchStorage; - - @Autowired - private ISIPCommanderForPlatform sipCommanderForPlatform; - - @Autowired - private IVideoManagerStorage storager; + private UserSetting userSetting; private final String taskOverduePrefix = "subscribe_overdue_"; @@ -59,15 +54,13 @@ } // 娣诲姞浠诲姟澶勭悊璁㈤槄杩囨湡 dynamicTask.stop(taskOverdueKey); - } public void putMobilePositionSubscribe(String platformId, SubscribeInfo subscribeInfo) { mobilePositionMap.put(platformId, subscribeInfo); - String key = VideoManagerConstants.SIP_SUBSCRIBE_PREFIX + "MobilePosition_" + platformId; + String key = VideoManagerConstants.SIP_SUBSCRIBE_PREFIX + userSetting.getServerId() + "MobilePosition_" + platformId; // 娣诲姞浠诲姟澶勭悊GPS瀹氭椂鎺ㄩ�� - dynamicTask.startCron(key, new MobilePositionSubscribeHandlerTask(redisCatchStorage, sipCommanderForPlatform, - storager, platformId, subscribeInfo.getSn(), key, this, dynamicTask), + dynamicTask.startCron(key, new MobilePositionSubscribeHandlerTask(platformId), subscribeInfo.getGpsInterval() * 1000); String taskOverdueKey = taskOverduePrefix + "MobilePosition_" + platformId; // 娣诲姞浠诲姟澶勭悊璁㈤槄杩囨湡 @@ -83,7 +76,7 @@ public void removeMobilePositionSubscribe(String platformId) { mobilePositionMap.remove(platformId); - String key = VideoManagerConstants.SIP_SUBSCRIBE_PREFIX + "MobilePosition_" + platformId; + String key = VideoManagerConstants.SIP_SUBSCRIBE_PREFIX + userSetting.getServerId() + "MobilePosition_" + platformId; // 缁撴潫浠诲姟澶勭悊GPS瀹氭椂鎺ㄩ�� dynamicTask.stop(key); String taskOverdueKey = taskOverduePrefix + "MobilePosition_" + platformId; -- Gitblit v1.8.0