Merge remote-tracking branch 'origin/master'
2 files added
41 files modified
8 files deleted
1 files copied
158 files renamed
| | |
| | | <version>5.0.1</version> |
| | | </dependency> |
| | | |
| | | <!-- 通用工具--> |
| | | <!-- <dependency>--> |
| | | <!-- <groupId>commons-codec</groupId>--> |
| | | <!-- <artifactId>commons-codec</artifactId>--> |
| | | <!-- <version>1.10</version>--> |
| | | <!-- </dependency>--> |
| | | |
| | | <dependency> |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>ruoyi-common</artifactId> |
| | |
| | | <artifactId>geodesy</artifactId> |
| | | <version>1.1.3</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.bytedeco</groupId> |
| | | <artifactId>javacv-platform</artifactId> |
| | | <version>1.5.7</version> |
| | | </dependency> |
| | | <!-- <dependency>-->
|
| | | <!-- <groupId>org.bytedeco</groupId>-->
|
| | | <!-- <artifactId>javacv-platform</artifactId>-->
|
| | | <!-- <version>1.5.7</version>-->
|
| | | <!-- </dependency>-->
|
| | | <!-- Forest --> |
| | | <dependency> |
| | | <groupId>com.dtflys.forest</groupId> |
| | |
| | | Integer keepAliveSeconds; |
| | | @Value("${ThreadPoolTask.queueCapacity}") |
| | | Integer queueCapacity; |
| | | |
| | | @Bean("alarmExecutor") |
| | | public Executor alarmExecutor(){ |
| | | ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); |
| | |
| | | executor.initialize(); |
| | | return executor; |
| | | } |
| | | @Bean("loginExecutor") |
| | | public Executor loginExecutor(){ |
| | | ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); |
| | | //配置核心线程数 |
| | | executor.setCorePoolSize(corePoolSize); |
| | | //配置最大线程数 |
| | | executor.setMaxPoolSize(maxPoolSize); |
| | | //配置队列大小 |
| | | executor.setQueueCapacity(queueCapacity); |
| | | //线程的名称前缀 |
| | | executor.setThreadNamePrefix("loginExecutor-"); |
| | | //线程活跃时间(秒) |
| | | executor.setKeepAliveSeconds(keepAliveSeconds); |
| | | //等待所有任务结束后再关闭线程池 |
| | | executor.setWaitForTasksToCompleteOnShutdown(true); |
| | | //设置拒绝策略 |
| | | executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy()); |
| | | //执行初始化 |
| | | executor.initialize(); |
| | | return executor; |
| | | } |
| | | } |
| | |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.context.ApplicationContextInitializer; |
| | | import org.springframework.context.ConfigurableApplicationContext; |
| | | import org.springframework.core.io.ClassPathResource;
|
| | | import org.springframework.core.io.Resource;
|
| | | import org.springframework.core.io.ResourceLoader;
|
| | | import org.springframework.stereotype.Component; |
| | |
|
| | | import javax.annotation.PostConstruct; |
| | | import javax.annotation.PreDestroy; |
| | | import java.io.File; |
| | | import java.io.IOException;
|
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | |
| | | Boolean webrtcEnabled; |
| | | //redis |
| | | String redisName = "redis-server.exe"; |
| | |
|
| | | /** |
| | | * 程序初始化启动redis |
| | | * 刘苏义 |
| | |
| | | @Override |
| | | public void initialize(ConfigurableApplicationContext applicationContext) { |
| | | if (Platform.isWindows()) { |
| | | String exePath = System.getProperty("user.dir") + File.separator + "lib" + File.separator + "redis" + File.separator + redisName; |
| | | String exePath = System.getProperty("user.dir") + File.separator + "server" + File.separator + "redis" + File.separator + redisName;
|
| | | List<String> cmd = new ArrayList<>(); |
| | | cmd.add(exePath); |
| | | if (CmdUtils.isProcessRunning(redisName)) { |
| | |
| | | if (minioEnabled) { |
| | | log.info("初始化启动minio"); |
| | | if (Platform.isWindows()) { |
| | | String exePath = System.getProperty("user.dir") + File.separator + "lib" + File.separator + "minio" + File.separator + minioName; |
| | | String exePath = System.getProperty("user.dir") + File.separator + "server" + File.separator + "minio" + File.separator + minioName;
|
| | | Map<String, String> env = new HashMap<>(); |
| | | env.put("MINIO_ROOT_USER", accessKey); |
| | | env.put("MINIO_ROOT_PASSWORD", secretKey); |
| | |
| | | if (mediamtxEnabled) { |
| | | log.info("初始化启动mediaMTX"); |
| | | if (Platform.isWindows()) { |
| | | String exePath = System.getProperty("user.dir") + File.separator + "lib" + File.separator + "mediamtx" + File.separator + mediamtxName; |
| | | String ymlPath = System.getProperty("user.dir") + File.separator + "lib" + File.separator + "mediamtx" + File.separator + "mediamtx.yml"; |
| | | String exePath = System.getProperty("user.dir") + File.separator + "server" + File.separator + "mediamtx" + File.separator + mediamtxName;
|
| | | String ymlPath = System.getProperty("user.dir") + File.separator + "server" + File.separator + "mediamtx" + File.separator + "mediamtx.yml";
|
| | | |
| | | List<String> cmd = new ArrayList<>(); |
| | | cmd.add(exePath); |
| | |
| | | if (webrtcEnabled) { |
| | | log.info("初始化启动webrtc-streamer"); |
| | | if (Platform.isWindows()) { |
| | | String exePath = System.getProperty("user.dir") + File.separator + "lib" + File.separator + "webrtc" + File.separator + webrtcName; |
| | | String exePath = System.getProperty("user.dir") + File.separator + "server" + File.separator + "webrtc" + File.separator + webrtcName;
|
| | | List<String> cmd = new ArrayList<>(); |
| | | cmd.add(exePath); |
| | | cmd.add("-H" + webrtcHost); |
| | |
| | | @ApiOperation("选择相机数据") |
| | | public List options(ArdCameras ardCameras) { |
| | | List<ArdCameras> list = ardCamerasService.findOptions(ardCameras); |
| | | System.out.println("list:"+list.size()); |
| | | List options = new ArrayList(); |
| | | for (ArdCameras item : list) { |
| | | Map option = new HashMap(); |
| | | option.put("value", item.getId()); |
| | | option.put("label", item.getName()); |
| | | option.put("channel", item.getChanNo()); |
| | | option.put("channelList", item.getChannelList()); |
| | | List timeList = ardVideoInspectTaskService.getCameraIdleTimeList(item.getId()); |
| | | option.put("idleTimeList", timeList);//空闲时间段 |
| | | options.add(option); |
| | |
| | | @Resource |
| | | private IArdCamerasService ardCamerasService; |
| | | |
| | | /** |
| | | * @描述 初始加载SDK库文件 |
| | | * @返回值 void |
| | | * @创建人 刘苏义 |
| | | * @创建时间 2023/1/17 16:13 |
| | | * @修改人和其它信息 if (Platform.isLinux()) |
| | | */ |
| | | @PostConstruct |
| | | public void initSDK() { |
| | | cameraSdkService.initSDK(); |
| | | } |
| | | |
| | | @RequestMapping("/preview") |
| | | private String preview() { |
| | |
| | | Map<String, Object> ptzMap = cameraSdkService.getPtz(cmd); |
| | | return AjaxResult.success("获取ptz", ptzMap); |
| | | } |
| | | |
| | | @ApiOperation("获取PTZ范围") |
| | | @PostMapping("/getPTZScope") |
| | | @Log(title = "获取PTZ范围", businessType = BusinessType.CONTROL) |
| | |
| | | import java.util.Map; |
| | | |
| | | public interface ICameraSdkService { |
| | | //sdk初始化 |
| | | void initSDK(); |
| | | //初始化登录
|
| | | void loginAll();
|
| | | |
| | | //登录 |
| | | Boolean login(ArdCameras ardCamera); |
| | |
| | | */ |
| | | @Override |
| | | public ArdCameras selectArdCamerasById(String id) { |
| | | return ardCamerasMapper.selectArdCamerasById(id); |
| | | ArdCameras ardCameras = ardCamerasMapper.selectArdCamerasById(id); |
| | | if (ardCameras != null) { |
| | | ArdChannel ardChannel = new ArdChannel(); |
| | | ardChannel.setDeviceId(ardCameras.getId()); |
| | | List<ArdChannel> ardChannels = ardChannelMapper.selectArdChannelList(ardChannel); |
| | | if (ardChannels != null) { |
| | | ardCameras.setChannelList(ardChannels); |
| | | } |
| | | } |
| | | return ardCameras; |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | public List findOptions(ArdCameras ardCameras) { |
| | | return ardCamerasMapper.findOptions(ardCameras); |
| | | List<ArdCameras> options = ardCamerasMapper.findOptions(ardCameras); |
| | | for (ArdCameras camera : |
| | | options) { |
| | | ArdChannel ardChannel = new ArdChannel(); |
| | | ardChannel.setDeviceId(camera.getId()); |
| | | List<ArdChannel> ardChannels = ardChannelMapper.selectArdChannelList(ardChannel); |
| | | camera.setChannelList(ardChannels); |
| | | } |
| | | return options; |
| | | } |
| | | |
| | | /** |
| New file |
| | |
| | | package com.ruoyi.device.camera.service.impl; |
| | | |
| | | import com.ruoyi.common.utils.Threads; |
| | | import com.ruoyi.device.camera.domain.ArdCameras; |
| | | import com.ruoyi.device.dhsdk.service.IDhClientService; |
| | | import com.ruoyi.device.hiksdk.service.IHikClientService; |
| | | import org.hibernate.validator.internal.util.stereotypes.Lazy; |
| | | import org.springframework.scheduling.annotation.Async; |
| | | import org.springframework.scheduling.annotation.EnableAsync; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * @ClassName 异步登录 |
| | | * @Description: |
| | | * @Author 刘苏义 |
| | | * @Date 2023/10/23 21:39 |
| | | * @Version 1.0 |
| | | */ |
| | | @Service |
| | | public class AsyncLogin { |
| | | @Resource |
| | | IHikClientService hikClientService; |
| | | |
| | | @Resource |
| | | IDhClientService dhClientService; |
| | | |
| | | @Async("loginExecutor") |
| | | public void hikLogin(ArdCameras ardCameras) { |
| | | hikClientService.login(ardCameras); |
| | | } |
| | | |
| | | |
| | | @Async("loginExecutor") |
| | | public void dhLogin(ArdCameras ardCameras) { |
| | | dhClientService.login(ardCameras); |
| | | } |
| | | } |
| | |
| | | import com.ruoyi.common.annotation.SdkOperate; |
| | | import com.ruoyi.common.constant.CacheConstants; |
| | | import com.ruoyi.common.core.redis.RedisCache; |
| | | import com.ruoyi.common.utils.file.FileUtils; |
| | | import com.ruoyi.common.utils.Threads;
|
| | | import com.ruoyi.device.camera.domain.ArdCameras; |
| | | import com.ruoyi.device.camera.domain.CameraCmd; |
| | | import com.ruoyi.device.camera.service.IArdCamerasService; |
| | | import com.ruoyi.device.camera.service.ICameraSdkService; |
| | | import com.ruoyi.device.channel.domain.ArdChannel; |
| | | import com.ruoyi.device.dhsdk.lib.NetSDKLib; |
| | | import com.ruoyi.device.dhsdk.module.RealPlayModule; |
| | | import com.ruoyi.device.dhsdk.service.IDhClientService; |
| | | import com.ruoyi.device.hiksdk.common.GlobalVariable; |
| | | import com.ruoyi.device.hiksdk.service.IHikClientService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.SmartInitializingSingleton;
|
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.PostConstruct;
|
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import static com.ruoyi.device.dhsdk.lib.ToolKits.getErrorCodePrint; |
| | | import static com.ruoyi.device.dhsdk.module.LoginModule.netsdk; |
| | | import static com.ruoyi.device.hiksdk.sdk.HCNetSDK.NET_DVR_CHECK_USER_STATUS; |
| | | |
| | | |
| | | /** |
| | |
| | | IDhClientService dhClientService; |
| | | @Resource |
| | | RedisCache redisCache; |
| | | @Resource
|
| | | AsyncLogin asyncLogin;
|
| | |
|
| | |
|
| | |
|
| | | //初始化SDK |
| | | @PostConstruct
|
| | | @Override |
| | | public void initSDK() { |
| | | //初始化加载sdk库文件 |
| | | boolean initHIK = hikClientService.init(); |
| | | if (initHIK) { |
| | | hikClientService.loginAll();//登录全部海康相机 |
| | | } |
| | | Boolean initDH = dhClientService.init(); |
| | | if (initDH) { |
| | | dhClientService.loginAll();//登录全部大华相机 |
| | | public void loginAll() {
|
| | | try {
|
| | | List<ArdCameras> ardCameras = ardCamerasService.selectArdCamerasListNoDataScope(new ArdCameras());
|
| | | for (ArdCameras camera : ardCameras) {
|
| | | if ("1".equals(camera.getFactory())) {
|
| | | asyncLogin.hikLogin(camera);
|
| | | } else if ("2".equals(camera.getFactory())) {
|
| | | asyncLogin.dhLogin(camera);
|
| | | } |
| | | } |
| | | } catch (Exception ex) {
|
| | | log.error("初始化登录相机异常:" + ex.getMessage());
|
| | | }
|
| | | }
|
| | |
|
| | | //登录 |
| | | @Override |
| | | public Boolean login(ArdCameras ardCamera) { |
| | |
| | | if (ardCamera != null) { |
| | | String factory = ardCamera.getFactory(); |
| | | if (factory.equals("1")) { |
| | | hikClientService.syncLogin(ardCamera); |
| | | asyncLogin.hikLogin(ardCamera);
|
| | | result=true; |
| | | } else if (factory.equals("2")) { |
| | | result = dhClientService.login(ardCamera); |
| | | asyncLogin.dhLogin(ardCamera);
|
| | | result = true;
|
| | | } |
| | | } |
| | | } catch (Exception ex) { |
| | |
| | | } |
| | | return result; |
| | | } |
| | |
|
| | | //注销 |
| | | @Override |
| | | public boolean logout(String cameraId) { |
| | |
| | | return false; |
| | | } |
| | | } |
| | |
|
| | | //云台控制 |
| | | @SdkOperate |
| | | @Override |
| | |
| | | return false; |
| | | } |
| | | } |
| | |
|
| | | //设置聚焦值 |
| | | @Override |
| | | public boolean setFocusPos(CameraCmd cmd) { |
| | |
| | | } |
| | | return result; |
| | | } |
| | |
|
| | | //获取聚焦值 |
| | | @Override |
| | | public int getFocusPos(CameraCmd cmd) { |
| | |
| | | } |
| | | return result; |
| | | } |
| | |
|
| | | //设置预置位 |
| | | @Override |
| | | public boolean setPreset(CameraCmd cmd) { |
| | |
| | | } |
| | | return result; |
| | | } |
| | |
|
| | | //调用预置位 |
| | | @Override |
| | | public boolean gotoPreset(CameraCmd cmd) { |
| | |
| | | } |
| | | return result; |
| | | } |
| | |
|
| | | //获取码流压缩参数 |
| | | @Override |
| | | public Map<String, Object> getVideoCompressionCfg(CameraCmd cmd) { |
| | |
| | | } |
| | | return map; |
| | | } |
| | |
|
| | | //透雾开关 |
| | | @Override |
| | | public boolean controlDefogcfg(CameraCmd cmd) { |
| | |
| | | } |
| | | return result; |
| | | } |
| | |
|
| | | //红外开关 |
| | | @Override |
| | | public boolean controlInfrarecfg(CameraCmd cmd) { |
| | |
| | | } |
| | | return result; |
| | | } |
| | |
|
| | | //手动/自动聚焦 |
| | | @Override |
| | | public boolean controlFocusMode(CameraCmd cmd) { |
| | |
| | | } |
| | | return result; |
| | | } |
| | |
|
| | | //获取聚焦模式 |
| | | @Override |
| | | public String getFocusMode(CameraCmd cmd) { |
| | |
| | | } |
| | | return result; |
| | | } |
| | |
|
| | | //云台加热 |
| | | @Override |
| | | public boolean controlPTHeateRpwron(CameraCmd cmd) { |
| | |
| | | } |
| | | return result; |
| | | } |
| | |
|
| | | //镜头加热 |
| | | @Override |
| | | public boolean controlCameraDeicing(CameraCmd cmd) { |
| | |
| | | public String captureJPEGPicture(CameraCmd cmd) { |
| | | return null; |
| | | } |
| | |
|
| | | //抓图 |
| | | @SdkOperate |
| | | @Override |
| | |
| | | } |
| | | return url; |
| | | } |
| | |
|
| | | //获取ptz |
| | | @Override |
| | | public Map<String, Object> getPtz(CameraCmd cmd) { |
| | |
| | | } |
| | | return map; |
| | | } |
| | |
|
| | | //获取ptz范围 |
| | | @Override |
| | | public Map<String, Object> getPtzScope(CameraCmd cmd) { |
| | |
| | | } |
| | | return map; |
| | | } |
| | |
|
| | | //设置ptz |
| | | @SdkOperate |
| | | @Override |
| | |
| | | } |
| | | return result; |
| | | } |
| | |
|
| | | //设置零方位角 |
| | | @SdkOperate |
| | | @Override |
| | |
| | | } |
| | | return result; |
| | | } |
| | |
|
| | | //引导指向目标 |
| | | @SdkOperate |
| | | @Override |
| | |
| | | } |
| | | return result; |
| | | } |
| | |
|
| | | //停止录像并存入minio |
| | | @Override |
| | | public String recordStopToMinio(CameraCmd cmd) { |
| | |
| | | } |
| | | return url; |
| | | } |
| | |
|
| | | //停止录像并不存入minio |
| | | @Override |
| | | public boolean recordStopNotToMinio(CameraCmd cmd) { |
| | |
| | | } |
| | | return map; |
| | | } |
| | |
|
| | |
|
| | | } |
| | |
| | | package com.ruoyi.device.dhsdk.lib; |
| | | |
| | | import com.ruoyi.device.dhsdk.lib.DynamicParseUtil; |
| | | import lombok.extern.slf4j.Slf4j;
|
| | | import org.xml.sax.SAXException; |
| | | |
| | | import javax.xml.parsers.ParserConfigurationException; |
| | |
| | | * @description 动态库加载 |
| | | * @date 2020/11/14 |
| | | */ |
| | | @Slf4j(topic = "dhSdk")
|
| | | public class LibraryLoad { |
| | | private static final String ARCH_WINDOWS = "win"; |
| | | private static final String ARCH_LINUX = "linux"; |
| | |
| | | if (!(EXTRACT_PATH.endsWith("/") || EXTRACT_PATH.endsWith("\\"))) { |
| | | path = EXTRACT_PATH + "/"; |
| | | } |
| | | System.out.println("load library: " + path + fullName); |
| | | log.debug("load library: " + path + fullName);
|
| | | return path + fullName; |
| | | } |
| | | |
| | |
| | | * @return |
| | | */ |
| | | private static String extractLibrary(String libName) { |
| | | return extractLibrary("", libName); |
| | | return extractLibrary("/lib", libName);
|
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | extractedLibFile = new File(nativeTempDir + libFullName); |
| | | reader = new BufferedInputStream(in); |
| | |
|
| | | // 检查文件夹是否存在,如果不存在则创建
|
| | | File parentDir = extractedLibFile.getParentFile();
|
| | | if (!parentDir.exists()) {
|
| | | parentDir.mkdirs();
|
| | | }
|
| | |
|
| | | writer = new FileOutputStream(extractedLibFile); |
| | | byte[] buffer = new byte[1024]; |
| | | while (true) { |
| | |
| | | writer.close(); |
| | | in.close(); |
| | | } catch (Exception e) { |
| | | //System.out.println("dynamic file[ "+ fileName+ " ] not found in project.please ensure you need this library."); |
| | | log.error("dynamic file[ " + fileName + " ] not found in project.please ensure you need this library.");
|
| | | } |
| | | return extractedLibFile != null ? extractedLibFile.getAbsolutePath() : ""; |
| | | } |
| | |
| | | */ |
| | | public interface NetSDKLib extends Library { |
| | | |
| | | NetSDKLib NETSDK_INSTANCE = Native.load("lib/dhDll/dhnetsdk", NetSDKLib.class); |
| | | //NetSDKLib NETSDK_INSTANCE = Native.load("lib/dhDll/dhnetsdk", NetSDKLib.class);
|
| | | //NetSDKLib CONFIG_INSTANCE = Native.load("lib/dhDll/dhconfigsdk", NetSDKLib.class);
|
| | | |
| | | NetSDKLib CONFIG_INSTANCE = Native.load("lib/dhDll/dhconfigsdk", NetSDKLib.class); |
| | | |
| | | NetSDKLib NETSDK_INSTANCE = Native.load(LibraryLoad.getLoadLibrary("dhnetsdk"), NetSDKLib.class);
|
| | | NetSDKLib CONFIG_INSTANCE = Native.load(LibraryLoad.getLoadLibrary("dhconfigsdk"), NetSDKLib.class);
|
| | | //NetSDKLib CONFIG_JNI = (NetSDKLib)Native.loadLibrary(util.getLoadLibrary("JNI1.dll"), INetSDK.class); |
| | | class LLong extends IntegerType { |
| | | private static final long serialVersionUID = 1L; |
| | |
| | | String loadLibrary = ""; |
| | | String osPrefix = getOsPrefix(); |
| | | if (osPrefix.toLowerCase().startsWith("win32-x86")) { |
| | | loadLibrary = "./libs/win32/"; |
| | | loadLibrary = "./lib/win32/";
|
| | | } else if (osPrefix.toLowerCase().startsWith("win32-amd64")) { |
| | | loadLibrary = "./libs/win64/"; |
| | | loadLibrary = "./lib/win64/";
|
| | | } else if (osPrefix.toLowerCase().startsWith("linux-i386")) { |
| | | loadLibrary = ""; |
| | | } else if (osPrefix.toLowerCase().startsWith("linux-amd64")) { |
| | |
| | | /** |
| | | * @author 47081 |
| | | * @description 动态监测报警配置,对应接口 {@link |
| | | * com.netsdk.lib.NetSDKLib#CLIENT_GetNewDevConfig(NetSDKLib.LLong, String, int, byte[], int, |
| | | * com.ruoyi.device.dhsdk.lib.NetSDKLib#CLIENT_GetNewDevConfig(NetSDKLib.LLong, String, int, byte[], int,
|
| | | * IntByReference, int)}和{@link NetSDKLib#CLIENT_SetNewDevConfig(NetSDKLib.LLong, String, int, |
| | | * byte[], int, IntByReference, IntByReference, int)} |
| | | * @date 2021/4/9 |
| | |
| | | public NET_TIME_EX stuUTC=new NET_TIME_EX(); // 事件发生的时间,标准的(不带时区偏差的)UTC时间 |
| | | public byte[] szUser=new byte[32]; // 用户名称 |
| | | /** |
| | | * {@link com.netsdk.lib.enumeration.NET_EVENT_OPERATE_TYPE} |
| | | * {@link com.ruoyi.device.dhsdk.lib.enumeration.NET_EVENT_OPERATE_TYPE}
|
| | | */ |
| | | public int emOpType; // 操作类型 |
| | | /** |
| | | * {@link com.netsdk.lib.enumeration.NET_EVENT_DEVICE_TYPE} |
| | | * {@link com.ruoyi.device.dhsdk.lib.enumeration.NET_EVENT_DEVICE_TYPE}
|
| | | */ |
| | | public int emDeviceType; // 设备类型 |
| | | public byte[] szReserved=new byte[1024];// 保留字节 |
| | |
| | | * @author 47081 |
| | | * @version 1.0 |
| | | * @description 门禁假日组配置,对应枚举 {@link |
| | | * com.netsdk.lib.enumeration.NET_EM_CFG_OPERATE_TYPE#NET_EM_CFG_ACCESSCTL_SPECIALDAY_GROUP} |
| | | * com.ruoyi.device.dhsdk.lib.enumeration.NET_EM_CFG_OPERATE_TYPE#NET_EM_CFG_ACCESSCTL_SPECIALDAY_GROUP}
|
| | | * @date 2020/10/19 |
| | | */ |
| | | public class NET_CFG_ACCESSCTL_SPECIALDAY_GROUP_INFO extends NetSDKLib.SdkStructure { |
| | |
| | | */ |
| | | public byte[] szCitizenID = new byte[64]; |
| | | /** |
| | | * 设备展示颜色 com.netsdk.lib.enumeration.EM_SHOW_COLOR |
| | | * 设备展示颜色 com.ruoyi.device.dhsdk.lib.enumeration.EM_SHOW_COLOR
|
| | | */ |
| | | public int emColor; |
| | | /** |
| | |
| | | * @author 47081 |
| | | * @version 1.0 |
| | | * @description CLIENT_StartRedirectServiceEx接口输入参数, {@link |
| | | * com.netsdk.lib.NetSDKLib#CLIENT_StartRedirectServiceEx(Pointer, Pointer)} |
| | | * com.ruoyi.device.dhsdk.lib.NetSDKLib#CLIENT_StartRedirectServiceEx(Pointer, Pointer)}
|
| | | * @date 2021/3/13 |
| | | */ |
| | | public class NET_IN_START_REDIRECT_SERVICE extends NetSDKLib.SdkStructure { |
| | |
| | | */ |
| | | public byte[] szAlarmLocation = new byte[256]; |
| | | /** |
| | | * com.netsdk.lib.NetSDKLib.EM_INSIDE_OBJECT_TYPE |
| | | * com.ruoyi.device.dhsdk.lib.NetSDKLib.EM_INSIDE_OBJECT_TYPE
|
| | | */ |
| | | public int[] emContrabandClass = new int[64]; // 违禁物品分类 |
| | | /** |
| | |
| | | package com.netsdk.lib.structure.customize; |
| | | package com.ruoyi.device.dhsdk.lib.structure.customize;
|
| | | |
| | | import com.ruoyi.device.dhsdk.lib.NetSDKLib; |
| | | import com.ruoyi.device.dhsdk.lib.Utils; |
| | |
| | | package com.netsdk.lib.structure.customize; |
| | | package com.ruoyi.device.dhsdk.lib.structure.customize;
|
| | | |
| | | import com.ruoyi.device.dhsdk.lib.NetSDKLib; |
| | | |
| | |
| | | package com.netsdk.lib.structure.customize; |
| | | package com.ruoyi.device.dhsdk.lib.structure.customize;
|
| | | |
| | | import com.ruoyi.device.dhsdk.lib.NetSDKLib; |
| | | import com.ruoyi.device.dhsdk.lib.enumeration.EM_CAPTURE_PROCESS_END_TYPE; |
| | |
| | | package com.netsdk.lib.structure.customize; |
| | | package com.ruoyi.device.dhsdk.lib.structure.customize;
|
| | | |
| | | import com.ruoyi.device.dhsdk.lib.NetSDKLib; |
| | | import com.ruoyi.device.dhsdk.lib.structure.POSTION; |
| | |
| | | package com.netsdk.lib.structure.customize; |
| | | package com.ruoyi.device.dhsdk.lib.structure.customize;
|
| | | |
| | | import com.ruoyi.device.dhsdk.lib.NetSDKLib; |
| | | import com.ruoyi.device.dhsdk.lib.Utils; |
| | |
| | | import com.ruoyi.device.dhsdk.lib.NetSDKLib; |
| | | import com.ruoyi.device.dhsdk.lib.ToolKits; |
| | | import com.sun.jna.ptr.IntByReference; |
| | | import lombok.extern.slf4j.Slf4j;
|
| | | |
| | | /** |
| | | * \if ENGLISH_LANG |
| | |
| | | * 包含: 本地、远程、定时和停止抓图 |
| | | * \endif |
| | | */ |
| | | @Slf4j(topic = "dhSdk")
|
| | | public class CapturePictureModule { |
| | | |
| | | public static NetSDKLib netsdk = NetSDKLib.NETSDK_INSTANCE; |
| | |
| | | public static boolean localCapturePicture(NetSDKLib.LLong hPlayHandle, String picFileName) { |
| | | |
| | | if (!netsdk.CLIENT_CapturePictureEx(hPlayHandle, picFileName, NetSDKLib.NET_CAPTURE_FORMATS.NET_CAPTURE_JPEG)) { |
| | | System.err.printf("CLIENT_CapturePicture Failed!" + ToolKits.getErrorCodePrint()); |
| | | log.error("CLIENT_CapturePicture Failed!" + ToolKits.getErrorCodePrint());
|
| | | return false; |
| | | } else { |
| | | System.out.println("CLIENT_CapturePicture success"); |
| | | log.debug("CLIENT_CapturePicture success");
|
| | | } |
| | | return true; |
| | | } |
| | |
| | | |
| | | IntByReference reserved = new IntByReference(0); |
| | | if (!LoginModule.netsdk.CLIENT_SnapPictureEx(m_hLoginHandle, stuSnapParams, reserved)) { |
| | | System.err.printf("CLIENT_SnapPictureEx Failed!" + ToolKits.getErrorCodePrint()); |
| | | log.error("CLIENT_SnapPictureEx Failed!" + ToolKits.getErrorCodePrint());
|
| | | return false; |
| | | } else { |
| | | System.out.println("CLIENT_SnapPictureEx success"); |
| | | log.debug("CLIENT_SnapPictureEx success");
|
| | | } |
| | | return true; |
| | | } |
| | |
| | | import com.ruoyi.device.dhsdk.lib.ToolKits;
|
| | | import com.sun.jna.Structure;
|
| | | import com.sun.jna.ptr.IntByReference;
|
| | | import lombok.extern.slf4j.Slf4j;
|
| | |
|
| | | import static com.ruoyi.device.dhsdk.lib.ToolKits.getErrorCodePrint;
|
| | |
|
| | |
| | | * @Author: 刘苏义
|
| | | * @Date: 2023年10月14日14:57:01
|
| | | **/
|
| | | @Slf4j(topic = "dhSdk")
|
| | | public class ConfigModule {
|
| | | public static NetSDKLib netsdk = NetSDKLib.NETSDK_INSTANCE;
|
| | | public static NetSDKLib configsdk = NetSDKLib.CONFIG_INSTANCE;
|
| | |
| | | IntByReference intRetLen = new IntByReference();
|
| | | stuInfo.write();
|
| | | if (!netsdk.CLIENT_QueryRemotDevState(hLoginHandle, nType, nChn, stuInfo.getPointer(), stuInfo.size(), intRetLen, 3000)) {
|
| | | System.err.println("Config Failed!" + ToolKits.getErrorCodePrint());
|
| | | log.error("Config Failed!" + ToolKits.getErrorCodePrint());
|
| | | return false;
|
| | | }
|
| | | stuInfo.read();
|
| | |
| | | cmdObject.read();
|
| | | result = true;
|
| | | } else {
|
| | | System.err.println("Parse " + strCmd + " Config Failed!" + ToolKits.getErrorCodePrint());
|
| | | log.error("Parse [" + strCmd + "] Config Failed!" + ToolKits.getErrorCodePrint());
|
| | | result = false;
|
| | | }
|
| | | } else {
|
| | | System.err.printf("Get %s Config Failed!Last Error = %s\n", strCmd, getErrorCodePrint());
|
| | | log.error("Get [" + strCmd + "] Config Failed!Last Error = " + getErrorCodePrint());
|
| | | result = false;
|
| | | }
|
| | |
|
| | |
| | | if (bRet) {
|
| | | cmdObject.read();
|
| | | } else {
|
| | | System.err.printf("Get %s Config Failed!Last Error = %s\n", strCmd, getErrorCodePrint());
|
| | | log.error("Get ["+strCmd+"] Config Failed!Last Error = " + getErrorCodePrint());
|
| | | result = false;
|
| | | }
|
| | | return result;
|
| | | }
|
| | |
|
| | | // 获取配置
|
| | | public static boolean GetConfig(NetSDKLib.LLong hLoginHandle, int nChn,int type,Structure cmdObject) {
|
| | | boolean result = false;
|
| | |
| | | cmdObject.read();
|
| | | result=true;
|
| | | } else {
|
| | | System.err.println("GetConfig Failed!" + getErrorCodePrint());
|
| | | log.error("GetConfig Failed!" + getErrorCodePrint());
|
| | | result=false;
|
| | | }
|
| | | return result;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 设置单个配置
|
| | | *
|
| | |
| | | if (netsdk.CLIENT_SetNewDevConfig(hLoginHandle, strCmd, nChn, szBuffer, nBufferLen, error, restart, 3000)) {
|
| | | result = true;
|
| | | } else {
|
| | | System.err.printf("Set %s Config Failed! Last Error = %s\n", strCmd, getErrorCodePrint());
|
| | | log.error("Set [" + strCmd + "] Config Failed! Last Error = " + getErrorCodePrint());
|
| | |
|
| | | result = false;
|
| | | }
|
| | | } else {
|
| | | System.err.println("Packet " + strCmd + " Config Failed!" + getErrorCodePrint());
|
| | | log.error("Parse [" + strCmd + "] Config Failed!" + ToolKits.getErrorCodePrint());
|
| | | result = false;
|
| | | }
|
| | |
|
| | |
| | | import com.ruoyi.device.dhsdk.lib.NetSDKLib.NET_OUT_LOGIN_WITH_HIGHLEVEL_SECURITY; |
| | | import com.sun.jna.ptr.IntByReference; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
|
| | | import static com.ruoyi.device.dhsdk.lib.ToolKits.getErrorCodePrint; |
| | | |
| | | /** |
| | |
| | | public static NetSDKLib netsdk = NetSDKLib.NETSDK_INSTANCE; |
| | | |
| | | // 设备信息 |
| | | public static NetSDKLib.NET_DEVICEINFO_Ex m_stDeviceInfo = new NetSDKLib.NET_DEVICEINFO_Ex(); |
| | | // public static NetSDKLib.NET_DEVICEINFO_Ex m_stDeviceInfo = new NetSDKLib.NET_DEVICEINFO_Ex();
|
| | | |
| | | // 登陆句柄 |
| | | public static LLong m_hLoginHandle = new LLong(0);// |
| | |
| | | int tryTimes = 1; //登录时尝试建立链接1次 |
| | | netsdk.CLIENT_SetConnectTime(waitTime, tryTimes); |
| | | |
| | | |
| | | // 设置更多网络参数,NET_PARAM的nWaittime,nConnectTryNum成员与CLIENT_SetConnectTime |
| | | // 接口设置的登录设备超时时间和尝试次数意义相同,可选 |
| | | NetSDKLib.NET_PARAM netParam = new NetSDKLib.NET_PARAM(); |
| | |
| | | * 登录设备 |
| | | * \endif |
| | | */ |
| | | public static LLong login(String m_strIp, int m_nPort, String m_strUser, String m_strPassword) { |
| | | public static LLong login(String m_strIp, int m_nPort, String m_strUser, String m_strPassword, NetSDKLib.NET_DEVICEINFO_Ex lpDeviceInfo) {
|
| | | IntByReference nError = new IntByReference(0); |
| | | //入参 |
| | | NET_IN_LOGIN_WITH_HIGHLEVEL_SECURITY pstInParam = new NET_IN_LOGIN_WITH_HIGHLEVEL_SECURITY(); |
| | |
| | | pstInParam.szPassword = m_strPassword.getBytes(); |
| | | pstInParam.szUserName = m_strUser.getBytes(); |
| | | //出参 |
| | | NET_OUT_LOGIN_WITH_HIGHLEVEL_SECURITY pstOutParam = new NET_OUT_LOGIN_WITH_HIGHLEVEL_SECURITY(); |
| | | pstOutParam.stuDeviceInfo = m_stDeviceInfo; |
| | | LLong m_hLoginHandle = netsdk.CLIENT_LoginEx2(m_strIp, m_nPort, m_strUser, m_strPassword, 0, null, m_stDeviceInfo, nError); |
| | | //NET_OUT_LOGIN_WITH_HIGHLEVEL_SECURITY pstOutParam = new NET_OUT_LOGIN_WITH_HIGHLEVEL_SECURITY();
|
| | | LLong m_hLoginHandle = netsdk.CLIENT_LoginEx2(m_strIp, m_nPort, m_strUser, m_strPassword, 0, null, lpDeviceInfo, nError);
|
| | | //m_hLoginHandle=netsdk.CLIENT_LoginWithHighLevelSecurity(pstInParam, pstOutParam); |
| | | if (m_hLoginHandle.longValue() == 0) { |
| | | log.debug("Login Device[%s] Port[%d]Failed. %s\n", m_strIp, m_nPort, getErrorCodePrint()); |
| | | log.debug("Login Failed [" + m_strIp + ":" + m_nPort + "],错误码:" + getErrorCodePrint());
|
| | | } else { |
| | | log.debug("Login Success [ " + m_strIp + " ]"); |
| | | log.debug("Login Success [ " + m_strIp + ":" + m_nPort + " ]");
|
| | | } |
| | | return m_hLoginHandle; |
| | | //return m_hLoginHandle.longValue() == 0? false:true; |
| | | } |
| | | |
| | | /** |
| | |
| | | import com.ruoyi.device.dhsdk.lib.NetSDKLib; |
| | | import com.ruoyi.device.dhsdk.lib.ToolKits; |
| | | import com.sun.jna.Pointer; |
| | | import lombok.extern.slf4j.Slf4j;
|
| | | |
| | | import static com.ruoyi.device.dhsdk.module.LoginModule.netsdk; |
| | | |
| | |
| | | * 实时预览接口实现 |
| | | * 主要有 :开始拉流、停止拉流功能 |
| | | */ |
| | | @Slf4j(topic = "dhSdk")
|
| | | public class RealPlayModule { |
| | | /** |
| | | * \if ENGLISH_LANG |
| | |
| | | NetSDKLib.NET_OUT_REALPLAY_BY_DATA_TYPE net_out_realplay_by_data_type = new NetSDKLib.NET_OUT_REALPLAY_BY_DATA_TYPE(); |
| | | NetSDKLib.LLong m_hPlayHandle = netsdk.CLIENT_RealPlayByDataType(m_hLoginHandle, net_in_realplay_by_data_type, net_out_realplay_by_data_type, 5000); |
| | | if (m_hPlayHandle.longValue() == 0) { |
| | | System.err.println("开始实时预览失败,错误码" + ToolKits.getErrorCodePrint()); |
| | | log.error("开始实时预览失败,错误码" + ToolKits.getErrorCodePrint());
|
| | | } else { |
| | | System.out.println("Success to start realplay"); |
| | | log.debug("Success to start realplay");
|
| | | } |
| | | return m_hPlayHandle; |
| | | } |
| | |
| | | if (0 != lRealHandle.longValue()) { |
| | | switch (dwDataType) { |
| | | case 0: |
| | | System.out.println("码流大小为" + dwBufSize + "\n" + "码流类型为原始音视频混合数据"); |
| | | log.debug("码流大小为" + dwBufSize + "\n" + "码流类型为原始音视频混合数据");
|
| | | break; |
| | | case 1: |
| | | //标准视频数据 |
| | | System.out.println("码流大小为" + dwBufSize + "\n" + "码流类型为标准视频数据"); |
| | | log.debug("码流大小为" + dwBufSize + "\n" + "码流类型为标准视频数据");
|
| | | break; |
| | | case 2: |
| | | //yuv 数据 |
| | | System.out.println("码流大小为" + dwBufSize + "\n" + "码流类型为yuv数据"); |
| | | log.debug("码流大小为" + dwBufSize + "\n" + "码流类型为yuv数据");
|
| | | break; |
| | | case 3: |
| | | //pcm 音频数据 |
| | | System.out.println("码流大小为" + dwBufSize + "\n" + "码流类型为音频数据"); |
| | | log.debug("码流大小为" + dwBufSize + "\n" + "码流类型为音频数据");
|
| | | break; |
| | | case 4: |
| | | //原始音频数据 |
| | | System.out.println("码流大小为" + dwBufSize + "\n" + "码流类型为原始音频数据"); |
| | | log.debug("码流大小为" + dwBufSize + "\n" + "码流类型为原始音频数据");
|
| | | break; |
| | | default: |
| | | break; |
| | |
| | | */
|
| | | public interface IDhClientService {
|
| | |
|
| | | //sdk初始化
|
| | | Boolean init();
|
| | |
|
| | | //登录
|
| | | Boolean login(ArdCameras ardCamera);
|
| | |
|
| | | //登录所有相机
|
| | | void loginAll();
|
| | |
|
| | | //注销
|
| | | Boolean logout(String cameraId);
|
| | |
| | | package com.ruoyi.device.dhsdk.service.impl;
|
| | |
|
| | | import com.ruoyi.common.annotation.SdkOperate;
|
| | | import com.ruoyi.common.utils.Threads;
|
| | | import com.ruoyi.common.utils.file.FileUtils;
|
| | | import com.ruoyi.common.utils.file.MimeTypeUtils;
|
| | | import com.ruoyi.common.utils.uuid.IdUtils;
|
| | |
| | | import com.ruoyi.device.dhsdk.module.*;
|
| | | import com.ruoyi.device.dhsdk.service.IDhClientService;
|
| | | import com.ruoyi.device.hiksdk.common.GlobalVariable;
|
| | | import com.ruoyi.device.camera.service.impl.AsyncLogin;
|
| | | import com.ruoyi.media.domain.Vtdu;
|
| | | import com.ruoyi.media.service.IVtduService;
|
| | | import com.ruoyi.utils.gis.GisUtil;
|
| | |
| | | import com.sun.jna.Pointer;
|
| | | import lombok.extern.slf4j.Slf4j;
|
| | | import org.springframework.beans.factory.annotation.Value;
|
| | | import org.springframework.scheduling.annotation.Async;
|
| | | import org.springframework.stereotype.Service;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
| | | private IVtduService vtduService;
|
| | | @Value("${minio.endpoint}")
|
| | | private String minioEndPoint;
|
| | | private final Object lock = new Object();
|
| | |
|
| | | // 设备断线通知回调
|
| | | private static DisConnect disConnect = new DisConnect();
|
| | | // 网络连接恢复
|
| | | private static HaveReConnect haveReConnect = new HaveReConnect();
|
| | |
|
| | | /**
|
| | | * 登录所有相机
|
| | | * 刘苏义
|
| | | * 2023/10/17 8:28:13
|
| | | */
|
| | | @Override
|
| | | public void loginAll() {
|
| | | try {
|
| | | ArdCameras ardCamera = new ArdCameras();
|
| | | ardCamera.setFactory("2");//获取大华相机
|
| | | List<ArdCameras> ardCameras = ardCamerasService.selectArdCamerasListNoDataScope(ardCamera);
|
| | | for (ArdCameras camera : ardCameras) {
|
| | | Thread.sleep(500);
|
| | | //异步登录
|
| | | login(camera);
|
| | | }
|
| | | } catch (Exception ex) {
|
| | | log.error("初始化登录相机异常:" + ex.getMessage());
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * sdk初始化
|
| | | * 刘苏义
|
| | | * 2023/10/17 8:28:13
|
| | | */
|
| | | @Override
|
| | | public Boolean init() {
|
| | | return LoginModule.init(disConnect, haveReConnect); // 打开工程,初始化
|
| | | }
|
| | |
|
| | | /**
|
| | | * 登录
|
| | |
| | | * 2023/10/17 8:28:13
|
| | | */
|
| | | @Override
|
| | | @Async
|
| | | public Boolean login(ArdCameras camera) {
|
| | | LLong loginId = LoginModule.login(camera.getIp(), camera.getPort(), camera.getUsername(), camera.getPassword());
|
| | | if (loginId.longValue() > 0) {
|
| | | //log.debug(camera.getIp() + ":" + camera.getPort() + "登录成功");
|
| | | LoginModule.init(disConnect, haveReConnect);
|
| | | NetSDKLib.NET_DEVICEINFO_Ex m_stDeviceInfo = new NetSDKLib.NET_DEVICEINFO_Ex();
|
| | | LLong loginId = LoginModule.login(camera.getIp(), camera.getPort(), camera.getUsername(), camera.getPassword(), m_stDeviceInfo);
|
| | | if (loginId.longValue() <= 0) {
|
| | | camera.setChanNum(0);
|
| | | camera.setLoginId(-1);
|
| | | camera.setState("0");
|
| | | ardCamerasService.updateArdCameras(camera);
|
| | | return false;
|
| | | }
|
| | | synchronized (lock) {
|
| | | if (GlobalVariable.loginMap.containsKey(camera.getId())) {
|
| | | GlobalVariable.loginMap.remove(camera.getId());
|
| | | }
|
| | | //删除管理通道
|
| | | ardChannelService.deleteArdChannelByDeviceId(camera.getId());
|
| | | camera.setState("1");
|
| | | camera.setChanNum(LoginModule.m_stDeviceInfo.byChanNum);
|
| | | camera.setChanNum(m_stDeviceInfo.byChanNum);
|
| | | camera.setStartDChan(1);
|
| | | camera.setLoginId((int) loginId.longValue());
|
| | | ardCamerasService.updateArdCameras(camera);
|
| | | GlobalVariable.loginMap.put(camera.getId(), loginId);
|
| | |
|
| | | //获取最新通道
|
| | | for (int i = 1; i < LoginModule.m_stDeviceInfo.byChanNum + 1; i++) {
|
| | | for (int i = 1; i < m_stDeviceInfo.byChanNum + 1; i++) {
|
| | | ArdChannel channel = new ArdChannel();
|
| | | AV_CFG_ChannelName av_cfg_channelName = new AV_CFG_ChannelName();
|
| | | boolean b = ConfigModule.GetNewDevConfig(loginId, i - 1, CFG_CMD_CHANNELTITLE, av_cfg_channelName);
|
| | |
| | | channel.setDeviceId(camera.getId());
|
| | | channel.setChanNo(i);
|
| | | ardChannelService.insertArdChannel(channel);
|
| | |
|
| | | }
|
| | | //配置到流媒体
|
| | | String name = camera.getId() + "_" + channel.getChanNo();
|
| | | String rtspSource = "rtsp://" + camera.getUsername() + ":" + camera.getPassword() + "@" + camera.getIp() + ":" + camera.getRtspPort() + "/cam/realmonitor?channel=" + channel.getChanNo() + "&subtype=0";
|
| | | for (int i = 1; i < m_stDeviceInfo.byChanNum + 1; i++) {
|
| | | String name = camera.getId() + "_" + i;
|
| | | String rtspSource = "rtsp://" + camera.getUsername() + ":" + camera.getPassword() + "@" + camera.getIp() + ":" + camera.getRtspPort() + "/cam/realmonitor?channel=" + i + "&subtype=0";
|
| | | Vtdu vtdu = vtduService.selectVtduByName(name);
|
| | | if (vtdu != null) {
|
| | | vtduService.deleteVtduByName(name);
|
| | | }
|
| | |
|
| | | //添加到流媒体
|
| | | CameraCmd cmd = new CameraCmd(camera.getId(), channel.getChanNo());
|
| | | CameraCmd cmd = new CameraCmd(camera.getId(), i);
|
| | | Map<String, Object> videoCompressionCfg = getVideoCompressionCfg(cmd);
|
| | | vtdu = new Vtdu();
|
| | | if (videoCompressionCfg.get("videoEncType").equals("标准h264")) {
|
| | |
| | | vtdu.setIsCode("1");//默认转码
|
| | | }
|
| | | vtdu.setRtspSource(rtspSource);
|
| | | vtdu.setName(camera.getId() + "_" + channel.getChanNo());
|
| | | vtdu.setName(camera.getId() + "_" + i);
|
| | | vtdu.setMode("1");//默认CPU软解码
|
| | | vtdu.setCameraId(camera.getId());
|
| | | vtduService.insertVtdu(vtdu);
|
| | | }
|
| | | } else {
|
| | | //log.debug(camera.getIp() + ":" + camera.getPort() + "登录失败");
|
| | | camera.setChanNum(0);
|
| | | camera.setLoginId(-1);
|
| | | camera.setState("0");
|
| | | ardCamerasService.updateArdCameras(camera);
|
| | | return false;
|
| | | }
|
| | |
|
| | | return true;
|
| | | }
|
| | |
|
| | |
| | | * 2023/10/17 8:28:13
|
| | | */
|
| | | @Override
|
| | | @SdkOperate
|
| | | public boolean pTZControl(CameraCmd cmd) {
|
| | | String cameraId = cmd.getCameraId();
|
| | | boolean enable = cmd.isEnable();
|
| | |
| | | * @修改人和其它信息 注意俯仰角度负值需要加上360得到的正值进行设置
|
| | | */
|
| | | @Override
|
| | | @SdkOperate
|
| | | public boolean setZeroPtz(CameraCmd cmd) {
|
| | | String cameraId = cmd.getCameraId();
|
| | | Integer chanNo = cmd.getChanNo();
|
| | |
| | | * @修改人和其它信息
|
| | | */
|
| | | @Override
|
| | | @SdkOperate
|
| | | public String picCutCate(CameraCmd cmd) {
|
| | | String cameraId = cmd.getCameraId();
|
| | | Integer chanNo = cmd.getChanNo();
|
| | |
| | | @Override
|
| | | public Map<String, Object> getVideoCompressionCfg(CameraCmd cmd) {
|
| | | Map<String, Object> map = new HashMap<>();
|
| | | try {
|
| | | String cameraId = cmd.getCameraId();
|
| | | Integer chanNo = cmd.getChanNo();
|
| | | if (!GlobalVariable.loginMap.containsKey(cameraId)) {
|
| | |
| | | map.put("videoEncType", videoEncType);//编码
|
| | | map.put("nFrameRate", String.valueOf(nFrameRate));//帧率
|
| | | }
|
| | | } catch (Exception ex) {
|
| | | log.error("取码流压缩参数异常:" + ex.getMessage());
|
| | | }
|
| | | return map;
|
| | | }
|
| | |
|
| | |
| | | // 设备断线回调: 当设备出现断线时,SDK会调用该函数
|
| | | private static class DisConnect implements NetSDKLib.fDisConnect {
|
| | | public void invoke(LLong m_hLoginHandle, String pchDVRIP, int nDVRPort, Pointer dwUser) {
|
| | | System.out.printf("Device[%s] Port[%d] DisConnect!\n", pchDVRIP, nDVRPort);
|
| | | log.warn("Device[" + pchDVRIP + "] Port[" + nDVRPort + "] DisConnect!");
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | private static class HaveReConnect implements NetSDKLib.fHaveReConnect {
|
| | | @Override
|
| | | public void invoke(LLong lLoginID, String pchDVRIP, int nDVRPort, Pointer dwUser) {
|
| | | System.out.printf("ReConnect Device[%s] Port[%d]\n", pchDVRIP, nDVRPort);
|
| | | log.warn("ReConnect Device[" + pchDVRIP + "] Port[" + nDVRPort + "]");
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | public static Map<String, Integer> previewMap = new HashMap<>(); |
| | | //线程字典 |
| | | public static Map<String,String>threadMap=new HashMap<>(); |
| | |
|
| | | //保存相机登录信息(loginId:Camera)
|
| | | public static Map<Integer, Object> loginCameraMap = new HashMap<>();
|
| | | } |
| New file |
| | |
| | | package com.ruoyi.device.hiksdk.sdk;
|
| | |
|
| | | import com.ruoyi.device.camera.domain.ArdCameras;
|
| | | import com.ruoyi.device.hiksdk.common.GlobalVariable;
|
| | | import com.sun.jna.Pointer;
|
| | | import javafx.scene.Camera;
|
| | | import lombok.extern.slf4j.Slf4j;
|
| | |
|
| | | import static com.ruoyi.device.hiksdk.sdk.HCNetSDK.*;
|
| | |
|
| | | /**
|
| | | * @Description: 注册接收异常、重连等消息的窗口句柄或回调函数
|
| | | * @ClassName: ExceptionCallBack
|
| | | * @Author: 刘苏义
|
| | | * @Date: 2023年10月23日15:37:40
|
| | | **/
|
| | | @Slf4j(topic = "hikSdk")
|
| | | public class ExceptionCallBack implements HCNetSDK.FExceptionCallBack {
|
| | | @Override
|
| | | public void invoke(int dwType, int lUserID, int lHandle, Pointer pUser) {
|
| | | ArdCameras camera = (ArdCameras) GlobalVariable.loginCameraMap.get(lUserID);
|
| | | if(camera!=null) {
|
| | | String ip = camera.getIp();
|
| | | Integer port = camera.getPort();
|
| | | switch (dwType) {
|
| | | case EXCEPTION_EXCHANGE:
|
| | | log.warn("Device[" + ip + "] Port[" + port + "]用户交互时异常");
|
| | | break;
|
| | | case EXCEPTION_PREVIEW:
|
| | | log.warn("Device[" + ip + "] Port[" + port + "]网络预览异常");
|
| | | break;
|
| | | case EXCEPTION_RECONNECT:
|
| | | log.warn("Device[" + ip + "] Port[" + port + "]预览时重连");
|
| | | break;
|
| | | case RELOGIN_SUCCESS:
|
| | | log.warn("Device[" + ip + "] Port[" + port + "]用户重登陆成功");
|
| | | break;
|
| | | case EXCEPTION_RELOGIN:
|
| | | log.warn("Device[" + ip + "] Port[" + port + "]用户重登陆");
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | | } |
| | |
| | | package com.ruoyi.device.hiksdk.sdk; |
| | | |
| | | import com.ruoyi.device.dhsdk.lib.LibraryLoad;
|
| | | import com.sun.jna.*; |
| | | import com.sun.jna.examples.win32.W32API; |
| | | import com.sun.jna.examples.win32.W32API.HWND; |
| | |
| | | //SDK接口说明,HCNetSDK.dll |
| | | public interface HCNetSDK extends Library { |
| | | |
| | | HCNetSDK hCNetSDK = Native.load(LibraryLoad.getLoadLibrary("HCNetSDK"), HCNetSDK.class);
|
| | | /*** 宏定义 ***/ |
| | | //常量 |
| | | |
| | |
| | | public static final int EXCEPTION_SERIALRECONNECT = 0x8007;//透明通道重连 |
| | | public static final int EXCEPTION_PLAYBACK = 0x8010;//回放异常 |
| | | public static final int EXCEPTION_DISKFMT = 0x8011;//硬盘格式化 |
| | | public static final int EXCEPTION_RELOGIN=0x8040;//用户重登陆
|
| | | public static final int RELOGIN_SUCCESS=0x8041;//用户重登陆成功
|
| | | /******************** |
| | | * 预览回调函数 |
| | | *********************/ |
| | |
| | | * @Version: 1.0 |
| | | **/ |
| | | public interface IHikClientService { |
| | | //sdk初始化 |
| | | boolean init(); |
| | | |
| | | //同步登录 |
| | | void syncLogin(ArdCameras cameras); |
| | | void login(ArdCameras cameras);
|
| | | |
| | | //异步登录 |
| | | void asyncLogin(ArdCameras cameras); |
| | | |
| | | //登录所有相机 |
| | | void loginAll(); |
| | | |
| | | //注销 |
| | | boolean logout(String cameraId); |
| | |
| | | import com.ruoyi.alarm.global.domain.GuidePriorityQueue;
|
| | | import com.ruoyi.alarm.global.domain.GuideTask;
|
| | | import com.ruoyi.common.annotation.SdkOperate;
|
| | | import com.ruoyi.common.utils.Threads;
|
| | | import com.ruoyi.common.utils.file.FileUtils;
|
| | | import com.ruoyi.common.utils.file.MimeTypeUtils;
|
| | | import com.ruoyi.common.utils.uuid.IdUtils;
|
| | |
| | | import com.ruoyi.device.channel.service.IArdChannelService;
|
| | | import com.ruoyi.device.hiksdk.common.GlobalVariable;
|
| | | import com.ruoyi.device.camera.domain.ArdCameras;
|
| | | import com.ruoyi.device.hiksdk.sdk.ExceptionCallBack;
|
| | | import com.ruoyi.device.camera.service.impl.AsyncLogin;
|
| | | import com.ruoyi.media.domain.Vtdu;
|
| | | import com.ruoyi.media.service.IVtduService;
|
| | | import com.ruoyi.utils.gis.GisUtil;
|
| | |
| | | import com.ruoyi.device.hiksdk.service.IHikClientService;
|
| | | import com.ruoyi.device.hiksdk.sdk.LoginResultCallBack;
|
| | | import com.ruoyi.utils.minio.MinioUtil;
|
| | | import com.sun.jna.Native;
|
| | | import com.sun.jna.NativeLong;
|
| | | import com.sun.jna.Platform;
|
| | | import com.sun.jna.Pointer;
|
| | | import com.sun.jna.ptr.IntByReference;
|
| | | import lombok.extern.slf4j.Slf4j;
|
| | | import org.springframework.scheduling.annotation.Async;
|
| | | import org.springframework.stereotype.Service;
|
| | |
|
| | | import java.util.Base64;
|
| | |
| | | private IArdChannelService ardChannelService;
|
| | | @Resource
|
| | | private IVtduService vtduService;
|
| | | private final Object lock = new Object();
|
| | | public static HCNetSDK hCNetSDK = HCNetSDK.hCNetSDK;
|
| | | private static FExceptionCallBack fExceptionCallBack;//异常回调
|
| | |
|
| | | private static HCNetSDK hCNetSDK;
|
| | |
|
| | | @Override
|
| | | public boolean init() {
|
| | | try {
|
| | | log.debug("开始加载sdk库文件路径");
|
| | | if (Platform.isWindows()) {
|
| | | String WIN_PATH = System.getProperty("user.dir") + File.separator + "lib\\hikDll\\HCNetSDK.dll";
|
| | | log.debug("当前Windows平台的sdk库路径:" + WIN_PATH);
|
| | | hCNetSDK = (HCNetSDK) Native.loadLibrary(WIN_PATH, HCNetSDK.class);
|
| | | } else {
|
| | | log.debug("Linux平台");
|
| | | String LINUX_PATH = System.getProperty("user.dir") + File.separator + "hiklib" + File.separator + "libhcnetsdk.so";
|
| | | log.debug("当前Linux平台的sdk库路径:" + LINUX_PATH);
|
| | | hCNetSDK = (HCNetSDK) Native.loadLibrary(LINUX_PATH, HCNetSDK.class);
|
| | |
|
| | | //设置HCNetSDKCom组件库所在路径
|
| | | //libhcnetsdk.so
|
| | | String strPathCom = "/home/hiklib";
|
| | | NET_DVR_LOCAL_SDK_PATH struComPath = new NET_DVR_LOCAL_SDK_PATH();
|
| | | System.arraycopy(strPathCom.getBytes(), 0, struComPath.sPath, 0, strPathCom.length());
|
| | | struComPath.write();
|
| | | hCNetSDK.NET_DVR_SetSDKInitCfg(2, struComPath.getPointer());
|
| | |
|
| | | //设置libcrypto.so所在路径
|
| | | BYTE_ARRAY ptrByteArrayCrypto = new BYTE_ARRAY(256);
|
| | | String strPathCrypto = "/home/hiklib/libcrypto.so.1.1";
|
| | | System.arraycopy(strPathCrypto.getBytes(), 0, ptrByteArrayCrypto.byValue, 0, strPathCrypto.length());
|
| | | ptrByteArrayCrypto.write();
|
| | | hCNetSDK.NET_DVR_SetSDKInitCfg(3, ptrByteArrayCrypto.getPointer());
|
| | |
|
| | | //设置libssl.so所在路径
|
| | | BYTE_ARRAY ptrByteArraySsl = new BYTE_ARRAY(256);
|
| | | String strPathSsl = "/home/hiklib/libssl.so.1.1";
|
| | | System.arraycopy(strPathSsl.getBytes(), 0, ptrByteArraySsl.byValue, 0, strPathSsl.length());
|
| | | ptrByteArraySsl.write();
|
| | | hCNetSDK.NET_DVR_SetSDKInitCfg(4, ptrByteArraySsl.getPointer());
|
| | | }
|
| | | return true;
|
| | | } catch (Exception ex) {
|
| | | log.error("加载库文件异常:" + ex.getMessage());
|
| | | return false;
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | /**
|
| | | * @描述 注册登录 只支持同步登陆,且官方不建议直接在此接口下写耗时操作
|
| | | * @参数 [dvrLogin]
|
| | |
| | | * @创建时间 2023/1/17 16:12
|
| | | * @修改人和其它信息
|
| | | */
|
| | | @Async
|
| | | public void syncLogin(ArdCameras camera) {
|
| | | @Override
|
| | | public void login(ArdCameras camera) {
|
| | | try {
|
| | | // 初始化
|
| | | if (!hCNetSDK.NET_DVR_Init()) {
|
| | | log.error("SDK初始化失败");
|
| | |
| | | short m_sPort = camera.getPort().shortValue();
|
| | | //设置连接时间与重连时间
|
| | | hCNetSDK.NET_DVR_SetConnectTime(2000, 1);
|
| | | hCNetSDK.NET_DVR_SetReconnect(100000, true);
|
| | | hCNetSDK.NET_DVR_SetReconnect(5000, true);
|
| | | //设备信息, 输出参数
|
| | | HCNetSDK.NET_DVR_DEVICEINFO_V40 m_strDeviceInfo = new HCNetSDK.NET_DVR_DEVICEINFO_V40();
|
| | | HCNetSDK.NET_DVR_USER_LOGIN_INFO m_strLoginInfo = new HCNetSDK.NET_DVR_USER_LOGIN_INFO();
|
| | |
| | | //同步登录
|
| | | int lUserID = hCNetSDK.NET_DVR_Login_V40(m_strLoginInfo, m_strDeviceInfo);
|
| | | if (lUserID < 0) {
|
| | | int errorCode = hCNetSDK.NET_DVR_GetLastError();
|
| | | log.error("登录异常:" + errorCode);
|
| | |
|
| | | log.debug(camera.getIp() + ":" + camera.getPort() + "登录失败");
|
| | | log.debug("Login Failed [ " + camera.getIp() + ":" + camera.getPort() + " ],错误码:" + hCNetSDK.NET_DVR_GetLastError());
|
| | | camera.setChanNum(0);
|
| | | camera.setLoginId(-1);
|
| | | camera.setState("0");
|
| | | return;
|
| | | }
|
| | | synchronized (lock) {
|
| | | log.debug("Login Success [ " + camera.getIp() + ":" + camera.getPort() + " ]");
|
| | | if (fExceptionCallBack == null) {
|
| | | fExceptionCallBack = new ExceptionCallBack();//异常回调
|
| | | //设置异常回调函数(可在回调函数中获取设备上下线状态等)
|
| | | if (!hCNetSDK.NET_DVR_SetExceptionCallBack_V30(0, 0, fExceptionCallBack, null)) {
|
| | | log.debug("Set fExceptionCallBack function fail");
|
| | | return;
|
| | | } else {
|
| | | log.debug("Set fExceptionCallBack function successfully!");
|
| | | }
|
| | | }
|
| | |
|
| | | if (GlobalVariable.loginMap.containsKey(camera.getId())) {
|
| | | GlobalVariable.loginMap.remove(camera.getId());
|
| | |
| | | //删除管理通道
|
| | | ardChannelService.deleteArdChannelByDeviceId(camera.getId());
|
| | | GlobalVariable.loginMap.put(camera.getId(), lUserID);
|
| | | log.debug(camera.getIp() + ":" + camera.getPort() + "登录成功");
|
| | | GlobalVariable.loginCameraMap.put(lUserID, camera);
|
| | |
|
| | |
|
| | | camera.setLoginId(lUserID);
|
| | | camera.setState("1");
|
| | |
| | | GuidePriorityQueue.cameraQueueMap.put(camera.getId(), priorityQueue);
|
| | | }
|
| | | ardCamerasService.updateArdCameras(camera);
|
| | | }
|
| | |
|
| | | } catch (Exception ex) {
|
| | | log.error("注册设备异常", ex);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | |
|
| | | }
|
| | |
|
| | | /**
|
| | | * @描述 登录所有相机
|
| | | * @参数 []
|
| | | * @返回值 void
|
| | | * @创建人 刘苏义
|
| | | * @创建时间 2023/2/3 10:10
|
| | | * @修改人和其它信息
|
| | | */
|
| | | @Override
|
| | | public void loginAll() {
|
| | | try {
|
| | | log.debug("加载lib完成!");
|
| | | ArdCameras ardCamera = new ArdCameras();
|
| | | ardCamera.setFactory("1");
|
| | | List<ArdCameras> ardCameras = ardCamerasService.selectArdCamerasListNoDataScope(ardCamera);
|
| | | for (ArdCameras camera : ardCameras) {
|
| | | Thread.sleep(500);
|
| | | //异步登录
|
| | | syncLogin(camera);
|
| | | }
|
| | | } catch (Exception ex) {
|
| | | log.error("初始化登录相机异常:" + ex.getMessage());
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * @描述 注销登录
|
| | |
| | | * @修改人和其它信息
|
| | | */
|
| | | @Override
|
| | | @SdkOperate
|
| | | public boolean pTZControlWithSpeed(CameraCmd cmd) {
|
| | | String cameraId = cmd.getCameraId();
|
| | | boolean enable = cmd.isEnable();
|
| | |
| | | log.error("控制失败,请稍后重试" + code);
|
| | | return new HashMap<>();
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | * @修改人和其它信息
|
| | | */
|
| | | @Override
|
| | | @SdkOperate
|
| | | public boolean controlDefogcfg(CameraCmd cmd) {
|
| | | String cameraId = cmd.getCameraId();
|
| | | boolean enable = cmd.isEnable();
|
| | |
| | | * @修改人和其它信息
|
| | | */
|
| | | @Override
|
| | | @SdkOperate
|
| | | public boolean controlInfrarecfg(CameraCmd cmd) {
|
| | | String cameraId = cmd.getCameraId();
|
| | | boolean enable = cmd.isEnable();
|
| | |
| | | * @修改人和其它信息
|
| | | */
|
| | | @Override
|
| | | @SdkOperate
|
| | | public boolean controlFocusMode(CameraCmd cmd) {
|
| | | String cameraId = cmd.getCameraId();
|
| | | boolean enable = cmd.isEnable();
|
| | |
| | | * @修改人和其它信息
|
| | | */
|
| | | @Override
|
| | | @SdkOperate
|
| | | public boolean controlPTHeateRpwron(CameraCmd cmd) {
|
| | | String cameraId = cmd.getCameraId();
|
| | | boolean enable = cmd.isEnable();
|
| | |
| | | * @修改人和其它信息
|
| | | */
|
| | | @Override
|
| | | @SdkOperate
|
| | | public boolean controlCameraDeicing(CameraCmd cmd) {
|
| | | String cameraId = cmd.getCameraId();
|
| | | boolean enable = cmd.isEnable();
|
| | |
| | | * @修改人和其它信息
|
| | | */
|
| | | @Override
|
| | | @SdkOperate
|
| | | public String picCutCate(CameraCmd cmd) {
|
| | | String cameraId = cmd.getCameraId();
|
| | | Integer channelNum = cmd.getChanNo();
|
| | |
| | | for (ArdVideoInspectTaskStep ardVideoInspectTaskStep : ardVideoInspectTaskStepList) { |
| | | if (ardVideoInspectTaskStep.getId() == null) { |
| | | //新的步骤,添加 |
| | | ardVideoInspectTaskStep.setId(IdUtils.simpleUUID()); |
| | | ardVideoInspectTaskStepMapper.insertArdVideoInspectTaskStep(ardVideoInspectTaskStep); |
| | | } else { |
| | | //已有步骤,更新 |
| | |
| | | |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.dtflys.forest.exceptions.ForestNetworkException; |
| | | import com.dtflys.forest.exceptions.ForestRuntimeException; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.media.domain.*; |
| | | import com.ruoyi.media.service.IMediaService; |
| | |
| | | * @Version: 1.0 |
| | | **/ |
| | | @Service |
| | | @Slf4j(topic = "cmd") |
| | | @Slf4j(topic = "vtdu") |
| | | @Order(2) |
| | | public class MediaServiceImpl implements IMediaService { |
| | | |
| | |
| | | */ |
| | | @Override |
| | | public Map<String, String> addPath(String name, String sourceUrl, String mode, String isCode) { |
| | | |
| | | Map<String, String> map = new HashMap<>(); |
| | | try { |
| | | String rtspUrl = "rtsp://" + mediamtxHost + ":8554/" + name; |
| | | String rtmpUrl = "rtmp://" + mediamtxHost + ":1935/" + name; |
| | | String webrtcUrl = "http://" + mediamtxHost + ":8889/" + name; |
| | |
| | | if (!checkNameExist(name)) { |
| | | mediaClient.addPath(name, conf); |
| | | } |
| | | Map<String, String> map = new HashMap<>(); |
| | | |
| | | map.put("rtspUrl", rtspUrl); |
| | | map.put("rtmpUrl", rtmpUrl); |
| | | map.put("webrtcUrl", webrtcUrl); |
| | | } catch (ForestRuntimeException ex) { |
| | | log.error("添加流媒体异常:"+ex.getMessage()); |
| | | } |
| | | return map; |
| | | } |
| | | |
| | |
| | | map.put("rtspUrl", rtspUrl); |
| | | map.put("rtmpUrl", rtmpUrl); |
| | | map.put("webrtcUrl", webrtcUrl); |
| | | } catch (ForestNetworkException ex) { |
| | | log.error(ex.getMessage()); |
| | | } catch (ForestRuntimeException ex) { |
| | | log.error("修改流媒体异常:"+ex.getMessage()); |
| | | } |
| | | return map; |
| | | } |
| | |
| | | |
| | | @Override |
| | | public void removePath(String name) { |
| | | try { |
| | | if (checkNameExist(name)) { |
| | | mediaClient.removePath(name); |
| | | } |
| | | } catch (ForestRuntimeException ex) { |
| | | log.error("移除流媒体异常:"+ex.getMessage()); |
| | | } |
| | | } |
| | | |
| | |
| | | @Override |
| | | public List<String> getNameList() { |
| | | List<String> nameList = new ArrayList<>(); |
| | | try { |
| | | String paths = mediaClient.paths(); |
| | | JsonsRoot jsonsRoot = JSONObject.parseObject(paths, JsonsRoot.class); |
| | | List<Items> items = jsonsRoot.getItems(); |
| | | for (Items item : items) { |
| | | nameList.add(item.getName()); |
| | | } |
| | | }catch (ForestNetworkException ex) { |
| | | log.error("获取流媒体name列表异常:"+ex.getMessage()); |
| | | } |
| | | catch (ForestRuntimeException ex) { |
| | | log.error("获取流媒体name列表异常:"+ex.getMessage()); |
| | | } |
| | | return nameList; |
| | | } |
| | | |
| | |
| | | * @date 2023-08-29 |
| | | */ |
| | | @Service |
| | | @Slf4j(topic = "sdk") |
| | | @Slf4j(topic = "vtdu") |
| | | public class VtduServiceImpl implements IVtduService { |
| | | @Resource |
| | | private VtduMapper vtduMapper; |
| | |
| | | */ |
| | | @Override |
| | | public int deleteVtduByName(String name) { |
| | | log.debug("流媒体【" + name + "】通道删除"); |
| | | mediaService.removePath(name); |
| | | log.debug("流媒体【" + name + "】通道删除"); |
| | | return vtduMapper.deleteVtduByName(name); |
| | | } |
| | | |
| | |
| | | /** |
| | | * 增加路径 |
| | | */ |
| | | @Post(url = "/config/paths/add/{name}") |
| | | @Post(url = "/config/paths/add/{name}",async = true) |
| | | public String addPath(@Var("name") String name, @JSONBody Conf body); |
| | | |
| | | /** |
| | |
| | | <lib>Infra</lib> |
| | | <lib>IvsDrawer</lib> |
| | | <lib>StreamConvertor</lib> |
| | |
|
| | | <lib>HCNetSDK</lib>
|
| | | <lib>HCCore</lib>
|
| | | <lib>GdiPlus</lib>
|
| | | <lib>hlog</lib>
|
| | | <lib>HmMerge</lib>
|
| | | <lib>hpr</lib>
|
| | | <lib>HXVA</lib>
|
| | | <lib>libcrypto-1_1-x64</lib>
|
| | | <lib>libmmd</lib>
|
| | | <lib>libssl-1_1-x64</lib>
|
| | | <lib>MP_Render</lib>
|
| | | <lib>NPQos</lib>
|
| | | <lib>OpenAL32</lib>
|
| | | <lib>PlayCtrl</lib>
|
| | | <lib>SuperRender</lib>
|
| | | <lib>YUVProcess</lib>
|
| | | <lib>zlib1</lib>
|
| | |
|
| | | <lib>HCNetSDKCom/AnalyzeData</lib>
|
| | | <lib>HCNetSDKCom/AudioIntercom</lib>
|
| | | <lib>HCNetSDKCom/AudioRender</lib>
|
| | | <lib>HCNetSDKCom/HCAlarm</lib>
|
| | | <lib>HCNetSDKCom/HCCoreDevCfg</lib>
|
| | | <lib>HCNetSDKCom/HCDisplay</lib>
|
| | | <lib>HCNetSDKCom/HCGeneralCfgMgr</lib>
|
| | | <lib>HCNetSDKCom/HCGeneralCfgMgr</lib>
|
| | | <lib>HCNetSDKCom/HCIndustry</lib>
|
| | | <lib>HCNetSDKCom/HCPlayBack</lib>
|
| | | <lib>HCNetSDKCom/HCPreview</lib>
|
| | | <lib>HCNetSDKCom/HCVoiceTalk</lib>
|
| | | <lib>HCNetSDKCom/libiconv2</lib>
|
| | | <lib>HCNetSDKCom/OpenAL32</lib>
|
| | | <lib>HCNetSDKCom/StreamTransClient</lib>
|
| | | <lib>HCNetSDKCom/SystemTransform</lib>
|
| | | </win64> |
| | | <win32> |
| | | <lib>avnetsdk</lib> |
copy from lib/hikDll/HCNetSDKCom/OpenAL32.dll
copy to ard-work/src/main/resources/lib/win64/OpenAL32.dll
Binary files differ
| | |
| | | <plugin> |
| | | <groupId>org.apache.maven.plugins</groupId> |
| | | <artifactId>maven-dependency-plugin</artifactId> |
| | | <executions> |
| | | <execution> |
| | | <id>copy-dependencies</id> |
| | | <phase>package</phase> |
| | | <goals> |
| | | <goal>copy-dependencies</goal> |
| | | </goals> |
| | | <configuration> |
| | | <!-- 依赖包输出目录,将来不打进jar包里 --> |
| | | <outputDirectory>${project.build.directory}/jarLib</outputDirectory> |
| | | <excludeTransitive>false</excludeTransitive> |
| | | <stripVersion>false</stripVersion> |
| | | <includeScope>runtime</includeScope> |
| | | </configuration> |
| | | </execution> |
| | | </executions> |
| | | <!-- <executions>--> |
| | | <!-- <execution>--> |
| | | <!-- <id>copy-dependencies</id>--> |
| | | <!-- <phase>package</phase>--> |
| | | <!-- <goals>--> |
| | | <!-- <goal>copy-dependencies</goal>--> |
| | | <!-- </goals>--> |
| | | <!-- <configuration>--> |
| | | <!-- <!– 依赖包输出目录,将来不打进jar包里 –>--> |
| | | <!-- <outputDirectory>${project.build.directory}/jarLib</outputDirectory>--> |
| | | <!-- <excludeTransitive>false</excludeTransitive>--> |
| | | <!-- <stripVersion>false</stripVersion>--> |
| | | <!-- <includeScope>runtime</includeScope>--> |
| | | <!-- </configuration>--> |
| | | <!-- </execution>--> |
| | | <!-- </executions>--> |
| | | </plugin> |
| | | <plugin> |
| | | <groupId>org.springframework.boot</groupId> |
| | |
| | | <version>2.1.1.RELEASE</version> |
| | | <configuration> |
| | | <fork>true</fork> <!-- 如果没有该配置,devtools不会生效 --> |
| | | <mainClass>com.ruoyi.RuoYiApplication</mainClass> |
| | | <layout>ZIP</layout> |
| | | <includes> |
| | | <include> |
| | | <groupId>nothing</groupId> |
| | | <artifactId>nothing</artifactId> |
| | | </include> |
| | | </includes> |
| | | <!-- <mainClass>com.ruoyi.RuoYiApplication</mainClass>--> |
| | | <!-- <layout>ZIP</layout>--> |
| | | <!-- <includes>--> |
| | | <!-- <include>--> |
| | | <!-- <groupId>nothing</groupId>--> |
| | | <!-- <artifactId>nothing</artifactId>--> |
| | | <!-- </include>--> |
| | | <!-- </includes>--> |
| | | </configuration> |
| | | <executions> |
| | | <execution> |
| | |
| | | level:
|
| | | authorize: info
|
| | | minio: info
|
| | | hikSdk: info
|
| | | hikSdk: debug
|
| | | dhSdk: debug
|
| | | stealAlarm: info
|
| | | websocket: info
|
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <configuration> |
| | | <!-- 日志存放路径 --> |
| | | <property name="log.path" value="./ardLog/logs"/> |
| | | <property name="log.path" value="./log"/>
|
| | | <!-- 日志输出格式 --> |
| | | <property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"/> |
| | | |
| | |
| | | <pattern>${log.pattern}</pattern> |
| | | </encoder> |
| | | </appender> |
| | | <!--流媒体日志输出-->
|
| | | <appender name="vtdu" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
| | | <file>${log.path}/vtdu.log</file>
|
| | | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
| | | <!--按天回滚daily-->
|
| | | <fileNamePattern>${log.path}/vtdu.%d{yyyy-MM-dd}.log</fileNamePattern>
|
| | | <!--日志最大的历史60天-->
|
| | | <maxHistory>60</maxHistory>
|
| | | </rollingPolicy>
|
| | | <encoder>
|
| | | <pattern>${log.pattern}</pattern>
|
| | | </encoder>
|
| | | </appender>
|
| | | <!-- 系统模块日志级别控制 --> |
| | | <logger name="com.ruoyi" level="info"/> |
| | | <!-- Spring日志级别控制 --> |
| | |
| | | <logger name="sy" level="INFO"> |
| | | <appender-ref ref="sy"/> |
| | | </logger> |
| | | <!--vtdu日志-->
|
| | | <logger name="vtdu" level="INFO">
|
| | | <appender-ref ref="vtdu"/>
|
| | | </logger>
|
| | | <!--rongCloud日志--> |
| | | <logger name="rongCloud" level="INFO"> |
| | | <appender-ref ref="rongCloud"/> |
| File was renamed from lib/mediamtx/mediamtx.yml |
| | |
| | | # Enable the HTTP API. |
| | | api: yes |
| | | # Address of the API listener. |
| | | apiAddress: 112.98.126.2:9997 |
| | | apiAddress: 127.0.0.1:9997 |
| | | |
| | | # Enable Prometheus-compatible metrics. |
| | | metrics: no |
| | | # Address of the metrics listener. |
| | | metricsAddress: 112.98.126.2:9998 |
| | | metricsAddress: 127.0.0.1:9998 |
| | | |
| | | # Enable pprof-compatible endpoint to monitor performances. |
| | | pprof: no |
| | | # Address of the pprof listener. |
| | | pprofAddress: 112.98.126.2:9999 |
| | | pprofAddress: 127.0.0.1:9999 |
| | | |
| | | # Command to run when a client connects to the server. |
| | | # This is terminated with SIGINT when a client disconnects from the server. |
| | |
| | | # needed when server and clients are on different LANs. |
| | | # TURN/TURNS servers are needed when a direct connection between server and |
| | | # clients is not possible. All traffic is routed through them. |
| | | - url: stun:112.98.126.2:3478 |
| | | - url: stun:127.0.0.1:3478 |
| | | # if user is "AUTH_SECRET", then authentication is secret based. |
| | | # the secret must be inserted into the password field. |
| | | username: 'admin' |
| | |
| | | webrtcICEInterfaces: [] |
| | | # List of public IP addresses that are to be used as a host. |
| | | # This is used typically for servers that are behind 1:1 D-NAT. |
| | | webrtcICEHostNAT1To1IPs: [112.98.126.2] |
| | | webrtcICEHostNAT1To1IPs: [127.0.0.1] |
| | | # Address of a ICE UDP listener in format host:port. |
| | | # If filled, ICE traffic will pass through a single UDP port, |
| | | # allowing the deployment of the server inside a container or behind a NAT. |
| | |
| | | # allowing the deployment of the server inside a container or behind a NAT. |
| | | # Using this setting forces usage of the TCP protocol, which is not |
| | | # optimal for WebRTC. |
| | | webrtcICETCPMuxAddress: 112.98.126.2:1234 |
| | | webrtcICETCPMuxAddress: 127.0.0.1:1234 |
| | | |
| | | ############################################### |
| | | # Global settings -> SRT |