#ifndef __HCNETSDK_H__
#define __HCNETSDK_H__

//#ifdef HCNETSDK_EXPORTS
#define NET_DVR_API extern "C" __declspec(dllexport)
//#else
//#define NET_DVR_API __declspec(dllimport)
//#endif

#define SERIALNO_LEN 48

/*******************查找文件和日志函数返回值*************************/
#define NET_DVR_FILE_SUCCESS		1000	//获得文件信息
#define NET_DVR_FILE_NOFIND			1001	//没有文件
#define NET_DVR_ISFINDING			1002	//正在查找文件
#define	NET_DVR_NOMOREFILE			1003	//查找文件时没有更多的文件
#define	NET_DVR_FILE_EXCEPTION		1004	//查找文件时异常

#define NET_DVR_MAX_USERNUM 52

#define MAX_CHANNEL_NUM 16

#define NET_USER_NUM	128

#define NAME_LEN 32
#define MACADDR_LEN 6
#define MAX_NAMELEN 16
#define LOG_INFO_LEN 4096
#define PTZ_PROTOCOL_NUM 200
#define DESC_LEN 16


/*************************************************
回放时播放控制命令宏定义 
NET_DVR_PlayBackControl
NET_DVR_PlayControlLocDisplay
NET_DVR_DecPlayBackCtrl的宏定义
具体支持查看函数说明和代码
**************************************************/	
#define NET_DVR_PLAYSTART		1//开始播放
#define NET_DVR_PLAYSTOP		2//停止播放
#define NET_DVR_PLAYPAUSE		3//暂停播放
#define NET_DVR_PLAYRESTART		4//恢复播放
#define NET_DVR_PLAYFAST		5//快放
#define NET_DVR_PLAYSLOW		6//慢放
#define NET_DVR_PLAYNORMAL		7//正常速度
#define NET_DVR_PLAYFRAME		8//单帧放
#define NET_DVR_PLAYSTARTAUDIO	9//打开声音
#define NET_DVR_PLAYSTOPAUDIO	10//关闭声音
#define NET_DVR_PLAYAUDIOVOLUME	11//调节音量
#define NET_DVR_PLAYSETPOS		12//改变文件回放的进度
#define NET_DVR_PLAYGETPOS		13//获取文件回放的进度
#define NET_DVR_PLAYGETTIME		14//获取当前已经播放的时间(按文件回放的时候有效)
#define NET_DVR_PLAYGETFRAME	15//获取当前已经播放的帧数(按文件回放的时候有效)
#define NET_DVR_GETTOTALFRAMES  16//获取当前播放文件总的帧数(按文件回放的时候有效)
#define NET_DVR_GETTOTALTIME    17//获取当前播放文件总的时间(按文件回放的时候有效)
#define NET_DVR_THROWBFRAME		20//丢B帧
#define NET_DVR_SETSPEED		24//设置码流速度
#define NET_DVR_KEEPALIVE		25//保持与设备的心跳(如果回调阻塞，建议2秒发送一次)
#define LIGHT_PWRON              2//接通灯光电源 
#define WIPER_PWRON              3//接通雨刷开关 
#define FAN_PWRON                4//接通风扇开关 
#define HEATER_PWRON             5//接通加热器开关 
#define AUX_PWRON1               6//接通辅助设备开关 
#define AUX_PWRON2               7//接通辅助设备开关 
#define SET_PRESET               8//设置预置点 
#define CLE_PRESET               9//清除预置点 
#define ZOOM_IN                 11//焦距以最大速度变大(倍率变大) 
#define ZOOM_OUT                12//焦距以最大速度变小(倍率变小) 
#define FOCUS_NEAR              13//焦点以最大速度前调 
#define FOCUS_FAR               14//焦点以最大速度后调 
#define IRIS_OPEN               15//光圈以最大速度扩大 
#define IRIS_CLOSE              16//光圈以最大速度缩小 
#define TILT_UP                 21//云台以最大速度上仰 
#define TILT_DOWN               22//云台以最大速度下俯 
#define PAN_LEFT                23//云台以最大速度左转 
#define PAN_RIGHT               24//云台以最大速度右转 
#define UP_LEFT                 25//云台以最大速度上仰和左转 
#define UP_RIGHT                26//云台以最大速度上仰和右转 
#define DOWN_LEFT               27//云台以SS的速度下俯和左转 
#define DOWN_RIGHT              28//云台以最大速度下俯和右转 
#define PAN_AUTO                29//云台以最大速度左右自动扫描 
#define FILL_PRE_SEQ            30//将预置点加入巡航序列 
#define SET_SEQ_DWELL           31//设置巡航点停顿时间 
#define SET_SEQ_SPEED           32//设置巡航速度 
#define CLE_PRE_SEQ             33//将预置点从巡航序列中删除 
#define STA_MEM_CRUISE          34//开始记录轨迹 
#define STO_MEM_CRUISE          35//停止记录轨迹 
#define RUN_CRUISE              36//开始轨迹 
#define RUN_SEQ                 37//开始巡航 
#define STOP_SEQ                38//停止巡航 
#define FILL_PRE_SEQ_END        39
#define GOTO_PRESET             39//快球转到预置点 
#define MAX_ALARMOUT             4//

#define MAX_NAMELEN             16 //设备本地登录名长度 
#define MAX_RIGHT               32 //设备支持的权限（1-21表示本地权限，13-32表示远程权限） 
#define NAME_LEN                32 //用户名长度 
#define PASSWD_LEN              16 //密码长度 
#define SERIALNO_LEN            48 //序列号长度 
#define MACADDR_LEN              6 //MAC地址长度 
#define MAX_ETHERNET             2 //设备可配以太网络 
#define PATHNAME_LEN           128 //路径长度 
#define MAX_TIMESEGMENT_V30      24 //V3.0以上版本支持的设备的最大时间段数 
#define MAX_TIMESEGMENT          4 //V3.0以下版本支持的设备的最大时间段数 
#define MAX_SHELTERNUM           4 //V3.0以下版本支持的设备的最大遮挡区域数 
#define MAX_DAYS                 7 //每周的天数 
#define PHONENUMBER_LEN         32 //PPPoE拨号号码最大长度 
#define MAX_DISKNUM_V30         33 //V3.0以上版本支持的设备的最大硬盘数，最多33个硬盘(包括16个内置SATA硬盘、1个eSATA硬盘和16个NFS盘) 
#define MAX_DISKNUM             16 //V3.0以下版本支持的设备的最大硬盘数 
#define MAX_DISKNUM_V10          8 //1.2版本之前版本 
#define MAX_WINDOW_V30          32 //V3.0以上版本支持的设备的本地显示最大播放窗口数 
#define MAX_WINDOW              16 //V3.0以下版本支持的设备的本地显示最大播放窗口数 
#define MAX_VGA_V30              4 //V3.0以上版本支持的设备的最大可接VGA数 
#define MAX_VGA                  1 //V3.0以下版本支持的设备的最大可接VGA数 
#define MAX_USERNUM_V30         12 //V3.0以上版本支持的设备的最大用户数 
#define MAX_USERNUM             16 //V3.0以下版本支持的设备的最大用户数 
#define MAX_EXCEPTIONNUM_V30    32 // V3.0以上版本支持的设备的最大异常处理数 
#define MAX_EXCEPTIONNUM        16 //V3.0以下版本支持的设备的最大异常处理数 
#define MAX_LINK                 6 //V3.0以下版本支持的设备的单通道最大视频流连接数 
#define MAX_DECPOOLNUM           4 //单路解码器每个解码通道最大可循环解码数 
#define MAX_DECNUM               4 //单路解码器的最大解码通道数（实际只有一个，其他三个保留） 
#define MAX_TRANSPARENTNUM       2 //单路解码器可配置最大透明通道数 
#define MAX_CYCLE_CHAN          16 //单路解码器最大轮循通道数 
#define MAX_CYCLE_CHAN_V30      64 //最大轮询通道数（扩展） 
#define MAX_DIRNAME_LENGTH      80 //最大目录长度 
#define MAX_WINDOWS             16 //最大窗口数 
#define MAX_STRINGNUM_V30        8 //V3.0以上版本支持的设备的最大OSD字符行数 
#define MAX_STRINGNUM            4 //V3.0以下版本支持的设备的最大OSD字符行数 
#define MAX_AUXOUT               4 //V3.0以下版本支持的设备的最大辅助输出数 
#define MAX_HD_GROUP            16 //V3.0以上版本支持的设备的最大硬盘组数 
#define MAX_NFS_DISK             8 //V3.0以下版本支持的设备的最大NFS硬盘数 
#define IW_ESSID_MAX_SIZE       32 //WIFI的SSID号长度 
#define IW_ENCODING_TOKEN_MAX   32 //WIFI密钥最大字节数 
#define MAX_SERIAL_NUM          64 //最多支持的透明通道路数 
#define MAX_DDNS_NUMS           10 //V3.0以上版本支持的设备最大可配DDNS数 
#define MAX_DOMAIN_NAME         64 //最大域名长度 
#define MAXPROGRESS            100 //回放时的最大百分率 
#define MAX_SERIALNUM            2 //设备支持的串口数：1-232，2-485 
#define CARDNUM_LEN             20 //卡号长度 
#define MAX_VIDEOOUT_V30         4 //V3.0以上版本支持的设备的视频输出数 
#define MAX_VIDEOOUT             2 //V3.0以下版本支持的设备的视频输出数 
#define MAX_EMAIL_ADDR_LEN      48 //最大EMAIL地址长度 
#define MAX_EMAIL_PWD_LEN       32 //最大EMAIL密码长度 
#define MAX_PRESET_V30         256 //V3.0以上版本支持的设备支持的云台预置点数 
#define MAX_TRACK_V30          256 //V3.0以上版本支持的设备支持的云台轨迹数 
#define MAX_CRUISE_V30         256 //V3.0以上版本支持的设备支持的云台巡航数 
#define MAX_PRESET             128 //V3.0以下版本支持的设备支持的云台预置点数 
#define MAX_TRACK              128 //V3.0以下版本支持的设备支持的云台轨迹数 
#define MAX_CRUISE             128 //V3.0以下版本支持的设备支持的云台巡航数 
#define CRUISE_MAX_PRESET_NUMS  32 //一条巡航最多的巡航点 
#define MAX_SERIAL_PORT          8 //V3.0以上版本支持的设备支持232串口数 
#define MAX_PREVIEW_MODE         8 //设备支持最大预览模式数目 1画面,4画面,9画面,16画面.... 
#define MAX_MATRIXOUT           16 //最大模拟矩阵输出个数 
#define LOG_INFO_LEN         4096//11840 //日志附加信息长度 
#define DESC_LEN                16 //云台描述字符串长度 
#define PTZ_PROTOCOL_NUM       200 //V3.0以上版本支持的设备最大支持的云台协议数 
#define MAX_AUDIO                1 //V3.0以下版本支持的设备的语音对讲通道数 
#define MAX_AUDIO_V30            2 //V3.0以上版本支持的设备的语音对讲通道数 
#define MAX_CHANNUM             16 //V3.0以下版本支持的设备的最大通道数 
#define MAX_ALARMIN             16 //V3.0以下版本支持的设备的最大报警输入数 
#define MAX_ALARMOUT             4 //V3.0以下版本支持的设备的最大报警输出数 
#define MAX_ANALOG_CHANNUM      32 //最大32个模拟通道 
#define MAX_ANALOG_ALARMOUT     32 //最大32路模拟报警输出 
#define MAX_ANALOG_ALARMIN      32 //最大32路模拟报警输入 
#define MAX_IP_DEVICE           32 //允许接入的最大IP设备数 
#define MAX_IP_CHANNEL          32 //允许加入的最多IP通道数 
#define MAX_IP_ALARMIN         128 //允许加入的最多报警输入数 
#define MAX_IP_ALARMOUT         64 //允许加入的最多报警输出数 
#define MAX_CHANNUM_V30         64 //(MAX_ANALOG_CHANNUM + MAX_IP_CHANNEL) 
#define MAX_ALARMOUT_V30        96 //(MAX_ANALOG_ALARMOUT + MAX_IP_ALARMOUT) 
#define MAX_ALARMIN_V30        160 //(MAX_ANALOG_ALARMIN + MAX_IP_ALARMIN) 
#define MAX_RULE_NUM             8 //最大规则条数 
#define MAX_TIMESEGMENT_2        2 //最大时间段数 
#define VCA_MAX_POLYGON_POINT_NUM 10// 检测区域最多支持10个点的多边形 
#define MAX_TARGET_NUM          30 //最大目标个数 
#define MAX_VCA_CHAN            16 //最大智能通道数 
#define IW_ESSID_MAX_SIZE       32 //SSID的长度 
#define WIFI_WEP_MAX_KEY_COUNT   4 //最大密钥个数 
#define WIFI_WEP_MAX_KEY_LENGTH 33 //最大密钥长度 
#define WIFI_WPA_PSK_MAX_KEY_LENGTH 63 //加密字符的最大长度 
#define WIFI_WPA_PSK_MIN_KEY_LENGTH  8 //加密字符的最小长度 
#define WIFI_MAX_AP_COUNT           20 //无线AP的最大个数 
#define NET_DVR_MAX_DISPREGION      16 //每个显示通道最多可以显示的窗口 
#define MAX_DECODECHANNUM           32 //多路解码器最大解码通道数 
#define MAX_DISPCHANNUM             24 //多路解码器最大显示通道数 
#define MAX_NET_DISK                16 //最大网络硬盘数 
#define MAX_ATM_PROTOCOL_NUM       256 //ATM最大协议数 
#define ATM_PROTOCOL_SORT            4 //ATM协议段数 
#define ATM_DESC_LEN                32 //ATM描述字符串长度 
#define MAX_ACTION_TYPE             12 //ATM自定义协议叠加交易行为最大行为个数 
#define SEARCH_EVENT_INFO_LEN      300 //事件信息长度 
#define MAX_MASK_REGION_NUM          4 //最大屏蔽区域个数 
#define MAX_CALIB_PT                 6 //最大标定点个数 

