<pre name="code" class="csharp">最近公司开发一个项目 需要用到海康视频上大屏
按照海康的SDK2次开发包事例调用了一遍 总是出现一些错误 在网上也很少有这方面的资料 今天调用成功 来分享下 希望有遇到相同问题的朋友可以免去一些问题 如果有问题或建议 欢迎评论或私信我
1首先是代码调用方法:
/// <summary> /// 解码器视频上墙 /// </summary> /// <param name="UserID">注册解码器成功后返回的id</param> /// <param name="EquIP">前端摄像机设备IP</param> /// <param name="DecoderChannel">解码器通道</param> /// <param name="EquChannel">前端摄像机通道</param> /// <param name="UName">设备用户名</param> /// <param name="Upwd">设备密码</param> /// <param name="Port">设备端口</param> /// <param name="WindowMode">解码器分屏模式 1屏 4屏 对应传入 1或4 </param> /// <param name="Type">解码类型 0-主动解码 1-被动解码</param> /// <param name="WindowModeChannel">分屏模式后 屏幕对应的通道号</param> /// <param name="Vga">输出的Vga口</param> public void HaiKangDecoder(int UserID, string EquIP, int DecoderChannel, int EquChannel,string UName,string Upwd,string Port,uint WindowMode, int Type,string[] WindowModeChannel,ushort Vga) { if (Type == 0)//主动解码 { #region 主动解码-实时流 //设备能力集结构体 CHCNetSDK.CHCNetSDK.NET_DVR_MATRIX_ABILITY_V41 struDecoderCapability=new CHCNetSDK.CHCNetSDK.NET_DVR_MATRIX_ABILITY_V41(); //结构体变量赋予初始长度 struDecoderCapability.byRes1 = new byte[5]; struDecoderCapability.byRes1 = new byte[119]; //struDecoderCapability.struDispMode = new CHCNetSDK.CHCNetSDK.NET_DVR_DISPWINDOWMODE[32]; //定义能力类型 uint dwAbilityType = 0x260;//多路解码器显示、解码能力 //定义输出长度 byte byDispMode = 0; //获取结构体长度 uint OutSize = (uint)Marshal.SizeOf(struDecoderCapability); //获取解码器能力集 if (CHCNetSDK.CHCNetSDK.NET_DVR_GetDeviceAbility(UserID, dwAbilityType,null, 0, out struDecoderCapability, OutSize)) { //获取成功 将分屏模式设定为 最后一个模式 for (int i = 0; i < CHCNetSDK.CHCNetSDK.MAX_DISPNUM_V41; i++) { if (struDecoderCapability.struDispMode[i].byDispChanType == 1 && struDecoderCapability.struDispMode[i].byDispChanSeq == 1) { for (int j = 0; j <CHCNetSDK.CHCNetSDK.MAX_WINDOWS_NUM; j++) { if (struDecoderCapability.struDispMode[i].byDispMode[j] > 0) { byDispMode = struDecoderCapability.struDispMode[i].byDispMode[j]; } } } } } //Console.WriteLine(CHCNetSDK.CHCNetSDK.NET_DVR_GetLastError()); //设置初始通道 此处为代码事例 需后续测试 uint DecChanNum = (uint)(struDecoderCapability.byStartChan + 1);//uint.Parse(DecoderChannel.ToString());// (uint)struDecoderCapability.byStartChan + 1; //设置解码通道为开: 0表示关闭,1表示打开 if (CHCNetSDK.CHCNetSDK.NET_DVR_MatrixSetDecChanEnable(UserID, (uint)DecoderChannel, 1))//设置解码通道开关,如果设置为关,通道将停止解码 { //Console.WriteLine(CHCNetSDK.CHCNetSDK.NET_DVR_GetLastError()); } //配置显示通道参数,包括画面分割、关联解码通道 ushort DispChanNum =ushort.Parse((struDecoderCapability.struVgaInfo.byStartChan+1).ToString()); //VGA1 CHCNetSDK.CHCNetSDK.NET_DVR_MATRIX_VOUTCFG struVoutCfg = new CHCNetSDK.CHCNetSDK.NET_DVR_MATRIX_VOUTCFG(); if (!CHCNetSDK.CHCNetSDK.NET_DVR_MatrixGetDisplayCfg_V41(UserID,2/*Convert.ToInt32(DispChanNum)*/, out struVoutCfg)) { //Console.WriteLine(CHCNetSDK.CHCNetSDK.NET_DVR_GetLastError()); } //取VGA1支持的画面分割能力的最后一个模式 struVoutCfg.dwWindowMode =WindowMode; //将关联窗口初始为0 for (int i = 0; i < CHCNetSDK.CHCNetSDK.MAX_WINDOWS_V41; i++) //此处可根据实际解码器的通道设置 { struVoutCfg.byJoinDecChan[i] =0; } //窗口关联解码通道 struVoutCfg.byJoinDecChan[0] =(byte)((WindowModeChannel[0] == "" || WindowModeChannel[0] == null) ? 0 :Convert.ToInt32(WindowModeChannel[0])); struVoutCfg.byJoinDecChan[1] = (byte)((WindowModeChannel[1] == "" || WindowModeChannel[1] == null) ? 1 : Convert.ToInt32(WindowModeChannel[1])); struVoutCfg.byJoinDecChan[2] = (byte)((WindowModeChannel[2] == "" || WindowModeChannel[2] == null) ? 2 : Convert.ToInt32(WindowModeChannel[2])); struVoutCfg.byJoinDecChan[3] = (byte)((WindowModeChannel[3] == "" || WindowModeChannel[3] == null) ? 3 : Convert.ToInt32(WindowModeChannel[3])); //设置分屏显示 if (!CHCNetSDK.CHCNetSDK.NET_DVR_MatrixSetDisplayCfg_V41(UserID,Vga/* DispChanNum*/, ref struVoutCfg)) { //Console.WriteLine(CHCNetSDK.CHCNetSDK.NET_DVR_GetLastError()); } //启动动态解码 CHCNetSDK.CHCNetSDK.NET_DVR_PU_STREAM_CFG_V41 struDynamicInfo = new CHCNetSDK.CHCNetSDK.NET_DVR_PU_STREAM_CFG_V41(); struDynamicInfo.Init(); struDynamicInfo.uDecStreamMode.byRes = new byte[300]; //取流模式byStreamMode:0- 无效,1- 通过IP或域名取流,2- 通过URL取流,3- 通过动态域名解析向设备取流 struDynamicInfo.byStreamMode = 1; //获取结构体长度 struDynamicInfo.dwSize =Marshal.SizeOf(typeof(CHCNetSDK.CHCNetSDK.NET_DVR_PU_STREAM_CFG_V41)); //声明前端设备信息结构体对象 CHCNetSDK.CHCNetSDK.NET_DVR_DEC_STREAM_DEV_EX devex = new CHCNetSDK.CHCNetSDK.NET_DVR_DEC_STREAM_DEV_EX(); //初始化值 devex.struDevChanInfo.Init(); //通道类型:0-普通通道,1-零通道,2-流ID,解码器支持的通道类型可以通过能力集DECODER_ABILITY获取 devex.struDevChanInfo.byChanType = 0; //前端设备IP地址 System.Text.Encoding.ASCII.GetBytes(EquIP).CopyTo(devex.struDevChanInfo.byAddress, 0); //前端设备服务端口 devex.struDevChanInfo.wDVRPort = ushort.Parse(Port); //取通道1的码流 devex.struDevChanInfo.byChannel = (byte)EquChannel; //前端设备登录用户名 System.Text.Encoding.ASCII.GetBytes(UName).CopyTo(devex.struDevChanInfo.sUserName, 0); //前端设备登录密码 System.Text.Encoding.ASCII.GetBytes(Upwd).CopyTo(devex.struDevChanInfo.sPassword, 0); //厂家私有协议,其他类型可以通过接口NET_DVR_GetIPCProtoList获取 //设置协议类型 默认为0 厂家私有协议 devex.struDevChanInfo.byFactoryType = 0; //将结构体转换为byte[] object ModeDevChan=devex; //将转换后的值赋值给数组 struDynamicInfo.uDecStreamMode.byRes = _analy.StructToBytes(ModeDevChan); //开始解码 if (CHCNetSDK.CHCNetSDK.NET_DVR_MatrixStartDynamic_V41(UserID,/*Convert.ToInt32(DecChanNum)*/DecoderChannel,ref struDynamicInfo)) { //Console.WriteLine(CHCNetSDK.CHCNetSDK.NET_DVR_GetLastError()); } //Console.WriteLine(CHCNetSDK.CHCNetSDK.NET_DVR_GetLastError()); //停止解码 //if (!CHCNetSDK.CHCNetSDK.NET_DVR_MatrixStopDynamic(UserID, DecoderChannel)) //{ // Console.WriteLine(CHCNetSDK.CHCNetSDK.NET_DVR_GetLastError()); //} #endregion } else if (Type == 1)//被动解码 { #region 被动解码 ushort BDispChanNum = 1;//显示通道,可以通过能力集获取 CHCNetSDK.CHCNetSDK.NET_DVR_MATRIX_VOUTCFG VoutCfg = new CHCNetSDK.CHCNetSDK.NET_DVR_MATRIX_VOUTCFG(); if (!CHCNetSDK.CHCNetSDK.NET_DVR_MatrixGetDisplayCfg_V41(UserID, BDispChanNum, out VoutCfg)) {//出错处理 } VoutCfg.byJoinDecChan = new byte[36]; VoutCfg.byRes2 = new byte[80]; VoutCfg.dwWindowMode = 4; //画面分割设为4画面 VoutCfg.byJoinDecChan[0] = 1; //VoutCfg.dwSize =(uint)Marshal.SizeOf(VoutCfg); VoutCfg.dwSize =Marshal.SizeOf(typeof(CHCNetSDK.CHCNetSDK.NET_DVR_MATRIX_VOUTCFG)); //VoutCfg.dwSize =616; //左上角第一个窗口关联解码通道1 if (!CHCNetSDK.CHCNetSDK.NET_DVR_MatrixSetDisplayCfg_V41(UserID, 1,ref VoutCfg)) { Console.WriteLine(CHCNetSDK.CHCNetSDK.NET_DVR_GetLastError()); //for (int i = 1; i < 300; i++) //{ // VoutCfg.dwSize = (uint)i; // if (CHCNetSDK.CHCNetSDK.NET_DVR_MatrixSetDisplayCfg_V41(UserID, 1, VoutCfg)) // { // Console.Write("waoooo" + i); // Console.Write("waoooo" + i); // Console.Write("waoooo" + i); // Console.Write("waoooo" + i); // } //} //出错处理 } uint BDec = 0; uint BDecChanNum = 1; //解码通道号,此处假设通道号为1 if (!CHCNetSDK.CHCNetSDK.NET_DVR_MatrixGetDecChanEnable(UserID, BDecChanNum, ref BDec)) //获取解码通道开关 { //出错处理 } //设置解码通道为开;0表示关闭,1表示打开 if (!CHCNetSDK.CHCNetSDK.NET_DVR_MatrixSetDecChanEnable(UserID, BDecChanNum, 1)) //设置解码通道开关,如果设置为关,通道将停止解码 { //出错处理 } //被动解码 ushort m_PassivePort = 8000; int lPassiveModeHandle = -1; //被动解码句柄 CHCNetSDK.CHCNetSDK.NET_DVR_MATRIX_PASSIVEMODE m_PassiveMode = new CHCNetSDK.CHCNetSDK.NET_DVR_MATRIX_PASSIVEMODE(); m_PassiveMode.wPassivePort = m_PassivePort; //UDP时的端口号,TCP时默认为8000 int login = HaiKangLogin("192.168.0.200", "8000", "admin", "12345"); //……其他被动解码参数 lPassiveModeHandle = CHCNetSDK.CHCNetSDK.NET_DVR_MatrixStartPassiveDecode(login,34/* BDecChanNum*/, ref m_PassiveMode); //启 动多路解码器被动解码 if (!CHCNetSDK.CHCNetSDK.NET_DVR_MatrixSendData(lPassiveModeHandle, IntPtr.Zero, (uint)Marshal.SizeOf(m_PassiveMode))) { } //向解码器发送数据,pSendBuf为发送数据缓冲区,dwBufSize为数据大小 //NET_DVR_MatrixStopPassiveDecode(lPassiveModeHandle); //停止多路解码器被动解码 #endregion } }
2.因为方法中的结构体 海康都没有给定义 需要自定义 我把整个文档全部贴出来 有一点点多 大家可以粘贴出去,需要注意的是 NET_DVR_DEC_STREAM_MODE是一个联合体(c++)中 在C#中可定义为下面的格式即可,需要用到哪个结构体时 把该结构体转为这个byRes数组即可
[StructLayoutAttribute(LayoutKind.Explicit)]
public struct NET_DVR_DEC_STREAM_MODE
{
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 300, ArraySubType = UnmanagedType.I1)]
public byte[] byRes;
}
<pre class="csharp" name="code">using System;
using System.Runtime.InteropServices;
namespace CHCNetSDK
{
/// <summary>
/// CHCNetSDK 的摘要说明。
/// </summary>
public class CHCNetSDK
{
public CHCNetSDK()
{
//
// TODO: 在此处添加构造函数逻辑
//
}
//SDK类型
public const int SDK_PLAYMPEG4 = 1;//播放库
public const int SDK_HCNETSDK = 2;//网络库
public const int NAME_LEN = 32;//用户名长度
public const int PASSWD_LEN = 16;//密码长度
public const int GUID_LEN = 16; //GUID长度
public const int DEV_TYPE_NAME_LEN = 24; //设备类型名称长度
public const int MAX_NAMELEN = 16;//DVR本地登陆名
public const int MAX_RIGHT = 32;//设备支持的权限(1-12表示本地权限,13-32表示远程权限)
public const int SERIALNO_LEN = 48;//序列号长度
public const int MACADDR_LEN = 6;//mac地址长度
public const int MAX_ETHERNET = 2;//设备可配以太网络
public const int MAX_NETWORK_CARD = 4; //设备可配最大网卡数目
public const int PATHNAME_LEN = 128;//路径长度
public const int MAX_NUMBER_LEN = 32; //号码最大长度
public const int MAX_NAME_LEN = 128; //设备名称最大长度
public const int MAX_TIMESEGMENT_V30 = 8;//9000设备最大时间段数
public const int MAX_TIMESEGMENT = 4;//8000设备最大时间段数
public const int MAX_ICR_NUM = 8; //抓拍机红外滤光片预置点数
public const int MAX_SHELTERNUM = 4;//8000设备最大遮挡区域数
public const int PHONENUMBER_LEN = 32;//pppoe拨号号码最大长度
public const int MAX_DISKNUM = 16;//8000设备最大硬盘数
public const int MAX_DISKNUM_V10 = 8;//1.2版本之前版本
public const int MAX_WINDOW_V30 = 32;//9000设备本地显示最大播放窗口数
public const int MAX_WINDOW = 16;//8000设备最大硬盘数
public const int MAX_VGA_V30 = 4;//9000设备最大可接VGA数
public const int MAX_VGA = 1;//8000设备最大可接VGA数
public const int MAX_USERNUM_V30 = 32;//9000设备最大用户数
public const int MAX_USERNUM = 16;//8000设备最大用户数
public const int MAX_EXCEPTIONNUM_V30 = 32;//9000设备最大异常处理数
public const int MAX_EXCEPTIONNUM = 16;//8000设备最大异常处理数
public const int MAX_LINK = 6;//8000设备单通道最大视频流连接数
public const int MAX_ITC_EXCEPTIONOUT = 32;//抓拍机最大报警输出
public const int MAX_DECPOOLNUM = 4;//单路解码器每个解码通道最大可循环解码数
public const int MAX_DECNUM = 4;//单路解码器的最大解码通道数(实际只有一个,其他三个保留)
public const int MAX_TRANSPARENTNUM = 2;//单路解码器可配置最大透明通道数
public const int MAX_CYCLE_CHAN = 16; //单路解码器最大轮循通道数
public const int MAX_CYCLE_CHAN_V30 = 64;//最大轮询通道数(扩展)
public const int MAX_DIRNAME_LENGTH = 80;//最大目录长度
public const int MAX_STRINGNUM_V30 = 8;//9000设备最大OSD字符行数数
public const int MAX_STRINGNUM = 4;//8000设备最大OSD字符行数数
public const int MAX_STRINGNUM_EX = 8;//8000定制扩展
public const int MAX_AUXOUT_V30 = 16;//9000设备最大辅助输出数
public const int MAX_AUXOUT = 4;//8000设备最大辅助输出数
public const int MAX_HD_GROUP = 16;//9000设备最大硬盘组数
public const int MAX_NFS_DISK = 8; //8000设备最大NFS硬盘数
public const int IW_ESSID_MAX_SIZE = 32;//WIFI的SSID号长度
public const int IW_ENCODING_TOKEN_MAX = 32;//WIFI密锁最大字节数
public const int WIFI_WEP_MAX_KEY_COUNT = 4;
public const int WIFI_WEP_MAX_KEY_LENGTH = 33;
public const int WIFI_WPA_PSK_MAX_KEY_LENGTH = 63;
public const int WIFI_WPA_PSK_MIN_KEY_LENGTH = 8;
public const int WIFI_MAX_AP_COUNT = 20;
public const int MAX_SERIAL_NUM = 64;//最多支持的透明通道路数
public const int MAX_DDNS_NUMS = 10;//9000设备最大可配ddns数
public const int MAX_EMAIL_ADDR_LEN = 48;//最大email地址长度
public const int MAX_EMAIL_PWD_LEN = 32;//最大email密码长度
public const int MAXPROGRESS = 100;//回放时的最大百分率
public const int MAX_SERIALNUM = 2;//8000设备支持的串口数 1-232, 2-485
public const int CARDNUM_LEN = 20;//卡号长度
public const int CARDNUM_LEN_OUT = 32; //外部结构体卡号长度
public const int MAX_VIDEOOUT_V30 = 4;//9000设备的视频输出数
public const int MAX_VIDEOOUT = 2;//8000设备的视频输出数
public const int MAX_PRESET_V30 = 256;// 9000设备支持的云台预置点数
public const int MAX_TRACK_V30 = 256;// 9000设备支持的云台轨迹数
public const int MAX_CRUISE_V30 = 256;// 9000设备支持的云台巡航数
public const int MAX_PRESET = 128;// 8000设备支持的云台预置点数
public const int MAX_TRACK = 128;// 8000设备支持的云台轨迹数
public const int MAX_CRUISE = 128;// 8000设备支持的云台巡航数
public const int CRUISE_MAX_PRESET_NUMS = 32;// 一条巡航最多的巡航点
public const int MAX_SERIAL_PORT = 8;//9000设备支持232串口数
public const int MAX_PREVIEW_MODE = 8;// 设备支持最大预览模式数目 1画面,4画面,9画面,16画面....
public const int MAX_MATRIXOUT = 16;// 最大模拟矩阵输出个数
public const int LOG_INFO_LEN = 11840; // 日志附加信息
public const int DESC_LEN = 16;// 云台描述字符串长度
public const int PTZ_PROTOCOL_NUM = 200;// 9000最大支持的云台协议数
public const int MAX_AUDIO = 1;//8000语音对讲通道数
public const int MAX_AUDIO_V30 = 2;//9000语音对讲通道数
public const int MAX_CHANNUM = 16;//8000设备最大通道数
public const int MAX_ALARMIN = 16;//8000设备最大报警输入数
public const int MAX_ALARMOUT = 4;//8000设备最大报警输出数
//9000 IPC接入
public const int MAX_ANALOG_CHANNUM = 32;//最大32个模拟通道
public const int MAX_ANALOG_ALARMOUT = 32; //最大32路模拟报警输出
public const int MAX_ANALOG_ALARMIN = 32;//最大32路模拟报警输入
public const int MAX_IP_DEVICE = 32;//允许接入的最大IP设备数
public const int MAX_IP_DEVICE_V40 = 64;//允许接入的最大IP设备数
public const int MAX_IP_CHANNEL = 32;//允许加入的最多IP通道数
public const int MAX_IP_ALARMIN = 128;//允许加入的最多报警输入数
public const int MAX_IP_ALARMOUT = 64;//允许加入的最多报警输出数
public const int MAX_IP_ALARMIN_V40 = 4096; //允许加入的最多报警输入数
public const int MAX_IP_ALARMOUT_V40 = 4096; //允许加入的最多报警输出数
public const int MAX_RECORD_FILE_NUM = 20; // 每次删除或者刻录的最大文件数
//SDK_V31 ATM
public const int MAX_ATM_NUM = 1;
public const int MAX_ACTION_TYPE = 12;
public const int ATM_FRAMETYPE_NUM = 4;
public const int MAX_ATM_PROTOCOL_NUM = 1025;
public const int ATM_PROTOCOL_SORT = 4;
public const int ATM_DESC_LEN = 32;
// SDK_V31 ATM
/* 最大支持的通道数 最大模拟加上最大IP支持 */
public const int MAX_CHANNUM_V30 = MAX_ANALOG_CHANNUM + MAX_IP_CHANNEL;//64
public const int MAX_ALARMOUT_V30 = MAX_ANALOG_ALARMOUT + MAX_IP_ALARMOUT;//96
public const int MAX_ALARMIN_V30 = MAX_ANALOG_ALARMIN + MAX_IP_ALARMIN;//160
public const int MAX_CHANNUM_V40 = 512;
public const int MAX_ALARMOUT_V40 = MAX_IP_ALARMOUT_V40 + MAX_ANALOG_ALARMOUT;//4128
public const int MAX_ALARMIN_V40 = MAX_IP_ALARMIN_V40 + MAX_ANALOG_ALARMOUT;//4128
public const int MAX_HUMAN_PICTURE_NUM = 10; //最大照片数
public const int MAX_HUMAN_BIRTHDATE_LEN = 10;
public const int MAX_LAYERNUMS = 32;
public const int MAX_ROIDETECT_NUM = 8; //支持的ROI区域数
public const int MAX_LANERECT_NUM = 5; //最大车牌识别区域数
public const int MAX_FORTIFY_NUM = 10; //最大布防个数
public const int MAX_INTERVAL_NUM = 4; //最大时间间隔个数
public const int MAX_CHJC_NUM = 3; //最大车辆省份简称字符个数
public const int MAX_VL_NUM = 5; //最大虚拟线圈个数
public const int MAX_DRIVECHAN_NUM = 16; //最大车道数
public const int MAX_COIL_NUM = 3; //最大线圈个数
public const int MAX_SIGNALLIGHT_NUM = 6; //最大信号灯个数
public const int LEN_32 = 32;
public const int LEN_31 = 31;
public const int MAX_CABINET_COUNT = 8; //最大支持机柜数量
public const int MAX_ID_LEN = 48;
public const int MAX_PARKNO_LEN = 16;
public const int MAX_ALARMREASON_LEN = 32;
public const int MAX_UPGRADE_INFO_LEN= 48; //获取升级文件匹配信息(模糊升级)
public const int MAX_CUSTOMDIR_LEN = 32; //自定义目录长度
public const int MAX_TRANSPARENT_CHAN_NUM = 4; //每个串口允许建立的最大透明通道数
public const int MAX_TRANSPARENT_ACCESS_NUM = 4; //每个监听端口允许接入的最大主机数
//ITS
public const int MAX_PARKING_STATUS = 8; //车位状态 0代表无车,1代表有车,2代表压线(优先级最高), 3特殊车位
public const int MAX_PARKING_NUM = 4; //一个通道最大4个车位 (从左到右车位 数组0~3)
public const int MAX_ITS_SCENE_NUM = 16; //最大场景数量
public const int MAX_SCENE_TIMESEG_NUM = 16; //最大场景时间段数量
public const int MAX_IVMS_IP_CHANNEL = 128; //最大IP通道数
public const int DEVICE_ID_LEN = 48; //设备编号长度
public const int MONITORSITE_ID_LEN = 48; //监测点编号长度
public const int MAX_AUXAREA_NUM = 16; //辅助区域最大数目
public const int MAX_SLAVE_CHANNEL_NUM = 16; //最大从通道数量
public const int MAX_SCH_TASKS_NUM = 10;
public const int MAX_SERVERID_LEN = 64; //最大服务器ID的长度
public const int MAX_SERVERDOMAIN_LEN = 128; //服务器域名最大长度
public const int MAX_AUTHENTICATEID_LEN = 64; //认证ID最大长度
public const int MAX_AUTHENTICATEPASSWD_LEN = 32; //认证密码最大长度
public const int MAX_SERVERNAME_LEN = 64; //最大服务器用户名
public const int MAX_COMPRESSIONID_LEN = 64; //编码ID的最大长度
public const int MAX_SIPSERVER_ADDRESS_LEN = 128; //SIP服务器地址支持域名和IP地址
//压线报警
public const int MAX_PlATE_NO_LEN = 32; //车牌号码最大长度 2013-09-27
public const int UPNP_PORT_NUM = 12; //upnp端口映射端口数目
public const int MAX_LOCAL_ADDR_LEN = 96; //SOCKS最大本地网段个数
public const int MAX_COUNTRY_NAME_LEN = 4; //国家简写名称长度
//码流连接方式
public const int NORMALCONNECT = 1;
public const int MEDIACONNECT = 2;
//设备型号(大类)
public const int HCDVR = 1;
public const int MEDVR = 2;
public const int PCDVR = 3;
public const int HC_9000 = 4;
public const int HF_I = 5;
public const int PCNVR = 6;
public const int HC_76NVR = 8;
//NVR类型
public const int DS8000HC_NVR = 0;
public const int DS9000HC_NVR = 1;
public const int DS8000ME_NVR = 2;
/*******************全局错误码 begin**********************/
public const int NET_DVR_NOERROR = 0;//没有错误
public const int NET_DVR_PASSWORD_ERROR = 1;//用户名密码错误
public const int NET_DVR_NOENOUGHPRI = 2;//权限不足
public const int NET_DVR_NOINIT = 3;//没有初始化
public const int NET_DVR_CHANNEL_ERROR = 4;//通道号错误
public const int NET_DVR_OVER_MAXLINK = 5;//连接到DVR的客户端个数超过最大
public const int NET_DVR_VERSIONNOMATCH = 6;//版本不匹配
public const int NET_DVR_NETWORK_FAIL_CONNECT = 7;//连接服务器失败
public const int NET_DVR_NETWORK_SEND_ERROR = 8;//向服务器发送失败
public const int NET_DVR_NETWORK_RECV_ERROR = 9;//从服务器接收数据失败
public const int NET_DVR_NETWORK_RECV_TIMEOUT = 10;//从服务器接收数据超时
public const int NET_DVR_NETWORK_ERRORDATA = 11;//传送的数据有误
public const int NET_DVR_ORDER_ERROR = 12;//调用次序错误
public const int NET_DVR_OPERNOPERMIT = 13;//无此权限
public const int NET_DVR_COMMANDTIMEOUT = 14;//DVR命令执行超时
public const int NET_DVR_ERRORSERIALPORT = 15;//串口号错误
public const int NET_DVR_ERRORALARMPORT = 16;//报警端口错误
public const int NET_DVR_PARAMETER_ERROR = 17;//参数错误
public const int NET_DVR_CHAN_EXCEPTION = 18;//服务器通道处于错误状态
public const int NET_DVR_NODISK = 19;//没有硬盘
public const int NET_DVR_ERRORDISKNUM = 20;//硬盘号错误
public const int NET_DVR_DISK_FULL = 21;//服务器硬盘满
public const int NET_DVR_DISK_ERROR = 22;//服务器硬盘出错
public const int NET_DVR_NOSUPPORT = 23;//服务器不支持
public const int NET_DVR_BUSY = 24;//服务器忙
public const int NET_DVR_MODIFY_FAIL = 25;//服务器修改不成功
public const int NET_DVR_PASSWORD_FORMAT_ERROR = 26;//密码输入格式不正确
public const int NET_DVR_DISK_FORMATING = 27;//硬盘正在格式化,不能启动操作
public const int NET_DVR_DVRNORESOURCE = 28;//DVR资源不足
public const int NET_DVR_DVROPRATEFAILED = 29;//DVR操作失败
public const int NET_DVR_OPENHOSTSOUND_FAIL = 30;//打开PC声音失败
public const int NET_DVR_DVRVOICEOPENED = 31;//服务器语音对讲被占用
public const int NET_DVR_TIMEINPUTERROR = 32;//时间输入不正确
public const int NET_DVR_NOSPECFILE = 33;//回放时服务器没有指定的文件
public const int NET_DVR_CREATEFILE_ERROR = 34;//创建文件出错
public const int NET_DVR_FILEOPENFAIL = 35;//打开文件出错
public const int NET_DVR_OPERNOTFINISH = 36; //上次的操作还没有完成
public const int NET_DVR_GETPLAYTIMEFAIL = 37;//获取当前播放的时间出错
public const int NET_DVR_PLAYFAIL = 38;//播放出错
public const int NET_DVR_FILEFORMAT_ERROR = 39;//文件格式不正确
public const int NET_DVR_DIR_ERROR = 40;//路径错误
public const int NET_DVR_ALLOC_RESOURCE_ERROR = 41;//资源分配错误
public const int NET_DVR_AUDIO_MODE_ERROR = 42;//声卡模式错误
public const int NET_DVR_NOENOUGH_BUF = 43;//缓冲区太小
public const int NET_DVR_CREATESOCKET_ERROR = 44;//创建SOCKET出错
public const int NET_DVR_SETSOCKET_ERROR = 45;//设置SOCKET出错
public const int NET_DVR_MAX_NUM = 46;//个数达到最大
public const int NET_DVR_USERNOTEXIST = 47;//用户不存在
public const int NET_DVR_WRITEFLASHERROR = 48;//写FLASH出错
public const int NET_DVR_UPGRADEFAIL = 49;//DVR升级失败
public const int NET_DVR_CARDHAVEINIT = 50;//解码卡已经初始化过
public const int NET_DVR_PLAYERFAILED = 51;//调用播放库中某个函数失败
public const int NET_DVR_MAX_USERNUM = 52;//设备端用户数达到最大
public const int NET_DVR_GETLOCALIPANDMACFAIL = 53;//获得客户端的IP地址或物理地址失败
public const int NET_DVR_NOENCODEING = 54;//该通道没有编码
public const int NET_DVR_IPMISMATCH = 55;//IP地址不匹配
public const int NET_DVR_MACMISMATCH = 56;//MAC地址不匹配
public const int NET_DVR_UPGRADELANGMISMATCH = 57;//升级文件语言不匹配
public const int NET_DVR_MAX_PLAYERPORT = 58;//播放器路数达到最大
public const int NET_DVR_NOSPACEBACKUP = 59;//备份设备中没有足够空间进行备份
public const int NET_DVR_NODEVICEBACKUP = 60;//没有找到指定的备份设备
public const int NET_DVR_PICTURE_BITS_ERROR = 61;//图像素位数不符,限24色
public const int NET_DVR_PICTURE_DIMENSION_ERROR = 62;//图片高*宽超限, 限128*256
public const int NET_DVR_PICTURE_SIZ_ERROR = 63;//图片大小超限,限100K
public const int NET_DVR_LOADPLAYERSDKFAILED = 64;//载入当前目录下Player Sdk出错
public const int NET_DVR_LOADPLAYERSDKPROC_ERROR = 65;//找不到Player Sdk中某个函数入口
public const int NET_DVR_LOADDSSDKFAILED = 66;//载入当前目录下DSsdk出错
public const int NET_DVR_LOADDSSDKPROC_ERROR = 67;//找不到DsSdk中某个函数入口
public const int NET_DVR_DSSDK_ERROR = 68;//调用硬解码库DsSdk中某个函数失败
public const int NET_DVR_VOICEMONOPOLIZE = 69;//声卡被独占
public const int NET_DVR_JOINMULTICASTFAILED = 70;//加入多播组失败
public const int NET_DVR_CREATEDIR_ERROR = 71;//建立日志文件目录失败
public const int NET_DVR_BINDSOCKET_ERROR = 72;//绑定套接字失败
public const int NET_DVR_SOCKETCLOSE_ERROR = 73;//socket连接中断,此错误通常是由于连接中断或目的地不可达
public const int NET_DVR_USERID_ISUSING = 74;//注销时用户ID正在进行某操作
public const int NET_DVR_SOCKETLISTEN_ERROR = 75;//监听失败
public const int NET_DVR_PROGRAM_EXCEPTION = 76;//程序异常
public const int NET_DVR_WRITEFILE_FAILED = 77;//写文件失败
public const int NET_DVR_FORMAT_READONLY = 78;//禁止格式化只读硬盘
public const int NET_DVR_WITHSAMEUSERNAME = 79;//用户配置结构中存在相同的用户名
public const int NET_DVR_DEVICETYPE_ERROR = 80;//导入参数时设备型号不匹配
public const int NET_DVR_LANGUAGE_ERROR = 81;//导入参数时语言不匹配
public const int NET_DVR_PARAVERSION_ERROR = 82;//导入参数时软件版本不匹配
public const int NET_DVR_IPCHAN_NOTALIVE = 83; //预览时外接IP通道不在线
public const int NET_DVR_RTSP_SDK_ERROR = 84;//加载高清IPC通讯库StreamTransClient.dll失败
public const int NET_DVR_CONVERT_SDK_ERROR = 85;//加载转码库失败
public const int NET_DVR_IPC_COUNT_OVERFLOW = 86;//超出最大的ip接入通道数
public const int NET_PLAYM4_NOERROR = 500;//no error
public const int NET_PLAYM4_PARA_OVER = 501;//input parameter is invalid
public const int NET_PLAYM4_ORDER_ERROR = 502;//The order of the function to be called is error
public const int NET_PLAYM4_TIMER_ERROR = 503;//Create multimedia clock failed
public const int NET_PLAYM4_DEC_VIDEO_ERROR = 504;//Decode video data failed
public const int NET_PLAYM4_DEC_AUDIO_ERROR = 505;//Decode audio data failed
public const int NET_PLAYM4_ALLOC_MEMORY_ERROR = 506;//Allocate memory failed
public const int NET_PLAYM4_OPEN_FILE_ERROR = 507;//Open the file failed
public const int NET_PLAYM4_CREATE_OBJ_ERROR = 508;//Create thread or event failed
public const int NET_PLAYM4_CREATE_DDRAW_ERROR = 509;//Create DirectDraw object failed
public const int NET_PLAYM4_CREATE_OFFSCREEN_ERROR = 510;//failed when creating off-screen surface
public const int NET_PLAYM4_BUF_OVER = 511;//buffer is overflow
public const int NET_PLAYM4_CREATE_SOUND_ERROR = 512;//failed when creating audio device
public const int NET_PLAYM4_SET_VOLUME_ERROR = 513;//Set volume failed
public const int NET_PLAYM4_SUPPORT_FILE_ONLY = 514;//The function only support play file
public const int NET_PLAYM4_SUPPORT_STREAM_ONLY = 515;//The function only support play stream
public const int NET_PLAYM4_SYS_NOT_SUPPORT = 516;//System not support
public const int NET_PLAYM4_FILEHEADER_UNKNOWN = 517;//No file header
public const int NET_PLAYM4_VERSION_INCORRECT = 518;//The version of decoder and encoder is not adapted
public const int NET_PALYM4_INIT_DECODER_ERROR = 519;//Initialize decoder failed
public const int NET_PLAYM4_CHECK_FILE_ERROR = 520;//The file data is unknown
public const int NET_PLAYM4_INIT_TIMER_ERROR = 521;//Initialize multimedia clock failed
public const int NET_PLAYM4_BLT_ERROR = 522;//Blt failed
public const int NET_PLAYM4_UPDATE_ERROR = 523;//Update failed
public const int NET_PLAYM4_OPEN_FILE_ERROR_MULTI = 524;//openfile error, streamtype is multi
public const int NET_PLAYM4_OPEN_FILE_ERROR_VIDEO = 525;//openfile error, streamtype is video
public const int NET_PLAYM4_JPEG_COMPRESS_ERROR = 526;//JPEG compress error
public const int NET_PLAYM4_EXTRACT_NOT_SUPPORT = 527;//Don't support the version of this file
public const int NET_PLAYM4_EXTRACT_DATA_ERROR = 528;//extract video data failed
/*******************全局错误码 end**********************/
/*************************************************
NET_DVR_IsSupport()返回值
1-9位分别表示以下信息(位与是TRUE)表示支持;
**************************************************/
public const int NET_DVR_SUPPORT_DDRAW = 1;//支持DIRECTDRAW,如果不支持,则播放器不能工作
public const int NET_DVR_SUPPORT_BLT = 2;//显卡支持BLT操作,如果不支持,则播放器不能工作
public const int NET_DVR_SUPPORT_BLTFOURCC = 4;//显卡BLT支持颜色转换,如果不支持,播放器会用软件方法作RGB转换
public const int NET_DVR_SUPPORT_BLTSHRINKX = 8;//显卡BLT支持X轴缩小;如果不支持,系统会用软件方法转换
public const int NET_DVR_SUPPORT_BLTSHRINKY = 16;//显卡BLT支持Y轴缩小;如果不支持,系统会用软件方法转换
public const int NET_DVR_SUPPORT_BLTSTRETCHX = 32;//显卡BLT支持X轴放大;如果不支持,系统会用软件方法转换
public const int NET_DVR_SUPPORT_BLTSTRETCHY = 64;//显卡BLT支持Y轴放大;如果不支持,系统会用软件方法转换
public const int NET_DVR_SUPPORT_SSE = 128;//CPU支持SSE指令,Intel Pentium3以上支持SSE指令
public const int NET_DVR_SUPPORT_MMX = 256;//CPU支持MMX指令集,Intel Pentium3以上支持SSE指令
/**********************云台控制命令 begin*************************/
public const int LIGHT_PWRON = 2;// 接通灯光电源
public const int WIPER_PWRON = 3;// 接通雨刷开关
public const int FAN_PWRON = 4;// 接通风扇开关
public const int HEATER_PWRON = 5;// 接通加热器开关
public const int AUX_PWRON1 = 6;// 接通辅助设备开关
public const int AUX_PWRON2 = 7;// 接通辅助设备开关
public const int SET_PRESET = 8;// 设置预置点
public const int CLE_PRESET = 9;// 清除预置点
public const int ZOOM_IN = 11;// 焦距以速度SS变大(倍率变大)
public const int ZOOM_OUT = 12;// 焦距以速度SS变小(倍率变小)
public const int FOCUS_NEAR = 13;// 焦点以速度SS前调
public const int FOCUS_FAR = 14;// 焦点以速度SS后调
public const int IRIS_OPEN = 15;// 光圈以速度SS扩大
public const int IRIS_CLOSE = 16;// 光圈以速度SS缩小
public const int TILT_UP = 21;/* 云台以SS的速度上仰 */
public const int TILT_DOWN = 22;/* 云台以SS的速度下俯 */
public const int PAN_LEFT = 23;/* 云台以SS的速度左转 */
public const int PAN_RIGHT = 24;/* 云台以SS的速度右转 */
public const int UP_LEFT = 25;/* 云台以SS的速度上仰和左转 */
public const int UP_RIGHT = 26;/* 云台以SS的速度上仰和右转 */
public const int DOWN_LEFT = 27;/* 云台以SS的速度下俯和左转 */
public const int DOWN_RIGHT = 28;/* 云台以SS的速度下俯和右转 */
public const int PAN_AUTO = 29;/* 云台以SS的速度左右自动扫描 */
public const int FILL_PRE_SEQ = 30;/* 将预置点加入巡航序列 */
public const int SET_SEQ_DWELL = 31;/* 设置巡航点停顿时间 */
public const int SET_SEQ_SPEED = 32;/* 设置巡航速度 */
public const int CLE_PRE_SEQ = 33;/* 将预置点从巡航序列中删除 */
public const int STA_MEM_CRUISE = 34;/* 开始记录轨迹 */
public const int STO_MEM_CRUISE = 35;/* 停止记录轨迹 */
public const int RUN_CRUISE = 36;/* 开始轨迹 */
public const int RUN_SEQ = 37;/* 开始巡航 */
public const int STOP_SEQ = 38;/* 停止巡航 */
public const int GOTO_PRESET = 39;/* 快球转到预置点 */
/**********************云台控制命令 end*************************/
/*************************************************
回放时播放控制命令宏定义
NET_DVR_PlayBackControl
NET_DVR_PlayControlLocDisplay
NET_DVR_DecPlayBackCtrl的宏定义
具体支持查看函数说明和代码
**************************************************/
public const int NET_DVR_PLAYSTART = 1;//开始播放
public const int NET_DVR_PLAYSTOP = 2;//停止播放
public const int NET_DVR_PLAYPAUSE = 3;//暂停播放
public const int NET_DVR_PLAYRESTART = 4;//恢复播放
public const int NET_DVR_PLAYFAST = 5;//快放
public const int NET_DVR_PLAYSLOW = 6;//慢放
public const int NET_DVR_PLAYNORMAL = 7;//正常速度
public const int NET_DVR_PLAYFRAME = 8;//单帧放
public const int NET_DVR_PLAYSTARTAUDIO = 9;//打开声音
public const int NET_DVR_PLAYSTOPAUDIO = 10;//关闭声音
public const int NET_DVR_PLAYAUDIOVOLUME = 11;//调节音量
public const int NET_DVR_PLAYSETPOS = 12;//改变文件回放的进度
public const int NET_DVR_PLAYGETPOS = 13;//获取文件回放的进度
public const int NET_DVR_PLAYGETTIME = 14;//获取当前已经播放的时间(按文件回放的时候有效)
public const int NET_DVR_PLAYGETFRAME = 15;//获取当前已经播放的帧数(按文件回放的时候有效)
public const int NET_DVR_GETTOTALFRAMES = 16;//获取当前播放文件总的帧数(按文件回放的时候有效)
public const int NET_DVR_GETTOTALTIME = 17;//获取当前播放文件总的时间(按文件回放的时候有效)
public const int NET_DVR_THROWBFRAME = 20;//丢B帧
public const int NET_DVR_SETSPEED = 24;//设置码流速度
public const int NET_DVR_KEEPALIVE = 25;//保持与设备的心跳(如果回调阻塞,建议2秒发送一次)
public const int NET_DVR_PLAYSETTIME = 26;//按绝对时间定位
public const int NET_DVR_PLAYGETTOTALLEN = 27;//获取按时间回放对应时间段内的所有文件的总长度
public const int NET_DVR_PLAY_FORWARD = 29;//倒放切换为正放
public const int NET_DVR_PLAY_REVERSE = 30;//正放切换为倒放
public const int NET_DVR_SET_TRANS_TYPE = 32;//设置转封装类型
public const int NET_DVR_PLAY_CONVERT = 33;//正放切换为倒放
//远程按键定义如下:
/* key value send to CONFIG program */
public const int KEY_CODE_1 = 1;
public const int KEY_CODE_2 = 2;
public const int KEY_CODE_3 = 3;
public const int KEY_CODE_4 = 4;
public const int KEY_CODE_5 = 5;
public const int KEY_CODE_6 = 6;
public const int KEY_CODE_7 = 7;
public const int KEY_CODE_8 = 8;
public const int KEY_CODE_9 = 9;
public const int KEY_CODE_0 = 10;
public const int KEY_CODE_POWER = 11;
public const int KEY_CODE_MENU = 12;
public const int KEY_CODE_ENTER = 13;
public const int KEY_CODE_CANCEL = 14;
public const int KEY_CODE_UP = 15;
public const int KEY_CODE_DOWN = 16;
public const int KEY_CODE_LEFT = 17;
public const int KEY_CODE_RIGHT = 18;
public const int KEY_CODE_EDIT = 19;
public const int KEY_CODE_ADD = 20;
public const int KEY_CODE_MINUS = 21;
public const int KEY_CODE_PLAY = 22;
public const int KEY_CODE_REC = 23;
public const int KEY_CODE_PAN = 24;
public const int KEY_CODE_M = 25;
public const int KEY_CODE_A = 26;
public const int KEY_CODE_F1 = 27;
public const int KEY_CODE_F2 = 28;
/* for PTZ control */
public const int KEY_PTZ_UP_START = KEY_CODE_UP;
public const int KEY_PTZ_UP_STOP = 32;
public const int KEY_PTZ_DOWN_START = KEY_CODE_DOWN;
public const int KEY_PTZ_DOWN_STOP = 33;
public const int KEY_PTZ_LEFT_START = KEY_CODE_LEFT;
public const int KEY_PTZ_LEFT_STOP = 34;
public const int KEY_PTZ_RIGHT_START = KEY_CODE_RIGHT;
public const int KEY_PTZ_RIGHT_STOP = 35;
public const int KEY_PTZ_AP1_START = KEY_CODE_EDIT;/* 光圈+ */
public const int KEY_PTZ_AP1_STOP = 36;
public const int KEY_PTZ_AP2_START = KEY_CODE_PAN;/* 光圈- */
public const int KEY_PTZ_AP2_STOP = 37;
public const int KEY_PTZ_FOCUS1_START = KEY_CODE_A;/* 聚焦+ */
public const int KEY_PTZ_FOCUS1_STOP = 38;
public const int KEY_PTZ_FOCUS2_START = KEY_CODE_M;/* 聚焦- */
public const int KEY_PTZ_FOCUS2_STOP = 39;
public const int KEY_PTZ_B1_START = 40;/* 变倍+ */
public const int KEY_PTZ_B1_STOP = 41;
public const int KEY_PTZ_B2_START = 42;/* 变倍- */
public const int KEY_PTZ_B2_STOP = 43;
//9000新增
public const int KEY_CODE_11 = 44;
public const int KEY_CODE_12 = 45;
public const int KEY_CODE_13 = 46;
public const int KEY_CODE_14 = 47;
public const int KEY_CODE_15 = 48;
public const int KEY_CODE_16 = 49;
/*************************参数配置命令 begin*******************************/
//用于NET_DVR_SetDVRConfig和NET_DVR_GetDVRConfig,注意其对应的配置结构
public const int NET_DVR_GET_DEVICECFG = 100;//获取设备参数
public const int NET_DVR_SET_DEVICECFG = 101;//设置设备参数
public const int NET_DVR_GET_NETCFG = 102;//获取网络参数
public const int NET_DVR_SET_NETCFG = 103;//设置网络参数
public const int NET_DVR_GET_PICCFG = 104;//获取图象参数
public const int NET_DVR_SET_PICCFG = 105;//设置图象参数
public const int NET_DVR_GET_COMPRESSCFG = 106;//获取压缩参数
public const int NET_DVR_SET_COMPRESSCFG = 107;//设置压缩参数
public const int NET_DVR_GET_RECORDCFG = 108;//获取录像时间参数
public const int NET_DVR_SET_RECORDCFG = 109;//设置录像时间参数
public const int NET_DVR_GET_DECODERCFG = 110;//获取解码器参数
public const int NET_DVR_SET_DECODERCFG = 111;//设置解码器参数
public const int NET_DVR_GET_RS232CFG = 112;//获取232串口参数
public const int NET_DVR_SET_RS232CFG = 113;//设置232串口参数
public const int NET_DVR_GET_ALARMINCFG = 114;//获取报警输入参数
public const int NET_DVR_SET_ALARMINCFG = 115;//设置报警输入参数
public const int NET_DVR_GET_ALARMOUTCFG = 116;//获取报警输出参数
public const int NET_DVR_SET_ALARMOUTCFG = 117;//设置报警输出参数
public const int NET_DVR_GET_TIMECFG = 118;//获取DVR时间
public const int NET_DVR_SET_TIMECFG = 119;//设置DVR时间
public const int NET_DVR_GET_PREVIEWCFG = 120;//获取预览参数
public const int NET_DVR_SET_PREVIEWCFG = 121;//设置预览参数
public const int NET_DVR_GET_VIDEOOUTCFG = 122;//获取视频输出参数
public const int NET_DVR_SET_VIDEOOUTCFG = 123;//设置视频输出参数
public const int NET_DVR_GET_USERCFG = 124;//获取用户参数
public const int NET_DVR_SET_USERCFG = 125;//设置用户参数
public const int NET_DVR_GET_EXCEPTIONCFG = 126;//获取异常参数
public const int NET_DVR_SET_EXCEPTIONCFG = 127;//设置异常参数
public const int NET_DVR_GET_ZONEANDDST = 128;//获取时区和夏时制参数
public const int NET_DVR_SET_ZONEANDDST = 129;//设置时区和夏时制参数
public const int NET_DVR_GET_SHOWSTRING = 130;//获取叠加字符参数
public const int NET_DVR_SET_SHOWSTRING = 131;//设置叠加字符参数
public const int NET_DVR_GET_EVENTCOMPCFG = 132;//获取事件触发录像参数
public const int NET_DVR_SET_EVENTCOMPCFG = 133;//设置事件触发录像参数
public const int NET_DVR_GET_AUXOUTCFG = 140;//获取报警触发辅助输出设置(HS设备辅助输出2006-02-28)
public const int NET_DVR_SET_AUXOUTCFG = 141;//设置报警触发辅助输出设置(HS设备辅助输出2006-02-28)
public const int NET_DVR_GET_PREVIEWCFG_AUX = 142;//获取-s系列双输出预览参数(-s系列双输出2006-04-13)
public const int NET_DVR_SET_PREVIEWCFG_AUX = 143;//设置-s系列双输出预览参数(-s系列双输出2006-04-13)
public const int NET_DVR_GET_PICCFG_EX = 200;//获取图象参数(SDK_V14扩展命令)
public const int NET_DVR_SET_PICCFG_EX = 201;//设置图象参数(SDK_V14扩展命令)
public const int NET_DVR_GET_USERCFG_EX = 202;//获取用户参数(SDK_V15扩展命令)
public const int NET_DVR_SET_USERCFG_EX = 203;//设置用户参数(SDK_V15扩展命令)
public const int NET_DVR_GET_COMPRESSCFG_EX = 204;//获取压缩参数(SDK_V15扩展命令2006-05-15)
public const int NET_DVR_SET_COMPRESSCFG_EX = 205;//设置压缩参数(SDK_V15扩展命令2006-05-15)
public const int NET_DVR_GET_NETAPPCFG = 222;//获取网络应用参数 NTP/DDNS/EMAIL
public const int NET_DVR_SET_NETAPPCFG = 223;//设置网络应用参数 NTP/DDNS/EMAIL
public const int NET_DVR_GET_NTPCFG = 224;//获取网络应用参数 NTP
public const int NET_DVR_SET_NTPCFG = 225;//设置网络应用参数 NTP
public const int NET_DVR_GET_DDNSCFG = 226;//获取网络应用参数 DDNS
public const int NET_DVR_SET_DDNSCFG = 227;//设置网络应用参数 DDNS
//对应NET_DVR_EMAILPARA
public const int NET_DVR_GET_EMAILCFG = 228;//获取网络应用参数 EMAIL
public const int NET_DVR_SET_EMAILCFG = 229;//设置网络应用参数 EMAIL
public const int NET_DVR_GET_NFSCFG = 230;/* NFS disk config */
public const int NET_DVR_SET_NFSCFG = 231;/* NFS disk config */
public const int NET_DVR_GET_SHOWSTRING_EX = 238;//获取叠加字符参数扩展(支持8条字符)
public const int NET_DVR_SET_SHOWSTRING_EX = 239;//设置叠加字符参数扩展(支持8条字符)
public const int NET_DVR_GET_NETCFG_OTHER = 244;//获取网络参数
public const int NET_DVR_SET_NETCFG_OTHER = 245;//设置网络参数
//对应NET_DVR_EMAILCFG结构
public const int NET_DVR_GET_EMAILPARACFG = 250;//Get EMAIL parameters
public const int NET_DVR_SET_EMAILPARACFG = 251;//Setup EMAIL parameters
public const int NET_DVR_GET_DDNSCFG_EX = 274;//获取扩展DDNS参数
public const int NET_DVR_SET_DDNSCFG_EX = 275;//设置扩展DDNS参数
public const int NET_DVR_SET_PTZPOS = 292;//云台设置PTZ位置
public const int NET_DVR_GET_PTZPOS = 293;//云台获取PTZ位置
public const int NET_DVR_GET_PTZSCOPE = 294;//云台获取PTZ范围
public const int NET_DVR_GET_AP_INFO_LIST = 305;//获取无线网络资源参数
public const int NET_DVR_SET_WIFI_CFG = 306;//设置IP监控设备无线参数
public const int NET_DVR_GET_WIFI_CFG = 307;//获取IP监控设备无线参数
public const int NET_DVR_SET_WIFI_WORKMODE = 308;//设置IP监控设备网口工作模式参数
public const int NET_DVR_GET_WIFI_WORKMODE = 309;//获取IP监控设备网口工作模式参数
public const int NET_DVR_GET_WIFI_STATUS = 310; //获取设备当前wifi连接状态
/***************************DS9000新增命令(_V30) begin *****************************/
//网络(NET_DVR_NETCFG_V30结构)
public const int NET_DVR_GET_NETCFG_V30 = 1000;//获取网络参数
public const int NET_DVR_SET_NETCFG_V30 = 1001;//设置网络参数
//图象(NET_DVR_PICCFG_V30结构)
public const int NET_DVR_GET_PICCFG_V30 = 1002;//获取图象参数
public const int NET_DVR_SET_PICCFG_V30 = 1003;//设置图象参数
//录像时间(NET_DVR_RECORD_V30结构)
public const int NET_DVR_GET_RECORDCFG_V30 = 1004;//获取录像参数
public const int NET_DVR_SET_RECORDCFG_V30 = 1005;//设置录像参数
//用户(NET_DVR_USER_V30结构)
public const int NET_DVR_GET_USERCFG_V30 = 1006;//获取用户参数
public const int NET_DVR_SET_USERCFG_V30 = 1007;//设置用户参数
//9000DDNS参数配置(NET_DVR_DDNSPARA_V30结构)
public const int NET_DVR_GET_DDNSCFG_V30 = 1010;//获取DDNS(9000扩展)
public const int NET_DVR_SET_DDNSCFG_V30 = 1011;//设置DDNS(9000扩展)
//EMAIL功能(NET_DVR_EMAILCFG_V30结构)
public const int NET_DVR_GET_EMAILCFG_V30 = 1012;//获取EMAIL参数
public const int NET_DVR_SET_EMAILCFG_V30 = 1013;//设置EMAIL参数
//巡航参数 (NET_DVR_CRUISE_PARA结构)
public const int NET_DVR_GET_CRUISE = 1020;
public const int NET_DVR_SET_CRUISE = 1021;
//报警输入结构参数 (NET_DVR_ALARMINCFG_V30结构)
public const int NET_DVR_GET_ALARMINCFG_V30 = 1024;
public const int NET_DVR_SET_ALARMINCFG_V30 = 1025;
//报警输出结构参数 (NET_DVR_ALARMOUTCFG_V30结构)
public const int NET_DVR_GET_ALARMOUTCFG_V30 = 1026;
public const int NET_DVR_SET_ALARMOUTCFG_V30 = 1027;
//视频输出结构参数 (NET_DVR_VIDEOOUT_V30结构)
public const int NET_DVR_GET_VIDEOOUTCFG_V30 = 1028;
public const int NET_DVR_SET_VIDEOOUTCFG_V30 = 1029;
//叠加字符结构参数 (NET_DVR_SHOWSTRING_V30结构)
public const int NET_DVR_GET_SHOWSTRING_V30 = 1030;
public const int NET_DVR_SET_SHOWSTRING_V30 = 1031;
//异常结构参数 (NET_DVR_EXCEPTION_V30结构)
public const int NET_DVR_GET_EXCEPTIONCFG_V30 = 1034;
public const int NET_DVR_SET_EXCEPTIONCFG_V30 = 1035;
//串口232结构参数 (NET_DVR_RS232CFG_V30结构)
public const int NET_DVR_GET_RS232CFG_V30 = 1036;
public const int NET_DVR_SET_RS232CFG_V30 = 1037;
//网络硬盘接入结构参数 (NET_DVR_NET_DISKCFG结构)
public const int NET_DVR_GET_NET_DISKCFG = 1038;//网络硬盘接入获取
public const int NET_DVR_SET_NET_DISKCFG = 1039;//网络硬盘接入设置
//压缩参数 (NET_DVR_COMPRESSIONCFG_V30结构)
public const int NET_DVR_GET_COMPRESSCFG_V30 = 1040;
public const int NET_DVR_SET_COMPRESSCFG_V30 = 1041;
//获取485解码器参数 (NET_DVR_DECODERCFG_V30结构)
public const int NET_DVR_GET_DECODERCFG_V30 = 1042;//获取解码器参数
public const int NET_DVR_SET_DECODERCFG_V30 = 1043;//设置解码器参数
//获取预览参数 (NET_DVR_PREVIEWCFG_V30结构)
public const int NET_DVR_GET_PREVIEWCFG_V30 = 1044;//获取预览参数
public const int NET_DVR_SET_PREVIEWCFG_V30 = 1045;//设置预览参数
//辅助预览参数 (NET_DVR_PREVIEWCFG_AUX_V30结构)
public const int NET_DVR_GET_PREVIEWCFG_AUX_V30 = 1046;//获取辅助预览参数
public const int NET_DVR_SET_PREVIEWCFG_AUX_V30 = 1047;//设置辅助预览参数
//IP接入配置参数 (NET_DVR_IPPARACFG结构)
public const int NET_DVR_GET_IPPARACFG = 1048; //获取IP接入配置信息
public const int NET_DVR_SET_IPPARACFG = 1049;//设置IP接入配置信息
//IP接入配置参数 (NET_DVR_IPPARACFG_V40结构)
public const int NET_DVR_GET_IPPARACFG_V40 = 1062; //获取IP接入配置信息
public const int NET_DVR_SET_IPPARACFG_V40 = 1063;//设置IP接入配置信息
//IP报警输入接入配置参数 (NET_DVR_IPALARMINCFG结构)
public const int NET_DVR_GET_IPALARMINCFG = 1050; //获取IP报警输入接入配置信息
public const int NET_DVR_SET_IPALARMINCFG = 1051; //设置IP报警输入接入配置信息
//IP报警输出接入配置参数 (NET_DVR_IPALARMOUTCFG结构)
public const int NET_DVR_GET_IPALARMOUTCFG = 1052;//获取IP报警输出接入配置信息
public const int NET_DVR_SET_IPALARMOUTCFG = 1053;//设置IP报警输出接入配置信息
//硬盘管理的参数获取 (NET_DVR_HDCFG结构)
public const int NET_DVR_GET_HDCFG = 1054;//获取硬盘管理配置参数
public const int NET_DVR_SET_HDCFG = 1055;//设置硬盘管理配置参数
//盘组管理的参数获取 (NET_DVR_HDGROUP_CFG结构)
public const int NET_DVR_GET_HDGROUP_CFG = 1056;//获取盘组管理配置参数
public const int NET_DVR_SET_HDGROUP_CFG = 1057;//设置盘组管理配置参数
//设备编码类型配置(NET_DVR_COMPRESSION_AUDIO结构)
public const int NET_DVR_GET_COMPRESSCFG_AUD = 1058;//获取设备语音对讲编码参数
public const int NET_DVR_SET_COMPRESSCFG_AUD = 1059;//设置设备语音对讲编码参数
//IP接入配置参数 (NET_DVR_IPPARACFG_V31结构)
public const int NET_DVR_GET_IPPARACFG_V31 = 1060;//获取IP接入配置信息
public const int NET_DVR_SET_IPPARACFG_V31 = 1061; //设置IP接入配置信息
//设备参数配置 (NET_DVR_DEVICECFG_V40结构)
public const int NET_DVR_GET_DEVICECFG_V40 = 1100;//获取设备参数
public const int NET_DVR_SET_DEVICECFG_V40 = 1101;//设置设备参数
//多网卡配置(NET_DVR_NETCFG_MULTI结构)
public const int NET_DVR_GET_NETCFG_MULTI = 1161;
public const int NET_DVR_SET_NETCFG_MULTI = 1162;
//BONDING网卡(NET_DVR_NETWORK_BONDING结构)
public const int NET_DVR_GET_NETWORK_BONDING = 1254;
public const int NET_DVR_SET_NETWORK_BONDING = 1255;
//NAT映射配置参数 (NET_DVR_NAT_CFG结构)
public const int NET_DVR_GET_NAT_CFG = 6111; //获取NAT映射参数
public const int NET_DVR_SET_NAT_CFG = 6112; //设置NAT映射参数
/*************************参数配置命令 end*******************************/
/************************DVR日志 begin***************************/
/* 报警 */
//主类型
public const int MAJOR_ALARM = 1;
//次类型
public const int MINOR_ALARM_IN = 1;/* 报警输入 */
public const int MINOR_ALARM_OUT = 2;/* 报警输出 */
public const int MINOR_MOTDET_START = 3; /* 移动侦测报警开始 */
public const int MINOR_MOTDET_STOP = 4; /* 移动侦测报警结束 */
public const int MINOR_HIDE_ALARM_START = 5;/* 遮挡报警开始 */
public const int MINOR_HIDE_ALARM_STOP = 6;/* 遮挡报警结束 */
public const int MINOR_VCA_ALARM_START = 7;/*智能报警开始*/
public const int MINOR_VCA_ALARM_STOP = 8;/*智能报警停止*/
/* 异常 */
//主类型
public const int MAJOR_EXCEPTION = 2;
//次类型
public const int MINOR_VI_LOST = 33;/* 视频信号丢失 */
public const int MINOR_ILLEGAL_ACCESS = 34;/* 非法访问 */
public const int MINOR_HD_FULL = 35;/* 硬盘满 */
public const int MINOR_HD_ERROR = 36;/* 硬盘错误 */
public const int MINOR_DCD_LOST = 37;/* MODEM 掉线(保留不使用) */
public const int MINOR_IP_CONFLICT = 38;/* IP地址冲突 */
public const int MINOR_NET_BROKEN = 39;/* 网络断开*/
public const int MINOR_REC_ERROR = 40;/* 录像出错 */
public const int MINOR_IPC_NO_LINK = 41;/* IPC连接异常 */
public const int MINOR_VI_EXCEPTION = 42;/* 视频输入异常(只针对模拟通道) */
public const int MINOR_IPC_IP_CONFLICT = 43;/*ipc ip 地址 冲突*/
//视频综合平台
public const int MINOR_FANABNORMAL = 49;/* 视频综合平台:风扇状态异常 */
public const int MINOR_FANRESUME = 50;/* 视频综合平台:风扇状态恢复正常 */
public const int MINOR_SUBSYSTEM_ABNORMALREBOOT = 51;/* 视频综合平台:6467异常重启 */
public const int MINOR_MATRIX_STARTBUZZER = 52;/* 视频综合平台:dm6467异常,启动蜂鸣器 */
/* 操作 */
//主类型
public const int MAJOR_OPERATION = 3;
//次类型
public const int MINOR_START_DVR = 65;/* 开机 */
public const int MINOR_STOP_DVR = 66;/* 关机 */
public const int MINOR_STOP_ABNORMAL = 67;/* 异常关机 */
public const int MINOR_REBOOT_DVR = 68;/*本地重启设备*/
public const int MINOR_LOCAL_LOGIN = 80;/* 本地登陆 */
public const int MINOR_LOCAL_LOGOUT = 81;/* 本地注销登陆 */
public const int MINOR_LOCAL_CFG_PARM = 82;/* 本地配置参数 */
public const int MINOR_LOCAL_PLAYBYFILE = 83;/* 本地按文件回放或下载 */
public const int MINOR_LOCAL_PLAYBYTIME = 84;/* 本地按时间回放或下载*/
public const int MINOR_LOCAL_START_REC = 85;/* 本地开始录像 */
public const int MINOR_LOCAL_STOP_REC = 86;/* 本地停止录像 */
public const int MINOR_LOCAL_PTZCTRL = 87;/* 本地云台控制 */
public const int MINOR_LOCAL_PREVIEW = 88;/* 本地预览 (保留不使用)*/
public const int MINOR_LOCAL_MODIFY_TIME = 89;/* 本地修改时间(保留不使用) */
public const int MINOR_LOCAL_UPGRADE = 90;/* 本地升级 */
public const int MINOR_LOCAL_RECFILE_OUTPUT = 91;/* 本地备份录象文件 */
public const int MINOR_LOCAL_FORMAT_HDD = 92;/* 本地初始化硬盘 */
public const int MINOR_LOCAL_CFGFILE_OUTPUT = 93;/* 导出本地配置文件 */
public const int MINOR_LOCAL_CFGFILE_INPUT = 94;/* 导入本地配置文件 */
public const int MINOR_LOCAL_COPYFILE = 95;/* 本地备份文件 */
public const int MINOR_LOCAL_LOCKFILE = 96;/* 本地锁定录像文件 */
public const int MINOR_LOCAL_UNLOCKFILE = 97;/* 本地解锁录像文件 */
public const int MINOR_LOCAL_DVR_ALARM = 98;/* 本地手动清除和触发报警*/
public const int MINOR_IPC_ADD = 99;/* 本地添加IPC */
public const int MINOR_IPC_DEL = 100;/* 本地删除IPC */
public const int MINOR_IPC_SET = 101;/* 本地设置IPC */
public const int MINOR_LOCAL_START_BACKUP = 102;/* 本地开始备份 */
public const int MINOR_LOCAL_STOP_BACKUP = 103;/* 本地停止备份*/
public const int MINOR_LOCAL_COPYFILE_START_TIME = 104;/* 本地备份开始时间*/
public const int MINOR_LOCAL_COPYFILE_END_TIME = 105;/* 本地备份结束时间*/
public const int MINOR_LOCAL_ADD_NAS = 106;/*本地添加网络硬盘*/
public const int MINOR_LOCAL_DEL_NAS = 107;/* 本地删除nas盘*/
public const int MINOR_LOCAL_SET_NAS = 108;/* 本地设置nas盘*/
public const int MINOR_REMOTE_LOGIN = 112;/* 远程登录 */
public const int MINOR_REMOTE_LOGOUT = 113;/* 远程注销登陆 */
public const int MINOR_REMOTE_START_REC = 114;/* 远程开始录像 */
public const int MINOR_REMOTE_STOP_REC = 115;/* 远程停止录像 */
public const int MINOR_START_TRANS_CHAN = 116;/* 开始透明传输 */
public const int MINOR_STOP_TRANS_CHAN = 117;/* 停止透明传输 */
public const int MINOR_REMOTE_GET_PARM = 118;/* 远程获取参数 */
public const int MINOR_REMOTE_CFG_PARM = 119;/* 远程配置参数 */
public const int MINOR_REMOTE_GET_STATUS = 120;/* 远程获取状态 */
public const int MINOR_REMOTE_ARM = 121;/* 远程布防 */
public const int MINOR_REMOTE_DISARM = 122;/* 远程撤防 */
public const int MINOR_REMOTE_REBOOT = 123;/* 远程重启 */
public const int MINOR_START_VT = 124;/* 开始语音对讲 */
public const int MINOR_STOP_VT = 125;/* 停止语音对讲 */
public const int MINOR_REMOTE_UPGRADE = 126;/* 远程升级 */
public const int MINOR_REMOTE_PLAYBYFILE = 127;/* 远程按文件回放 */
public const int MINOR_REMOTE_PLAYBYTIME = 128;/* 远程按时间回放 */
public const int MINOR_REMOTE_PTZCTRL = 129;/* 远程云台控制 */
public const int MINOR_REMOTE_FORMAT_HDD = 130;/* 远程格式化硬盘 */
public const int MINOR_REMOTE_STOP = 131;/* 远程关机 */
public const int MINOR_REMOTE_LOCKFILE = 132;/* 远程锁定文件 */
public const int MINOR_REMOTE_UNLOCKFILE = 133;/* 远程解锁文件 */
public const int MINOR_REMOTE_CFGFILE_OUTPUT = 134;/* 远程导出配置文件 */
public const int MINOR_REMOTE_CFGFILE_INTPUT = 135;/* 远程导入配置文件 */
public const int MINOR_REMOTE_RECFILE_OUTPUT = 136;/* 远程导出录象文件 */
public const int MINOR_REMOTE_DVR_ALARM = 137;/* 远程手动清除和触发报警*/
public const int MINOR_REMOTE_IPC_ADD = 138;/* 远程添加IPC */
public const int MINOR_REMOTE_IPC_DEL = 139;/* 远程删除IPC */
public const int MINOR_REMOTE_IPC_SET = 140;/* 远程设置IPC */
public const int MINOR_REBOOT_VCA_LIB = 141;/*重启智能库*/
public const int MINOR_REMOTE_ADD_NAS = 142;/* 远程添加nas盘*/
public const int MINOR_REMOTE_DEL_NAS = 143;/* 远程删除nas盘*/
public const int MINOR_REMOTE_SET_NAS = 144;/* 远程设置nas盘*/
//2009-12-16 增加视频综合平台日志类型
public const int MINOR_SUBSYSTEMREBOOT = 160;/*视频综合平台:dm6467 正常重启*/
public const int MINOR_MATRIX_STARTTRANSFERVIDEO = 161; /*视频综合平台:矩阵切换开始传输图像*/
public const int MINOR_MATRIX_STOPTRANSFERVIDEO = 162; /*视频综合平台:矩阵切换停止传输图像*/
public const int MINOR_REMOTE_SET_ALLSUBSYSTEM = 163; /*视频综合平台:设置所有6467子系统信息*/
public const int MINOR_REMOTE_GET_ALLSUBSYSTEM = 164; /*视频综合平台:获取所有6467子系统信息*/
public const int MINOR_REMOTE_SET_PLANARRAY = 165; /*视频综合平台:设置计划轮询组*/
public const int MINOR_REMOTE_GET_PLANARRAY = 166; /*视频综合平台:获取计划轮询组*/
public const int MINOR_MATRIX_STARTTRANSFERAUDIO = 167; /*视频综合平台:矩阵切换开始传输音频*/
public const int MINOR_MATRIX_STOPRANSFERAUDIO = 168; /*视频综合平台:矩阵切换停止传输音频*/
public const int MINOR_LOGON_CODESPITTER = 169; /*视频综合平台:登陆码分器*/
public const int MINOR_LOGOFF_CODESPITTER = 170; /*视频综合平台:退出码分器*/
/*日志附加信息*/
//主类型
public const int MAJOR_INFORMATION = 4;/*附加信息*/
//次类型
public const int MINOR_HDD_INFO = 161;/*硬盘信息*/
public const int MINOR_SMART_INFO = 162;/*SMART信息*/
public const int MINOR_REC_START = 163;/*开始录像*/
public const int MINOR_REC_STOP = 164;/*停止录像*/
public const int MINOR_REC_OVERDUE = 165;/*过期录像删除*/
public const int MINOR_LINK_START = 166;//连接前端设备
public const int MINOR_LINK_STOP = 167;//断开前端设备
public const int MINOR_NET_DISK_INFO = 168;//网络硬盘信息
//当日志的主类型为MAJOR_OPERATION=03,次类型为MINOR_LOCAL_CFG_PARM=0x52或者MINOR_REMOTE_GET_PARM=0x76或者MINOR_REMOTE_CFG_PARM=0x77时,dwParaType:参数类型有效,其含义如下:
public const int PARA_VIDEOOUT = 1;
public const int PARA_IMAGE = 2;
public const int PARA_ENCODE = 4;
public const int PARA_NETWORK = 8;
public const int PARA_ALARM = 16;
public const int PARA_EXCEPTION = 32;
public const int PARA_DECODER = 64;/*解码器*/
public const int PARA_RS232 = 128;
public const int PARA_PREVIEW = 256;
public const int PARA_SECURITY = 512;
public const int PARA_DATETIME = 1024;
public const int PARA_FRAMETYPE = 2048;/*帧格式*/
//vca
public const int PARA_VCA_RULE = 4096;//行为规则
/************************DVR日志 End***************************/
/*******************查找文件和日志函数返回值*************************/
public const int NET_DVR_FILE_SUCCESS = 1000;//获得文件信息
public const int NET_DVR_FILE_NOFIND = 1001;//没有文件
public const int NET_DVR_ISFINDING = 1002;//正在查找文件
public const int NET_DVR_NOMOREFILE = 1003;//查找文件时没有更多的文件
public const int NET_DVR_FILE_EXCEPTION = 1004;//查找文件时异常
/*********************回调函数类型 begin************************/
public const int COMM_ALARM = 0x1100;//8000报警信息主动上传,对应NET_DVR_ALARMINFO
public const int COMM_ALARM_RULE = 0x1102;//行为分析报警信息,对应NET_VCA_RULE_ALARM
public const int COMM_ALARM_PDC = 0x1103;//人流量统计报警上传,对应NET_DVR_PDC_ALRAM_INFO
public const int COMM_ALARM_ALARMHOST = 0x1105;//网络报警主机报警上传,对应NET_DVR_ALARMHOST_ALARMINFO
public const int COMM_ALARM_FACE = 0x1106;//人脸检测识别报警信息,对应NET_DVR_FACEDETECT_ALARM
public const int COMM_RULE_INFO_UPLOAD = 0x1107; // 事件数据信息上传
public const int COMM_ALARM_AID = 0x1110; //交通事件报警信息
public const int COMM_ALARM_TPS = 0x1111; //交通参数统计报警信息
public const int COMM_UPLOAD_FACESNAP_RESULT = 0x1112; //人脸识别结果上传
public const int COMM_ALARM_TFS = 0x1113; //交通取证报警信息
public const int COMM_ALARM_TPS_V41 = 0x1114; //交通参数统计报警信息扩展
public const int COMM_ALARM_AID_V41 = 0x1115; //交通事件报警信息扩展
public const int COMM_ALARM_VQD_EX = 0x1116; //视频质量诊断报警
public const int COMM_SENSOR_VALUE_UPLOAD = 0x1120; //模拟量数据实时上传
public const int COMM_SENSOR_ALARM = 0x1121; //模拟量报警上传
public const int COMM_SWITCH_ALARM = 0x1122; //开关量报警
public const int COMM_ALARMHOST_EXCEPTION = 0x1123; //报警主机故障报警
public const int COMM_ALARMHOST_OPERATEEVENT_ALARM = 0x1124; //操作事件报警上传
public const int COMM_ALARMHOST_SAFETYCABINSTATE = 0x1125; //防护舱状态
public const int COMM_ALARMHOST_ALARMOUTSTATUS = 0x1126; //报警输出口/警号状态
public const int COMM_ALARMHOST_CID_ALARM = 0x1127; //报告报警上传
public const int COMM_ALARMHOST_EXTERNAL_DEVICE_ALARM = 0x1128; //报警主机外接设备报警上传
public const int COMM_ALARMHOST_DATA_UPLOAD = 0x1129; //报警数据上传
public const int COMM_ALARM_AUDIOEXCEPTION = 0x1150; //声音报警信息
public const int COMM_ALARM_DEFOCUS = 0x1151; //虚焦报警信息
public const int COMM_ALARM_BUTTON_DOWN_EXCEPTION = 0x1152; //按钮按下报警信息
public const int COMM_ALARM_ALARMGPS = 0x1202; //GPS报警信息上传
public const int COMM_TRADEINFO = 0x1500; //ATMDVR主动上传交易信息
public const int COMM_UPLOAD_PLATE_RESULT = 0x2800; //上传车牌信息
public const int COMM_ITC_STATUS_DETECT_RESULT = 0x2810; //实时状态检测结果上传(智能高清IPC)
public const int COMM_IPC_AUXALARM_RESULT = 0x2820; //PIR报警、无线报警、呼救报警上传
public const int COMM_UPLOAD_PICTUREINFO = 0x2900; //上传图片信息
public const int COMM_SNAP_MATCH_ALARM = 0x2902; //黑名单比对结果上传
public const int COMM_ITS_PLATE_RESULT = 0x3050; //终端图片上传
public const int COMM_ITS_TRAFFIC_COLLECT = 0x3051; //终端统计数据上传
public const int COMM_ITS_GATE_VEHICLE = 0x3052; //出入口车辆抓拍数据上传
public const int COMM_ITS_GATE_FACE = 0x3053 ; //出入口人脸抓拍数据上传
public const int COMM_ITS_GATE_COSTITEM = 0x3054; //出入口过车收费明细 2013-11-19
public const int COMM_ITS_GATE_HANDOVER = 0x3055 ; //出入口交接班数据 2013-11-19
public const int COMM_ITS_PARK_VEHICLE = 0x3056; //停车场数据上传
public const int COMM_ITS_BLACKLIST_ALARM = 0x3057; //黑名单报警上传
public const int COMM_ALARM_V30 = 0x4000; //9000报警信息主动上传
public const int COMM_IPCCFG = 0x4001; //9000设备IPC接入配置改变报警信息主动上传
public const int COMM_IPCCFG_V31 = 0x4002; //9000设备IPC接入配置改变报警信息主动上传扩展 9000_1.1
public const int COMM_IPCCFG_V40 = 0x4003; // IVMS 2000 编码服务器 NVR IPC接入配置改变时报警信息上传
public const int COMM_ALARM_DEVICE = 0x4004; //设备报警内容,由于通道值大于256而扩展
public const int COMM_ALARM_CVR = 0x4005; //CVR 2.0.X外部报警类型
public const int COMM_ALARM_HOT_SPARE = 0x4006; //热备异常报警(N+1模式异常报警)
public const int COMM_ALARM_V40 = 0x4007; //移动侦测,视频丢失,遮挡,IO信号量等报警信息主动上传,报警数据为可变长
public const int COMM_ITS_ROAD_EXCEPTION = 0x4500; //路口设备异常报警
public const int COMM_ITS_EXTERNAL_CONTROL_ALARM = 0x4520; //外控报警
public const int COMM_SCREEN_ALARM = 0x5000; //多屏控制器报警类型
public const int COMM_DVCS_STATE_ALARM = 0x5001; //分布式大屏控制器报警上传
public const int COMM_ALARM_VQD = 0x6000; //VQD主动报警上传
public const int COMM_PUSH_UPDATE_RECORD_INFO = 0x6001; //推模式录像信息上传
public const int COMM_DIAGNOSIS_UPLOAD = 0x5100; //诊断服务器VQD报警上传
/*************操作异常类型(消息方式, 回调方式(保留))****************/
public const int EXCEPTION_EXCHANGE = 32768;//用户交互时异常
public const int EXCEPTION_AUDIOEXCHANGE = 32769;//语音对讲异常
public const int EXCEPTION_ALARM = 32770;//报警异常
public const int EXCEPTION_PREVIEW = 32771;//网络预览异常
public const int EXCEPTION_SERIAL = 32772;//透明通道异常
public const int EXCEPTION_RECONNECT = 32773;//预览时重连
public const int EXCEPTION_ALARMRECONNECT = 32774;//报警时重连
public const int EXCEPTION_SERIALRECONNECT = 32775;//透明通道重连
public const int EXCEPTION_PLAYBACK = 32784;//回放异常
public const int EXCEPTION_DISKFMT = 32785;//硬盘格式化
/********************预览回调函数*********************/
public const int NET_DVR_SYSHEAD = 1;//系统头数据
public const int NET_DVR_STREAMDATA = 2;//视频流数据(包括复合流和音视频分开的视频流数据)
public const int NET_DVR_AUDIOSTREAMDATA = 3;//音频流数据
public const int NET_DVR_STD_VIDEODATA = 4;//标准视频流数据
public const int NET_DVR_STD_AUDIODATA = 5;//标准音频流数据
//回调预览中的状态和消息
public const int NET_DVR_REALPLAYEXCEPTION = 111;//预览异常
public const int NET_DVR_REALPLAYNETCLOSE = 112;//预览时连接断开
public const int NET_DVR_REALPLAY5SNODATA = 113;//预览5s没有收到数据
public const int NET_DVR_REALPLAYRECONNECT = 114;//预览重连
/********************回放回调函数*********************/
public const int NET_DVR_PLAYBACKOVER = 101;//回放数据播放完毕
public const int NET_DVR_PLAYBACKEXCEPTION = 102;//回放异常
public const int NET_DVR_PLAYBACKNETCLOSE = 103;//回放时候连接断开
public const int NET_DVR_PLAYBACK5SNODATA = 104;//回放5s没有收到数据
/*********************回调函数类型 end************************/
//设备型号(DVR类型)
/* 设备类型 */
public const int DVR = 1;/*对尚未定义的dvr类型返回NETRET_DVR*/
public const int ATMDVR = 2;/*atm dvr*/
public const int DVS = 3;/*DVS*/
public const int DEC = 4;/* 6001D */
public const int ENC_DEC = 5;/* 6001F */
public const int DVR_HC = 6;/*8000HC*/
public const int DVR_HT = 7;/*8000HT*/
public const int DVR_HF = 8;/*8000HF*/
public const int DVR_HS = 9;/* 8000HS DVR(no audio) */
public const int DVR_HTS = 10; /* 8016HTS DVR(no audio) */
public const int DVR_HB = 11; /* HB DVR(SATA HD) */
public const int DVR_HCS = 12; /* 8000HCS DVR */
public const int DVS_A = 13; /* 带ATA硬盘的DVS */
public const int DVR_HC_S = 14; /* 8000HC-S */
public const int DVR_HT_S = 15;/* 8000HT-S */
public const int DVR_HF_S = 16;/* 8000HF-S */
public const int DVR_HS_S = 17; /* 8000HS-S */
public const int ATMDVR_S = 18;/* ATM-S */
public const int LOWCOST_DVR = 19;/*7000H系列*/
public const int DEC_MAT = 20; /*多路解码器*/
public const int DVR_MOBILE = 21;/* mobile DVR */
public const int DVR_HD_S = 22; /* 8000HD-S */
public const int DVR_HD_SL = 23;/* 8000HD-SL */
public const int DVR_HC_SL = 24;/* 8000HC-SL */
public const int DVR_HS_ST = 25;/* 8000HS_ST */
public const int DVS_HW = 26; /* 6000HW */
public const int DS630X_D = 27; /* 多路解码器 */
public const int IPCAM = 30;/*IP 摄像机*/
public const int MEGA_IPCAM = 31;/*X52MF系列,752MF,852MF*/
public const int IPCAM_X62MF = 32;/*X62MF系列可接入9000设备,762MF,862MF*/
public const int IPDOME = 40; /*IP 标清球机*/
public const int IPDOME_MEGA200 = 41;/*IP 200万高清球机*/
public const int IPDOME_MEGA130 = 42;/*IP 130万高清球机*/
public const int IPMOD = 50;/*IP 模块*/
public const int DS71XX_H = 71;/* DS71XXH_S */
public const int DS72XX_H_S = 72;/* DS72XXH_S */
public const int DS73XX_H_S = 73;/* DS73XXH_S */
public const int DS76XX_H_S = 76;/* DS76XX_H_S */
public const int DS81XX_HS_S = 81;/* DS81XX_HS_S */
public const int DS81XX_HL_S = 82;/* DS81XX_HL_S */
public const int DS81XX_HC_S = 83;/* DS81XX_HC_S */
public const int DS81XX_HD_S = 84;/* DS81XX_HD_S */
public const int DS81XX_HE_S = 85;/* DS81XX_HE_S */
public const int DS81XX_HF_S = 86;/* DS81XX_HF_S */
public const int DS81XX_AH_S = 87;/* DS81XX_AH_S */
public const int DS81XX_AHF_S = 88;/* DS81XX_AHF_S */
public const int DS90XX_HF_S = 90; /*DS90XX_HF_S*/
public const int DS91XX_HF_S = 91; /*DS91XX_HF_S*/
public const int DS91XX_HD_S = 92; /*91XXHD-S(MD)*/
/**********************设备类型 end***********************/
/*************************************************
参数配置结构、参数(其中_V30为9000新增)
**************************************************/
//校时结构参数
[StructLayoutAttribute(LayoutKind.Sequential)]
public struct NET_DVR_TIME
{
public uint dwYear;
public uint dwMonth;
public uint dwDay;
public uint dwHour;
public uint dwMinute;
public uint dwSecond;
}
[StructLayoutAttribute(LayoutKind.Sequential)]
public struct NET_DVR_CALIBRATE_TIME
{
public int dwSize;
public NET_DVR_TIME struTime;
public uint wMilliSec;
public byte[] byRes;
}
//时间参数
[StructLayoutAttribute(LayoutKind.Sequential)]
public struct NET_DVR_TIME_V30
{
public ushort wYear;
public byte byMonth;
public byte byDay;
public byte byHour;
public byte byMinute;
public byte bySecond;
public byte byRes;
public ushort wMilliSec;
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 2, ArraySubType = UnmanagedType.I1)]
public byte[] byRes1;
}
[StructLayoutAttribute(LayoutKind.Sequential)]
public struct NET_DVR_TIME_EX
{
public ushort wYear;
public byte byMonth;
public byte byDay;
public byte byHour;
public byte byMinute;
public byte bySecond;
public byte byRes;
}
//时间段(子结构)
[StructLayoutAttribute(LayoutKind.Sequential)]
public struct NET_DVR_SCHEDTIME
{
public byte byStartHour;//开始时间
public byte byStartMin;//开始时间
public byte byStopHour;//结束时间
public byte byStopMin;//结束时间
}
/*设备报警和异常处理方式*/
public const int NOACTION = 0x0;/*无响应*/
public const int WARNONMONITOR = 0x1;/*监视器上警告*/
public const int WARNONAUDIOOUT = 0x2;/*声音警告*/
public const int UPTOCENTER = 0x4;/*上传中心*/
public const int TRIGGERALARMOUT = 0x8;/*触发报警输出*/
public const int TRIGGERCATPIC = 0x10;/*触发抓图并上传E-mail*/
public const int SEND_PIC_FTP = 0x200; /*抓图并上传ftp*/
[StructLayoutAttribute(LayoutKind.Sequential)]
public struct NET_DVR_STRUCTHEAD
{
public ushort wLength; //结构长度
public byte byVersion; /*高低4位分别代表高低版本,后续根据版本和长度进行扩展,不同的版本的长度进行限制*/
public byte byRes;
}
[StructLayoutAttribute(LayoutKind.Sequential)]
public struct NET_DVR_HANDLEEXCEPTION_V41
{
public uint dwHandleType;/*处理方式,处理方式的"或"结果*/
/*0x00: 无响应*/
/*0x01: 监视器上警告*/
/*0x02: 声音警告*/
/*0x04: 上传中心*/
/*0x08: 触发报警输出*/
/*0x10: 触发JPRG抓图并上传Email*/
/*0x20: 无线声光报警器联动*/
/*0x40: 联动电子地图(目前只有PCNVR支持)*/
/*0x200: 抓图并上传FTP*/
public uint dwMaxRelAlarmOutChanNum; //触发的报警输出通道数(只读)最大支持数
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_ALARMOUT_V40, ArraySubType = UnmanagedType.U4)]
public uint[] dwRelAlarmOut; //触发报警通道
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 64, ArraySubType = UnmanagedType.I1)]
public byte[] byRes; //保留
}
[StructLayoutAttribute(LayoutKind.Sequential)]
public struct NET_DVR_HANDLEEXCEPTION_V40
{
public uint dwHandleType;/*处理方式,处理方式的"或"结果*/
/*0x00: 无响应*/
/*0x01: 监视器上警告*/
/*0x02: 声音警告*/
/*0x04: 上传中心*/
/*0x08: 触发报警输出*/
/*0x10: 触发JPRG抓图并上传Email*/
/*0x20: 无线声光报警器联动*/
/*0x40: 联动电子地图(目前只有PCNVR支持)*/
/*0x200: 抓图并上传FTP*/
public uint dwMaxRelAlarmOutChanNum; //触发的报警输出通道数(只读)最大支持数
public uint dwRelAlarmOutChanNum; //触发的报警输出通道数 实际支持数
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_CHANNUM_V30, ArraySubType = UnmanagedType.U4)]
public uint[] dwRelAlarmOut; //触发报警通道
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 64, ArraySubType = UnmanagedType.I1)]
public byte[] byRes; //保留
}
//报警和异常处理结构(子结构)(多处使用)(9000扩展)
[StructLayoutAttribute(LayoutKind.Sequential)]
public struct NET_DVR_HANDLEEXCEPTION_V30
{
public uint dwHandleType;/*处理方式,处理方式的"或"结果*/
/*0x00: 无响应*/
/*0x01: 监视器上警告*/
/*0x02: 声音警告*/
/*0x04: 上传中心*/
/*0x08: 触发报警输出*/
/*0x10: 触发JPRG抓图并上传Email*/
/*0x20: 无线声光报警器联动*/
/*0x40: 联动电子地图(目前只有PCNVR支持)*/
/*0x200: 抓图并上传FTP*/
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_ALARMOUT_V30, ArraySubType = UnmanagedType.I1)]
public byte[] byRelAlarmOut;//报警触发的输出通道,报警触发的输出,为1表示触发该输出
}
//报警和异常处理结构(子结构)(多处使用)
[StructLayoutAttribute(LayoutKind.Sequential)]
public struct NET_DVR_HANDLEEXCEPTION
{
public uint dwHandleType;/*处理方式,处理方式的"或"结果*/
/*0x00: 无响应*/
/*0x01: 监视器上警告*/
/*0x02: 声音警告*/
/*0x04: 上传中心*/
/*0x08: 触发报警输出*/
/*0x10: Jpeg抓图并上传EMail*/
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_ALARMOUT, ArraySubType = UnmanagedType.I1)]
public byte[] byRelAlarmOut;//报警触发的输出通道,报警触发的输出,为1表示触发该输出
}
//DVR设备参数
[StructLayoutAttribute(LayoutKind.Sequential)]
public struct NET_DVR_DEVICECFG
{
public uint dwSize;
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = NAME_LEN, ArraySubType = UnmanagedType.I1)]
public byte[] sDVRName;//DVR名称
public uint dwDVRID;//DVR ID,用于遥控器 //V1.4(0-99), V1.5(0-255)
public uint dwRecycleRecord;//是否循环录像,0:不是; 1:是
//以下不可更改
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = SERIALNO_LEN, ArraySubType = UnmanagedType.I1)]
public byte[] sSerialNumber;//序列号
public uint dwSoftwareVersion;//软件版本号,高16位是主版本,低16位是次版本
public uint dwSoftwareBuildDate;//软件生成日期,0xYYYYMMDD
public uint dwDSPSoftwareVersion;//DSP软件版本,高16位是主版本,低16位是次版本
public uint dwDSPSoftwareBuildDate;// DSP软件生成日期,0xYYYYMMDD
public uint dwPanelVersion;// 前面板版本,高16位是主版本,低16位是次版本
public uint dwHardwareVersion;// 硬件版本,高16位是主版本,低16位是次版本
public byte byAlarmInPortNum;//DVR报警输入个数
public byte byAlarmOutPortNum;//DVR报警输出个数
public byte byRS232Num;//DVR 232串口个数
public byte byRS485Num;//DVR 485串口个数
public byte byNetworkPortNum;//网络口个数
public byte byDiskCtrlNum;//DVR 硬盘控制器个数
public byte byDiskNum;//DVR 硬盘个数
public byte byDVRType;//DVR类型, 1:DVR 2:ATM DVR 3:DVS ......
public byte byChanNum;//DVR 通道个数
public byte byStartChan;//起始通道号,例如DVS-1,DVR - 1
public byte byDecordChans;//DVR 解码路数
public byte byVGANum;//VGA口的个数
public byte byUSBNum;//USB口的个数
public byte byAuxoutNum;//辅口的个数
public byte byAudioNum;//语音口的个数
public byte byIPChanNum;//最大数字通道数
}
/*IP地址*/
[StructLayoutAttribute(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public struct NET_DVR_IPADDR
{
/// char[16]
[MarshalAsAttribute(UnmanagedType.ByValTStr, SizeConst = 16)]
public string sIpV4;
/// BYTE[128]
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 128, ArraySubType = UnmanagedType.I1)]
public byte[] byRes;
public void Init()
{
byRes = new byte[128];
}
}
/*网络数据结构(子结构)(9000扩展)*/
[StructLayoutAttribute(LayoutKind.Sequential)]
public struct NET_DVR_ETHERNET_V30
{
public NET_DVR_IPADDR struDVRIP;//DVR IP地址
public NET_DVR_IPADDR struDVRIPMask;//DVR IP地址掩码
public uint dwNetInterface;//网络接口:1-10MBase-T;2-10MBase-T全双工;3-100MBase-TX;4-100M全双工;5-10M/100M/1000M自适应;6-1000M全双工
public ushort wDVRPort;//端口号
public ushort wMTU;//增加MTU设置,默认1500。
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MACADDR_LEN, ArraySubType = UnmanagedType.I1)]
public byte[] byMACAddr;// 物理地址
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 2, ArraySubType = UnmanagedType.I1)]
public byte[] byRes;
}
/*网络数据结构(子结构)*/
[StructLayoutAttribute(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public struct NET_DVR_ETHERNET
{
[MarshalAsAttribute(UnmanagedType.ByValTStr, SizeConst = 16)]
public string sDVRIP;//DVR IP地址
[MarshalAsAttribute(UnmanagedType.ByValTStr, SizeConst = 16)]
public string sDVRIPMask;//DVR IP地址掩码
public uint dwNetInterface;//网络接口 1-10MBase-T 2-10MBase-T全双工 3-100MBase-TX 4-100M全双工 5-10M/100M自适应
public ushort wDVRPort;//端口号
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MACADDR_LEN, ArraySubType = UnmanagedType.I1)]
public byte[] byMACAddr;//服务器的物理地址
}
//pppoe结构
[StructLayoutAttribute(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public struct NET_DVR_PPPOECFG
{
public uint dwPPPOE;//0-不启用,1-启用
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = NAME_LEN, ArraySubType = UnmanagedType.I1)]
public byte[] sPPPoEUser;//PPPoE用户名
[MarshalAsAttribute(UnmanagedType.ByValTStr, SizeConst = PASSWD_LEN)]
public string sPPPoEPassword;// PPPoE密码
public NET_DVR_IPADDR struPPPoEIP;//PPPoE IP地址
}
//网络配置结构(9000扩展)
[StructLayoutAttribute(LayoutKind.Sequential)]
public struct NET_DVR_NETCFG_V30
{
public uint dwSize;
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_ETHERNET, ArraySubType = UnmanagedType.Struct)]
public NET_DVR_ETHERNET_V30[] struEtherNet;//以太网口
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 2, ArraySubType = UnmanagedType.Struct)]
public NET_DVR_IPADDR[] struRes1;/*保留*/
public NET_DVR_IPADDR struAlarmHostIpAddr;/* 报警主机IP地址 */
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 4, ArraySubType = UnmanagedType.I1)]
public byte[] byRes2;
public ushort wAlarmHostIpPort;
public byte byUseDhcp;
public byte byRes3;
public NET_DVR_IPADDR struDnsServer1IpAddr;/* 域名服务器1的IP地址 */
public NET_DVR_IPADDR struDnsServer2IpAddr;/* 域名服务器2的IP地址 */
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_DOMAIN_NAME, ArraySubType = UnmanagedType.I1)]
public byte[] byIpResolver;
public ushort wIpResolverPort;
public ushort wHttpPortNo;
public NET_DVR_IPADDR struMulticastIpAddr;/* 多播组地址 */
public NET_DVR_IPADDR struGatewayIpAddr;/* 网关地址 */
public NET_DVR_PPPOECFG struPPPoE;
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 64, ArraySubType = UnmanagedType.I1)]
public byte[] byRes;
}
//单个网卡配置信息结构体
[StructLayoutAttribute(LayoutKind.Sequential)]
public struct NET_DVR_ETHERNET_MULTI
{
public NET_DVR_IPADDR struDVRIP;
public NET_DVR_IPADDR struDVRIPMask;
public uint dwNetInterface;
public byte byCardType; //网卡类型,0-普通网卡,1-内网网卡,2-外网网卡
public byte byRes1;
public ushort wMTU;
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MACADDR_LEN, ArraySubType = UnmanagedType.I1)]
public byte[] byMACAddr;
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 2, ArraySubType = UnmanagedType.I1)]
public byte[] byRes2;
public byte byUseDhcp;
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 3, ArraySubType = UnmanagedType.I1)]
public byte[] byRes3;
public NET_DVR_IPADDR struGatewayIpAddr;
public NET_DVR_IPADDR struDnsServer1IpAddr;
public NET_DVR_IPADDR struDnsServer2IpAddr;
}
//多网卡网络配置结构
[StructLayoutAttribute(LayoutKind.Sequential)]
public struct NET_DVR_NETCFG_MULTI
{
public uint dwSize;
public byte byDefaultRoute;
public byte byNetworkCardNum;
public byte byWorkMode; //0-普通多网卡模式,1-内外网隔离模式
public byte byRes;
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_NETWORK_CARD, ArraySubType = UnmanagedType.Struct)]
public NET_DVR_ETHERNET_MULTI[] struEtherNet;//以太网口
public NET_DVR_IPADDR struManageHost1IpAddr;
public NET_DVR_IPADDR struManageHost2IpAddr;
public NET_DVR_IPADDR struAlarmHostIpAddr;
public ushort wManageHost1Port;
public ushort wManageHost2Port;
public ushort wAlarmHostIpPort;
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_DOMAIN_NAME, ArraySubType = UnmanagedType.I1)]
public byte[] byIpResolver;
public ushort wIpResolverPort;
public ushort wDvrPort;
public ushort wHttpPortNo;
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 6, ArraySubType = UnmanagedType.I1)]
public byte[] byRes2;
public NET_DVR_IPADDR struMulticastIpAddr;/* 多播组地址 */
public NET_DVR_PPPOECFG struPPPoE;
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 24, ArraySubType = UnmanagedType.I1)]
public byte[] byRes3;
}
//网络配置结构
[StructLayoutAttribute(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public struct NET_DVR_NETCFG
{
public uint dwSize;
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_ETHERNET, ArraySubType = UnmanagedType.Struct)]
public NET_DVR_ETHERNET[] struEtherNet;/* 以太网口 */
[MarshalAsAttribute(UnmanagedType.ByValTStr, SizeConst = 16)]
public string sManageHostIP;//远程管理主机地址
public ushort wManageHostPort;//远程管理主机端口号
[MarshalAsAttribute(UnmanagedType.ByValTStr, SizeConst = 16)]
public string sIPServerIP;//IPServer服务器地址
[MarshalAsAttribute(UnmanagedType.ByValTStr, SizeConst = 16)]
public string sMultiCastIP;//多播组地址
[MarshalAsAttribute(UnmanagedType.ByValTStr, SizeConst = 16)]
public string sGatewayIP;//网关地址
[MarshalAsAttribute(UnmanagedType.ByValTStr, SizeConst = 16)]
public string sNFSIP;//NFS主机IP地址
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = PATHNAME_LEN, ArraySubType = UnmanagedType.I1)]
public byte[] sNFSDirectory;//NFS目录
public uint dwPPPOE;//0-不启用,1-启用
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = NAME_LEN, ArraySubType = UnmanagedType.I1)]
public byte[] sPPPoEUser;//PPPoE用户名
[MarshalAsAttribute(UnmanagedType.ByValTStr, SizeConst = PASSWD_LEN)]
public string sPPPoEPassword;// PPPoE密码
[MarshalAsAttribute(UnmanagedType.ByValTStr, SizeConst = 16)]
public string sPPPoEIP;//PPPoE IP地址(只读)
public ushort wHttpPort;//HTTP端口号
}
[StructLayoutAttribute(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public struct NET_DVR_SIP_CFG
{
public uint dwSize;
public byte byEnableAutoLogin; //使能自动注册,0-不使能,1-使能
public byte byLoginStatus; //注册状态,0-未注册,1-已注册,此参数只能获取
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 2, ArraySubType = UnmanagedType.I1)]
public byte[] byRes1;
public NET_DVR_IPADDR stuServerIP; //SIP服务器IP
public ushort wServerPort; //SIP服务器端口
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 2, ArraySubType = UnmanagedType.I1)]
public byte[] byRes2;
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = NAME_LEN, ArraySubType = UnmanagedType.I1)]
public byte[] byUserName; //注册用户名
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = PASSWD_LEN, ArraySubType = UnmanagedType.I1)]
public byte[] byPassWord; //注册密码
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_NUMBER_LEN, ArraySubType = UnmanagedType.I1)]
public byte[] byLocalNo;
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_NAME_LEN, ArraySubType = UnmanagedType.I1)]
public byte[] byDispalyName; //设备显示名称
public ushort wLocalPort; //本地端口
public byte byLoginCycle; //注册周期,1-99分钟
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 129, ArraySubType = UnmanagedType.I1)]
public byte[] byRes;
}
//IP可视对讲分机配置
[StructLayoutAttribute(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public struct NET_DVR_IP_VIEW_DEVCFG
{
public uint dwSize;
public byte byDefaultRing; //默认铃音,范围1-6
public byte byRingVolume; //铃音音量,范围0-9
public byte byInputVolume; //输入音量值,范围0-6
public byte byOutputVolume; //输出音量值,范围0-9
public ushort wRtpPort; //Rtp端口
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 2, ArraySubType = UnmanagedType.I1)]
public byte[] byRes1;
public uint dwPreviewDelayTime; //预览延时配置,0-30秒
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 64, ArraySubType = UnmanagedType.I1)]
public byte[] byRes2;
}
//Ip可视对讲音频相关参数配置
[StructLayoutAttribute(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public struct NET_DVR_IP_VIEW_AUDIO_CFG
{
public uint dwSize;
public byte byAudioEncPri1; //音频编码优先级1,0-OggVorbis,1-G711_U,2-G711_A, 5-MPEG2,6-G726,7-AAC
public byte byAudioEncPri2; //音频编码优先级2,当sip服务器不支持音频编码1时会使用音频编码2,0-OggVorbis,1-G711_U,2-G711_A, 5-MPEG2,6-G726,7-AAC
public ushort wAudioPacketLen1; //音频编码1数据包长度
public ushort wAudioPacketLen2; //音频编码2数据包长度
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 30, ArraySubType = UnmanagedType.I1)]
public byte[] byRes;
}
//IP分机呼叫对讲参数配置结构体
[StructLayoutAttribute(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public struct NET_DVR_IP_VIEW_CALL_CFG
{
public uint dwSize ;
public byte byEnableAutoResponse; //使能自动应答,0-不使能,1-使能
public byte byAudoResponseTime; //自动应答时间,0-30秒
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 2, ArraySubType = UnmanagedType.I1)]
public byte[] byRes1;
public byte byEnableAlarmNumber1; //启动报警号码1,0-不启动,1-启动
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 3, ArraySubType = UnmanagedType.I1)]
public byte[] byRes;
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_NUMBER_LEN, ArraySubType = UnmanagedType.I1)]
public byte[] byAlarmNumber1; //呼叫号码1
public byte byEnableAlarmNumber2; //启动报警号码2,0-不启动,1-启动
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 3, ArraySubType = UnmanagedType.I1)]
public byte[] byRes3;
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_NUMBER_LEN, ArraySubType = UnmanagedType.I1)]
public byte[] byAlarmNumber2; //呼叫号码2,呼叫号码1失败会尝试呼叫号码2
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 72, ArraySubType = UnmanagedType.I1)]
public byte[] byRes4;
}
//通道图象结构
//移动侦测(子结构)(按组方式扩展)
[StructLayoutAttribute(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public struct NET_DVR_RECORDCHAN
{
public uint dwMaxRecordChanNum; //设备支持的最大关联录像通道数-只读
public uint dwCurRecordChanNum; //当前实际已配置的关联录像通道数
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_CHANNUM_V30, ArraySubType = UnmanagedType.U4)]
public uint dwRelRecordChan; /* 实际触发录像通道,按值表示,采用紧凑型排列,从下标0 - MAX_CHANNUM_V30-1有效,如果中间遇到0xffffffff,则后续无效*/
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 64, ArraySubType = UnmanagedType.I1)]
public byte[] byRes; //保留
}
//通道图象结构
//移动侦测(子结构)(9000扩展)
[StructLayoutAttribute(LayoutKind.Sequential)]
public struct NET_DVR_MOTION_V30
{
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 96*64, ArraySubType = UnmanagedType.I1)]
public byte[] byMotionScope;/*侦测区域,0-96位,表示64行,共有96*64个小宏块,为1表示是移动侦测区域,0-表示不是*/
public byte byMotionSensitive;/*移动侦测灵敏度, 0 - 5,越高越灵敏,oxff关闭*/
public byte byEnableHandleMotion;/* 是否处理移动侦测 0-否 1-是*/
public byte byEnableDisplay;/* 启用移动侦测高亮显示:0- 否,1- 是 */
public byte reservedData;
public NET_DVR_HANDLEEXCEPTION_V30 struMotionHandleType;/* 处理方式 */
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_DAYS * MAX_TIMESEGMENT_V30, ArraySubType = UnmanagedType.Struct)]
public NET_DVR_SCHEDTIME[] struAlarmTime;/*布防时间*/
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_CHANNUM_V30, ArraySubType = UnmanagedType.I1)]
public byte[] byRelRecordChan;/* 报警触发的录象通道*/
}
//移动侦测(子结构)
[StructLayoutAttribute(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public struct NET_DVR_MOTION
{
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 396, ArraySubType = UnmanagedType.I1)]
public byte[] byMotionScope;/*侦测区域,共有22*18个小宏块,为1表示改宏块是移动侦测区域,0-表示不是*/
public byte byMotionSensitive;/*移动侦测灵敏度, 0 - 5,越高越灵敏,0xff关闭*/
public byte byEnableHandleMotion;/* 是否处理移动侦测 */
[MarshalAsAttribute(UnmanagedType.ByValTStr, SizeConst = 2)]
public string reservedData;
public NET_DVR_HANDLEEXCEPTION strMotionHandleType;/* 处理方式 */
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_DAYS * MAX_TIMESEGMENT, ArraySubType = UnmanagedType.Struct)]
public NET_DVR_SCHEDTIME[] struAlarmTime;//布防时间
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_CHANNUM, ArraySubType = UnmanagedType.I1)]
public byte[] byRelRecordChan;//报警触发的录象通道,为1表示触发该通道
}
//遮挡报警(子结构)(9000扩展) 区域大小704*576
[StructLayoutAttribute(LayoutKind.Sequential)]
public struct NET_DVR_HIDEALARM_V30
{
public uint dwEnableHideAlarm;/* 是否启动遮挡报警 ,0-否,1-低灵敏度 2-中灵敏度 3-高灵敏度*/
public ushort wHideAlarmAreaTopLeftX;/* 遮挡区域的x坐标 */
public ushort wHideAlarmAreaTopLeftY;/* 遮挡区域的y坐标 */
public ushort wHideAlarmAreaWidth;/* 遮挡区域的宽 */
public ushort wHideAlarmAreaHeight;/*遮挡区域的高*/
public NET_DVR_HANDLEEXCEPTION_V30 strHideAlarmHandleType; /* 处理方式 */
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_DAYS * MAX_TIMESEGMENT_V30, ArraySubType = UnmanagedType.Struct)]
public NET_DVR_SCHEDTIME[] struAlarmTime;//布防时间
}
//遮挡报警(子结构) 区域大小704*576
[StructLayoutAttribute(LayoutKind.Sequential)]
public struct NET_DVR_HIDEALARM
{
public uint dwEnableHideAlarm;/* 是否启动遮挡报警 ,0-否,1-低灵敏度 2-中灵敏度 3-高灵敏度*/
public ushort wHideAlarmAreaTopLeftX;/* 遮挡区域的x坐标 */
public ushort wHideAlarmAreaTopLeftY;/* 遮挡区域的y坐标 */
public ushort wHideAlarmAreaWidth;/* 遮挡区域的宽 */
public ushort wHideAlarmAreaHeight;/*遮挡区域的高*/
public NET_DVR_HANDLEEXCEPTION strHideAlarmHandleType;/* 处理方式 */
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_DAYS * MAX_TIMESEGMENT, ArraySubType = UnmanagedType.Struct)]
public NET_DVR_SCHEDTIME[] struAlarmTime;//布防时间
}
//信号丢失报警(子结构)(9000扩展)
[StructLayoutAttribute(LayoutKind.Sequential)]
public struct NET_DVR_VILOST_V30
{
public byte byEnableHandleVILost;/* 是否处理信号丢失报警 */
public NET_DVR_HANDLEEXCEPTION_V30 strVILostHandleType;/* 处理方式 */
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 56, ArraySubType = UnmanagedType.Struct)]
public NET_DVR_SCHEDTIME[] struAlarmTime;//布防时间
}
//信号丢失报警(子结构)
[StructLayoutAttribute(LayoutKind.Sequential)]
public struct NET_DVR_VILOST
{
public byte byEnableHandleVILost;/* 是否处理信号丢失报警 */
public NET_DVR_HANDLEEXCEPTION strVILostHandleType;/* 处理方式 */
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_DAYS * MAX_TIMESEGMENT_V30, ArraySubType = UnmanagedType.Struct)]
public NET_DVR_SCHEDTIME[] struAlarmTime;//布防时间
}
//遮挡区域(子结构)
[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
public struct NET_DVR_SHELTER
{
public ushort wHideAreaTopLeftX;/* 遮挡区域的x坐标 */
public ushort wHideAreaTopLeftY;/* 遮挡区域的y坐标 */
public ushort wHideAreaWidth;/* 遮挡区域的宽 */
public ushort wHideAreaHeight;/*遮挡区域的高*/
}
[StructLayoutAttribute(LayoutKind.Sequential)]
public struct NET_DVR_COLOR
{
public byte byBrightness;/*亮度,0-255*/
public byte byContrast;/*对比度,0-255*/
public byte bySaturation;/*饱和度,0-255*/
public byte byHue;/*色调,0-255*/
}
//通道图象结构(9000扩展)
[StructLayoutAttribute(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public struct NET_DVR_PICCFG_V30
{
public uint dwSize;
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = NAME_LEN, ArraySubType = UnmanagedType.I1)]
public byte[] sChanName;
public uint dwVideoFormat;/* 只读 视频制式 1-NTSC 2-PAL*/
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 64, ArraySubType = UnmanagedType.I1)]
public byte[] byReservedData;/*保留*/
//显示通道名
public uint dwShowChanName;// 预览的图象上是否显示通道名称,0-不显示,1-显示 区域大小704*576
public ushort wShowNameTopLeftX;/* 通道名称显示位置的x坐标 */
public ushort wShowNameTopLeftY;/* 通道名称显示位置的y坐标 */
//视频信号丢失报警
public NET_DVR_VILOST_V30 struVILost;
public NET_DVR_VILOST_V30 struRes;/*保留*/
//移动侦测
public NET_DVR_MOTION_V30 struMotion;
//遮挡报警
public NET_DVR_HIDEALARM_V30 struHideAlarm;
//遮挡 区域大小704*576
public uint dwEnableHide;/* 是否启动遮挡 ,0-否,1-是*/
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_SHELTERNUM, ArraySubType = UnmanagedType.Struct)]
public NET_DVR_SHELTER[] struShelter;
//OSD
public uint dwShowOsd;// 预览的图象上是否显示OSD,0-不显示,1-显示 区域大小704*576
public ushort wOSDTopLeftX;/* OSD的x坐标 */
public ushort wOSDTopLeftY;/* OSD的y坐标 */
public byte byOSDType;/* OSD类型(主要是年月日格式) */
/* 0: XXXX-XX-XX 年月日 */
/* 1: XX-XX-XXXX 月日年 */
/* 2: XXXX年XX月XX日 */
/* 3: XX月XX日XXXX年 */
/* 4: XX-XX-XXXX 日月年*/
/* 5: XX日XX月XXXX年 */
public byte byDispWeek;/* 是否显示星期 */
public byte byOSDAttrib;/* OSD属性:透明,闪烁 */
/* 0: 不显示OSD */
/* 1: 透明,闪烁 */
/* 2: 透明,不闪烁 */
/* 3: 闪烁,不透明 */
/* 4: 不透明,不闪烁 */
public byte byHourOSDType;/* OSD小时制:0-24小时制,1-12小时制 */
public byte byFontSize;//字体大小,16*16(中)/8*16(英),1-32*32(中)/16*32(英),2-64*64(中)/32*64(英) 3-48*48(中)/24*48(英) 0xff-自适应(adaptive)
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 63, ArraySubType = UnmanagedType.I1)]
public byte[] byRes;
}
//通道图象结构SDK_V14扩展
[StructLayoutAttribute(LayoutKind.Sequential)]
public struct NET_DVR_PICCFG_EX
{
public uint dwSize;
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = NAME_LEN, ArraySubType = UnmanagedType.I1)]
public byte[] sChanName;
public uint dwVideoFormat;/* 只读 视频制式 1-NTSC 2-PAL*/
public byte byBrightness;/*亮度,0-255*/
public byte byContrast;/*对比度,0-255*/
public byte bySaturation;/*饱和度,0-255 */
public byte byHue;/*色调,0-255*/
//显示通道名
public uint dwShowChanName;// 预览的图象上是否显示通道名称,0-不显示,1-显示 区域大小704*576
public ushort wShowNameTopLeftX;/* 通道名称显示位置的x坐标 */
public ushort wShowNameTopLeftY;/* 通道名称显示位置的y坐标 */
//信号丢失报警
public NET_DVR_VILOST struVILost;
//移动侦测
public NET_DVR_MOTION struMotion;
//遮挡报警
public NET_DVR_HIDEALARM struHideAlarm;
//遮挡 区域大小704*576
public uint dwEnableHide;/* 是否启动遮挡 ,0-否,1-是*/
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_SHELTERNUM, ArraySubType = UnmanagedType.Struct)]
public NET_DVR_SHELTER[] struShelter;
//OSD
public uint dwShowOsd;// 预览的图象上是否显示OSD,0-不显示,1-显示 区域大小704*576
public ushort wOSDTopLeftX;/* OSD的x坐标 */
public ushort wOSDTopLeftY;/* OSD的y坐标 */
public byte byOSDType;/* OSD类型(主要是年月日格式) */
/* 0: XXXX-XX-XX 年月日 */
/* 1: XX-XX-XXXX 月日年 */
/* 2: XXXX年XX月XX日 */
/* 3: XX月XX日XXXX年 */
/* 4: XX-XX-XXXX 日月年*/
/* 5: XX日XX月XXXX年 */
public byte byDispWeek;/* 是否显示星期 */
public byte byOSDAttrib;/* OSD属性:透明,闪烁 */
/* 0: 不显示OSD */
/* 1: 透明,闪烁 */
/* 2: 透明,不闪烁 */
/* 3: 闪烁,不透明 */
/* 4: 不透明,不闪烁 */
public byte byHourOsdType;/* OSD小时制:0-24小时制,1-12小时制 */
}
//通道图象结构(SDK_V13及之前版本)
[StructLayoutAttribute(LayoutKind.Sequential)]
public struct NET_DVR_PICCFG
{
public uint dwSize;
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = NAME_LEN, ArraySubType = UnmanagedType.I1)]
public byte[] sChanName;
public uint dwVideoFormat;/* 只读 视频制式 1-NTSC 2-PAL*/
public byte byBrightness;/*亮度,0-255*/
public byte byContrast;/*对比度,0-255*/
public byte bySaturation;/*饱和度,0-255 */
public byte byHue;/*色调,0-255*/
//显示通道名
public uint dwShowChanName;// 预览的图象上是否显示通道名称,0-不显示,1-显示 区域大小704*576
public ushort wShowNameTopLeftX;/* 通道名称显示位置的x坐标 */
public ushort wShowNameTopLeftY;/* 通道名称显示位置的y坐标 */
//信号丢失报警
public NET_DVR_VILOST struVILost;
//移动侦测
public NET_DVR_MOTION struMotion;
//遮挡报警
public NET_DVR_HIDEALARM struHideAlarm;
//遮挡 区域大小704*576
public uint dwEnableHide;/* 是否启动遮挡 ,0-否,1-是*/
public ushort wHideAreaTopLeftX;/* 遮挡区域的x坐标 */
public ushort wHideAreaTopLeftY;/* 遮挡区域的y坐标 */
public ushort wHideAreaWidth;/* 遮挡区域的宽 */
public ushort wHideAreaHeight;/*遮挡区域的高*/
//OSD
public uint dwShowOsd;// 预览的图象上是否显示OSD,0-不显示,1-显示 区域大小704*576
public ushort wOSDTopLeftX;/* OSD的x坐标 */
public ushort wOSDTopLeftY;/* OSD的y坐标 */
public byte byOSDType;/* OSD类型(主要是年月日格式) */
/* 0: XXXX-XX-XX 年月日 */
/* 1: XX-XX-XXXX 月日年 */
/* 2: XXXX年XX月XX日 */
/* 3: XX月XX日XXXX年 */
/* 4: XX-XX-XXXX 日月年*/
/* 5: XX日XX月XXXX年 */
public byte byDispWeek;/* 是否显示星期 */
public byte byOSDAttrib;/* OSD属性:透明,闪烁 */
/* 0: 不显示OSD */
/* 1: 透明,闪烁 */
/* 2: 透明,不闪烁 */
/* 3: 闪烁,不透明 */
/* 4: 不透明,不闪烁 */
public byte reservedData2;
}
//码流压缩参数(子结构)(9000扩展)
[StructLayoutAttribute(LayoutKind.Sequential)]
public struct NET_DVR_COMPRESSION_INFO_V30
{
public byte byStreamType;//码流类型 0-视频流, 1-复合流, 表示事件压缩参数时最高位表示是否启用压缩参数
public byte byResolution;//分辨率0-DCIF 1-CIF, 2-QCIF, 3-4CIF, 4-2CIF 5(保留)16-VGA(640*480) 17-UXGA(1600*1200) 18-SVGA (800*600)19-HD720p(1280*720)20-XVGA 21-HD900p
public byte byBitrateType;//码率类型 0:变码率, 1:定码率
public byte byPicQuality;//图象质量 0-最好 1-次好 2-较好 3-一般 4-较差 5-差
public uint dwVideoBitrate;//视频码率 0-保留 1-16K 2-32K 3-48k 4-64K 5-80K 6-96K 7-128K 8-160k 9-192K 10-224K 11-256K 12-320K
// 13-384K 14-448K 15-512K 16-640K 17-768K 18-896K 19-1024K 20-1280K 21-1536K 22-1792K 23-2048K
//最高位(31位)置成1表示是自定义码流, 0-30位表示码流值。
public uint dwVideoFrameRate;//帧率 0-全部; 1-1/16; 2-1/8; 3-1/4; 4-1/2; 5-1; 6-2; 7-4; 8-6; 9-8; 10-10; 11-12; 12-16; 13-20; V2.0版本中新加14-15; 15-18; 16-22;
public ushort wIntervalFrameI;//I帧间隔
//2006-08-11 增加单P帧的配置接口,可以改善实时流延时问题
public byte byIntervalBPFrame;//0-BBP帧; 1-BP帧; 2-单P帧
public byte byres1; //保留
public byte byVideoEncType;//视频编码类型 0 hik264;1标准h264; 2标准mpeg4;
public byte byAudioEncType; //音频编码类型 0-OggVorbis
public byte byVideoEncComplexity; //视频编码复杂度,0-低,1-中,2高,0xfe:自动,和源一致
public byte byEnableSvc; //0 - 不启用SVC功能;1- 启用SVC功能
public byte byFormatType; //封装类型,1-裸流,2-RTP封装,3-PS封装,4-TS封装,5-私有,6-FLV,7-ASF,8-3GP,9-RTP+PS(国标:GB28181),0xff-无效
public byte byAudioBitRate; //音频码率0-默认,1-8Kbps, 2- 16Kbps, 3-32Kbps,4-64Kbps,5-128Kbps,6-192Kbps;(IPC5.1.0默认4-64Kbps)
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 6, ArraySubType = UnmanagedType.I1)]
public byte[] byres;//这里保留音频的压缩参数
}
//通道压缩参数(9000扩展)
[StructLayoutAttribute(LayoutKind.Sequential)]
public struct NET_DVR_COMPRESSIONCFG_V30
{
public uint dwSize;
public NET_DVR_COMPRESSION_INFO_V30 struNormHighRecordPara;//录像 对应8000的普通
public NET_DVR_COMPRESSION_INFO_V30 struRes;//保留 char reserveData[28];
public NET_DVR_COMPRESSION_INFO_V30 struEventRecordPara;//事件触发压缩参数
public NET_DVR_COMPRESSION_INFO_V30 struNetPara;//网传(子码流)
}
//码流压缩参数(子结构)
[StructLayoutAttribute(LayoutKind.Sequential)]
public struct NET_DVR_COMPRESSION_INFO
{
public byte byStreamType;//码流类型0-视频流,1-复合流,表示压缩参数时最高位表示是否启用压缩参数
public byte byResolution;//分辨率0-DCIF 1-CIF, 2-QCIF, 3-4CIF, 4-2CIF, 5-2QCIF(352X144)(车载专用)
public byte byBitrateType;//码率类型0:变码率,1:定码率
public byte byPicQuality;//图象质量 0-最好 1-次好 2-较好 3-一般 4-较差 5-差
public uint dwVideoBitrate; //视频码率 0-保留 1-16K(保留) 2-32K 3-48k 4-64K 5-80K 6-96K 7-128K 8-160k 9-192K 10-224K 11-256K 12-320K
// 13-384K 14-448K 15-512K 16-640K 17-768K 18-896K 19-1024K 20-1280K 21-1536K 22-1792K 23-2048K
//最高位(31位)置成1表示是自定义码流, 0-30位表示码流值(MIN-32K MAX-8192K)。
public uint dwVideoFrameRate;//帧率 0-全部; 1-1/16; 2-1/8; 3-1/4; 4-1/2; 5-1; 6-2; 7-4; 8-6; 9-8; 10-10; 11-12; 12-16; 13-20;
}
//通道压缩参数
[StructLayoutAttribute(LayoutKind.Sequential)]
public struct NET_DVR_COMPRESSIONCFG
{
public uint dwSize;
public NET_DVR_COMPRESSION_INFO struRecordPara;//录像/事件触发录像
public NET_DVR_COMPRESSION_INFO struNetPara;//网传/保留
}
//码流压缩参数(子结构)(扩展) 增加I帧间隔
[StructLayoutAttribute(LayoutKind.Sequential)]
public struct NET_DVR_COMPRESSION_INFO_EX
{
public byte byStreamType;//码流类型0-视频流, 1-复合流
public byte byResolution;//分辨率0-DCIF 1-CIF, 2-QCIF, 3-4CIF, 4-2CIF, 5-2QCIF(352X144)(车载专用)
public byte byBitrateType;//码率类型0:变码率,1:定码率
public byte byPicQuality;//图象质量 0-最好 1-次好 2-较好 3-一般 4-较差 5-差
public uint dwVideoBitrate;//视频码率 0-保留 1-16K(保留) 2-32K 3-48k 4-64K 5-80K 6-96K 7-128K 8-160k 9-192K 10-224K 11-256K 12-320K
// 13-384K 14-448K 15-512K 16-640K 17-768K 18-896K 19-1024K 20-1280K 21-1536K 22-1792K 23-2048K
//最高位(31位)置成1表示是自定义码流, 0-30位表示码流值(MIN-32K MAX-8192K)。
public uint dwVideoFrameRate;//帧率 0-全部; 1-1/16; 2-1/8; 3-1/4; 4-1/2; 5-1; 6-2; 7-4; 8-6; 9-8; 10-10; 11-12; 12-16; 13-20, //V2.0增加14-15, 15-18, 16-22;
public ushort wIntervalFrameI;//I帧间隔
//2006-08-11 增加单P帧的配置接口,可以改善实时流延时问题
public byte byIntervalBPFrame;//0-BBP帧; 1-BP帧; 2-单P帧
public byte byRes;
}
//通道压缩参数(扩展)
[StructLayoutAttribute(LayoutKind.Sequential)]
public struct NET_DVR_COMPRESSIONCFG_EX
{
public uint dwSize;
public NET_DVR_COMPRESSION_INFO_EX struRecordPara;//录像
public NET_DVR_COMPRESSION_INFO_EX struNetPara;//网传
}
//时间段录像参数配置(子结构)
[StructLayoutAttribute(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public struct NET_DVR_RECORDSCHED
{
public NET_DVR_SCHEDTIME struRecordTime;
public byte byRecordType;//0:定时录像,1:移动侦测,2:报警录像,3:动测|报警,4:动测&报警, 5:命令触发, 6: 智能录像
[MarshalAsAttribute(UnmanagedType.ByValTStr, SizeConst = 3)]
public string reservedData;
}
//全天录像参数配置(子结构)
[StructLayoutAttribute(LayoutKind.Sequential)]
public struct NET_DVR_RECORDDAY
{
public ushort wAllDayRecord;/* 是否全天录像 0-否 1-是*/
public byte byRecordType;/* 录象类型 0:定时录像,1:移动侦测,2:报警录像,3:动测|报警,4:动测&报警 5:命令触发, 6: 智能录像*/
public byte reservedData;
}
//通道录像参数配置(9000扩展)
[StructLayoutAttribute(LayoutKind.Sequential)]
public struct NET_DVR_RECORD_V30
{
public uint dwSize;
public uint dwRecord;/*是否录像 0-否 1-是*/
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_DAYS, ArraySubType = UnmanagedType.Struct)]
public NET_DVR_RECORDDAY[] struRecAllDay;
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_DAYS * MAX_TIMESEGMENT_V30, ArraySubType = UnmanagedType.Struct)]
public NET_DVR_RECORDSCHED[] struRecordSched;
public uint dwRecordTime;/* 录象延时长度 0-5秒, 1-20秒, 2-30秒, 3-1分钟, 4-2分钟, 5-5分钟, 6-10分钟*/
public uint dwPreRecordTime;/* 预录时间 0-不预录 1-5秒 2-10秒 3-15秒 4-20秒 5-25秒 6-30秒 7-0xffffffff(尽可能预录) */
public uint dwRecorderDuration;/* 录像保存的最长时间 */
public byte byRedundancyRec;/*是否冗余录像,重要数据双备份:0/1*/
public byte byAudioRec;/*录像时复合流编码时是否记录音频数据:国外有此法规*/
public byte byStreamType; // 0:主码流 1:子码流
public byte byPassbackRecord; // 0:不回传录像 1:回传录像
public ushort wLockDuration; // 录像锁定时长,单位小时 0表示不锁定,0xffff表示永久锁定,录像段的时长大于锁定的持续时长的录像,将不会锁定
public byte byRecordBackup; // 0:录像不存档 1:录像存档
public byte bySVCLevel; //SVC抽帧类型:0-不抽,1-抽二分之一 2-抽四分之三
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 4, ArraySubType = UnmanagedType.I1)]
public byte[] byReserve;
}
//通道录像参数配置
[StructLayoutAttribute(LayoutKind.Sequential)]
public struct NET_DVR_RECORD
{
public uint dwSize;
public uint dwRecord;/*是否录像 0-否 1-是*/
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_DAYS, ArraySubType = UnmanagedType.Struct)]
public NET_DVR_RECORDDAY[] struRecAllDay;
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_DAYS * MAX_TIMESEGMENT, ArraySubType = UnmanagedType.Struct)]
public NET_DVR_RECORDSCHED[] struRecordSched;
public uint dwRecordTime;/* 录象时间长度 */
public uint dwPreRecordTime;/* 预录时间 0-不预录 1-5秒 2-10秒 3-15秒 4-20秒 5-25秒 6-30秒 7-0xffffffff(尽可能预录) */
}
//云台协议表结构配置
[StructLayoutAttribute(LayoutKind.Sequential)]
public struct NET_DVR_PTZ_PROTOCOL
{
public uint dwType;/*解码器类型值,从1开始连续递增*/
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = DESC_LEN, ArraySubType = UnmanagedType.I1)]
public byte[] byDescribe;/*解码器的描述符,和8000中的一致*/
}
[StructLayoutAttribute(LayoutKind.Sequential)]
public struct NET_DVR_PTZCFG
{
public uint dwSize;
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = PTZ_PROTOCOL_NUM, ArraySubType = UnmanagedType.Struct)]
public NET_DVR_PTZ_PROTOCOL[] struPtz;/*最大200中PTZ协议*/
public uint dwPtzNum;/*有效的ptz协议数目,从0开始(即计算时加1)*/
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 8, ArraySubType = UnmanagedType.I1)]
public byte[] byRes;
}
/***************************云台类型(end)******************************/
//通道解码器(云台)参数配置(9000扩展)
[StructLayoutAttribute(LayoutKind.Sequential)]
public struct NET_DVR_DECODERCFG_V30
{
public uint dwSize;
public uint dwBaudRate;//波特率(bps),0-50,1-75,2-110,3-150,4-300,5-600,6-1200,7-2400,8-4800,9-9600,10-19200, 11-38400,12-57600,13-76800,14-115.2k;
public byte byDataBit;// 数据有几位 0-5位,1-6位,2-7位,3-8位;
public byte byStopBit;// 停止位 0-1位,1-2位
public byte byParity;// 校验 0-无校验,1-奇校验,2-偶校验;
public byte byFlowcontrol;// 0-无,1-软流控,2-硬流控
public ushort wDecoderType;//解码器类型, 从0开始,对应ptz协议列表
public ushort wDecoderAddress;/*解码器地址:0 - 255*/
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_PRESET_V30, ArraySubType = UnmanagedType.I1)]
public byte[] bySetPreset;/* 预置点是否设置,0-没有设置,1-设置*/
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_CRUISE_V30, ArraySubType = UnmanagedType.I1)]
public byte[] bySetCruise;/* 巡航是否设置: 0-没有设置,1-设置 */
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_TRACK_V30, ArraySubType = UnmanagedType.I1)]
public byte[] bySetTrack;/* 轨迹是否设置,0-没有设置,1-设置*/
}
//通道解码器(云台)参数配置
[StructLayoutAttribute(LayoutKind.Sequential)]
public struct NET_DVR_DECODERCFG
{
public uint dwSize;
public uint dwBaudRate; //波特率(bps),0-50,1-75,2-110,3-150,4-300,5-600,6-1200,7-2400,8-4800,9-9600,10-19200, 11-38400,12-57600,13-76800,14-115.2k;
public byte byDataBit; // 数据有几位 0-5位,1-6位,2-7位,3-8位;
public byte byStopBit;// 停止位 0-1位,1-2位;
public byte byParity; // 校验 0-无校验,1-奇校验,2-偶校验;
public byte byFlowcontrol;// 0-无,1-软流控,2-硬流控
public ushort wDecoderType;//解码器类型, 0-YouLi,1-LiLin-1016,2-LiLin-820,3-Pelco-p,4-DM DynaColor,5-HD600,6-JC-4116,7-Pelco-d WX,8-Pelco-d PICO
public ushort wDecoderAddress;/*解码器地址:0 - 255*/
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_PRESET, ArraySubType = UnmanagedType.I1)]
public byte[] bySetPreset;/* 预置点是否设置,0-没有设置,1-设置*/
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_CRUISE, ArraySubType = UnmanagedType.I1)]
public byte[] bySetCruise;/* 巡航是否设置: 0-没有设置,1-设置 */
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_TRACK, ArraySubType = UnmanagedType.I1)]
public byte[] bySetTrack;/* 轨迹是否设置,0-没有设置,1-设置*/
}
//ppp参数配置(子结构)
[StructLayoutAttribute(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public struct NET_DVR_PPPCFG_V30
{
public NET_DVR_IPADDR struRemoteIP;//远端IP地址
public NET_DVR_IPADDR struLocalIP;//本地IP地址
[MarshalAsAttribute(UnmanagedType.ByValTStr, SizeConst = 16)]
public string sLocalIPMask;//本地IP地址掩码
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = NAME_LEN, ArraySubType = UnmanagedType.I1)]
public byte[] sUsername;/* 用户名 */
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = PASSWD_LEN, ArraySubType = UnmanagedType.I1)]
public byte[] sPassword;/* 密码 */
public byte byPPPMode;//PPP模式, 0-主动,1-被动
public byte byRedial;//是否回拨 :0-否,1-是
public byte byRedialMode;//回拨模式,0-由拨入者指定,1-预置回拨号码
public byte byDataEncrypt;//数据加密,0-否,1-是
public uint dwMTU;//MTU
[MarshalAsAttribute(UnmanagedType.ByValTStr, SizeConst = PHONENUMBER_LEN)]
public string sTelephoneNumber;//电话号码
}
//ppp参数配置(子结构)
[StructLayoutAttribute(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public struct NET_DVR_PPPCFG
{
[MarshalAsAttribute(UnmanagedType.ByValTStr, SizeConst = 16)]
public string sRemoteIP;//远端IP地址
[MarshalAsAttribute(UnmanagedType.ByValTStr, SizeConst = 16)]
public string sLocalIP;//本地IP地址
[MarshalAsAttribute(UnmanagedType.ByValTStr, SizeConst = 16)]
public string sLocalIPMask;//本地IP地址掩码
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = NAME_LEN, ArraySubType = UnmanagedType.I1)]
public byte[] sUsername;/* 用户名 */
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = PASSWD_LEN, ArraySubType = UnmanagedType.I1)]
public byte[] sPassword;/* 密码 */
public byte byPPPMode;//PPP模式, 0-主动,1-被动
public byte byRedial;//是否回拨 :0-否,1-是
public byte byRedialMode;//回拨模式,0-由拨入者指定,1-预置回拨号码
public byte byDataEncrypt;//数据加密,0-否,1-是
public uint dwMTU;//MTU
[MarshalAsAttribute(UnmanagedType.ByValTStr, SizeConst = PHONENUMBER_LEN)]
public string sTelephoneNumber;//电话号码
}
//RS232串口参数配置(9000扩展)
[StructLayoutAttribute(LayoutKind.Sequential)]
public struct NET_DVR_SINGLE_RS232
{
public uint dwBaudRate;/*波特率(bps),0-50,1-75,2-110,3-150,4-300,5-600,6-1200,7-2400,8-4800,9-9600,10-19200, 11-38400,12-57600,13-76800,14-115.2k;*/
public byte byDataBit;/* 数据有几位 0-5位,1-6位,2-7位,3-8位 */
public byte byStopBit;/* 停止位 0-1位,1-2位 */
public byte byParity;/* 校验 0-无校验,1-奇校验,2-偶校验 */
public byte byFlowcontrol;/* 0-无,1-软流控,2-硬流控 */
public uint dwWorkMode; /* 工作模式,0-232串口用于PPP拨号,1-232串口用于参数控制,2-透明通道 */
}
//RS232串口参数配置(9000扩展)
[StructLayoutAttribute(LayoutKind.Sequential)]
public struct NET_DVR_RS232CFG_V30
{
public uint dwSize;
public NET_DVR_SINGLE_RS232 struRs232;
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 84, ArraySubType = UnmanagedType.I1)]
public byte[] byRes;
public NET_DVR_PPPCFG_V30 struPPPConfig;
}
//RS232串口参数配置
[StructLayoutAttribute(LayoutKind.Sequential)]
public struct NET_DVR_RS232CFG
{
public uint dwSize;
public uint dwBaudRate;//波特率(bps),0-50,1-75,2-110,3-150,4-300,5-600,6-1200,7-2400,8-4800,9-9600,10-19200, 11-38400,12-57600,13-76800,14-115.2k;
public byte byDataBit;// 数据有几位 0-5位,1-6位,2-7位,3-8位;
public byte byStopBit;// 停止位 0-1位,1-2位;
public byte byParity;// 校验 0-无校验,1-奇校验,2-偶校验;
public byte byFlowcontrol;// 0-无,1-软流控,2-硬流控
public uint dwWorkMode;// 工作模式,0-窄带传输(232串口用于PPP拨号),1-控制台(232串口用于参数控制),2-透明通道
public NET_DVR_PPPCFG struPPPConfig;
}
[StructLayoutAttribute(LayoutKind.Sequential)]
public struct NET_DVR_PRESETCHAN_INFO
{
public uint dwEnablePresetChan; /*启用预置点的通道*/
public uint dwPresetPointNo; /*调用预置点通道对应的预置点序号, 0xfffffff表示不调用预置点。*/
}
[StructLayoutAttribute(LayoutKind.Sequential)]
public struct NET_DVR_CRUISECHAN_INFO
{
public uint dwEnableCruiseChan; /*启用巡航的通道*/
public uint dwCruiseNo; /*巡航通道对应的巡航编号, 0xfffffff表示无效*/
}
[StructLayoutAttribute(LayoutKind.Sequential)]
public struct NET_DVR_PTZTRACKCHAN_INFO
{
public uint dwEnablePtzTrackChan; /*启用云台轨迹的通道*/
public uint dwPtzTrackNo; /*云台轨迹通道对应的编号, 0xfffffff表示无效*/
}
//报警输入参数配置(256路NVR扩展)
[StructLayoutAttribute(LayoutKind.Sequential)]
public struct NET_DVR_ALARMINCFG_V40
{
public uint dwSize;
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = NAME_LEN, ArraySubType = UnmanagedType.I1)]
public byte[] sAlarmInName; /* 名称 */
public byte byAlarmType; //报警器类型,0:常开,1:常闭
public byte byAlarmInHandle; /* 是否处理 0-不处理 1-处理*/
public byte byChannel; // 报警输入触发智能识别通道
public byte byRes1; //保留
public uint dwHandleType; //异常处理,异常处理方式的"或"结果
/*0x00: 无响应*/
/*0x01: 监视器上警告*/
/*0x02: 声音警告*/
/*0x04: 上传中心*/
/*0x08: 触发报警输出*/
/*0x10: 触发JPRG抓图并上传Email*/
/*0x20: 无线声光报警器联动*/
/*0x40: 联动电子地图(目前只有PCNVR支持)*/
/*0x200: 抓图并上传FTP*/
public uint dwMaxRelAlarmOutChanNum ; //触发的报警输出通道数(只读)最大支持数量
public uint dwRelAlarmOutChanNum; //触发的报警输出通道数 实际支持数
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_ALARMOUT_V40, ArraySubType = UnmanagedType.U4)]
public uint[] dwRelAlarmOut; //触发报警通道
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_DAYS * MAX_TIMESEGMENT_V30, ArraySubType = UnmanagedType.Struct)]
public NET_DVR_SCHEDTIME[] struAlarmTime;//布防时间
/*触发的录像通道*/
public uint dwMaxRecordChanNum; //设备支持的最大关联录像通道数-只读
public uint dwCurRecordChanNum; //当前实际已配置的关联录像通道数
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_CHANNUM_V40, ArraySubType = UnmanagedType.U4)]
public uint[] dwRelRecordChan; /* 实际触发录像通道,按值表示,采用紧凑型排列,从下标0 - dwCurRecordChanNum -1有效,如果中间遇到0xffffffff,则后续无效*/
public uint dwMaxEnablePtzCtrlNun; //最大可启用的云台控制总数(只读)
public uint dwEnablePresetChanNum; //当前已启用预置点的数目
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_CHANNUM_V40, ArraySubType = UnmanagedType.Struct)]
public NET_DVR_PRESETCHAN_INFO[] struPresetChanInfo; //启用的预置点信息
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 516, ArraySubType = UnmanagedType.I1)]
public byte[] byRes2; /*保留*/
public uint dwEnableCruiseChanNum; //当前已启用巡航的通道数目
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_CHANNUM_V40, ArraySubType = UnmanagedType.Struct)]
public NET_DVR_CRUISECHAN_INFO[] struCruiseChanInfo; //启用巡航功能通道的信息
public uint dwEnablePtzTrackChanNum; //当前已启用巡航的通道数目
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_CHANNUM_V40, ArraySubType = UnmanagedType.Struct)]
public NET_DVR_PTZTRACKCHAN_INFO[] struPtzTrackInfo; //调用云台轨迹的通道信息
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 256, ArraySubType = UnmanagedType.I1)]
public byte[] byRes;
}
//报警输入参数配置(9000扩展)
[StructLayoutAttribute(LayoutKind.Sequential)]
public struct NET_DVR_ALARMINCFG_V30
{
public uint dwSize;
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = NAME_LEN, ArraySubType = UnmanagedType.I1)]
public byte[] sAlarmInName;/* 名称 */
public byte byAlarmType; //报警器类型,0:常开,1:常闭
public byte byAlarmInHandle; /* 是否处理 0-不处理 1-处理*/
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 2, ArraySubType = UnmanagedType.I1)]
public byte[] byRes1;
public NET_DVR_HANDLEEXCEPTION_V30 struAlarmHandleType;/* 处理方式 */
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_DAYS * MAX_TIMESEGMENT_V30, ArraySubType = UnmanagedType.Struct)]
public NET_DVR_SCHEDTIME[] struAlarmTime;//布防时间
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_CHANNUM_V30, ArraySubType = UnmanagedType.I1)]
public byte[] byRelRecordChan;//报警触发的录象通道,为1表示触发该通道
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_CHANNUM_V30, ArraySubType = UnmanagedType.I1)]
public byte[] byEnablePreset;/* 是否调用预置点 0-否,1-是*/
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_CHANNUM_V30, ArraySubType = UnmanagedType.I1)]
public byte[] byPresetNo;/* 调用的云台预置点序号,一个报警输入可以调用多个通道的云台预置点, 0xff表示不调用预置点。*/
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 192, ArraySubType = UnmanagedType.I1)]
public byte[] byRes2;/*保留*/
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_CHANNUM_V30, ArraySubType = UnmanagedType.I1)]
public byte[] byEnableCruise;/* 是否调用巡航 0-否,1-是*/
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_CHANNUM_V30, ArraySubType = UnmanagedType.I1)]
public byte[] byCruiseNo;/* 巡航 */
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_CHANNUM_V30, ArraySubType = UnmanagedType.I1)]
public byte[] byEnablePtzTrack;/* 是否调用轨迹 0-否,1-是*/
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_CHANNUM_V30, ArraySubType = UnmanagedType.I1)]
public byte[] byPTZTrack;/* 调用的云台的轨迹序号 */
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 16, ArraySubType = UnmanagedType.I1)]
public byte[] byRes3;
}
[StructLayoutAttribute(LayoutKind.Sequential)]
public struct STRUCT_IO_ALARM
{
public uint dwAlarmInputNo; //发生报警的报警输入通道号,一次只有一个
public uint dwTrigerAlarmOutNum; /*触发的报警输出个数,用于后面计算变长数据部分中所有触发的报警输出通道号,四字节表示一个*/
public uint dwTrigerRecordChanNum; /*触发的录像通道个数,用于后面计算变长数据部分中所有触发的录像通道号,四字节表示一个*/
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 116, ArraySubType = UnmanagedType.I1)]
public byte[] byRes;
}
[StructLayoutAttribute(LayoutKind.Sequential)]
public struct STRUCT_ALARM_CHANNEL
{
public uint dwAlarmChanNum; /*发生报警通道数据个数,用于后面计算变长数据部分中所有发生的报警通道号,四字节表示一个*/
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 124, ArraySubType = UnmanagedType.I1)]
public byte[] byRes;
}
[StructLayoutAttribute(LayoutKind.Sequential)]
public struct STRUCT_ALARM_HD
{
public uint dwAlarmHardDiskNum; /*发生报警的硬盘数据长度,用于后面计算变长数据部分中所有发生报警的硬盘号,四节表示一个*/
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 124, ArraySubType = UnmanagedType.I1)]
public byte[] byRes;
}
[StructLayout(LayoutKind.Explicit)]
public struct UNION_ALARMINFO_FIXED
{
[FieldOffset(0)]
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 128, ArraySubType = UnmanagedType.I1)]
public byte[] byUnionLen;
[FieldOffset(0)]
public STRUCT_IO_ALARM struIOAlarm;// 报警类型dwAlarmType为0时有效
[FieldOffset(0)]
public STRUCT_ALARM_CHANNEL struAlarmChannel; // dwAlarmType为2,3,6,9,10或13时有效
[FieldOffset(0)]
public STRUCT_ALARM_HD struAlarmHardDisk; // dwAlarmType为1,4,5时有效
}
[StructLayoutAttribute(LayoutKind.Sequential)]
public struct NET_DVR_ALRAM_FIXED_HEADER
{
public uint dwAlarmType; /*0-信号量报警,1-硬盘满,2-信号丢失,3-移动侦测,4-硬盘未格式化,5-写硬盘出错,6-遮挡报警,7-制式不匹配, 8-非法访问,9-视频信号异常,10-录像异常,11-智能场景变化,12-阵列异常,13-前端/录像分辨率不匹配*/
public NET_DVR_TIME_EX struAlarmTime; //发生报警的时间
public UNION_ALARMINFO_FIXED uStruAlarm;
}
[StructLayoutAttribute(LayoutKind.Sequential)]
public struct NET_DVR_ALARMINFO_V40
{
public NET_DVR_ALRAM_FIXED_HEADER struAlarmFixedHeader; //报警固定部分
public IntPtr pAlarmData; //报警可变部分内容
}
//报警输入参数配置
[StructLayoutAttribute(LayoutKind.Sequential)]
public struct NET_DVR_ALARMINCFG
{
public uint dwSize;
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = NAME_LEN, ArraySubType = UnmanagedType.I1)]
public byte[] sAlarmInName;/* 名称 */
public byte byAlarmType;//报警器类型,0:常开,1:常闭
public byte byAlarmInHandle;/* 是否处理 0-不处理 1-处理*/
public byte byChannel; // 报警输入触发智能识别通道
public byte byRes;
public NET_DVR_HANDLEEXCEPTION struAlarmHandleType;/* 处理方式 */
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_DAYS * MAX_TIMESEGMENT, ArraySubType = UnmanagedType.Struct)]
public NET_DVR_SCHEDTIME[] struAlarmTime;//布防时间
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_CHANNUM, ArraySubType = UnmanagedType.I1)]
public byte[] byRelRecordChan;//报警触发的录象通道,为1表示触发该通道
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_CHANNUM, ArraySubType = UnmanagedType.I1)]
public byte[] byEnablePreset;/* 是否调用预置点 0-否,1-是*/
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_CHANNUM, ArraySubType = UnmanagedType.I1)]
public byte[] byPresetNo;/* 调用的云台预置点序号,一个报警输入可以调用多个通道的云台预置点, 0xff表示不调用预置点。*/
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_CHANNUM, ArraySubType = UnmanagedType.I1)]
public byte[] byEnableCruise;/* 是否调用巡航 0-否,1-是*/
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_CHANNUM, ArraySubType = UnmanagedType.I1)]
public byte[] byCruiseNo;/* 巡航 */
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_CHANNUM, ArraySubType = UnmanagedType.I1)]
public byte[] byEnablePtzTrack;/* 是否调用轨迹 0-否,1-是*/
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_CHANNUM, ArraySubType = UnmanagedType.I1)]
public byte[] byPTZTrack;/* 调用的云台的轨迹序号 */
}
//模拟报警输入参数配置
[StructLayoutAttribute(LayoutKind.Sequential)]
public struct NET_DVR_ANALOG_ALARMINCFG
{
public uint dwSize;
public byte byEnableAlarmHandle; //处理报警输入
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 3, ArraySubType = UnmanagedType.I1)]
public byte[] byRes1;
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = NAME_LEN, ArraySubType = UnmanagedType.I1)]
public byte[] byAlarmInName; //模拟报警输入名称
public ushort wAlarmInUpper; //模拟输入电压上限,实际值乘10,范围0~360
public ushort wAlarmInLower; //模拟输入电压下限,实际值乘10,范围0~360
public NET_DVR_HANDLEEXCEPTION_V30 struAlarmHandleType; /* 处理方式 */
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_DAYS * MAX_TIMESEGMENT_V30, ArraySubType = UnmanagedType.Struct)]
public NET_DVR_SCHEDTIME[] struAlarmTime;//布防时间
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_CHANNUM_V30, ArraySubType = UnmanagedType.I1)]
public byte[] byRelRecordChan; //被触发的录像通道
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 100, ArraySubType = UnmanagedType.I1)]
public byte[] byRes2;
}
//上传报警信息(9000扩展)
[StructLayoutAttribute(LayoutKind.Sequential)]
public struct NET_DVR_ALARMINFO_V30
{
public uint dwAlarmType;/*0-信号量报警,1-硬盘满,2-信号丢失,3-移动侦测,4-硬盘未格式化,5-读写硬盘出错,6-遮挡报警,7-制式不匹配, 8-非法访问, 0xa-GPS定位信息(车载定制)*/
public uint dwAlarmInputNumber;/*报警输入端口*/
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_ALARMOUT_V30, ArraySubType = UnmanagedType.I1)]
public byte[] byAlarmOutputNumber;/*触发的输出端口,为1表示对应输出*/
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_CHANNUM_V30, ArraySubType = UnmanagedType.I1)]
public byte[] byAlarmRelateChannel;/*触发的录像通道,为1表示对应录像, dwAlarmRelateChannel[0]对应第1个通道*/
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_CHANNUM_V30, ArraySubType = UnmanagedType.I1)]
public byte[] byChannel;/*dwAlarmType为2或3,6时,表示哪个通道,dwChannel[0]对应第1个通道*/
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_DISKNUM_V30, ArraySubType = UnmanagedType.I1)]
public byte[] byDiskNumber;/*dwAlarmType为1,4,5时,表示哪个硬盘, dwDiskNumber[0]对应第1个硬盘*/
public void Init()
{
dwAlarmType = 0;
dwAlarmInputNumber = 0;
byAlarmRelateChannel = new byte[MAX_CHANNUM_V30];
byChannel = new byte[MAX_CHANNUM_V30];
byAlarmOutputNumber = new byte[MAX_ALARMOUT_V30];
byDiskNumber = new byte[MAX_DISKNUM_V30];
for (int i = 0; i < MAX_CHANNUM_V30; i++)
{
byAlarmRelateChannel[i] = Convert.ToByte(0);
byChannel[i] = Convert.ToByte(0);
}
for (int i = 0; i < MAX_ALARMOUT_V30; i++)
{
byAlarmOutputNumber[i] = Convert.ToByte(0);
}
for (int i = 0; i < MAX_DISKNUM_V30; i++)
{
byDiskNumber[i] = Convert.ToByte(0);
}
}
public void Reset()
{
dwAlarmType = 0;
dwAlarmInputNumber = 0;
for (int i = 0; i < MAX_CHANNUM_V30; i++)
{
byAlarmRelateChannel[i] = Convert.ToByte(0);
byChannel[i] = Convert.ToByte(0);
}
for (int i = 0; i < MAX_ALARMOUT_V30; i++)
{
byAlarmOutputNumber[i] = Convert.ToByte(0);
}
for (int i = 0; i < MAX_DISKNUM_V30; i++)
{
byDiskNumber[i] = Convert.ToByte(0);
}
}
}
[StructLayoutAttribute(LayoutKind.Sequential)]
public struct NET_DVR_ALARM_HOT_SPARE
{
public uint dwSize; //结构体
public uint dwExceptionCase; //报警原因 0-网络异常
public NET_DVR_IPADDR struDeviceIP; //产生异常的设备IP地址
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 256, ArraySubType = UnmanagedType.I1)]
public byte[] byRes; //保留
}
[StructLayoutAttribute(LayoutKind.Sequential)]
public struct NET_DVR_ALARMINFO
{
public int dwAlarmType;/*0-信号量报警,1-硬盘满,2-信号丢失,3-移动侦测,4-硬盘未格式化,5-读写硬盘出错,6-遮挡报警,7-制式不匹配, 8-非法访问, 9-串口状态, 0xa-GPS定位信息(车载定制)*/
public int dwAlarmInputNumber;/*报警输入端口, 当报警类型为9时该变量表示串口状态0表示正常, -1表示错误*/
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_ALARMOUT, ArraySubType = UnmanagedType.U4)]
public int[] dwAlarmOutputNumber;/*触发的输出端口,哪一位为1表示对应哪一个输出*/
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_CHANNUM, ArraySubType = UnmanagedType.U4)]
public int[] dwAlarmRelateChannel;/*触发的录像通道,哪一位为1表示对应哪一路录像, dwAlarmRelateChannel[0]对应第1个通道*/
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_CHANNUM, ArraySubType = UnmanagedType.U4)]
public int[] dwChannel;/*dwAlarmType为2或3,6时,表示哪个通道,dwChannel[0]位对应第1个通道*/
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_DISKNUM, ArraySubType = UnmanagedType.U4)]
public int[] dwDiskNumber;/*dwAlarmType为1,4,5时,表示哪个硬盘, dwDiskNumber[0]位对应第1个硬盘*/
public void Init()
{
dwAlarmType = 0;
dwAlarmInputNumber = 0;
dwAlarmOutputNumber = new int[MAX_ALARMOUT];
dwAlarmRelateChannel = new int[MAX_CHANNUM];
dwChannel = new int[MAX_CHANNUM];
dwDiskNumber = new int[MAX_DISKNUM];
for (int i = 0; i < MAX_ALARMOUT; i++)
{
dwAlarmOutputNumber[i] = 0;
}
for (int i = 0; i < MAX_CHANNUM; i++)
{
dwAlarmRelateChannel[i] = 0;
dwChannel[i] = 0;
}
for (int i = 0; i < MAX_DISKNUM; i++)
{
dwDiskNumber[i] = 0;
}
}
public void Reset()
{
dwAlarmType = 0;
dwAlarmInputNumber = 0;
for (int i = 0; i < MAX_ALARMOUT; i++)
{
dwAlarmOutputNumber[i] = 0;
}
for (int i = 0; i < MAX_CHANNUM; i++)
{
dwAlarmRelateChannel[i] = 0;
dwChannel[i] = 0;
}
for (int i = 0; i < MAX_DISKNUM; i++)
{
dwDiskNumber[i] = 0;
}
}
}
//
//IPC接入参数配置
/* IP设备结构 */
[StructLayoutAttribute(LayoutKind.Sequential)]
public struct NET_DVR_IPDEVINFO
{
public uint dwEnable;/* 该IP设备是否启用 */
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = NAME_LEN, ArraySubType = UnmanagedType.I1)]
public byte[] sUserName;/* 用户名 */
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = PASSWD_LEN, ArraySubType = UnmanagedType.I1)]
public byte[] sPassword; /* 密码 */
public NET_DVR_IPADDR struIP;/* IP地址 */
public ushort wDVRPort;/* 端口号 */
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 34, ArraySubType = UnmanagedType.I1)]
public byte[] byRes;/* 保留 */
public void Init()
{
sUserName = new byte[NAME_LEN];
sPassword = new byte[PASSWD_LEN];
byRes = new byte[34];
}
}
//ipc接入设备信息扩展,支持ip设备的域名添加
[StructLayoutAttribute(LayoutKind.Sequential)]
public struct NET_DVR_IPDEVINFO_V31
{
public byte byEnable;//该IP设备是否有效
public byte byProType;
public byte byEnableQuickAdd;
public byte byRes1;//保留字段,置0
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = NAME_LEN, ArraySubType = UnmanagedType.I1)]
public byte[] sUserName;//用户名
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = PASSWD_LEN, ArraySubType = UnmanagedType.I1)]
public byte[] sPassword;//密码
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_DOMAIN_NAME, ArraySubType = UnmanagedType.I1)]
public byte[] byDomain;//设备域名
public NET_DVR_IPADDR struIP;//IP地址
public ushort wDVRPort;// 端口号
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 34, ArraySubType = UnmanagedType.I1)]
public byte[] byRes2;//保留字段,置0
public void Init()
{
sUserName = new byte[NAME_LEN];
sPassword = new byte[PASSWD_LEN];
byDomain = new byte[MAX_DOMAIN_NAME];
byRes2 = new byte[34];
}
}
/* IP通道匹配参数 */
[StructLayoutAttribute(LayoutKind.Sequential)]
public struct NET_DVR_IPCHANINFO
{
public byte byEnable;/* 该通道是否在线 */
public byte byIPID;/* IP设备ID 取值1- MAX_IP_DEVICE */
public byte byChannel;/* 通道号 */
public byte byIPIDHigh; // IP设备ID的高8位
public byte byTransProtocol;//传输协议类型0-TCP/auto(具体有设备决定),1-UDP 2-多播 3-仅TCP 4-auto
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 31, ArraySubType = UnmanagedType.I1)]
public byte[] byRes;//保留,置0
public void Init()
{
byRes = new byte[31];
}
}
/* IP接入配置结构 */
[StructLayoutAttribute(LayoutKind.Sequential)]
public struct NET_DVR_IPPARACFG
{
public uint dwSize;/* 结构大小 */
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_IP_DEVICE, ArraySubType = UnmanagedType.Struct)]
public NET_DVR_IPDEVINFO[] struIPDevInfo;/* IP设备 */
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_ANALOG_CHANNUM, ArraySubType = UnmanagedType.I1)]
public byte[] byAnalogChanEnable; /* 模拟通道是否启用,从低到高表示1-32通道,0表示无效 1有效 */
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_IP_CHANNEL, ArraySubType = UnmanagedType.Struct)]
public NET_DVR_IPCHANINFO[] struIPChanInfo;/* IP通道 */
public void Init()
{
int i = 0;
struIPDevInfo = new NET_DVR_IPDEVINFO[MAX_IP_DEVICE];
for (i = 0; i < MAX_IP_DEVICE; i++)
{
struIPDevInfo[i].Init();
}
byAnalogChanEnable = new byte[MAX_ANALOG_CHANNUM];
struIPChanInfo = new NET_DVR_IPCHANINFO[MAX_IP_CHANNEL];
for (i = 0; i < MAX_IP_CHANNEL; i++)
{
struIPChanInfo[i].Init();
}
}
}
/* 扩展IP接入配置结构 */
[StructLayoutAttribute(LayoutKind.Sequential)]
public struct NET_DVR_IPPARACFG_V31
{
public uint dwSize;/* 结构大小 */
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_IP_DEVICE, ArraySubType = UnmanagedType.Struct)]
public NET_DVR_IPDEVINFO_V31[] struIPDevInfo; /* IP设备 */
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_ANALOG_CHANNUM, ArraySubType = UnmanagedType.I1)]
public byte[] byAnalogChanEnable; /* 模拟通道是否启用,从低到高表示1-32通道,0表示无效 1有效 */
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_IP_CHANNEL, ArraySubType = UnmanagedType.Struct)]
public NET_DVR_IPCHANINFO[] struIPChanInfo;/* IP通道 */
public void Init()
{
int i = 0;
struIPDevInfo = new NET_DVR_IPDEVINFO_V31[MAX_IP_DEVICE];
for (i = 0; i < MAX_IP_DEVICE; i++)
{
struIPDevInfo[i].Init();
}
byAnalogChanEnable = new byte[MAX_ANALOG_CHANNUM];
struIPChanInfo = new NET_DVR_IPCHANINFO[MAX_IP_CHANNEL];
for (i = 0; i < MAX_IP_CHANNEL; i++)
{
struIPChanInfo[i].Init();
}
}
}
[StructLayoutAttribute(LayoutKind.Sequential)]
public struct NET_DVR_IPSERVER_STREAM
{
public byte byEnable;
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 3, ArraySubType = UnmanagedType.I1)]
public byte[] byRes;
public NET_DVR_IPADDR struIPServer;
public ushort wPort;
public ushort wDvrNameLen;
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = NAME_LEN, ArraySubType = UnmanagedType.I1)]
public byte[] byDVRName;
public ushort wDVRSerialLen;
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 2, ArraySubType = UnmanagedType.U2)]
public ushort[] byRes1;
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = SERIALNO_LEN, ArraySubType = UnmanagedType.I1)]
public byte[] byDVRSerialNumber;
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = NAME_LEN, ArraySubType = UnmanagedType.I1)]
public byte[] byUserName;
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = PASSWD_LEN, ArraySubType = UnmanagedType.I1)]
public byte[] byPassWord;
public byte byChannel;
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 11, ArraySubType = UnmanagedType.I1)]
public byte[] byRes2;
public void Init()
{
byRes = new byte[3];
byDVRName = new byte[NAME_LEN];
byRes1 = new ushort[2];
byDVRSerialNumber = new byte[SERIALNO_LEN];
byUserName = new byte[NAME_LEN];
byPassWord = new byte[PASSWD_LEN];
byRes2 = new byte[11];
}
}
/*流媒体服务器基本配置*/
[StructLayoutAttribute(LayoutKind.Sequential)]
public struct NET_DVR_STREAM_MEDIA_SERVER_CFG
{
public byte byValid;/*是否启用流媒体服务器取流,0表示无效,非0表示有效*/
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 3, ArraySubType = UnmanagedType.I1)]
public byte[] byRes1;
public NET_DVR_IPADDR struDevIP;
public ushort wDevPort;/*流媒体服务器端口*/
public byte byTransmitType;/*传输协议类型 0-TCP,1-UDP*/
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 69, ArraySubType = UnmanagedType.I1)]
public byte[] byRes2;
}
//设备通道信息
[StructLayoutAttribute(LayoutKind.Sequential)]
public struct NET_DVR_DEV_CHAN_INFO
{
public NET_DVR_IPADDR struIP; //DVR IP地址
public ushort wDVRPort; //端口号
public byte byChannel; //通道号
public byte byTransProtocol; //传输协议类型0-TCP,1-UDP
public byte byTransMode; //传输码流模式 0-主码流 1-子码流
public byte byFactoryType; /*前端设备厂家类型,通过接口获取*/
public byte byDeviceType; //设备类型(视频综合平台智能板使用),1-解码器(此时根据视频综合平台能力集中byVcaSupportChanMode字段来决定是使用解码通道还是显示通道),2-编码器
public byte byDispChan;//显示通道号,智能配置使用
public byte bySubDispChan;//显示通道子通道号,智能配置时使用
public byte byResolution; //; 1-CIF 2-4CIF 3-720P 4-1080P 5-500w大屏控制器使用,大屏控制器会根据该参数分配解码资源
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 2, ArraySubType = UnmanagedType.I1)]
public byte[] byRes;
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_DOMAIN_NAME, ArraySubType = UnmanagedType.I1)]
public byte[] byDomain; //设备域名
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = NAME_LEN, ArraySubType = UnmanagedType.I1)]
public byte[] sUserName; //监控主机登陆帐号
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = PASSWD_LEN, ArraySubType = UnmanagedType.I1)]
public byte[] sPassword; //监控主机密码
}
[StructLayoutAttribute(LayoutKind.Sequential)]
public struct NET_DVR_PU_STREAM_CFG
{
public uint dwSize;
public NET_DVR_STREAM_MEDIA_SERVER_CFG struStreamMediaSvrCfg;
public NET_DVR_DEV_CHAN_INFO struDevChanInfo;
}
[StructLayoutAttribute(LayoutKind.Sequential)]
public struct NET_DVR_DDNS_STREAM_CFG
{
public byte byEnable;
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 3, ArraySubType = UnmanagedType.I1)]
public byte[] byRes1;
public NET_DVR_IPADDR struStreamServer;
public ushort wStreamServerPort;
public byte byStreamServerTransmitType;
public byte byRes2;
public NET_DVR_IPADDR struIPServer;
public ushort wIPServerPort;
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 2, ArraySubType = UnmanagedType.I1)]
public byte[] byRes3;
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = NAME_LEN, ArraySubType = UnmanagedType.I1)]
public byte[] sDVRName;
public ushort wDVRNameLen;
public ushort wDVRSerialLen;
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = SERIALNO_LEN, ArraySubType = UnmanagedType.I1)]
public byte[] sDVRSerialNumber;
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = NAME_LEN, ArraySubType = UnmanagedType.I1)]
public byte[] sUserName;
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = PASSWD_LEN, ArraySubType = UnmanagedType.I1)]
public byte[] sPassWord;
public ushort wDVRPort;
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 2, ArraySubType = UnmanagedType.I1)]
public byte[] byRes4;
public byte byChannel;
public byte byTransProtocol;
public byte byTransMode;
public byte byFactoryType;
public void Init()
{
byRes1 = new byte[3];
byRes3 = new byte[2];
sDVRName = new byte[NAME_LEN];
sDVRSerialNumber = new byte[SERIALNO_LEN];
sUserName = new byte[NAME_LEN];
sPassWord = new byte[PASSWD_LEN];
byRes4 = new byte[2];
}
}
[StructLayoutAttribute(LayoutKind.Sequential)]
public struct NET_DVR_PU_STREAM_URL
{
public byte byEnable;
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 240, ArraySubType = UnmanagedType.I1)]
public byte[] strURL;
public byte byTransPortocol;
public Int32 wIPID;
public Int32 byChannel;
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 7, ArraySubType = UnmanagedType.I1)]
public byte[] byRes;
//public void Init()
//{
// strURL = new byte[240];
// byRes = new byte[7];
//}
}
[StructLayoutAttribute(LayoutKind.Sequential)]
public struct NET_DVR_HKDDNS_STREAM
{
public byte byEnable;
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 3, ArraySubType = UnmanagedType.I1)]
public byte[] byRes;
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 64, ArraySubType = UnmanagedType.I1)]
public byte[] byDDNSDomain;
public ushort wPort;
public ushort wAliasLen;
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = NAME_LEN, ArraySubType = UnmanagedType.I1)]
public byte[] byAlias;
public ushort wDVRSerialLen;
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 2, ArraySubType = UnmanagedType.I1)]
public byte[] byRes1;
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = SERIALNO_LEN, ArraySubType = UnmanagedType.I1)]
public byte[] byDVRSerialNumber;
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = NAME_LEN, ArraySubType = UnmanagedType.I1)]
public byte[] byUserName;
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = PASSWD_LEN, ArraySubType = UnmanagedType.I1)]
public byte[] byPassWord;
public byte byChannel;
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 11, ArraySubType = UnmanagedType.I1)]
public byte[] byRes2;
public void Init()
{
byRes = new byte[3];
byDDNSDomain = new byte[64];
byAlias = new byte[NAME_LEN];
byRes1 = new byte[2];
byDVRSerialNumber = new byte[SERIALNO_LEN];
byUserName = new byte[NAME_LEN];
byPassWord = new byte[PASSWD_LEN];
byRes2 = new byte[11];
}
}
[StructLayoutAttribute(LayoutKind.Sequential)]
public struct NET_DVR_IPCHANINFO_V40
{
public byte byEnable; /* 该通道是否在线 */
public byte byRes1;
public ushort wIPID; //IP设备ID
public uint dwChannel; //通道号
public byte byTransProtocol; //传输协议类型0-TCP,1-UDP
public byte byTransMode; //传输码流模式 0-主码流 1-子码流
public byte byFactoryType; /*前端设备厂家类型,通过接口获取*/
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 241, ArraySubType = UnmanagedType.I1)]
public byte[] byRes;
}
[StructLayout(LayoutKind.Explicit)]
public struct NET_DVR_GET_STREAM_UNION
{
[FieldOffset(0)]
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 492, ArraySubType = UnmanagedType.I1)]
public byte[] byUnion;
}
[StructLayoutAttribute(LayoutKind.Sequential)]
public struct NET_DVR_STREAM_MODE
{
public byte byGetStreamType;/*取流方式:0- 直接从设备取流;1- 从流媒体取流;2- 通过IPServer获得IP地址后取流;
* 3- 通过IPServer找到设备,再通过流媒体取设备的流; 4- 通过流媒体由URL去取流;
* 5- 通过hiDDNS域名连接设备然后从设备取流 */
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 3, ArraySubType = UnmanagedType.I1)]
public byte[] byRes;
public NET_DVR_GET_STREAM_UNION uGetStream;
public void Init()
{
byGetStreamType = 0;
byRes = new byte[3];
//uGetStream.Init();
}
}
/* V40扩展IP接入配置结构 */
[StructLayoutAttribute(LayoutKind.Sequential)]
public struct NET_DVR_IPPARACFG_V40
{
public uint dwSize;/* 结构大小 */
public uint dwGroupNum;
public uint dwAChanNum;
public uint dwDChanNum;
public uint dwStartDChan;
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_CHANNUM_V30, ArraySubType = UnmanagedType.I1)]
public byte[] byAnalogChanEnable; /* 模拟通道是否启用,从低到高表示1-32通道,0表示无效 1有效 */
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_IP_DEVICE_V40, ArraySubType = UnmanagedType.Struct)]
public NET_DVR_IPDEVINFO_V31[] struIPDevInfo; /* IP设备 */
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_CHANNUM_V30, ArraySubType = UnmanagedType.Struct)]
public NET_DVR_STREAM_MODE[] struStreamMode;/* IP通道 */
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 20, ArraySubType = UnmanagedType.I1)]
public byte[] byRes2; /* 模拟通道是否启用,从低到高表示1-32通道,0表示无效 1有效 */
}
//为CVR扩展的报警类型
[StructLayoutAttribute(LayoutKind.Sequential)]
public struct NET_DVR_ALARMINFO_DEV
{
public uint dwAlarmType; //0-编码器(通道)信号量报警;1-私有卷二损坏;2- NVR服务退出;
//3-编码器状态异常;4-系统时钟异常;5-录像卷剩余容量过低;
//6-编码器(通道)移动侦测报警;7-编码器(通道)遮挡报警。
public NET_DVR_TIME struTime; //报警时间
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 32, ArraySubType = UnmanagedType.I1)]
public byte[] byRes; //保留
public uint dwNumber; //数目
public IntPtr pNO; //dwNumber个WORD; 每个WORD表示一个通道号,或者磁盘号, 无效时为0
}
/* 报警输出参数 */
[StructLayoutAttribute(LayoutKind.Sequential)]
public struct NET_DVR_IPALARMOUTINFO
{
public byte byIPID;/* IP设备ID取值1- MAX_IP_DEVICE */
public byte byAlarmOut;/* 报警输出号 */
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 18, ArraySubType = UnmanagedType.I1)]
public byte[] byRes;/* 保留 */
public void Init()
{
byRes = new byte[18];
}
}
/* IP报警输出配置结构 */
[StructLayoutAttribute(LayoutKind.Sequential)]
public struct NET_DVR_IPALARMOUTCFG
{
public uint dwSize; /* 结构大小 */
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_IP_ALARMOUT, ArraySubType = UnmanagedType.Struct)]
public NET_DVR_IPALAR