@ -1,4 +1,6 @@
using System.Runtime.InteropServices ;
#define Win
using System.Runtime.InteropServices ;
namespace EC.Util.CameraSDK ;
@ -6,10 +8,13 @@ public static class HiKOriSDK
{
#region Lib Attr
public const string LibHkNetSDK = @"./libs/hk-win64/HCNetSDK.dll" ;
//public const string LibHkNetSDK = @"./libs/hk-win64/libhcnetsdk.so";
#if Win
public const string LibSdkPath = @"./libs/hik/HCNetSDK.dll" ;
#else
public const string LibSdkPath = @"./libs/hik/libhcnetsdk.so" ;
#endif
private const bool Debug = true ;
private const bool Debug = fals e;
#endregion Lib Attr
@ -306,38 +311,38 @@ public static class HiKOriSDK
#region Common Method
[DllImport(LibHkNetSDK , CallingConvention = CallingConvention.StdCall)]
[DllImport(LibSdkPath , CallingConvention = CallingConvention.StdCall)]
public static extern bool NET_DVR_Init ( ) ;
[DllImport(LibHkNetSDK , CallingConvention = CallingConvention.StdCall)]
[DllImport(LibSdkPath , CallingConvention = CallingConvention.StdCall)]
public static extern bool NET_DVR_Cleanup ( ) ;
[DllImport(LibHkNetSDK , CallingConvention = CallingConvention.StdCall)]
[DllImport(LibSdkPath , CallingConvention = CallingConvention.StdCall)]
public static extern bool NET_DVR_SetLogToFile ( int bLogEnable , string strLogDir , bool bAutoDel ) ;
[DllImport(LibHkNetSDK , CallingConvention = CallingConvention.StdCall)]
[DllImport(LibSdkPath , CallingConvention = CallingConvention.StdCall)]
public static extern uint NET_DVR_GetLastError ( ) ;
[DllImport(LibHkNetSDK , CallingConvention = CallingConvention.StdCall)]
[DllImport(LibSdkPath , CallingConvention = CallingConvention.StdCall)]
public static extern int NET_DVR_Login_V30 ( string sDVRIP , int wDVRPort , string sUserName , string sPassword , ref NET_DVR_DEVICEINFO_V30 lpDeviceInfo ) ;
[DllImport(LibHkNetSDK , CallingConvention = CallingConvention.StdCall)]
[DllImport(LibSdkPath , CallingConvention = CallingConvention.StdCall)]
public static extern int NET_DVR_Login_V40 ( ref NET_DVR_USER_LOGIN_INFO pLoginInfo , ref NET_DVR_DEVICEINFO_V40 lpDeviceInfo ) ;
[DllImport(LibHkNetSDK , CallingConvention = CallingConvention.StdCall)]
[DllImport(LibSdkPath , CallingConvention = CallingConvention.StdCall)]
public static extern bool NET_DVR_Logout ( int iUserID ) ;
[DllImport(LibHkNetSDK , CallingConvention = CallingConvention.StdCall)]
[DllImport(LibSdkPath , CallingConvention = CallingConvention.StdCall)]
public static extern bool NET_DVR_SetReconnect ( uint dwInterval , int bEnableRecon ) ;
//参数配置 begin
[DllImport(LibHkNetSDK , CallingConvention = CallingConvention.StdCall)]
[DllImport(LibSdkPath , CallingConvention = CallingConvention.StdCall)]
public static extern bool NET_DVR_GetDVRConfig ( int lUserID , uint dwCommand , int lChannel , IntPtr lpOutBuffer , uint dwOutBufferSize , ref uint lpBytesReturned ) ;
[DllImport(LibHkNetSDK , CallingConvention = CallingConvention.StdCall)]
[DllImport(LibSdkPath , CallingConvention = CallingConvention.StdCall)]
public static extern bool NET_DVR_PTZControlWithSpeed_Other ( int lUserID , int lChannel , uint dwPTZCommand , uint dwStop , uint dwSpeed ) ;
[DllImport(LibHkNetSDK , CallingConvention = CallingConvention.StdCall)]
[DllImport(LibSdkPath , CallingConvention = CallingConvention.StdCall)]
public static extern bool NET_DVR_PTZPreset_Other ( int lUserID , int lChannel , uint dwPTZPresetCmd , uint dwPresetIndex ) ;
/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
@ -365,7 +370,7 @@ public static class HiKOriSDK
Return : 1 表 示 失 败 , 其 他 值 作 为 NET_DVR_StopRealPlay等函数的句柄参数
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * /
[DllImport(LibHkNetSDK , CallingConvention = CallingConvention.StdCall)]
[DllImport(LibSdkPath , CallingConvention = CallingConvention.StdCall)]
public static extern int NET_DVR_RealPlay_V40 ( int iUserID , ref NET_DVR_PREVIEWINFO lpPreviewInfo , RealDataCallBack fRealDataCallBack_V30 , IntPtr pUser ) ;
/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
@ -376,7 +381,7 @@ public static class HiKOriSDK
Return :
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * /
[DllImport(LibHkNetSDK , CallingConvention = CallingConvention.StdCall)]
[DllImport(LibSdkPath , CallingConvention = CallingConvention.StdCall)]
public static extern bool NET_DVR_StopRealPlay ( int iRealHandle ) ;
#endregion Common Method