#define MAJOR_ALARM 0x1 //报警 
#define MAJOR_EXCEPTION 0x2 //异常 
#define MAJOR_OPERATION 0x3 //操作 
#define MAJOR_INFORMATION 0x4 //日志附加信息 
//alarm subtype
#define MINOR_ALARM_IN 0x1 //报警输入 
#define MINOR_ALARM_OUT 0x2 //报警输出 
#define MINOR_MOTDET_START 0x3 //移动侦测报警开始 
#define MINOR_MOTDET_STOP 0x4 //移动侦测报警结束 
#define MINOR_HIDE_ALARM_START 0x5 //遮挡报警开始 
#define MINOR_HIDE_ALARM_STOP 0x6 //遮挡报警结束 
#define MINOR_VCA_ALARM_START 0x7 //智能报警开始 
#define MINOR_VCA_ALARM_STOP 0x8 //智能报警结束 
//exception
#define MINOR_VI_LOST 0x21 //视频信号丢失 
#define MINOR_ILLEGAL_ACCESS 0x22 //非法访问 
#define MINOR_HD_FULL 0x23 //硬盘满 
#define MINOR_HD_ERROR 0x24 //网络硬盘错误，录像异常 
#define MINOR_DCD_LOST 0x25 //MODEM 掉线(保留) 
#define MINOR_IP_CONFLICT 0x26 //IP地址冲突 
#define MINOR_NET_BROKEN 0x27 //网络断开 
#define MINOR_REC_ERROR 0x28 //录像出错 
#define MINOR_IPC_NO_LINK 0x29 //IPC连接异常 
#define MINOR_VI_EXCEPTION 0x2a //视频输入异常(只针对模拟通道) 
#define MINOR_IPC_IP_CONFLICT 0x2b //IPC的IP地址冲突
//operation 
#define MINOR_START_DVR 0x41 //开机 
#define MINOR_STOP_DVR 0x42 //关机 
#define MINOR_STOP_ABNORMAL 0x43 //异常关机 
#define MINOR_REBOOT_DVR 0x44 //本地重启设备 
#define MINOR_LOCAL_LOGIN 0x50 //本地登陆 
#define MINOR_LOCAL_LOGOUT 0x51 //本地注销登陆 
#define MINOR_LOCAL_CFG_PARM 0x52 //本地配置参数 
#define MINOR_LOCAL_PLAYBYFILE 0x53 //本地按文件回放或下载 
#define MINOR_LOCAL_PLAYBYTIME 0x54 //本地按时间回放或下载 
#define MINOR_LOCAL_START_REC 0x55 //本地开始录像 
#define MINOR_LOCAL_STOP_REC 0x56 //本地停止录像 
#define MINOR_LOCAL_PTZCTRL 0x57 //本地云台控制 
#define MINOR_LOCAL_PREVIEW 0x58 //本地预览(保留不使用) 
#define MINOR_LOCAL_MODIFY_TIME 0x59 //本地修改时间(保留不使用) 
#define MINOR_LOCAL_UPGRADE 0x5a //本地升级 
#define MINOR_LOCAL_RECFILE_OUTPUT 0x5b //本地备份录象文件 
#define MINOR_LOCAL_FORMAT_HDD 0x5c //本地初始化硬盘 
#define MINOR_LOCAL_CFGFILE_OUTPUT 0x5d //导出本地配置文件 
#define MINOR_LOCAL_CFGFILE_INPUT 0x5e //导入本地配置文件 
#define MINOR_LOCAL_COPYFILE 0x5f //本地备份文件 
#define MINOR_LOCAL_LOCKFILE 0x60 //本地锁定录像文件 
#define MINOR_LOCAL_UNLOCKFILE 0x61 //本地解锁录像文件 
#define MINOR_LOCAL_DVR_ALARM 0x62 //本地手动清除和触发报警 
#define MINOR_IPC_ADD 0x63 //本地添加IPC 
#define MINOR_IPC_DEL 0x64 //本地删除IPC 
#define MINOR_IPC_SET 0x65 //本地设置IPC 
#define MINOR_LOCAL_START_BACKUP 0x66 //本地开始备份 
#define MINOR_LOCAL_STOP_BACKUP 0x67 //本地停止备份 
#define MINOR_LOCAL_COPYFILE_START_TIME 0x68 //本地备份开始时间 
#define MINOR_LOCAL_COPYFILE_END_TIME 0x69 //本地备份结束时间 
#define MINOR_LOCAL_ADD_NAS 0x6a //本地添加网络硬盘 
#define MINOR_LOCAL_DEL_NAS 0x6b //本地删除NAS盘 
#define MINOR_LOCAL_SET_NAS 0x6c //本地设置NAS盘 
#define MINOR_REMOTE_LOGIN 0x70 //远程登录 
#define MINOR_REMOTE_LOGOUT 0x71 //远程注销登陆 
#define MINOR_REMOTE_START_REC 0x72 //远程开始录像 
#define MINOR_REMOTE_STOP_REC 0x73 //远程停止录像 
#define MINOR_START_TRANS_CHAN 0x74 //开始透明传输 
#define MINOR_STOP_TRANS_CHAN 0x75 //停止透明传输 
#define MINOR_REMOTE_GET_PARM 0x76 //远程获取参数 
#define MINOR_REMOTE_CFG_PARM 0x77 //远程配置参数 
#define MINOR_REMOTE_GET_STATUS 0x78 //远程获取状态 
#define MINOR_REMOTE_ARM 0x79 //远程布防 
#define MINOR_REMOTE_DISARM 0x7a //远程撤防 
#define MINOR_REMOTE_REBOOT 0x7b //远程重启 
#define MINOR_START_VT 0x7c //开始语音对讲 
#define MINOR_STOP_VT 0x7d //停止语音对讲 
#define MINOR_REMOTE_UPGRADE 0x7e //远程升级 
#define MINOR_REMOTE_PLAYBYFILE 0x7f //远程按文件回放 
#define MINOR_REMOTE_PLAYBYTIME 0x80 //远程按时间回放 
#define MINOR_REMOTE_PTZCTRL 0x81 //远程云台控制 
#define MINOR_REMOTE_FORMAT_HDD 0x82 //远程格式化硬盘 
#define MINOR_REMOTE_STOP 0x83 //远程关机 
#define MINOR_REMOTE_LOCKFILE 0x84 //远程锁定文件 
#define MINOR_REMOTE_UNLOCKFILE 0x85 //远程解锁文件 
#define MINOR_REMOTE_CFGFILE_OUTPUT 0x86 //远程导出配置文件 
#define MINOR_REMOTE_CFGFILE_INTPUT 0x87 //远程导入配置文件 
#define MINOR_REMOTE_RECFILE_OUTPUT 0x88 //远程导出录象文件 
#define MINOR_REMOTE_DVR_ALARM 0x89 //远程手动清除和触发报警 
#define MINOR_REMOTE_IPC_ADD 0x8a //远程添加IPC 
#define MINOR_REMOTE_IPC_DEL 0x8b //远程删除IPC 
#define MINOR_REMOTE_IPC_SET 0x8c //远程设置IPC 
#define MINOR_REBOOT_VCA_LIB 0x8d //重启智能库 
#define MINOR_REMOTE_ADD_NAS 0x8e //远程添加NAS盘 
#define MINOR_REMOTE_DEL_NAS 0x8f //远程删除NAS盘 
#define MINOR_REMOTE_SET_NAS 0x90 //远程设置NAS盘 
//  information
#define MINOR_HDD_INFO 0xa1 //硬盘信息 
#define MINOR_SMART_INFO 0xa2 //S.M.A.R.T信息 
#define MINOR_REC_START 0xa3 //开始录像 
#define MINOR_REC_STOP 0xa4 //停止录像 
#define MINOR_REC_OVERDUE 0xa5 //过期录像删除 
#define MINOR_LINK_START 0xa6 //连接前端设备 
#define MINOR_LINK_STOP 0xa7 //断开前端设备 
#define MINOR_NET_DISK_INFO 0xa8 //网络硬盘信息 

