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.
70 lines
1.6 KiB
70 lines
1.6 KiB
//#define Win
|
|
|
|
using System.Runtime.InteropServices;
|
|
|
|
namespace EC.Util.CameraSDK;
|
|
|
|
public class PlayCtrlSdk
|
|
{
|
|
#region Fields
|
|
|
|
#if Win
|
|
public const string LibSdkPath = @"./libs/hik/PlayCtrl.dll";
|
|
#else
|
|
public const string LibSdkPath = @"./libs/hik/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)]
|
|
public static extern bool PlayM4_GetPort(ref int nPort);
|
|
|
|
[DllImport(LibSdkPath)]
|
|
public static extern bool PlayM4_FreePort(int nPort);
|
|
|
|
[DllImport(LibSdkPath)]
|
|
public static extern uint PlayM4_GetLastError(int nPort);
|
|
|
|
[DllImport(LibSdkPath)]
|
|
public static extern bool PlayM4_SetStreamOpenMode(int nPort, uint nMode);
|
|
|
|
[DllImport(LibSdkPath)]
|
|
public static extern bool PlayM4_OpenStream(int nPort, IntPtr pFileHeadBuf, uint nSize, uint nBufPoolSize);
|
|
|
|
[DllImport(LibSdkPath)]
|
|
public static extern bool PlayM4_CloseStream(int nPort);
|
|
|
|
[DllImport(LibSdkPath)]
|
|
public static extern bool PlayM4_SetDisplayBuf(int nPort, uint nNum);
|
|
|
|
[DllImport(LibSdkPath)]
|
|
public static extern bool PlayM4_InputData(int nPort, IntPtr pBuf, uint nSize);
|
|
|
|
[DllImport(LibSdkPath)]
|
|
public static extern bool PlayM4_Play(int nPort, IntPtr hWnd);
|
|
|
|
[DllImport(LibSdkPath)]
|
|
public static extern bool PlayM4_Stop(int nPort);
|
|
|
|
#endregion Sdk Method
|
|
}
|