From 209c26e699ba9b5f12855772b59618ce1a423da9 Mon Sep 17 00:00:00 2001
From: xc <double72cheng@gmail.com>
Date: Mon, 16 Aug 2021 17:31:26 +0800
Subject: [PATCH] add

---
 src/main/resources/depend/hdsdkws.war                             |    0 
 src/main/resources/depend/hdDNAPI.dll                             |    0 
 src/main/resources/depend/hdProcComm.dll                          |    0 
 src/main/resources/depend/hdKingAPI.lib                           |    0 
 src/main/resources/depend/hdDataSDK.dll                           |    0 
 src/main/resources/depend/hdOS.dll                                |    0 
 src/main/resources/public/monitor/live.html                       |    4 
 src/main/java/com/hbbh/adapter/controller/MonibucaController.java |    6 
 src/main/resources/depend/hdNetClient.dll                         |    0 
 src/main/resources/depend/gson-2.2.4.jar                          |    0 
 src/main/resources/public/monitor/test.html                       |    2 
 src/main/resources/depend/cvs-dataprovider-3.0.0.jar              |    0 
 src/main/resources/depend/webserviceClient.bat                    |   30 +++++++
 src/main/resources/depend/hd-datasdk-3.5.0.jar                    |    0 
 src/main/resources/depend/commons-lang3-3.4.jar                   |    0 
 src/main/java/com/hbbh/adapter/app/RTDBPath.java                  |  116 +++++++++++++++++++++++++++++
 src/main/java/com/hbbh/adapter/utils/PathUtil.java                |   65 ++++++++++++++++
 src/main/resources/depend/hdKingAPI.dll                           |    0 
 src/main/resources/depend/hd-dataprovider-3.5.0.jar               |    0 
 src/main/resources/depend/log4j-1.2.13.jar                        |    0 
 src/main/resources/depend/LogAPI.xml                              |    2 
 21 files changed, 219 insertions(+), 6 deletions(-)