#define NET_DVR_SET_DEVICECFG         101  //设置设备参数 NET_DVR_DEVICECFG 
#define NET_DVR_SET_TIMECFG           119  //设置时间参数 NET_DVR_TIME 
#define NET_DVR_SET_NETCFG            103  //设置网络参数 NET_DVR_NETCFG 
#define NET_DVR_SET_NETCFG_V30      1001 //设置网络参数 NET_DVR_NETCFG_V3
#define NET_DVR_SET_PICCFG            105  //设置图像参数 NET_DVR_PICCFG 
#define NET_DVR_SET_PICCFG_EX         201  //设置图像参数（扩展） NET_DVR_PICCFG_EX 
#define NET_DVR_SET_PICCFG_V30        1003 //设置图像参数 NET_DVR_PICCFG_V30
#define NET_DVR_SET_COMPRESSCFG       107  //设置压缩参数 NET_DVR_COMPRESSIONCFG
#define NET_DVR_SET_EVENTCOMPCFG      133  //设置事件触发录像参数 NET_DVR_COMPRESSIONCF
#define NET_DVR_SET_COMPRESSCFG_EX    205  //设置压缩参数（扩展） NET_DVR_COMPRESSIONCFG_EX 
#define NET_DVR_SET_COMPRESSCFG_V30   1041 //设置压缩参数 NET_DVR_COMPRESSIONCFG_V30
#define NET_DVR_SET_RECORDCFG         109  //设置录像参数 NET_DVR_RECORD
#define NET_DVR_SET_RECORDCFG_V30     1005 //设置录像参数 NET_DVR_RECORD_V30
#define NET_DVR_SET_DECODERCFG        111  //设置（云台）解码器参数 NET_DVR_DECODERCFG
#define NET_DVR_SET_DECODERCFG_V30    1043 //设置（云台）解码器参数 NET_DVR_DECODERCFG_V30
#define NET_DVR_SET_RS232CFG          113  //设置232串口参数 NET_DVR_RS232CFG 
#define NET_DVR_SET_RS232CFG_V30      1037 //设置232串口参数 NET_DVR_RS232CFG_V30
#define NET_DVR_SET_ALARMINCFG        115  //设置报警输入参数 NET_DVR_ALARMINCFG
#define NET_DVR_SET_ALARMINCFG_V30    1025 //设置报警输入参数 NET_DVR_ALARMINCFG_V30
#define NET_DVR_SET_ALARMOUTCFG       117  //设置报警输出参数 NET_DVR_ALARMOUTCFG
#define NET_DVR_SET_ALARMOUTCFG_V30   1027 //设置报警输出参数 NET_DVR_ALARMOUTCFG_V30 
#define NET_DVR_SET_PREVIEWCFG        121  //设置本地预览参数 NET_DVR_PREVIEWCFG 
#define NET_DVR_SET_PREVIEWCFG_AUX    143  //设置-s系列双输出预览参数 NET_DVR_PREVIEWCFG
#define NET_DVR_SET_PREVIEWCFG_V30    1045 //设置本地预览参数 NET_DVR_PREVIEWCFG_V30
#define NET_DVR_SET_PREVIEWCFG_AUX_V30 1047 //设置辅助预览参数 NET_DVR_PREVIEWCFG_V30 
#define NET_DVR_SET_VIDEOOUTCFG       123  //设置视频输出参数 NET_DVR_VIDEOOUT 
#define NET_DVR_SET_VIDEOOUTCFG_V30   1029 //设置视频输出参数 NET_DVR_VIDEOOUT_V30
#define NET_DVR_SET_USERCFG           125  //设置用户参数 NET_DVR_USER
#define NET_DVR_SET_USERCFG_EX        203  //设置用户参数 NET_DVR_USER_EX
#define NET_DVR_SET_USERCFG_V30       1007 //设置用户参数 NET_DVR_USER_V30
#define NET_DVR_SET_EXCEPTIONCFG      127  //设置异常参数 NET_DVR_EXCEPTION
#define NET_DVR_SET_EXCEPTIONCFG_V30  1035 //设置异常参数 NET_DVR_EXCEPTION_V30   
#define NET_DVR_SET_ZONEANDDST        129  //设置时区和夏时制参数 NET_DVR_ZONEANDDST
#define NET_DVR_SET_SHOWSTRING        131  //设置叠加字符参数 NET_DVR_SHOWSTRING  
#define NET_DVR_SET_SHOWSTRING_V30    1031 //设置叠加字符参数 NET_DVR_SHOWSTRING_V30
#define NET_DVR_SET_AUXOUTCFG         141  //设置报警触发辅助输出参数 NET_DVR_AUXOUTCFG
#define NET_DVR_SET_NETAPPCFG         223  //设置网络应用参数(NTP/DDNS) NET_DVR_NETAPPCFG  
#define NET_DVR_SET_NTPCFG            225  //设置网络应用参数(NTP) NET_DVR_NTPPARA
#define NET_DVR_SET_DDNSCFG           227  //设置网络应用参数(DDNS) NET_DVR_DDNSPARA
#define NET_DVR_SET_DDNSCFG_EX        275  //设置网络应用参数(DDNS) NET_DVR_DDNSPARA_EX 
#define NET_DVR_SET_DDNSCFG_V30       1011 //设置网络应用参数(DDNS) NET_DVR_DDNSPARA_V30
#define NET_DVR_SET_EMAILPARACFG      251  //设置网络应用参数(EMAIL) NET_DVR_EMAILCFG 
#define NET_DVR_SET_EMAILCFG_V30      1013 //设置网络应用参数(EMAIL) NET_DVR_EMAILCFG_V30
#define NET_DVR_SET_NFSCFG            231  //设置NFS（网络文件系统）参数 NET_DVR_NFSCFG
#define NET_DVR_SET_IPPARACFG         1049 //设置IP接入配置参数 NET_DVR_IPPARACFG
#define NET_DVR_SET_IPPARACFG_V31     1061 //设置IP接入配置参数 NET_DVR_IPPARACFG_V31 
#define NET_DVR_SET_HDCFG             1055 //设置硬盘管理参数 NET_DVR_HDCFG 
#define NET_DVR_SET_HDGROUP_CFG       1057 //设置盘组管理参数 NET_DVR_HDGROUP_CFG 
#define NET_DVR_SET_PTZPOS            292  //设置IP快球PTZ参数  NET_DVR_PTZPOS
#define NET_DVR_SET_CRUISE            1021 //设置巡航参数 NET_DVR_CRUISE_PARA 
#define NET_DVR_SET_COMPRESSCFG_AUD   1059 //设置语音对讲音频参数 NET_DVR_COMPRESSION_AUDIO
#define NET_DVR_SET_WIFI_CFG          306  //设置IP监控设备无线参数 NET_DVR_WIFI_CFG
#define NET_DVR_SET_WIFI_WORKMODE     308  //设置IP监控设备网口参数 NET_DVR_WIFI_WORKMODE
#define NET_DVR_SET_NET_DISKCFG       1039 //设置网络硬盘接入参数 NET_DVR_NET_DISKCFG  

#define NET_DVR_GET_TIMECFG 118  //获取时间参数 NET_DVR_TIME
#define NET_DVR_GET_HDCFG 1054   //获取硬盘管理参数 NET_DVR_HDCFG  


#define COMM_ALARM_V30 0x4000

/********************预览回调函数*********************/
#define NET_DVR_SYSHEAD			1	//系统头数据
#define NET_DVR_STREAMDATA		2	//视频流数据（包括复合流和音视频分开的视频流数据）
#define NET_DVR_AUDIOSTREAMDATA	3	//音频流数据
#define NET_DVR_STD_VIDEODATA	4	//标准视频流数据
#define NET_DVR_STD_AUDIODATA	5	//标准音频流数据
#define NET_DVR_GET_DECODERCFG 110  //获取云台参数
#define NET_DVR_GET_NETCFG_V30   1000  //获取网络参数
#define NET_DVR_GET_DECODERCFG_V30 1042  //获取云台参数
#define NET_DVR_GET_NETAPPCFG 222 //获取网络应用参数(NTP/DDNS)
#define NET_DVR_GET_NTPCFG 224 //获取网络应用参数(NTP)
#define NET_DVR_GET_DDNSCFG_V30 1010 //获取网络应用参数(DDNS)
#define NET_DVR_GET_EMAILCFG_V30 1012 //获取网络应用参数(EMAIL)
#define NET_DVR_GET_PREVIEWCFG_V30 1044 //获取本地预览参数
#define NET_DVR_GET_PICCFG_V30      1002 //获取图像参数
#define NET_DVR_GET_RECORDCFG_V30    1004 //获取录像参数
#define NET_DVR_GET_COMPRESSCFG_V30  1040 //获取压缩参数 
#define NET_DVR_GET_VIDEOOUTCFG_V30   1028 //获取视频输出参数
#define NET_DVR_GET_DEVICECFG         100  //获取设备参数
#define NET_DVR_GET_USERCFG_V30       1006 //获取用户参数
#define NET_DVR_GET_ALARMOUTCFG_V30   1026 //获取报警输出参数
#define NET_DVR_GET_ALARMINCFG_V30    1024 //获取报警输入参数

#define EXCEPTION_EXCHANGE 0x8000 //用户交互时异常 
#define EXCEPTION_AUDIOEXCHANGE 0x8001 //语音对讲异常 
#define EXCEPTION_ALARM 0x8002 //报警异常 
#define EXCEPTION_PREVIEW 0x8003 //网络预览异常 
#define EXCEPTION_SERIAL 0x8004 //透明通道异常 
#define EXCEPTION_RECONNECT 0x8005 //预览时重连 
#define EXCEPTION_ALARMRECONNECT 0x8006 //报警时重连 
#define EXCEPTION_SERIALRECONNECT 0x8007 //透明通道重连 
#define EXCEPTION_SERIALRECONSUCCESS 0x8008 //透明通道重连成功 
#define EXCEPTION_PLAYBACK 0x8010 //回放异常 
#define EXCEPTION_DISKFMT 0x8011// 硬盘格式化 
#define EXCEPTION_PASSIVEDECODE 0x8012 //被动解码异常 

//begin of new function
#define NET_DVR_GET_FTPCFG		10000//get ftp configuration
#define NET_DVR_GET_FTPTASK		10001//get ftp task schedule
#define NET_DVR_GET_IPFILTER	10002//get ip filter table
#define NET_DVR_GET_SERVCFG		10003//get service configuration
#define NET_DVR_GET_HTTPCFG		10004//get web configuration
#define NET_DVR_GET_3GCFG		10005//get 3g configuration
#define NET_DVR_GET_LOCALLINK	10006//get local link configuration
#define NET_GET_VERSIONINFO     10007//get version
#define NET_GET_REC_SCHEDULE     10008//get rec schedule
#define NET_DVR_GET_HDDFULL_EXPCFG       10009//get hdd full config
#define NET_DVR_GET_HDDERR_EXPCFG        10010//get hdd err config
#define NET_DVR_GET_NETDISCONNECT_EXPCFG 10011//get net disconnect config
#define NET_DVR_GET_IPCONFLICT_EXPCFG    10012//get ip conflict config
#define NET_DVR_GET_PPPOECFG             10013//get pppoecfg
#define NET_DVR_GET_LINKTYPE             10014//get linktype
#define NET_DVR_GET_UPNP_STATE           10015//get upnp state
#define NET_DVR_GET_OUTPUT_CFG           10016//get output cfg

#define NET_DVR_SET_FTPCFG		20000//set ftp configuration
#define NET_DVR_SET_FTPTASK		20001//set ftp task schedule
#define NET_DVR_SET_IPFILTER	20002//set ip filter table
#define NET_DVR_SET_SERVCFG		20003//set service configuration
#define NET_DVR_SET_HTTPCFG		20004//set web configuration
#define NET_DVR_SET_3GCFG		20005//set 3g configuration
#define NET_DVR_SET_LOCALLINK	20006//set local link configuration
#define NET_SET_REC_SCHEDULE     20008//set rec schedule
#define NET_DVR_SET_HDDFULL_EXPCFG       20009//set hdd full config
#define NET_DVR_SET_HDDERR_EXPCFG        20010//set hdd err config
#define NET_DVR_SET_NETDISCONNECT_EXPCFG 20011//set net disconnect config
#define NET_DVR_SET_IPCONFLICT_EXPCFG    20012//set ip conflict config
#define NET_DVR_SET_PPPOECFG             20013//set pppoecfg
#define NET_DVR_SET_LINKTYPE             20014//set linktype
#define NET_DVR_SET_UPNP_STATE           20015//set upnp state
#define NET_DVR_SET_OUTPUT_CFG           20016//set output cfg

