You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

77 lines
2.3 KiB

//#define Win32
#define Win64
//#define Linux32
//#define Linux64
using System.Runtime.InteropServices;
namespace EC.Util.CameraSDK;
public class PlayCtrlSdk
{
#region Fields
#if Win32
public const string LibSdkPath = @"./libs/hik/win32/PlayCtrl.dll";
#elif Win64
public const string LibSdkPath = @"./libs/hik/win64/PlayCtrl.dll";
#elif Linux32
public const string LibSdkPath = @"./libs/hik/linux32/libPlayCtrl.so";
#elif Linux64
public const string LibSdkPath = @"./libs/hik/linux64/libPlayCtrl.so";
#endif
#endregion Fields
static PlayCtrlSdk()
{
}
#region Sdk Struct
public struct FRAME_INFO
{
public int nWidth;
public int nHeight;
public int nStamp;
public int nType;
public int nFrameRate;
public uint dwFrameNum;
}
#endregion Sdk Struct
#region Sdk Method
[DllImport(LibSdkPath, CallingConvention = CallingConvention.StdCall)]
public static extern bool PlayM4_GetPort(ref int nPort);
[DllImport(LibSdkPath, CallingConvention = CallingConvention.StdCall)]
public static extern bool PlayM4_FreePort(int nPort);
[DllImport(LibSdkPath, CallingConvention = CallingConvention.StdCall)]
public static extern uint PlayM4_GetLastError(int nPort);
[DllImport(LibSdkPath, CallingConvention = CallingConvention.StdCall)]
public static extern bool PlayM4_SetStreamOpenMode(int nPort, uint nMode);
[DllImport(LibSdkPath, CallingConvention = CallingConvention.StdCall)]
public static extern bool PlayM4_OpenStream(int nPort, IntPtr pFileHeadBuf, uint nSize, uint nBufPoolSize);
[DllImport(LibSdkPath, CallingConvention = CallingConvention.StdCall)]
public static extern bool PlayM4_CloseStream(int nPort);
[DllImport(LibSdkPath, CallingConvention = CallingConvention.StdCall)]
public static extern bool PlayM4_SetDisplayBuf(int nPort, uint nNum);
[DllImport(LibSdkPath, CallingConvention = CallingConvention.StdCall)]
public static extern bool PlayM4_InputData(int nPort, IntPtr pBuf, uint nSize);
[DllImport(LibSdkPath, CallingConvention = CallingConvention.StdCall)]
public static extern bool PlayM4_Play(int nPort, IntPtr hWnd);
[DllImport(LibSdkPath, CallingConvention = CallingConvention.StdCall)]
public static extern bool PlayM4_Stop(int nPort);
#endregion Sdk Method
}