1. 在git中删除lib库,优化go get 下载速度
This commit is contained in:
parent
724c4febd9
commit
7eae57ef1c
3
.gitignore
vendored
3
.gitignore
vendored
@ -9,4 +9,5 @@
|
||||
/build
|
||||
/arm64_linux_lib
|
||||
/arm64_windows_lib
|
||||
/amd64_linux_lib
|
||||
/amd64_linux_lib
|
||||
/libs/
|
||||
|
||||
@ -1,12 +0,0 @@
|
||||
<?xml version="1.0" encoding="GB2312"?>
|
||||
<SdkLocal>
|
||||
<SdkLog>
|
||||
<logLevel>3</logLevel><!--req, 1-ERROR, 2-DEBUG, 3-INFO-->
|
||||
<logDirectory>./SDKLOG/</logDirectory><!--the end of the string must be '/'-->
|
||||
<autoDelete>true</autoDelete><!--true: There are less than 10 files in the directory, it will be auto deleted by sdk when the files are more than 10; false: No upper limit to the number of log files-->
|
||||
</SdkLog>
|
||||
<HeartbeatCfg>
|
||||
<Interval>120</Interval> <!-- 心跳时间间隔,单位秒,等于0,使用默认值120s,取值范围为[30, 120] 小于30s,间隔为30s,大于120s,间隔为120s-->
|
||||
<Count>1</Count> <!-- 触发异常回调需要心跳交互异常的次数,等于0,使用默认值1次-->
|
||||
</HeartbeatCfg>
|
||||
</SdkLocal>
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,46 +0,0 @@
|
||||
【库文件加载说明】
|
||||
1. lib文件夹里面所有库文件libhcnetsdk.so、libHCCore.so、libssl.so.1.1、libcrypto.so.1.1以及HCNetSDKCom文件夹都需要加载到工程中。
|
||||
|
||||
2. HCNetSDKCom文件夹如果和libhcnetsdk.so、libhpr.so、libHCCore文件、可执行文件不在同级目录,或者加载失败,可以调用NET_DVR_SetSDKInitCfg(enumType类型赋值为2,lpInBuff对应结构体NET_DVR_LOCAL_SDK_PATH)设置组件库所在路径。
|
||||
|
||||
3. libcrypto.so.1.1和libssl.so.1.1是开源库,如果库文件加载失败,可以调用NET_DVR_SetSDKInitCfg(enumType类型赋值为3,lpInBuff对应libcrypto.so.1.1所在的路径字符串)、NET_DVR_SetSDKInitCfg(enumType类型赋值为4,lpInBuff对应libssl.so.1.1所在的路径字符串)指定下这些库文件加载路径。
|
||||
|
||||
4. 如果库文件加载始终不成功,初始化失败,可以尝试将SDK所在路径添加到LD_LIBRARY_PATH环境变量中。
|
||||
|
||||
|
||||
【路径设置的Java示例代码】
|
||||
//这里是库的绝对路径,请根据实际情况修改,注意改路径必须有访问权限
|
||||
|
||||
//设置HCNetSDKCom组件库所在路径
|
||||
String strPathCom = "/home/test/Desktop/JavaDemoLinux/lib";
|
||||
HCNetSDK.NET_DVR_LOCAL_SDK_PATH struComPath = new HCNetSDK.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所在路径
|
||||
HCNetSDK.BYTE_ARRAY ptrByteArrayCrypto = new HCNetSDK.BYTE_ARRAY(256);
|
||||
String strPathCrypto = "/home/test/Desktop/JavaDemoLinux/lib/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所在路径
|
||||
HCNetSDK.BYTE_ARRAY ptrByteArraySsl = new HCNetSDK.BYTE_ARRAY(256);
|
||||
String strPathSsl = "/home/test/Desktop/JavaDemoLinux/lib/libssl.so.1.1";
|
||||
System.arraycopy(strPathSsl.getBytes(), 0, ptrByteArraySsl.byValue, 0, strPathSsl.length());
|
||||
ptrByteArraySsl.write();
|
||||
hCNetSDK.NET_DVR_SetSDKInitCfg(4, ptrByteArraySsl.getPointer());
|
||||
|
||||
【路径设置的C++示例代码】
|
||||
char cryptoPath[2048] = {0};
|
||||
sprintf(cryptoPath, "/home/test/Desktop/alarm_demo/libcrypto.so.1.1");
|
||||
NET_DVR_SetSDKInitCfg(NET_SDK_INIT_CFG_LIBEAY_PATH, cryptoPath);
|
||||
|
||||
char sslPath[2048] = {0};
|
||||
sprintf(sslPath, "/home/test/Desktop/alarm_demo/libssl.so.1.1");
|
||||
NET_DVR_SetSDKInitCfg(NET_SDK_INIT_CFG_SSLEAY_PATH, sslPath);
|
||||
|
||||
NET_DVR_LOCAL_SDK_PATH struComPath = {0};
|
||||
sprintf(struComPath.sPath, "/home/test/Desktop/alarm_demo"); //HCNetSDKCom文件夹所在的路径
|
||||
NET_DVR_SetSDKInitCfg(NET_SDK_INIT_CFG_SDK_PATH, &struComPath);
|
||||
Loading…
Reference in New Issue
Block a user