#define NET_DVR_SHUTDOWN                 30000//set dvr shutdown
#define NET_DVR_REBOOT					 30001//set dvr reboot

#define NET_DVR_RESTORE                  30010 // set dvr restore
#define NET_DVR_SET_AUTO_REBOOT_CFG      30011 // set dvr auto reboot
#define NET_DVR_GET_AUTO_REBOOT_CFG      30012 // get dvr auto reboot

#define NET_DVR_GET_HDD_CFG              30013 // get dvr hdd cfg
#define NET_DVR_INIT_HDD                 30014 // init dvr hdd 

#define NET_DVR_SET_SYSGENERAL_CFG       30015 // set dvr system general cfg
#define NET_DVR_GET_SYSGENERAL_CFG       30016 // get dvr system general cfg

#define NET_DVR_SET_DST_CFG              30017 // set dvr dst cfg
#define NET_DVR_GET_DST_CFG              30018 // get dvr dst cfg

//end of new function
typedef struct 
{
	/*I帧为x0dc，x在第一个字节，0为第二个字节，d为第三个字节，c为第四个字节，p 帧为x1dc*/
	unsigned char channel;
	unsigned char frametype;
	unsigned char resv0;
	unsigned char resv1;
	unsigned int streamtype;   /*流格式：暂时固定为H264，ASCII*/
	unsigned int framelen;     /*仅视频帧数据长度*/
	unsigned short extenlen;    /*仅扩展数据长度*/
	unsigned short externmod;   /*扩展模式*/
	__int64 pts;          /*时间戳*/
}video_head_t;

typedef struct 
{
	unsigned char channel;
	unsigned char frametype;
	unsigned char resv0;
	unsigned char resv1;
	unsigned short framelen;     /*一个音频帧长度*/
	unsigned short datalen;    /*此包音频数据长度*/
}audio_head_t;

typedef struct tagNET_DVR_TIME{
	unsigned int    dwYear;
	unsigned int    dwMonth;
	unsigned int    dwDay;
	unsigned int    dwHour;
	unsigned int    dwMinute;
	unsigned int    dwSecond;
}NET_DVR_TIME, *LPNET_DVR_TIME;


typedef struct tagNET_DVR_FINDDATA_V30{
	char             sFileName[100];
	NET_DVR_TIME     struStartTime;
	NET_DVR_TIME     struStopTime;
	DWORD            dwFileSize;
	char             sCardNum[32];
	BYTE             byLocked;
	BYTE             byRes[3];
}NET_DVR_FINDDATA_V30,*LPNET_DVR_FINDDATA_V30;


typedef struct tagNET_DVR_FILECOND{
	LONG             lChannel;
	DWORD            dwFileType;
	DWORD            dwIsLocked;
	DWORD            dwUseCardNo;
	BYTE             sCardNumber[32];
	NET_DVR_TIME     struStartTime;
	NET_DVR_TIME     struStopTime;
}NET_DVR_FILECOND,*LPNET_DVR_FILECOND;


typedef struct tagNET_DVR_CLIENTINFO{
	LONG    lChannel;
	LONG    lLinkMode;
	HWND    hPlayWnd;
	char    *sMultiCastIP;
}NET_DVR_CLIENTINFO, *LPNET_DVR_CLIENTINFO;

typedef struct tagNET_DVR_DEVICEINF0{
	BYTE     sSerialNumber[SERIALNO_LEN];
	BYTE     byAlarmInPortNum;
	BYTE     byAlarmOutPortNum;
	BYTE     byDiskNum;
	BYTE     byDVRType;
	BYTE     byChanNum;
	BYTE     byStartChan;
}NET_DVR_DEVICEINFO,*LPNET_DVR_DEVICEINFO;


typedef struct tagNET_DVR_DEVICEINFO_V30{
	char     sSerialNumber[SERIALNO_LEN];
	char     byAlarmInPortNum;
	char     byAlarmOutPortNum;
	char     byDiskNum;
	char     byDVRType;
	char     byChanNum;
	char     byStartChan;
	char     byAudioChanNum;
	char     byIPChanNum;
	char     byRes1[24];
	unsigned int channelTypes[4];
	int norm;//PAL:0 NTSC:1
	int      b485;
}NET_DVR_DEVICEINFO_V30,*LPNET_DVR_DEVICEINFO_V30;

typedef struct tagNET_DVR_JPEGPARA{
	WORD     wPicSize;
	WORD     wPicQuality;
}NET_DVR_JPEGPARA,*LPNET_DVR_JPEGPARA;

typedef struct tagNET_DVR_ALARMER{
	BYTE     byUserIDValid;
	BYTE     bySerialValid;
	BYTE     byVersionValid;
	BYTE     byDeviceNameValid;
	BYTE     byMacAddrValid;
	BYTE     byLinkPortValid;
	BYTE     byDeviceIPValid;
	BYTE     bySocketIPValid;
	LONG     lUserID;
	BYTE     sSerialNumber[SERIALNO_LEN];
	DWORD    dwDeviceVersion;
	char     sDeviceName[NAME_LEN];
	BYTE     byMacAddr[MACADDR_LEN];
	WORD     wLinkPort;
	char     sDeviceIP[128];
	char     sSocketIP[128];
	BYTE     byIpProtocol;
	BYTE     byRes2[11];
}NET_DVR_ALARMER,*LPNET_DVR_ALARMER;


typedef void(CALLBACK*MSGCallBack)(
								   LONG               lCommand,
								   NET_DVR_ALARMER    *pAlarmer,
								   char               *pAlarmInfo,
								   DWORD              dwBufLen,
								   void               *pUser
								   );

typedef void(CALLBACK *fExceptionCallBack)(
										   DWORD    dwType,
										   LONG     lUserID,
										   LONG     lHandle,
										   void     *pUser
										   );

typedef struct tagNET_DVR_IPADDR{
	char    sIpV4[16];
	char    sIpV6[128];
}NET_DVR_IPADDR, *LPNET_DVR_IPADDR;


typedef struct tagNET_DVR_LOG_V30{
	NET_DVR_TIME     strLogTime;
	DWORD            dwMajorType;
	DWORD            dwMinorType;
	BYTE             sPanelUser[MAX_NAMELEN];
	BYTE             sNetUser[MAX_NAMELEN];
	NET_DVR_IPADDR   struRemoteHostAddr;
	DWORD            dwParaType;
	DWORD            dwChannel;
	DWORD            dwDiskNumber;
	DWORD            dwAlarmInPort;
	DWORD            dwAlarmOutPort;
	DWORD            dwInfoLen;
	char             sInfo[LOG_INFO_LEN];
}NET_DVR_LOG_V30,*LPNET_DVR_LOG_V30;

typedef struct tagNET_DVR_PTZ_PROTOCOL{
	DWORD    dwType;
	BYTE     byDescribe[DESC_LEN];
}NET_DVR_PTZ_PROTOCOL, *LPNET_DVR_PTZ_PROTOCOL;



typedef struct tagNET_DVR_PTZCFG{
	DWORD                   dwSize;
	NET_DVR_PTZ_PROTOCOL    struPtz[PTZ_PROTOCOL_NUM];
	DWORD                   dwPtzNum;
	BYTE                    byRes[8];
}NET_DVR_PTZCFG, *LPNET_DVR_PTZCFG;

#define MAX_ALARMOUT_V30 96

typedef struct tagNET_DVR_ALARMOUTSTATUS_V30{
	BYTE      Output[MAX_ALARMOUT_V30];
}NET_DVR_ALARMOUTSTATUS_V30,*LPNET_DVR_ALARMOUTSTATUS_V30;

typedef struct 
{
	DWORD dwVolume;//硬盘的容量
	DWORD dwFreeSpace;//硬盘的剩余空间
	DWORD dwHardDiskStatic; //硬盘的状态,0-活动,1-休眠,2-不正常
}NET_DVR_DISKSTATE, *LPNET_DVR_DISKSTATE;

typedef struct 
{
	BYTE byRecordStatic; //通道是否在录像,0-不录像,1-录像
	BYTE bySignalStatic; //连接的信号状态,0-正常,1-信号丢失
	BYTE byHardwareStatic;//通道硬件状态,0-正常,1-异常,例如DSP死掉
	BYTE byRes1;		//保留
	DWORD dwBitRate;//实际码率
	DWORD dwLinkNum;//客户端连接的个数
	NET_DVR_IPADDR struClientIP[MAX_LINK];//客户端的IP地址
	DWORD dwIPLinkNum;//如果该通道为IP接入，那么表示IP接入当前的连接数
	BYTE byRes[12];
}NET_DVR_CHANNELSTATE_V30, *LPNET_DVR_CHANNELSTATE_V30;

typedef struct tagNET_DVR_WORKSTATE_V30{
	DWORD                      dwDeviceStatic;
	NET_DVR_DISKSTATE          struHardDiskStatic[MAX_DISKNUM_V30];
	NET_DVR_CHANNELSTATE_V30   struChanStatic[MAX_CHANNUM_V30];
	BYTE                       byAlarmInStatic[MAX_ALARMIN_V30];
	BYTE                       byAlarmOutStatic[MAX_ALARMOUT_V30];
	DWORD                      dwLocalDisplay;
	BYTE                       byAudioChanStatus[MAX_AUDIO_V30];
	BYTE                       byRes[10];
}NET_DVR_WORKSTATE_V30,*LPNET_DVR_WORKSTATE_V30;

typedef struct tagNET_DVR_DECODERCFG_V30{
	DWORD     dwSize;
	DWORD     dwBaudRate;
	BYTE      byDataBit;
	BYTE      byStopBit;
	BYTE      byParity;
	BYTE      byFlowcontrol;
	WORD      wDecoderType;
	WORD      wDecoderAddress;
	BYTE      bySetPreset[MAX_PRESET_V30];
	BYTE      bySetCruise[MAX_CRUISE_V30];
	BYTE      bySetTrack[MAX_TRACK_V30];
}NET_DVR_DECODERCFG_V30, *LPNET_DVR_DECODERCFG_V30;

typedef struct tagNET_DVR_ETHERNET_V30{
	NET_DVR_IPADDR    struDVRIP;
	NET_DVR_IPADDR    struDVRIPMask;
	DWORD             dwNetInterface;
	WORD              wDVRPort;
	WORD              wMTU;
	BYTE              byMACAddr[MACADDR_LEN];
}NET_DVR_ETHERNET_V30, *LPNET_DVR_ETHERNET_V30;

typedef struct tagNET_DVR_PPPOECFG{
	DWORD             dwPPPOE;
	BYTE              sPPPoEUser[NAME_LEN];
	char              sPPPoEPassword[PASSWD_LEN];
	NET_DVR_IPADDR    struPPPoEIP;
}NET_DVR_PPPOECFG, *LPNET_DVR_PPPOECFG;

typedef struct tagNET_DVR_NETCFG_V30{
	DWORD                    dwSize;
	NET_DVR_ETHERNET_V30     struEtherNet[MAX_ETHERNET];
	NET_DVR_IPADDR           struRes1[2];
	NET_DVR_IPADDR           struAlarmHostIpAddr;
	WORD                     wRes2[2];
	WORD                     wAlarmHostIpPort;
	BYTE                     byUseDhcp;
	BYTE                     byRes3;
	NET_DVR_IPADDR           struDnsServer1IpAddr;
	NET_DVR_IPADDR           struDnsServer2IpAddr;
	BYTE                     byIpResolver[MAX_DOMAIN_NAME];
	WORD                     wIpResolverPort;
	WORD                     wHttpPortNo;
	NET_DVR_IPADDR           struMulticastIpAddr;
	NET_DVR_IPADDR           struGatewayIpAddr;
	NET_DVR_PPPOECFG         struPPPoE;
	BYTE                     byRes[64];
}NET_DVR_NETCFG_V30,*LPNET_DVR_NETCFG_V30;

