C# 视频监控系列(7):服务器端——封装API(下) [DS40xxSDK.dll] (上)
2009-04-08 08:23:53 来源:WEB开发网#region 1.板卡初始化及卸载
/// <summary>
/// 1.1初始化DSP InitDSPs
/// 说 明: 初始化系统中每一块板卡,应在应用软件程序启动时完成。如果返回值为0则表
/// 明初始化失败,可能没有找到相应的DSP软件模块。
///
/// int __stdcall InitDSPs()
/// </summary>
/// <returns>系统内可用的编码通道个数。 </returns>
[DllImport("DS40xxSDK.dll")]
public static extern int InitDSPs();
/// <summary>
/// 1.2卸载DSP DeInitDSPs
/// 说 明: 关闭每一块板卡上的功能,应在应用软件程序退出时调用。
///
/// int __stdcall DeInitDSPs()
/// </summary>
/// <returns>0</returns>
[DllImport("DS40xxSDK.dll")]
public static extern int DeInitDSPs();
#endregion
#region 2.板卡信息获取
/// <summary>
/// 2.1获取系统中板卡的张数GetBoardCount
/// 说 明: 获取系统中所有板卡的张数,包含编码卡和解码卡。
///
/// unsigned int __stdcall GetBoardCount()
/// </summary>
/// <returns>系统中板卡的总张数。</returns>
[DllImport("DS40xxSDK.dll")]
public static extern uint GetBoardCount();
/// <summary>
/// 2.2获取系统中DSP的个数GetDspCount
/// 说 明: 获取系统中所有板卡的DSP的个数。
///
/// unsigned int __stdcall GetDspCount()
/// </summary>
/// <returns>系统中DSP的总个数</returns>
[DllImport("DS40xxSDK.dll")]
public static extern uint GetDspCount();
/// <summary>
/// GetTotalDSPs:可用GetDspCount 替代
/// 获得实际可用DSP
/// </summary>
/// <returns></returns>
[DllImport("DS40xxSDK.dll")]
public static extern int GetTotalDSPs();
/// <summary>
/// 2.3获取系统中编码通道的个数GetEncodeChannelCount
/// 说 明: 获取系统中所有编码卡的编码通道总个数,包含H系列和HC系列编码卡。
///
/// unsigned int __stdcall GetEncodeChannelCount()
/// </summary>
/// <returns>系统中编码通道的个数</returns>
[DllImport("DS40xxSDK.dll")]
public static extern uint GetEncodeChannelCount();
/// <summary>
/// 2.4获取系统中解码通道的个数GetDecodeChannelCount
/// 说 明: 获取系统中MD卡的解码通道个数
///
/// unsigned int __stdcall GetDecodeChannelCount()
/// </summary>
/// <returns></returns>
[DllImport("DS40xxSDK.dll")]
public static extern uint GetDecodeChannelCount();
/// <summary>
/// 2.5获取系统中解码显示通道的个数GetDisplayChannelCount
/// 说 明: 获取系统中MD卡显示通道的个数,即模拟视频输出通道的个数
///
/// unsigned int __stdcall GetDisplayChannelCount()
/// </summary>
/// <returns>系统中显示通道的个数</returns>
[DllImport("DS40xxSDK.dll")]
public static extern uint GetDisplayChannelCount();
/// <summary>
/// 2.6获取板卡详细信息GetBoardDetail
/// 说 明: 获取某张板卡的详细信息
///
/// int __stdcall GetBoardDetail(UINT boardNum,DS_BOARD_DETAIL *pBoardDetail)
/// </summary>
/// <param name="boardNum">板卡索引</param>
/// <param name="pBoardDetail">板卡信息</param>
/// <returns>成功返回0;失败返回错误号</returns>
[DllImport("DS40xxSDK.dll")]
public static extern int GetBoardDetail(uint boardNum, ref DS_BOARD_DETAIL pBoardDetail);
/// <summary>
/// 2.7获取DSP详细信息GetDspDetail
/// 说 明: 获取某个DSP的详细信息
///
/// int __stdcall GetDspDetail(UINT dspNum,DSP_DETAIL *pDspDetail)
/// </summary>
/// <param name="dspNum">DSP索引</param>
/// <param name="pDspDetail">DSP信息</param>
/// <returns>成功返回0;失败返回错误号</returns>
[DllImport("DS40xxSDK.dll")]
public static extern int GetDspDetail(uint dspNum, ref DSP_DETAIL pDspDetail);
/// <summary>
/// 2.8获取板卡型号及序列号信息GetBoardInfo
/// 说 明: 获取板卡的型号及序列号信息
///
/// int __stdcall GetBoardInfo(HANDLE hChannelHandle, ULONG *BoardType, UCHAR *SerialNo)
/// </summary>
/// <param name="hChannelHandle">通道句柄</param>
/// <param name="BoardType">板卡型号</param>
/// <param name="SerialNo">
/// 板卡ID号, 内容为板卡序列号的ASCII的数值,次序为SerialNo[0] 对应最高位,
/// SerialNo[11]对应最低位。比如卡号为“40000002345”的值对应为 4,0,0,0,0,1,0,0,2,3,4,5 的整形数组。
/// </param>
/// <returns>成功为0;失败返回错误号 </returns>
[DllImport("DS40xxSDK.dll")]
public static extern int GetBoardInfo(IntPtr hChannelHandle, ulong BoardType, byte[] SerialNo);
/// <summary>
/// 2.9获取板卡特殊功能信息GetCapability
/// 说 明: 获取板卡特殊功能信息
///
/// int __stdcall GetCapability(HANDLE hChannelHandle, CHANNEL_CAPABILITY *Capability)
/// </summary>
/// <param name="hChannelHandle">通道句柄</param>
/// <param name="Capability">特殊功能 </param>
/// <returns>成功返回0;失败返回错误号</returns>
[DllImport("DS40xxSDK.dll")]
public static extern int GetCapability(IntPtr hChannelHandle, CHANNEL_CAPABILITY Capability);
/// <summary>
/// 2.10获取板卡SDK信息GetSDKVersion
/// 说 明: 获取当前所使用的DSP、Driver、SDK版本号
///
/// int __stdcall GetSDKVersion(PVERSION_INFO VersionInfo)
/// </summary>
/// <param name="VersionInfo">版本信息</param>
/// <returns>成功返回0;失败返回错误号。</returns>
[DllImport("DS40xxSDK.dll")]
public static extern int GetSDKVersion(ref PVERSION_INFO VersionInfo);
/// <summary>
/// 2.11获取板卡SDK及DSP错误报告GetLastErrorNum*,此函数只对H卡有效
/// 说 明: 获取SDK及DSP错误报告。此函数只对H卡有效,用于HC卡上返回0且无效
///
/// int __stdcall GetLastErrorNum(HANDLE hChannelHandle, ULONG *DspError, ULONG *SdkError)
/// </summary>
/// <param name="hChannelHandle">通道句柄</param>
/// <param name="DspError">DSP错误</param>
/// <param name="SdkError">SDK错误</param>
/// <returns>DSP错误信息、SDK错误信息</returns>
[DllImport("DS40xxSDK.dll")]
public static extern int GetLastErrorNum(IntPtr hChannelHandle, ref int DspError, ref int SdkError);
#endregion
更多精彩
赞助商链接