diff --git a/src/main/java/com/hbbh/adapter/app/RTDBPath.java b/src/main/java/com/hbbh/adapter/app/RTDBPath.java
new file mode 100644
index 0000000..648b75e
--- /dev/null
+++ b/src/main/java/com/hbbh/adapter/app/RTDBPath.java
@@ -0,0 +1,116 @@
+package com.hbbh.adapter.app;
+
+
+import com.google.common.collect.Lists;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * 设置 实时数据库环境程序
+ */
+public class RTDBPath {
+
+
+    public static void main(String[] args) {
+        printLibrary();
+    }
+
+    private static final String key = "java.library.path";
+    //Windows
+    private static final String regex_win = ";";
+    // mac
+    private static final String regex_mac = ":";
+
+    private static final String _mac = "mac";
+    private static final String _windows = "windows";
+
+    private static final String os_name = "os.name";
+
+
+    public static void printLibrary() {
+        String os = chooseOS();
+        setSystemPath(os);
+
+        String osName = System.getProperty(os_name).toLowerCase();
+
+        System.out.println("当前运行操作系统:" + osName);
+        System.out.println("-------------- 引入第三方包环境变量之前 --- Before -------------- ");
+        String propertyBefore = System.getProperty(key);
+        if (propertyBefore.contains(regex_win)) {
+            String[] split = propertyBefore.split(regex_win);
+            for (String s : split) {
+                System.out.println(s);
+            }
+        } else {
+            System.out.println(propertyBefore);
+        }
+        System.out.println("------------------------------------------ ");
+    }
+
+    //需要在 resources 下创建 depend 文件夹 将实时库依赖包放进去
+    private static String dependPath = Thread.currentThread().getContextClassLoader().getResource("depend").getPath();
+
+    private static void setSystemPath(String os) {
+        String propertyBefore = System.getProperty(key);
+
+        switch (os) {
+            case _windows:
+                String[] splitWin = propertyBefore.split(regex_win);
+                List<String> wins = Arrays.asList(splitWin);
+                List<String> winList = Lists.newArrayList(wins);
+                winList.add(dependPath);
+                spliceWin(wins);
+                break;
+            case _mac:
+                String[] splitMac = propertyBefore.split(regex_mac);
+                List<String> macs = Arrays.asList(splitMac);
+                List<String> macList = Lists.newArrayList(macs);
+                macList.add(dependPath);
+                spliceMac(macList);
+                break;
+            default:
+                throw new RuntimeException("当前操作系统不识别");
+        }
+    }
+
+    private static void spliceMac(List<String> macList) {
+        StringBuilder sb=new StringBuilder();
+        for (int i = 0; i < macList.size(); i++) {
+            if (i==(macList.size()-1)){
+                sb.append(macList.get(i));
+            }else {
+                sb.append(macList.get(i));
+                sb.append(regex_mac);
+            }
+        }
+        System.setProperty(key, sb.toString());
+    }
+
+    private static void spliceWin(List<String> winList) {
+        StringBuilder sb=new StringBuilder();
+        for (int i = 0; i < winList.size(); i++) {
+            if (i==(winList.size()-1)){
+                sb.append(winList.get(i));
+            }else {
+                sb.append(winList.get(i));
+                sb.append(regex_win);
+            }
+        }
+        System.setProperty(key, sb.toString());
+    }
+
+    private static String chooseOS() {
+        String osName = System.getProperty(os_name).toLowerCase();
+        if (osName.contains(_mac)) {
+            //throw new RuntimeException("警告:当前程序必须在Windows环境下执行");
+        } else if (osName.contains(_windows)) {
+            return _windows;
+        } else {
+            throw new RuntimeException("当前操作系统不识别");
+        }
+
+        throw new RuntimeException("当前操作系统不识别");
+    }
+}
diff --git a/src/main/java/com/hbbh/adapter/controller/MonibucaController.java b/src/main/java/com/hbbh/adapter/controller/MonibucaController.java
index e8540f0..e4560c8 100644
--- a/src/main/java/com/hbbh/adapter/controller/MonibucaController.java
+++ b/src/main/java/com/hbbh/adapter/controller/MonibucaController.java
@@ -56,12 +56,12 @@
     public MonicaResult live(@RequestParam("param")String param) {
         MonicaResult monicaResult = new MonicaResult();
         try {
-            monicaResult.setSourceURL("rtsp:////");
+            monicaResult.setSourceURL("rtsp://admin:abcd1234@192.168.12.211:554/Streaming/Channels/202");
             monicaResult.setHlsURL("");
             monicaResult.setFlvURL("");
-            monicaResult.setJessicaURL("ws://172.16.30.113:8082/live/ff80808178af424e0178af44e677000343616d657261.flv");
+            monicaResult.setJessicaURL("ws://172.16.30.113:8082/live/402881e878d98f2d0178d9b0154b006243616d657261.flv");
             monicaResult.setWebrtcURL("");
-            monicaResult.setStreamPath("live/ff80808178af424e0178af44e677000343616d657261");
+            monicaResult.setStreamPath("live/402881e878d98f2d0178d9b0154b006243616d657261");
 
             return monicaResult;
         } catch (Exception e) {
diff --git a/src/main/java/com/hbbh/adapter/utils/PathUtil.java b/src/main/java/com/hbbh/adapter/utils/PathUtil.java
new file mode 100644
index 0000000..4110187
--- /dev/null
+++ b/src/main/java/com/hbbh/adapter/utils/PathUtil.java
@@ -0,0 +1,65 @@
+package com.hbbh.adapter.utils;
+
+
+import java.util.Properties;
+
+/**
+ * 环境变量工具
+ * for fameview
+ */
+public class PathUtil {
+
+
+    private static final String key= "java.library.path";
+    private static final String path="user.dir";
+    //Windows
+    private static final String regex_win= ";";
+    // mac
+    private static final String regex_mac= ":";
+
+    private static final String _mac= "mac";
+    private static final String _windows= "windows";
+
+    private static final String os_name= "os.name";
+
+
+    /**
+     * 输出
+     * 1.当前程序必须在Windows环境运行
+     * 2.第三方依赖包存放位置
+     * 3.环境变量所在位置
+     */
+    public static void printLibrary(){
+        String regex=null;
+        String osName = System.getProperty(os_name).toLowerCase();
+        if (osName.contains(_mac)){
+            System.out.println("警告:当前程序必须在Windows环境下执行");
+            regex=regex_mac;
+        }else if (osName.contains(_windows)){
+            regex=regex_win;
+        }else if (null==osName){
+            System.out.println("警告:当前程序必须在Windows环境下执行");
+            regex=regex_win;
+        }
+
+        System.out.println("当前运行操作系统:"+osName);
+        System.out.println("-------------- 引入第三方包环境变量 -------------- ");
+        String property = System.getProperty(key);
+        if (property.contains(regex)) {
+            String[] split = property.split(regex);
+            for (String s : split) {
+                System.out.println("需要在文件--> "+s+"  | 下放置依赖包");
+            }
+        } else {
+            System.out.println("需要在文件--> "+property+"  | 下放置依赖包");
+        }
+        System.out.println("-------------- 或者重新制定环境变量 ------------------- ");
+    }
+
+    public static void main(String[] args) {
+        //printLibrary();
+        Properties properties = System.getProperties();
+    }
+
+
+}
diff --git a/src/main/resources/depend/LogAPI.xml b/src/main/resources/depend/LogAPI.xml
new file mode 100644
index 0000000..c3d7c63
--- /dev/null
+++ b/src/main/resources/depend/LogAPI.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Config level="error" maxsize="1024"/>
\ No newline at end of file
diff --git a/src/main/resources/depend/commons-lang3-3.4.jar b/src/main/resources/depend/commons-lang3-3.4.jar
new file mode 100644
index 0000000..8ec91d4
--- /dev/null
+++ b/src/main/resources/depend/commons-lang3-3.4.jar
Binary files differ
diff --git a/src/main/resources/depend/cvs-dataprovider-3.0.0.jar b/src/main/resources/depend/cvs-dataprovider-3.0.0.jar
new file mode 100644
index 0000000..d471ebb
--- /dev/null
+++ b/src/main/resources/depend/cvs-dataprovider-3.0.0.jar
Binary files differ
diff --git a/src/main/resources/depend/gson-2.2.4.jar b/src/main/resources/depend/gson-2.2.4.jar
new file mode 100644
index 0000000..9478253
--- /dev/null
+++ b/src/main/resources/depend/gson-2.2.4.jar
Binary files differ
diff --git a/src/main/resources/depend/hd-dataprovider-3.5.0.jar b/src/main/resources/depend/hd-dataprovider-3.5.0.jar
new file mode 100644
index 0000000..135dc3e
--- /dev/null
+++ b/src/main/resources/depend/hd-dataprovider-3.5.0.jar
Binary files differ
diff --git a/src/main/resources/depend/hd-datasdk-3.5.0.jar b/src/main/resources/depend/hd-datasdk-3.5.0.jar
new file mode 100644
index 0000000..691372b
--- /dev/null
+++ b/src/main/resources/depend/hd-datasdk-3.5.0.jar
Binary files differ
diff --git a/src/main/resources/depend/hdDNAPI.dll b/src/main/resources/depend/hdDNAPI.dll
new file mode 100644
index 0000000..66187db
--- /dev/null
+++ b/src/main/resources/depend/hdDNAPI.dll
Binary files differ
diff --git a/src/main/resources/depend/hdDataSDK.dll b/src/main/resources/depend/hdDataSDK.dll
new file mode 100644
index 0000000..6ae9e2f
--- /dev/null
+++ b/src/main/resources/depend/hdDataSDK.dll
Binary files differ
diff --git a/src/main/resources/depend/hdKingAPI.dll b/src/main/resources/depend/hdKingAPI.dll
new file mode 100644
index 0000000..4737b26
--- /dev/null
+++ b/src/main/resources/depend/hdKingAPI.dll
Binary files differ
diff --git a/src/main/resources/depend/hdKingAPI.lib b/src/main/resources/depend/hdKingAPI.lib
new file mode 100644
index 0000000..12a367e
--- /dev/null
+++ b/src/main/resources/depend/hdKingAPI.lib
Binary files differ
diff --git a/src/main/resources/depend/hdNetClient.dll b/src/main/resources/depend/hdNetClient.dll
new file mode 100644
index 0000000..e444de6
--- /dev/null
+++ b/src/main/resources/depend/hdNetClient.dll
Binary files differ
diff --git a/src/main/resources/depend/hdOS.dll b/src/main/resources/depend/hdOS.dll
new file mode 100644
index 0000000..91e179c
--- /dev/null
+++ b/src/main/resources/depend/hdOS.dll
Binary files differ
diff --git a/src/main/resources/depend/hdProcComm.dll b/src/main/resources/depend/hdProcComm.dll
new file mode 100644
index 0000000..803d80b
--- /dev/null
+++ b/src/main/resources/depend/hdProcComm.dll
Binary files differ
diff --git a/src/main/resources/depend/hdsdkws.war b/src/main/resources/depend/hdsdkws.war
new file mode 100644
index 0000000..7b8189a
--- /dev/null
+++ b/src/main/resources/depend/hdsdkws.war
Binary files differ
diff --git a/src/main/resources/depend/log4j-1.2.13.jar b/src/main/resources/depend/log4j-1.2.13.jar
new file mode 100644
index 0000000..dde9972
--- /dev/null
+++ b/src/main/resources/depend/log4j-1.2.13.jar
Binary files differ
diff --git a/src/main/resources/depend/webserviceClient.bat b/src/main/resources/depend/webserviceClient.bat
new file mode 100644
index 0000000..c32360b
--- /dev/null
+++ b/src/main/resources/depend/webserviceClient.bat
@@ -0,0 +1,30 @@
+@chcp 65001
+@echo webservice根据相应的service的IP和端口生成客户端client
+@echo Input IP(eg:127.0.0.1)......
+@set /p ip=
+@echo Input port(eg:8080)......
+@set /p port=
+@mkdir clientTmp
+@cd clientTmp
+@echo 根据wsdl生成client的java文件...
+@chcp 936
+@wsimport -s ./ -p com.baosight.client -keep http://%ip%:%port%/hdsdkws/HDConnectionFactoryWs?wsdl
+@wsimport -s ./ -p com.baosight.client -keep http://%ip%:%port%/hdsdkws/HDUserManagerWs?wsdl
+@wsimport -s ./ -p com.baosight.client -keep http://%ip%:%port%/hdsdkws/HDTagManagerWs?wsdl
+@wsimport -s ./ -p com.baosight.client -keep http://%ip%:%port%/hdsdkws/HDDataProviderWs?wsdl
+@wsimport -s ./ -p com.baosight.client -keep http://%ip%:%port%/hdsdkws/HDDataWriterWs?wsdl
+@wsimport -s ./ -p com.baosight.client -keep http://%ip%:%port%/hdsdkws/HDAlarmManagerWs?wsdl
+@wsimport -s ./ -p com.baosight.client -keep http://%ip%:%port%/hdsdkws/HDServerFactoryWs?wsdl
+@wsimport -s ./ -p com.baosight.client -keep http://%ip%:%port%/hdsdkws/HDDataAnalysisWs?wsdl
+@chcp 65001
+@echo 把java文件打包成jar...
+@jar -cef com.baosight.client hdsdkwsclient.jar com
+@move hdsdkwsclient.jar ./../
+@cd ..
+@rd /s /q clientTmp
+@echo. 
+@echo.  
+@echo ------------------------------------------------------
+@echo ----- 生成的jar包为当前目录下的hdsdkwsclient.jar -----
+@echo ------------------------------------------------------
+@pause
\ No newline at end of file
diff --git a/src/main/resources/public/monitor/live.html b/src/main/resources/public/monitor/live.html
index 9a0f512..41ab3e2 100755
--- a/src/main/resources/public/monitor/live.html
+++ b/src/main/resources/public/monitor/live.html
@@ -27,8 +27,8 @@
 <script>
     let liveComponent = new LiveComponent({
         elem: "jessibucaContainer",
-        cameraId: "ff80808178af424e0178af44e677000343616d657261",
-        rtspUrl: "rtsp://admin:12345...@192.168.1.201:554/Streaming/Channels/301",
+        cameraId: "",
+        rtspUrl: "rtsp://admin:abcd1234@192.168.12.211:554/Streaming/Channels/202",
     });
     //关闭流
     //liveComponent.close();
diff --git a/src/main/resources/public/monitor/test.html b/src/main/resources/public/monitor/test.html
index 82c9123..feb0261 100644
--- a/src/main/resources/public/monitor/test.html
+++ b/src/main/resources/public/monitor/test.html
@@ -62,7 +62,7 @@
     h5lc.onLoad = function () {
         //this.play("wss://pulls.1234326.cn/live/L01.flv")
         //this.play("ws://localhost:8080/live/test.flv")
-        //this.play("ws://" + source + ":8080/live/" + stream)
+        this.play("ws://172.16.30.113:8082/live/ff80808178af4cc60178af5f629f004a43616d657261.flv");
         //this.play("ws://pull3.afb1188.com/live/" + stream + ".flv")
         //this.play("ws://pull2.afb1188.com/live/" + stream + ".flv")
     }

--
Gitblit v1.9.1