typedef struct tagNET_DVR_NTPPARA{
	BYTE           sNTPServer[64];
	WORD           wInterval;
	BYTE           byEnableNTP;
	signed char    cTimeDifferenceH;
	signed char    cTimeDifferenceM;
	BYTE           res1;
	WORD           wNtpPort;
	BYTE           res2[8];
}NET_DVR_NTPPARA,*LPNET_DVR_NTPPARA;

typedef struct tagNET_DVR_DDNSPARA_V30{
	BYTE     byEnableDDNS;
	BYTE     byHostIndex;
	BYTE     byRes1[2];
	struct{
		BYTE   sUserName[NAME_LEN];
		BYTE   sPassword[PASSWD_LEN];
		BYTE   sDomainName[MAX_DOMAIN_NAME];
		BYTE   sServerName[MAX_DOMAIN_NAME];
		WORD   wDDNSPort;
		BYTE   byRes[16];
	}struDDNS[MAX_DDNS_NUMS];
	BYTE     byRes2[16];
}NET_DVR_DDNSPARA_V30,*LPNET_DVR_DDNSPARA_V30;


typedef struct tagNET_DVR_DDNSPARA{
	BYTE     sUserName[NAME_LEN];
	BYTE     sPassword[PASSWD_LEN];
	BYTE     sDomainName[64];
	BYTE     byEnableDDNS;
	BYTE     res[15];
}NET_DVR_DDNSPARA,*LPNET_DVR_DDNSPARA;

typedef struct tagNET_DVR_EMAILCFG_V30{
	DWORD     dwSize;
	BYTE      sAccount[NAME_LEN];
	BYTE      sPassword[MAX_EMAIL_PWD_LEN];
	struct{
		BYTE   sName[NAME_LEN];
		BYTE   sAddress[MAX_EMAIL_ADDR_LEN];
	}struSender;
	BYTE      sSmtpServer[MAX_EMAIL_ADDR_LEN];
	BYTE      sPop3Server[MAX_EMAIL_ADDR_LEN];
	struct{
		BYTE   sName[NAME_LEN];
		BYTE   sAddress[MAX_EMAIL_ADDR_LEN];
	}struReceiver[3];
	BYTE      byAttachment;
	BYTE      bySmtpServerVerify;
	BYTE      byMailInterval;
	BYTE      byEnableSSL;
	WORD      wSmtpPort;
	BYTE      byRes[74];
}NET_DVR_EMAILCFG_V30,*LPNET_DVR_EMAILCFG_V30;


typedef struct tagNET_DVR_NETAPPCFG{
	DWORD               dwSize;
	char                sDNSIp[16];
	NET_DVR_NTPPARA     struNtpClientParam;
	NET_DVR_DDNSPARA    struDDNSClientParam;
	BYTE                res[464];
}NET_DVR_NETAPPCFG,*LPNET_DVR_NETAPPCFG;

typedef struct tagNET_DVR_PREVIEWCFG_V30{
	DWORD      dwSize;
	BYTE       byPreviewNumber;
	BYTE       byEnableAudio;
	BYTE       wSwitchTime;
	BYTE       bySwitchSeq[MAX_PREVIEW_MODE][MAX_WINDOW_V30];
	BYTE       byRes[24];
}NET_DVR_PREVIEWCFG_V30,*LPNET_DVR_PREVIEWCFG_V30;

typedef struct tagNET_DVR_HANDLEEXCEPTION_V30{
	DWORD    dwHandleType;
	BYTE     byRelAlarmOut[MAX_ALARMOUT_V30];
}NET_DVR_HANDLEEXCEPTION_V30, *LPNET_DVR_HANDLEEXCEPTION_V30;

typedef struct tagNET_DVR_SCHEDTIME{
	BYTE    byStartHour;
	BYTE    byStartMin;
	BYTE    byStopHour;
	BYTE    byStopMin;
}NET_DVR_SCHEDTIME, *LPNET_DVR_SCHEDTIME;


typedef struct tagNET_DVR_VILOST_V30{
	BYTE                           byEnableHandleVILost;
	NET_DVR_HANDLEEXCEPTION_V30    strVILostHandleType;
	//NET_DVR_SCHEDTIME              struAlarmTime[MAX_DAYS][MAX_TIMESEGMENT_V30];
	int                            ivalid;
	int                            iTimeTable[MAX_DAYS][MAX_TIMESEGMENT_V30];
}NET_DVR_VILOST_V30, *LPNET_DVR_VILOST_V30;

typedef struct tagSENSITIVITY_INFO_V30
{
    BYTE byBeginHour;
    BYTE byBeginMinute;
    BYTE byEndHour;
    BYTE byEndMinute;
    BYTE bySensitivity;
    BYTE szRes[3];
}SENSITIVITY_INFO_V30;


typedef struct tagNET_DVR_MOTION_V30{
	int                            iWidth;
	int                            iHight;
	BYTE                           byMotionScope[64][96];
    SENSITIVITY_INFO_V30           szSensitivityInfo[4];
	BYTE                           byEnableHandleMotion;
	BYTE                           szRes[3];
	NET_DVR_HANDLEEXCEPTION_V30    strMotionHandleType;
	//NET_DVR_SCHEDTIME              struAlarmTime[MAX_DAYS][MAX_TIMESEGMENT_V30];
	int                            invalid;
	int                            iTimeTable[MAX_DAYS][MAX_TIMESEGMENT_V30];
	BYTE                           byRelRecordChan[MAX_CHANNUM_V30];
}NET_DVR_MOTION_V30, *LPNET_DVR_MOTION_V30;

typedef struct tagNET_DVR_HIDEALARM_V30{
	DWORD                          dwEnableHideAlarm;
	WORD                           wHideAlarmAreaTopLeftX;
	WORD                           wHideAlarmAreaTopLeftY;
	WORD                           wHideAlarmAreaWidth;
	WORD                           wHideAlarmAreaHeight;
	NET_DVR_HANDLEEXCEPTION_V30    strHideAlarmHandleType;
	//NET_DVR_SCHEDTIME              struAlarmTime[MAX_DAYS][MAX_TIMESEGMENT_V30];
	int                            invalid;
	int                            iTimeTable[MAX_DAYS][MAX_TIMESEGMENT_V30];
}NET_DVR_HIDEALARM_V30, *LPNET_DVR_HIDEALARM_V30;

typedef struct tagNET_DVR_SHELTER{
	INT    wHideAreaTopLeftX;
	INT    wHideAreaTopLeftY;
	INT    wHideAreaWidth;
	INT    wHideAreaHeight;
}NET_DVR_SHELTER, *LPNET_DVR_SHELTER;

typedef struct tagNET_DVR_COLOR{
	BYTE    byBrightness;
	BYTE    byContrast;
	BYTE    bySaturation;
	BYTE    byHue;
}NET_DVR_COLOR, *LPNET_DVR_COLOR;

typedef struct tagNET_DVR_PICCFG_V30{
	DWORD                    dwSize;
	BYTE                     sChanName[NAME_LEN];
	DWORD                    dwVideoFormat;
	NET_DVR_COLOR            struColor;
	char                     reservedData[60];
	DWORD                    dwShowChanName;
	DWORD                    dwShowNameTopLeftX;
	DWORD                    dwShowNameTopLeftY;
	NET_DVR_VILOST_V30       struVILost;
	NET_DVR_VILOST_V30       struRes;
	NET_DVR_MOTION_V30       struMotion;
	NET_DVR_HIDEALARM_V30    struHideAlarm;
	DWORD                    dwEnableHide;
	NET_DVR_SHELTER          struShelter[MAX_SHELTERNUM];
	DWORD                    dwShowOsd;
	DWORD                    dwOSDTopLeftX;
	DWORD                    dwOSDTopLeftY;
	BYTE                     byOSDType;
	BYTE                     byDispWeek;
	BYTE                     byOSDAttrib;
	BYTE                     byHourOsdType;
	BYTE                     byRes[64];
}NET_DVR_PICCFG_V30,*LPNET_DVR_PICCFG_V30;

typedef struct tagNET_DVR_RECORDDAY{
	WORD    wAllDayRecord;
	BYTE    byRecordType;
	char    reservedData;
}NET_DVR_RECORDDAY, *LPNET_DVR_RECORDDAY;

typedef struct tagNET_DVR_RECORDSCHED{
	NET_DVR_SCHEDTIME    struRecordTime;
	DWORD                 byRecordType;
	//char                 reservedData[3];
}NET_DVR_RECORDSCHED, *LPNET_DVR_RECORDSCHED;


typedef struct tagNET_DVR_RECORD_V30{
	DWORD                 dwSize;
	DWORD                 bCycle;//是否循环写入
	DWORD                 packageTime;//打包时间间隔
	DWORD                 dwRecordTime;//录像延迟
	DWORD                 dwPreRecordTime;//是否预录
	DWORD                 dwRecorderDuration;
	BYTE                  byRedundancyRec;
	BYTE                  byAudioRec;
	BYTE                  byReserve[10];
}NET_DVR_RECORD_V30, *LPNET_DVR_RECORD_V30;

typedef struct
{
	DWORD                 dwRecord;
	NET_DVR_RECORDDAY     struRecAllDay[MAX_DAYS];
	int                   invalidType;
	NET_DVR_RECORDSCHED   struRecordSched[MAX_DAYS][MAX_TIMESEGMENT_V30];
}NET_DVR_RECORD_SCHEDULE, *LNET_DVR_RECORD_SCHEDULE;

typedef struct tagNET_DVR_COMPRESSION_INFO_V30{
	BYTE     byStreamType;
	BYTE     byResolution;
	BYTE     byBitrateType;
	BYTE     byPicQuality;
	DWORD    dwVideoBitrate;
	DWORD    dwVideoFrameRate;
	WORD     wIntervalFrameI;
	BYTE     byIntervalBPFrame;
	BYTE     byres1;
	BYTE     byVideoEncType;
	BYTE     byAudioEncType;
	BYTE     byres[10];
}NET_DVR_COMPRESSION_INFO_V30, *LPNET_DVR_COMPRESSION_INFO_V30;

typedef struct tagNET_DVR_COMPRESSIONCFG_V30{
	DWORD                           dwSize;
	NET_DVR_COMPRESSION_INFO_V30    struNormHighRecordPara;
	NET_DVR_COMPRESSION_INFO_V30    struRes;
	NET_DVR_COMPRESSION_INFO_V30    struEventRecordPara;
	NET_DVR_COMPRESSION_INFO_V30    struNetPara;
}NET_DVR_COMPRESSIONCFG_V30, *LPNET_DVR_COMPRESSIONCFG_V30;

typedef struct tagNET_DVR_VOOUT{
	BYTE      byVideoFormat;
	BYTE      byMenuAlphaValue;
	WORD      wScreenSaveTime;
	WORD      wVOffset;
	WORD      wBrightness;
	BYTE      byStartMode;
	BYTE      byEnableScaler;
}NET_DVR_VOOUT,*LPNET_DVR_VOOUT;

typedef struct tagNET_DVR_VGAPARA{
	WORD       wResolution;
	WORD       wFreq;
	DWORD      dwBrightness;
}NET_DVR_VGAPARA,*LPNET_DVR_VGAPARA;

