From c2aaae9325db012c9960b69784330ced5ec15ab9 Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: 星期一, 09 五月 2022 18:15:30 +0800 Subject: [PATCH] 初步实现语音喊话 --- src/main/java/com/genersoft/iot/vmp/gb28181/session/CatalogDataCatch.java | 28 ++++++++++++++++++++-------- 1 files changed, 20 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/session/CatalogDataCatch.java b/src/main/java/com/genersoft/iot/vmp/gb28181/session/CatalogDataCatch.java index 759b317..3d53914 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/session/CatalogDataCatch.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/session/CatalogDataCatch.java @@ -21,9 +21,6 @@ public static Map<String, CatalogData> data = new ConcurrentHashMap<>(); @Autowired - private DeferredResultHolder deferredResultHolder; - - @Autowired private IVideoManagerStorage storager; public void addReady(Device device, int sn ) { @@ -65,25 +62,38 @@ public List<DeviceChannel> get(String deviceId) { CatalogData catalogData = data.get(deviceId); - if (catalogData == null) return null; + if (catalogData == null) { + return null; + } return catalogData.getChannelList(); } public int getTotal(String deviceId) { CatalogData catalogData = data.get(deviceId); - if (catalogData == null) return 0; + if (catalogData == null) { + return 0; + } return catalogData.getTotal(); } public SyncStatus getSyncStatus(String deviceId) { CatalogData catalogData = data.get(deviceId); - if (catalogData == null) return null; - if (catalogData.getStatus().equals(CatalogData.CatalogDataStatus.end)) return null; + if (catalogData == null) { + return null; + } SyncStatus syncStatus = new SyncStatus(); syncStatus.setCurrent(catalogData.getChannelList().size()); syncStatus.setTotal(catalogData.getTotal()); syncStatus.setErrorMsg(catalogData.getErrorMsg()); return syncStatus; + } + + public boolean isSyncRunning(String deviceId) { + CatalogData catalogData = data.get(deviceId); + if (catalogData == null) { + return false; + } + return !catalogData.getStatus().equals(CatalogData.CatalogDataStatus.end); } @Scheduled(fixedRate = 5 * 1000) //姣�5绉掓墽琛屼竴娆�, 鍙戠幇鏁版嵁5绉掓湭鏇存柊鍒欑Щ闄ゆ暟鎹苟璁や负鏁版嵁鎺ユ敹瓒呮椂 @@ -120,7 +130,9 @@ public void setChannelSyncEnd(String deviceId, String errorMsg) { CatalogData catalogData = data.get(deviceId); - if (catalogData == null)return; + if (catalogData == null) { + return; + } catalogData.setStatus(CatalogData.CatalogDataStatus.end); catalogData.setErrorMsg(errorMsg); } -- Gitblit v1.8.0