typedef struct tagNET_DVR_MATRIXPARA_V30{
	WORD       wOrder[MAX_ANALOG_CHANNUM];
	WORD       wSwitchTime;
	BYTE       res[14];
}NET_DVR_MATRIXPARA_V30,*LPNET_DVR_MATRIXPARA_V30;

typedef struct tagNET_DVR_VIDEOOUT_V30{
	DWORD                       dwSize;
	NET_DVR_VOOUT               struVOOut[MAX_VIDEOOUT_V30];
	NET_DVR_VGAPARA             struVGAPara[MAX_VGA_V30];
	NET_DVR_MATRIXPARA_V30      struMatrixPara[MAX_MATRIXOUT];
	BYTE                        byRes[16];
}NET_DVR_VIDEOOUT_V30,*LPNET_DVR_VIDEOOUT_V30;

typedef struct tagNET_DVR_DEVICECFG{
	DWORD    dwSize;
	BYTE     sDVRName[NAME_LEN];
	DWORD    dwDVRID;
	BYTE     byAlarmInPortNum;
	BYTE     byAlarmOutPortNum;
	BYTE     byRS232Num;
	BYTE     byRS485Num;
	BYTE     byNetworkPortNum;
	BYTE     byDiskCtrlNum;
	BYTE     byDiskNum;
	BYTE     byDVRType;
	BYTE     byChanNum;
	BYTE     byStartChan;
	BYTE     byDecordChans;
	BYTE     byVGANum;
	BYTE     byUSBNum;
	BYTE     byAuxoutNum;
	BYTE     byAudioNum;
	BYTE     byIPChanNum;
	DWORD    norm;
	DWORD    fmt;
	DWORD    language;
}NET_DVR_DEVICECFG,*LPNET_DVR_DEVICECFG;


typedef struct
{
	DWORD 	dwHDNo;
	DWORD 	dwCapacity;
	DWORD 	dwFreeSpace;
	DWORD 	dwHdStatus;
	BYTE		byHDAttr;
	BYTE		byHDType;
	BYTE		byRes1[2];
	DWORD 	dwHdGroup;
	BYTE		byRes2[120];
}NET_DVR_SINGLE_HD, *LPNET_DVR_SINGLE_HD;

typedef struct
{
	DWORD 				dwSize;
	DWORD 				dwHDCount;
	NET_DVR_SINGLE_HD 	struHDInfo[MAX_DISKNUM_V30];
}NET_DVR_HDCFG, *LPNET_DVR_HDCFG;

typedef struct tagNET_DVR_USER_INFO_V30{
	BYTE                sUserName[NAME_LEN];
	BYTE                sPassword[PASSWD_LEN];
	BYTE                byLocalRight[MAX_RIGHT];
	BYTE                byRemoteRight[MAX_RIGHT];
	BYTE                byNetPreviewRight[MAX_CHANNUM_V30];
	BYTE                byLocalPlaybackRight[MAX_CHANNUM_V30];
	BYTE                byNetPlaybackRight[MAX_CHANNUM_V30];
	BYTE                byLocalRecordRight[MAX_CHANNUM_V30];
	BYTE                byNetRecordRight[MAX_CHANNUM_V30];
	BYTE                byLocalPTZRight[MAX_CHANNUM_V30];
	BYTE                byNetPTZRight[MAX_CHANNUM_V30];
	BYTE                byLocalBackupRight[MAX_CHANNUM_V30];
	NET_DVR_IPADDR      struUserIP;
	BYTE                byMACAddr[MACADDR_LEN];
	BYTE                byPriority;
	BYTE                byRes[17];
}NET_DVR_USER_INFO_V30,*LPNET_DVR_USER_INFO_V30;

typedef struct tagNET_DVR_USER_V30{
	DWORD                     dwSize;
	NET_DVR_USER_INFO_V30     struUser[MAX_USERNUM_V30];
}NET_DVR_USER_V30,*LPNET_DVR_USER_V30;

typedef struct tagNET_DVR_ALARMINCFG_V30{
	DWORD                            dwSize;
	BYTE                             sAlarmInName[NAME_LEN];
	BYTE                             byAlarmType;
	BYTE                             byAlarmInHandle;
	BYTE                             byRes1[2];
	NET_DVR_HANDLEEXCEPTION_V30      struAlarmHandleType;
	//NET_DVR_SCHEDTIME                struAlarmTime[MAX_DAYS][MAX_TIMESEGMENT_V30];
	int                              invalid;
	int                              byTimeTable[MAX_DAYS][MAX_TIMESEGMENT_V30];
	BYTE                             byRelRecordChan[MAX_CHANNUM_V30];
	BYTE                             byEnablePreset[MAX_CHANNUM_V30];
	BYTE                             byPresetNo[MAX_CHANNUM];
	BYTE                             byRes2[192];
	BYTE                             byEnableCruise[MAX_CHANNUM];
	BYTE                             byCruiseNo[MAX_CHANNUM];
	BYTE                             byEnablePtzTrack[MAX_CHANNUM];
	BYTE                             byPTZTrack[MAX_CHANNUM];
	BYTE                             byRes3[16];
}NET_DVR_ALARMINCFG_V30,*LPNET_DVR_ALARMINCFG_V30;

typedef struct tagNET_DVR_ALARMOUTCFG_V30{
	DWORD                   dwSize;
	BYTE                    sAlarmOutName[NAME_LEN];
	DWORD                   dwAlarmOutDelay;
	//NET_DVR_SCHEDTIME       struAlarmOutTime[MAX_DAYS][MAX_TIMESEGMENT_V30];
	int                     invalid;
	int                     iTimeTable[MAX_DAYS][MAX_TIMESEGMENT_V30];
	BYTE                    byRes[16];
}NET_DVR_ALARMOUTCFG_V30,*LPNET_DVR_ALARMOUTCFG_V30;

typedef struct 
{
	char	cName[32];//名称
	char	cType[32];//类型
	char	cSerialNo[32];//序列好
	char	cBuildDay[32];//build号
	char	cHardwareVer[32];//硬件编号
	char	cCfgVer[32];//配置版本
	char	cFirmwareVer[32];//软件版本号
	char	cDetail[32];//详细信息
	char	res[16];
}NetVersionInfo, *PNetVersionInfo;

//上传报警信息(9000扩展)
typedef struct 
{
	DWORD dwAlarmType;/*0-信号量报警,1-硬盘满,2-信号丢失,3－移动侦测,4－硬盘未格式化,5-读写硬盘出错,6-遮挡报警,7-制式不匹配, 8-非法访问, 9-视频信号异常，10-录像异常 */
	DWORD dwAlarmInputNumber;/*报警输入端口*/
	BYTE byAlarmOutputNumber[MAX_ALARMOUT_V30];/*触发的输出端口，为1表示对应输出*/
	BYTE byAlarmRelateChannel[MAX_CHANNUM_V30];/*触发的录像通道，为1表示对应录像, dwAlarmRelateChannel[0]对应第1个通道*/
	BYTE byChannel[MAX_CHANNUM_V30];/*dwAlarmType为2或3,6，9，10时，表示哪个通道，dwChannel[0]对应第1个通道*/
	BYTE byDiskNumber[MAX_DISKNUM_V30];/*dwAlarmType为1,4,5时,表示哪个硬盘, dwDiskNumber[0]对应第1个硬盘*/
}NET_DVR_ALARMINFO_V30, *LPNET_DVR_ALARMINFO_V30;

typedef struct
{
	BYTE    PresetNum;
	BYTE    Dwell;
	BYTE    Speed;
	BYTE    Reserve;
}NET_DVR_CRUISE_POINT, *LPNET_DVR_CRUISE_POINT;

typedef struct
{
	NET_DVR_CRUISE_POINT	  struCruisePoint[32];
}NET_DVR_CRUISE_RET,*LPNET_DVR_CRUISE_RET;

NET_DVR_API DWORD NET_DVR_GetLastError();
/*beginnig of new function*/
typedef struct {
	char    byStartHour;
	char    byStartMin;
	char    byStopHour;
	char    byStopMin;
}NetAppSchedTime;

typedef struct
{
	int port;
}NetAppServiceCfg, *PNetAppServiceCfg;

typedef struct
{
	int port;
}NetAppWebCfg, *PNetAppWebCfg;

typedef struct
{
	char ip[16];
	char mask[16];
	char gateway[16];
	char mac[24];
}NetAppIPCfg, *PNetAppIPCfg;

typedef struct
{
	char dns1[16];
	char dns2[16];
}NetAppDNSCfg, *PNetAppDNSCfg;

typedef struct
{
	char server[32];
	int port;
	int bnonymous;
	char username[32];
	char password[32];
	char remotedir[256];
	int filelen;	
}NetAppFTPCfg, *PNetAppFTPCfg;

typedef struct
{
	NetAppSchedTime time;
	int type;
}NetAppTimeSection, *PNetAppTimeSection; 

typedef struct
{
	int channel;
	int bvalid;
	NetAppTimeSection timetable[7][2];
}NetAppFTPTask, *PNetAppFTPTask;

typedef struct
{
	int type;    // 0:ipfilter invalid   1:white valid  2:black valid
	char white[64][16];
	char black[64][16];
}NetAppIPFilterCfg, *PNetAppIPFilterCfg;

typedef struct
{
	int bautoapn;
	char apn[128];
	char phone[32];/*dial phone num*/
	char name[128];/*user name */
	char pass[32];/*user password*/
	int bautoip;
	int bautodns;
	NetAppIPCfg ip;
	NetAppDNSCfg dns;
}NetApp3GConfig, *PNetApp3GConfig;

typedef struct
{
	int bdhcp;//dhcp or static
	int bautodns;//get dns automaticaly or static configure
	NetAppIPCfg ipconfig;//ip configure
	NetAppDNSCfg dnsconfig; //dns configure
}NetAppLocalConfig, *PNetAppLocalConfig;

typedef struct
{
    char name[128];
    char pass[128];
}NetAppPPPoECfg,*PNetAppPPPoEcFG;

typedef enum
{
    NET_TYPE_LAN,
    NET_TYPE_PPPOE,
    NET_TYPE_CDMA
}NetAppLinkType;

typedef struct
{
    int enable;
}NetAppUPNPCfg, *PNetAppUPNPCfg;

typedef struct
{
    int reso;
    char name[32];
}NetAppResoType;

typedef struct
{
    int types;
    int cur;
    NetAppResoType list[32];
}NetAppResotList;

typedef struct
{
    int max;
    int min;
    int cur;
}NetAppUITrans;

typedef struct
{
    int max;
    int min;
    int cur;
}NetAppMouseSense;

typedef struct
{
    int types;
    int cur;
    int list[16];
}NetAppDellTable;

typedef struct
{
    NetAppResotList reso;
    NetAppUITrans trans;
    NetAppMouseSense mouseSense;
    NetAppDellTable dwell;
    int bmute;
}NetAppOutputCfg,*PNetAppOutputCfg;

/*end of new function*/
#define MAX_RESO_TYPES 10

#define MAX_QUAULITY_TYPES MAX_RESO_TYPES
#define MAX_QUAULITY_NUM 10

#define MAX_FRAME_TYPES MAX_RESO_TYPES
#define MAX_FRAME_NUM 20

#define MAX_BIT_RATE_TYPES MAX_RESO_TYPES
#define MAX_BIT_RATE_NUM 15

typedef struct
{
	int quaulityTypes;
	int quaulity[MAX_QUAULITY_NUM];
}NetDvrQuaulityInfo;

typedef struct
{
	int channel[4];//channel bit, use bit OR
	int streamType;//main stream:0  substream:1
	int reso;
	char strReso[32];
}NetDvrResoInfo;

typedef struct
{
	int min;//min frame rate
	int max;//max frame rate
	int def;
	int types;//frame types to choose
	int frame[MAX_FRAME_NUM];//frame list 
}NetDvrFrameInfo;

typedef struct
{
	int min;//min bit rate
	int max;//max bit rate
	int def;
	int types;// bit rate types to choose
	int times;//relationship between bit rat and frame rate
	int bitRate[MAX_BIT_RATE_NUM];//bit rate list
}NetDvrBitRateInfo;

typedef struct
{	
	int resoTypes;//resolution types to choose
	NetDvrResoInfo reso[MAX_RESO_TYPES];//resolution list
	
	NetDvrQuaulityInfo quaulity[MAX_QUAULITY_TYPES];
	
	NetDvrFrameInfo frame[MAX_FRAME_TYPES];
	
	NetDvrBitRateInfo bitRate[MAX_BIT_RATE_TYPES];
}NetDvrStreamInfo;

typedef struct
{
	int bAudio;
	int resolution;
	int enctype;
	int picQuaulity;
	int frame;
	int bCustom;
	int bitRate;
}NetDvrEncInfo, *PNetDvrEncInfo;

typedef struct
{
	int bHD;//is hd channel or not
	int streamTypes;//valid stream types
	NetDvrEncInfo mainStream;
	NetDvrEncInfo subStream;
	NetDvrEncInfo resStream;
}NetDvrChannelEncInfo;

typedef struct
{
	int triggerBuzzer;
	int triggerSnap;
	int triggerOut[32];
	int reserve[2];
}NetDvrExceptionCfg, *PNetDvrExceptionCfg;
//---------------------------------API DESCRIPTION---------------------------------------------
//
//SDK control API. incluing 6 API fucntions
//inluding: 1. NET_DVR_Init() - Initiate SDK; 
//               2. NET_DVR_Cleanup() -  Destroy SDK
///             3. NET_DVR_GetSDKVersion() - get SDK version;
//               4. NET_DVR_SetConnectTime() - socket control;
//               5. NET_DVR_SetReconnect() - socket control;
//               6. NET_DVR_GetHostByName() - Domain name to IP 
//		    
//---------------------------------API DESCRIPTION---------------------------------------------
/* Initialise the SDK module*/
NET_DVR_API BOOL   NET_DVR_Init();
NET_DVR_API BOOL   NET_DVR_Cleanup();
NET_DVR_API DWORD  NET_DVR_GetSDKVersion();

NET_DVR_API BOOL NET_DVR_SetConnectTime(DWORD dwWaitTime = 5000, DWORD dwTryTimes = 3);
NET_DVR_API BOOL NET_DVR_SetReconnect(DWORD dwInterval = 30000, BOOL bEnableRecon = TRUE);
//---------------------------------API DESCRIPTION---------------------------------------------
//
//Login/Logout a DVR API. Including 2 API functions.
//inluding:  1. NET_DVR_Login() - Login 
//                2. NET_DVR_Logout() - Logout
//
//---------------------------------API DESCRIPTION---------------------------------------------
NET_DVR_API LONG  NET_DVR_Login_V30(char *sDVRIP,WORD wDVRPort,char *sUserName,char *sPassword,LPNET_DVR_DEVICEINFO_V30 lpDeviceInfo);
NET_DVR_API BOOL  NET_DVR_Logout_V30(LONG lUserID);


//---------------------------------API DESCRIPTION---------------------------------------------
//
//Realtime preview, capture, display and storage API. Including 15 API functions
//inluding: 1. NET_DVR_SetPlayerBufNumber() - Set buffer number for recieve realtime streaming from network.
//               2. NET_DVR_RealPlay_V30() - start preview; 
//               3. NET_DVR_RigisterDrawFun() - register a callback function to draw OSD on the media display window
//               4. NET_DVR_SetRealDataCallBack() - register a callback function to capture the realtime streaming
//               5. NET_DVR_SaveRealData_V30() - save the realtime streaming to local disk
//               6. NET_DVR_StopSaveRealData() - stop save the realtime streaming to local disk
//               7. NET_DVR_MakeKeyFrame() - Make a I frame in the main stream
//               8. NET_DVR_MakeKeyFrameSub() - Make a I frame in the sub stream
//               9. NET_DVR_OpenSound() - Open the preview sound
//             10. NET_DVR_CloseSound() - Close the preview sound
//             11. NET_DVR_SetVolume() - Set the volume of  the preview sound
//             12. NET_DVR_GetRealPlayerIndex() - Get the port of local decoder for this streaming channel
//             13. NET_DVR_CapturePicture() - Capture a BMP picture
//             14. NET_DVR_CaptureJPEGPicture() - Capture a JPEG picture
//             15. NET_DVR_StopRealPlay_V30() - stop preview; 
//          16. NET_DVR_ClientSetVideoEffect() - control image parameter
//          17. NET_DVR_ClientGetVideoEffect() - get image parameter
//
//---------------------------------API DESCRIPTION---------------------------------------------
NET_DVR_API LONG  NET_DVR_RealPlay_V30(LONG lUserID, LPNET_DVR_CLIENTINFO lpClientInfo, void(CALLBACK *fRealDataCallBack_V30) (LONG lRealHandle, DWORD dwDataType, BYTE *pBuffer, DWORD dwBufSize, void* pUser) = NULL, void* pUser = NULL, BOOL bBlocked = FALSE);
NET_DVR_API BOOL NET_DVR_SetPlayerBufNumber(LONG lRealHandle,DWORD dwBufNum);
typedef void(CALLBACK *fDrawFun)(LONG  lRealHandle, HDC  hDc, DWORD dwUser);
NET_DVR_API BOOL NET_DVR_RigisterDrawFun(LONG lRealHandle, fDrawFun cbDraw, DWORD dwUser);
NET_DVR_API BOOL  NET_DVR_SetRealDataCallBack(LONG lRealHandle,void(CALLBACK *fRealDataCallBack) (LONG lRealHandle, DWORD dwDataType, BYTE *pBuffer,DWORD dwBufSize,DWORD dwUser),DWORD dwUser);
NET_DVR_API BOOL  NET_DVR_SaveRealData_V30(LONG lRealHandle, DWORD dwTransType, char *sFileName);
NET_DVR_API BOOL  NET_DVR_StopSaveRealData(LONG lRealHandle);
NET_DVR_API BOOL  NET_DVR_OpenSound(LONG lRealHandle);
NET_DVR_API BOOL  NET_DVR_CloseSound();
NET_DVR_API BOOL  NET_DVR_Volume(LONG lRealHandle,WORD wVolume);
NET_DVR_API int NET_DVR_GetRealPlayerIndex(LONG lRealHandle);
//capture JPEG file
NET_DVR_API BOOL NET_DVR_CaptureJPEGPicture(LONG lUserID, LONG lChannel, LPNET_DVR_JPEGPARA lpJpegPara, char *sPicFileName);
NET_DVR_API BOOL  NET_DVR_StopRealPlay(LONG lRealHandle);


//---------------------------------API DESCRIPTION---------------------------------------------
//
//Recording file searching, playback, storage. Including 20 API functions
//inluding:  1. NET_DVR_FindFile_V30() - search the recording file by the certain conditions 
//                2. NET_DVR_FindNextFile_V30() - search the next file
//                3. NET_DVR_FindFileByEvent() - search the recording file by the event
//                4. NET_DVR_FindNextEvent() - search the next recording file by the event
//                5. NET_DVR_FindClose_V30() - close the process of searching files
//                6. NET_DVR_LockFileByName() -Lock a file
//                7. NET_DVR_UnlockFileByName() - unlock a file
//                8. NET_DVR_PlayBackByName() - play back a file
//                9. NET_DVR_PlayBackByTime() - play back the recording during the certain time
//              10. NET_DVR_PlayBackControl() - play control: play, pause, fast-forward, backword, ......
//              11. NET_DVR_GetPlayBackPos() - get the palyback progress.
//              12. NET_DVR_SetPlayDataCallBack() - register a callback function to capure the data from playback session
//              13. NET_DVR_PlayBackSaveData() - save the data from playback session to local HDD
//              14. NET_DVR_StopPlayBackSave() - stop save the data from playback session
//              15. NET_DVR_PlayBackCaptureFile() -capture a JPEG/BMP file
//              16. NET_DVR_GetFileByName() - download a recording file
//              17. NET_DVR_GetFileByTime() - download the recording files during the certain time
//              18. NET_DVR_GetDownloadPos() - get the progress of downloading
//              19. NET_DVR_StopGetFile() - stop downloading
//              20. NET_DVR_StopPlayBack() - stop playback session
//
//---------------------------------API DESCRIPTION---------------------------------------------
NET_DVR_API LONG  NET_DVR_FindFile_V30(LONG lUserID, LPNET_DVR_FILECOND pFindCond);
NET_DVR_API LONG  NET_DVR_FindNextFile_V30(LONG lFindHandle, LPNET_DVR_FINDDATA_V30 lpFindData);
NET_DVR_API BOOL  NET_DVR_FindClose_V30(LONG lFindHandle);
NET_DVR_API LONG  NET_DVR_PlayBackByName(LONG lUserID,char *sPlayBackFileName, HWND hWnd);
NET_DVR_API BOOL  NET_DVR_PlayBackControl(LONG lPlayHandle,DWORD dwControlCode,DWORD dwInValue,DWORD *LPOutValue);
NET_DVR_API BOOL NET_DVR_SetPlayDataCallBack(LONG lPlayHandle,void(CALLBACK *fPlayDataCallBack) (LONG lPlayHandle, DWORD dwDataType, BYTE *pBuffer,DWORD dwBufSize,DWORD dwUser),DWORD dwUser);
NET_DVR_API BOOL  NET_DVR_PlayBackSaveData(LONG lPlayHandle,char *sFileName);
NET_DVR_API BOOL  NET_DVR_StopPlayBackSave(LONG lPlayHandle);
NET_DVR_API BOOL NET_DVR_PlayBackCaptureFile(LONG lPlayHandle,char *sFileName);
NET_DVR_API LONG  NET_DVR_GetFileByName(LONG lUserID,char *sDVRFileName,char *sSavedFileName);
NET_DVR_API BOOL  NET_DVR_StopGetFile(LONG lFileHandle);
NET_DVR_API int  NET_DVR_GetDownloadPos(LONG lFileHandle);
NET_DVR_API BOOL  NET_DVR_StopPlayBack(LONG lPlayHandle);

//---------------------------------API DESCRIPTION---------------------------------------------
//
//start and stop recording manually. Including 2 API functions
//inluding:  1. NET_DVR_StartDVRRecord() - start recording manually
//                2. NET_DVR_StopDVRRecord() - stop recording manually
//
//---------------------------------API DESCRIPTION---------------------------------------------
NET_DVR_API BOOL  NET_DVR_StartDVRRecord(LONG lUserID,LONG lChannel,LONG lRecordType);
NET_DVR_API BOOL  NET_DVR_StopDVRRecord(LONG lUserID,LONG lChannel);

//---------------------------------API DESCRIPTION---------------------------------------------
//
//capture the alarm information.  Including 3 API functions
//inluding:  1. NET_DVR_SetupAlarmChan_V30() - Setup the alarm channle
//           2. NET_DVR_SetDVRMessageCallBack_V30() - register a callback function to capture alarm information
//           3. NET_DVR_CloseAlarmChan_V30() - cancel the alarm channle
//
//---------------------------------API DESCRIPTION---------------------------------------------

NET_DVR_API LONG NET_DVR_SetupAlarmChan_V30(LONG lUserID);

NET_DVR_API BOOL NET_DVR_SetDVRMessageCallBack_V30(MSGCallBack fMessageCallBack, void* pUser);

NET_DVR_API BOOL NET_DVR_CloseAlarmChan_V30(LONG lAlarmHandle);


//---------------------------------API DESCRIPTION---------------------------------------------
//
//PTZ control.  Including 1 API function
//inluding:  1. NET_DVR_PTZControl() - send PTZ command to DVR
//           2. NET_DVR_PTZPreset() - Preset command
//           3. NET_DVR_PTZCruise() - Cruise command
//           4. NET_DVR_PTZTrack() - Track command
//
//---------------------------------API DESCRIPTION---------------------------------------------
NET_DVR_API BOOL  NET_DVR_PTZControl(LONG lRealHandle,DWORD dwPTZCommand,DWORD dwStop);
NET_DVR_API BOOL  NET_DVR_PTZPreset(LONG lRealHandle, DWORD dwPTZPresetCmd, DWORD dwPresetIndex);
NET_DVR_API BOOL  NET_DVR_PTZCruise(LONG lRealHandle, DWORD dwPTZCruiseCmd, BYTE byCruiseRoute, BYTE byCruisePoint, WORD put);
NET_DVR_API BOOL  NET_DVR_PTZTrack(LONG lRealHandle, DWORD dwPTZTrackCmd);
NET_DVR_API BOOL  NET_DVR_GetPTZCruise(LONG lUserID, LONG lChannel, LONG lCruiseRoute, LPNET_DVR_CRUISE_RET lpCruiseRet);

//---------------------------------API DESCRIPTION---------------------------------------------
//
//two-way and multicast audio. Including 7 API functions
//inluding:  1. NET_DVR_StartVoiceCom_V30() - Start two way audio 
//           2. NET_DVR_SetVoiceComClientVolume(0 - set audio volume of two-way and multicast audio
//           3. NET_DVR_StopVoiceCom() - Stop two way audio
//           4. NET_DVR_ClientAudioStart_V30() - start multicast audio
//           5. NET_DVR_AddDVR_V30() - add a multicast audio client
//           6. NET_DVR_delDVR_V30() - delete a multicast audio client
//           7. NET_DVR_ClientAudioStop() - stopmulticast audio
//
//---------------------------------API DESCRIPTION---------------------------------------------
NET_DVR_API LONG NET_DVR_StartVoiceCom_V30(LONG lUserID, DWORD dwVoiceChan, BOOL bNeedCBNoEncData, void(CALLBACK *fVoiceDataCallBack)(LONG lVoiceComHandle, char *pRecvDataBuffer, DWORD dwBufSize, BYTE byAudioFlag, void* pUser), void* pUser);

NET_DVR_API BOOL NET_DVR_SetVoiceComClientVolume(LONG lVoiceComHandle, WORD wVolume);

NET_DVR_API BOOL NET_DVR_StopVoiceCom(LONG lVoiceComHandle);


//---------------------------------API DESCRIPTION---------------------------------------------
//
//Format HDD. Including 3 API functions
//inluding:  1. NET_DVR_FormatDisk() - start format 
//                2. NET_DVR_GetFormatProgress() - get the progress of format process
//                3. NET_DVR_CloseFormatHandle() - release the handle
//
//---------------------------------API DESCRIPTION---------------------------------------------
NET_DVR_API LONG  NET_DVR_FormatDisk(LONG lUserID,LONG lDiskNumber);

NET_DVR_API BOOL NET_DVR_GetFormatProgress(LONG lFormatHandle, LONG *pCurrentFormatDisk,LONG *pCurrentDiskPos,LONG *pFormatStatic);
NET_DVR_API BOOL NET_DVR_CloseFormatHandle(LONG lFormatHandle);
//---------------------------------API DESCRIPTION---------------------------------------------
//
//search the log information. Including 3 API functions
//inluding:  1. NET_DVR_FindDVRLog_V30() - Start searching
//           2. NET_DVR_FindNextLog_V30() - find the next log item 
//           3. NET_DVR_FindLogClose_V30() -stop searching
//
//---------------------------------API DESCRIPTION---------------------------------------------
NET_DVR_API LONG  NET_DVR_FindDVRLog_V30(LONG lUserID, LONG lSelectMode, DWORD dwMajorType,DWORD dwMinorType, LPNET_DVR_TIME lpStartTime, LPNET_DVR_TIME lpStopTime, BOOL bOnlySmart = FALSE);


NET_DVR_API LONG  NET_DVR_FindNextLog_V30(LONG lLogHandle, LPNET_DVR_LOG_V30 lpLogData);

NET_DVR_API BOOL  NET_DVR_FindLogClose_V30(LONG lLogHandle);

//---------------------------------API DESCRIPTION---------------------------------------------
//
//Get and set config file from/to the certain DVR. Including 2 API functions
//inluding:  1. NET_DVR_GetConfigFile() - get config file from the certain DVR
//           2. NET_DVR_SetConfigFile() - set config file to the certain DVR
//
//---------------------------------API DESCRIPTION---------------------------------------------
NET_DVR_API BOOL  NET_DVR_GetConfigFile(LONG lUserID, char *sFileName);

NET_DVR_API BOOL  NET_DVR_SetConfigFile(LONG lUserID, char *sFileName);

//---------------------------------API DESCRIPTION---------------------------------------------
//
//update dev
//---------------------------------API DESCRIPTION---------------------------------------------
NET_DVR_API BOOL NET_DVR_Upgrade( LONG lUserID, char  *sFileName, int iUpgradeConfig);

//---------------------------------API DESCRIPTION---------------------------------------------
//
//Reboot and shut down the DVR. Including 2 API functions
//inluding:  1. NET_DVR_RebootDVR() - Reboot the DVR
//		    2. NET_DVR_ShutDownDVR() - shut down the DVR
//
//---------------------------------API DESCRIPTION---------------------------------------------
NET_DVR_API BOOL  NET_DVR_RebootDVR(LONG lUserID);
NET_DVR_API BOOL  NET_DVR_ShutDownDVR(LONG lUserID);

//---------------------------------API DESCRIPTION---------------------------------------------
//
//config the DVR parameter, including 4 API functions
//inluding:  1. NET_DVR_GetDVRConfig() - get the config from the certain DVR
//		    2. NET_DVR_SetDVRConfig() - set the config to the certain DVR
//		    3. NET_DVR_RestoreConfig() - restore the config of the certain DVR
//		    4. NET_DVR_GetPTZProtocol() - get thePTZ  protocol that the DVR supports ???why we need this API??
//
//---------------------------------API DESCRIPTION---------------------------------------------
NET_DVR_API BOOL  NET_DVR_GetDVRConfig(LONG lUserID, DWORD dwCommand,LONG lChannel, LPVOID lpOutBuffer, DWORD dwOutBufferSize, LPDWORD lpBytesReturned);
NET_DVR_API BOOL  NET_DVR_SetDVRConfig(LONG lUserID, DWORD dwCommand,LONG lChannel, LPVOID lpInBuffer, DWORD dwInBufferSize);
NET_DVR_API BOOL  NET_DVR_RestoreConfig(LONG lUserID);

NET_DVR_API BOOL NET_DVR_GetPTZProtocol(LONG lUserID, NET_DVR_PTZCFG *pPtzcfg);
//---------------------------------API DESCRIPTION---------------------------------------------
//
//config the DVR parameter, including 2 API functions
//inluding:  1. NET_DVR_RebootDVR() - reboot device
//		    2. NET_DVR_ShutDownDVR() - shutdown device
//
//---------------------------------API DESCRIPTION---------------------------------------------
NET_DVR_API BOOL  NET_DVR_RebootDVR(LONG lUserID);
NET_DVR_API BOOL  NET_DVR_ShutDownDVR(LONG lUserID);

//---------------------------------API DESCRIPTION---------------------------------------------
//
//config the DVR parameter, including 2 API functions
//inluding:  1. NET_DVR_ClientSetVideoEffect() - get vedio parameter
//		    2. NET_DVR_ClientGetVideoEffect() - set vedio paramter
//
//---------------------------------API DESCRIPTION---------------------------------------------
NET_DVR_API BOOL  NET_DVR_ClientSetVideoEffect(LONG lRealHandle,DWORD dwBrightValue,
											   DWORD dwContrastValue, DWORD dwSaturationValue,DWORD dwHueValue);
NET_DVR_API BOOL  NET_DVR_ClientGetVideoEffect(LONG lRealHandle,DWORD *pBrightValue,DWORD *pContrastValue,
											   DWORD *pSaturationValue,DWORD *pHueValue);


NET_DVR_API BOOL NET_DVR_CapturePicture(LONG lRealHandle, char  *sPicFileName);

//---------------------------------API DESCRIPTION---------------------------------------------
//
//control the DVR alarm out. Including 2 API functions
//inluding:  1. NET_DVR_GetAlarmOut_V30() - get the DVR alarm out status
//		       2. NET_DVR_SetAlarmOut() - set the DVR alarm out status
//
//---------------------------------API DESCRIPTION---------------------------------------------
NET_DVR_API BOOL NET_DVR_GetAlarmOut_V30(LONG lUserID, LPNET_DVR_ALARMOUTSTATUS_V30 lpAlarmOutState);

NET_DVR_API BOOL NET_DVR_SetAlarmOut(LONG lUserID, LONG lAlarmOutPort,LONG lAlarmOutStatic);


//---------------------------------API DESCRIPTION---------------------------------------------
//
//Get the DVR device ability, including 1 API function
//inluding:  1. NET_DVR_GetDeviceAbility() - get the DVR device ability
//
//---------------------------------API DESCRIPTION---------------------------------------------
NET_DVR_API BOOL NET_DVR_GetDeviceAbility(LONG lUserID, DWORD dwAbilityType, char* pInBuf, DWORD dwInLength, char* pOutBuf, DWORD dwOutLength);


//---------------------------------API DESCRIPTION---------------------------------------------
//
//Get the DVR runing status, including 1 API function
//inluding:  1. NET_DVR_GetDVRWorkState_V30() - get the DVR runing status
//
//---------------------------------API DESCRIPTION---------------------------------------------
NET_DVR_API BOOL NET_DVR_GetDVRWorkState_V30(LONG lUserID, LPNET_DVR_WORKSTATE_V30 lpWorkState);

//---------------------------------API DESCRIPTION---------------------------------------------
//
//exception call back  API. including 1 API function.
//inluding:  1. NET_DVR_SetExceptionCallBack_V30() - Register a callback function to capture the exception information
//
//---------------------------------API DESCRIPTION---------------------------------------------
NET_DVR_API BOOL NET_DVR_SetExceptionCallBack_V30(UINT nMessage, HWND hWnd, void (CALLBACK* fExceptionCallBack)(DWORD dwType, LONG lUserID, LONG lHandle, void *pUser), void *pUser);

NET_DVR_API BOOL NET_DVR_H264toAVI(char* srcFile,char* destFile);

NET_DVR_API BOOL NET_DVR_GetChannelEncInfo(LONG lUserID,	NetDvrStreamInfo *pStreamInfo);

// ---------------------------------导入导出配置相关接口-------------------------------------------------
NET_DVR_API int NET_DVR_GET_EXPORT_FILE_PERCENT(LONG lUserID);

// ----------------------------------日志查询接口---------------------------------------------------------
NET_DVR_API BOOL  NET_DVR_GetLogFile(LONG lUserID, char *sFileName);
NET_DVR_API int NET_DVR_GET_LOG_FILE_PERCENT(LONG lUserID);

#endif


