Вы находитесь на странице: 1из 97

SDK Programmer Manual of Embedded Net DVRDVS

SDK Programmer Manual


Net DVRDVS
(Version2.2)

Page 1 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

Preface
Thanks for purchasing our products, and we will provide our best service to you. If
you have any request or questions, please contact us immediately.
This manual may contain some technically incorrect places or printing errors. This
manual will be updated on a regular basis without additional specific notice. The updates
will be added into the new version of this manual. We will readily improve or update the
products or procedures described in the manual.
You can refer to all the agents for the technical information of our products.
This SDK can be used for embedded DVS.

Page 2 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

Index

VERSION DESCRIPTION ....................................................................... 5


CHAPTER 1 INTRODUCTION..............................................................32
1.1 Composition ........................................................................................................ 32
1.2 Notice .................................................................................................................. 32
1.2.1 Basic notice .......................................................................................................................... 32
1.2.2 Notice for the graphic adapter of computer ......................................................................... 32
1.2.3 Notes for the hardware decode card ..................................................................................... 33
CHAPTER 2 PROGRAM GUIDE ..........................................................34
2.1 Program Introduction ........................................................................................... 34
2.2 Sequence of calling the functions ......................................................................... 35
CHAPTER 3 DATA STRUCTURE .........................................................38
3.1 Client-end data structure ...................................................................................... 38
3.1.1 device model define ............................................................................................................. 38
3.1.2 Display mode ....................................................................................................................... 39
3.1.2 Network link mode............................................................................................................... 39
3.1.3 Device message structure ..................................................................................................... 39
3.1.4 Network preview parameters ............................................................................................... 39
3.1.5 File information structure ..................................................................................................... 40
3.1.6 Upload the alarm message ................................................................................................... 40
3.1.7 Alarm output status .............................................................................................................. 40
3.1.8 Hardware decoding preview struct ....................................................................................... 41
3.1.9 Log message ......................................................................................................................... 41
3.1.10 Devices status information ................................................................................................ 43
3.1.11 Transaction information ATM DVR upload to center ........................................................ 44
3.2 Device-end parameter data structure .................................................................... 44
3.2.1 Device system configuration structure ................................................................................. 45
3.2.2 Network configuration structure .......................................................................................... 46
3.2.3 Channel image configuration structure ................................................................................ 47
3.2.4 Compression parameter confirguration structure ................................................................. 50
3.2.5 Record parameter configuration structure ............................................................................ 50
3.2.6 PTZ parameter configuration structure ................................................................................ 51
3.2.7 Serial ports confirguration structure ..................................................................................... 51
3.2.8 Alarm input configuration structure ..................................................................................... 52
3.2.9 Alarm output configuration structure ................................................................................... 53
3.2.10 Local preview parameter configuration structure .............................................................. 53
3.2.11 Video output configuration structure .................................................................................. 53
3.2.12 User parameter confirguration structure............................................................................. 54
3.2.13 Exception parameter configuration structure ..................................................................... 55
3.2.14 Frame configuration structure ............................................................................................ 55
3.2.15 the configure structure of characrer added in the encoder side ....................................... 56
3.2.16 6001D/F configuration structure ........................................................................................ 56
3.2.17 HS device AUX output configuration structure ................................................................. 59

Page 3 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

3.2.18 network parametersNTP/DDNS/EMAIL ................................................................... 59


3.2.19 NFS configuration .............................................................................................................. 61
3.2.20 IPspeed dome configuration ............................................................................................... 61
3.2.21 multi-channel decoder parameters ..................................................................................... 62
CHAPTER 4 API FUNCTION INTRODUCTION ................................64
4.1 Client-end function .............................................................................................. 64
4.1.1 Initialization ......................................................................................................................... 64
4.1.2 Set display mode .................................................................................................................. 67
4.1.3 Start/Stop listen program...................................................................................................... 68
4.1.4 Get the error code ................................................................................................................. 68
4.1.5 User login ............................................................................................................................. 70
4.1.6 Network preview .................................................................................................................. 70
4.1.6.1 Video parameter ................................................................................................................ 71
4.1.6.2 Overlap characters and pictures ........................................................................................ 71
4.1.6.3 Play control ....................................................................................................................... 72
4.1.6.4 Audio control..................................................................................................................... 72
4.1.6.5 Capture data ...................................................................................................................... 73
4.1.6.6 Capture picture .................................................................................................................. 74
4.1.7 PTZ control .......................................................................................................................... 74
4.1.8 Playback and download........................................................................................................ 79
4.1.8.1 Search file ......................................................................................................................... 79
4.1.8.2 Playback ............................................................................................................................ 80
4.1.8.3 Play control ....................................................................................................................... 81
4.1.8.4 Capture data ...................................................................................................................... 82
4.1.8.5 Get OSD time .................................................................................................................... 83
4.1.8.6 Capture picture .................................................................................................................. 83
4.1.8.7 Download .......................................................................................................................... 83
4.1.9 Alarm.................................................................................................................................... 84
4.1.10 Voice dialogue .................................................................................................................... 85
4.1.11 Voice broadcast................................................................................................................... 85
4.1.12 Transparent channel ........................................................................................................... 86
4.1.13 Remote control local display .............................................................................................. 87
4.1.14 Remote manually record .................................................................................................... 87
4.1.15 Decode card........................................................................................................................ 88
4.1.16 Log ..................................................................................................................................... 91
4.1.17 Get device status ................................................................................................................ 91
4.2 DVR-end configuration function .......................................................................... 92
4.2.1 Parameter configuration ....................................................................................................... 92
4.2.2 Restore the default parameters ............................................................................................. 95
4.2.3 Save parameter ..................................................................................................................... 95
4.2.4 Reboot/shut down device ..................................................................................................... 95
4.2.5 Remote upgrading ................................................................................................................ 95
4.2.6 Remote format hard disk ...................................................................................................... 96
4.2.7 Configure transaction information (ATM/POS DVR) ......................................................... 97

Page 4 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

Version Description

Version 2.2(080327)
1. Add the define of the device model, SDK V2.2device model as below:
#define DVR 1 /*undefined dvr model */
#define ATMDVR 2 /*atm dvr*/
#define DVS 3 /*DVS*/
#define DEC 4 /* 6001D */
#define ENC_DEC 5 /* 6001F */
#define DVR_HC 6 /*8000HC*/
#define DVR_HT 7 /*8000HT*/
#define DVR_HF 8 /*8000HF*/
#define DVR_HS 9 /* 8000HS DVR(no audio)
*/
#define DVR_HTS 10 /* 8016HTS DVR(no
audio) */
#define DVR_HB 11 /* HB DVR(SATA HD) */
#define DVR_HCS 12 /* 8000HCS DVR */
#define DVS_A 13 /* support HDD DVS */
#define DVR_HC_S 14 /* 8000HC-S */
#define DVR_HT_S 15 /* 8000HT-S */
#define DVR_HF_S 16 /* 8000HF-S */
#define DVR_HS_S 17 /* 8000HS-S */
#define ATMDVR_S 18 /* ATM-S */
#define DVR_7000H 19 /*7000 DVR*/
#define DEC_MAT 20 /*multi channel decoder*/
#define DVR_MOBILE 21 /* mobile DVR */
#define DVR_HD_S 22 /* 8000HD-S */
#define DVR_HD_SL 23 /* 8000HD-SL */
#define DVR_HC_SL 24 /* 8000HC-SL */
#define DVR_HS_ST 25 /* 8000HS-ST */
#define DVS_HW 26 /* 6000HW */
#define IPCAM 30 /*IP camera*/
#define IPDOME 40 /*IP speed dome*/
#define IPMOD 50 /*IP module*/

2. Added new PTZ protocol as below:


#define TC615P 88
#define NANWANG 89

Page 5 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

#define NANWANG_1602 90
#define SieMens 91
#define WVCS850 92
#define PHLIPS_2 93
#define PHLIPS_3 94
#define AD 95
#define TYCO_AD 96
#define VICON 97
#define TKC676 98
#define YAAN_NEW 99
#define DL_NVS_1Z 100
#define I3_Z1200 101
#define I3_Z2200 102

3Add the DDNS configures tructure. The structure define as below:


#define MAX_DOMAIN_NAME 64 //the length of the domain name

typedef struct tagNET_DDNSPARA_EX


{
BYTE byHostIndex; /* 0- (reserved) 1Dyndns 2PeanutHull
*/
BYTE byEnableDDNS; /*whetherto use the DDNS, 0-NO,
1-YES */
WORD wDDNSPort; /* DDNS port */
BYTE sUsername[NAME_LEN]; /* DDNS user name */
BYTE sPassword[PASSWD_LEN]; /* DDNS password */
BYTE sDomainName[MAX_DOMAIN_NAME]; /* the domain address that
device have */
BYTE sServerName[MAX_DOMAIN_NAME]; /* DDNS server address, IP address
or domainname */
BYTE byRes[16];
}NET_DVR_DDNSPARA_EX, *LPNET_DVR_DDNSPARA_EX;

Parameters configure command


#define NET_DVR_GET_DDNSCFG_EX 274 //get the extend DDNS parameters
#define NET_DVR_SET_DDNSCFG_EX 275 //set the extend DDNS parameters
Use the API NET_DVR_GetDVRConfig / NET_DVR_SetDVRConfi to get the set the
parameters
4. Add sleep HDD error type in the HDD status of device status
typedef struct tagDISKSTATE
{
DWORD dwVolume;//HDD space
DWORD dwFreeSpace;// HDD free space
DWORD dwHardDiskStatic; //HDD status, 1-sleep, 2- abnormal, 3-sleep HDD error
}NET_DVR_DISKSTATE, *LPNET_DVR_DISKSTATE;

Page 6 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

This stuucture is included in the NET_DVR_WORKSTATE and you can get it using
NET_DVR_GetDVRWorkState

5. Add status value when remote format the HDD, the status value as below:
0----being formating
1----format complete
2----format the current HDD error(including local HDD and network HDD)
3----the network HDD lost(such as network failure), can not format.

6. Event trigger the bytebyStreamTypein which in the structure of


NET_DVR_COMPRESSION_INFO, its highest bit means if make the configuration of
event trigger compression parameters effective, 0-NO,1-YES.

7. multi channel decoder get the dwIsLinked in the decode channel status structure
NET_DVR_MATRIX_DEC_CHAN_STATUS, which means the device decode status.
Ststus character add up to 4, 0-sleep, 1-being connecting, 2-connect successful, 3-being
decoding

8. Add new API which used for getting the sdk build number

NET_DVR_API DWORD __stdcall NET_DVR_GetSDKBuildVersion();


Function: get the SDK build number
Return value: SDK build number, the 2 high byte means version, 2 low byte means
version modification increment, return such as 0x0220****

9. support some of the ATM machine which have 5 kinds on-off alarm input,
in other words, support the ATM which support environment trigger alarm, add
environment trigger alarm record type, the number is 0x8, if the device type is ATM and
the device parameters have 5 on-off alarm input, it means this type is supported.

10. Add new define of ATM COM input


#define KALATEL 22
#define NCR_2 23
#define NXS 24

Version 2.11(071130)

1 Add new email configure function

#define NET_DVR_GET_EMAILPARACFG 250 //Get EMAIL parameters


#define NET_DVR_SET_EMAILPARACFG 251 //Setup EMAIL parameters

typedef struct tagEMAILCFG


{ /* 12 bytes */

Page 7 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

DWORD dwSize;
char sUserName[32];
char sPassWord[32];
char sFromName[32]; /* Sender */
char sFromAddr[48]; /* Sender address *///at the beginning and at the
end of the character, it can not be @, but in the character, it must have @.
char sToName1[32]; /* Receiver1 */
char sToName2[32]; /* Receiver2 */
char sToAddr1[48]; /* Receiver address1 */
char sToAddr2[48]; /* Receiver address2 */
char sEmailServer[32]; /* Email server address */
BYTE byServerType; /* Email server type: 0-SMTP*/
BYTE byUseAuthen; /* Email server authentication method: 1-enable,
0-disable */
BYTE byAttachment; /* Enable attachment */
BYTE byMailinterval; /* Mail interval 0-2s, 1-3s, 2-4s. 3-5s*/
} NET_DVR_EMAILCFG, *LPNET_DVR_EMAILCFG;

2Add a group of compression parameters of event trigger


#define NET_DVR_GET_EVENTCOMPCFG 132 //Get the event trigger record
parameters
#define NET_DVR_SET_EVENTCOMPCFG 133 //Set event trigger record
parameters
typedef struct tagCOMPRESSIONCFG
{
DWORD dwSize;
NET_DVR_COMPRESSION_INFO struRecordPara; //Event trigger record
NET_DVR_COMPRESSION_INFO struNetPara; //Reserved
}NET_DVR_COMPRESSIONCFG,*LPNET_DVR_COMPRESSIONCFG;

3NTPDDNSDNS configure
// NET_DVR_NETAPPCFG structure
#define NET_DVR_GET_NETAPPCFG 222 //Get network application
parameters NTP/DDNS/EMAIL
#define NET_DVR_SET_NETAPPCFG 223 //Set network application
parameters NTP/DDNS/EMAIL

typedef struct tagNTPPARA{


BYTE sNTPServer[64]; /* Domain Name or IP addr of NTP server */
WORD wInterval; /* Adjust time interval(hours) */
BYTE byEnableNTP; /* Enable NPT client 0-no1-yes*/
signed char cTimeDifferenceH; /* Time difference between the international
standard time
-12 ... +13 */
signed char cTimeDifferenceM;

Page 8 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

BYTE res[11];
}NET_DVR_NTPPARA, *LPNET_DVR_NTPPARA;

typedef struct tagDDNSPARA{


BYTE sUsername[NAME_LEN]; /* DDNS accounts user name and password */
BYTE sPassword[PASSWD_LEN];
BYTE sDomainName[64]; /* Domain name */
BYTE byEnableDDNS; /*Whether to use 0-no1-yes*/
BYTE res[15];
}NET_DVR_DDNSPARA, *LPNET_DVR_DDNSPARA;

typedef struct tagNETAPPCFG{


DWORD dwSize;
char sDNSIp[16]; /* DNS server address */
NET_DVR_NTPPARA struNtpClientParam; /* NTP parameters */
NET_DVR_DDNSPARA struDDNSClientParam; /* DDNS parameters */
BYTE res[464]; /* reserverd */
}NET_DVR_NETAPPCFG, *LPNET_DVR_NETAPPCFG;

4NFS setting
#define NET_DVR_GET_NFSCFG 230 /* NFS disk config */
#define NET_DVR_SET_NFSCFG 231
typedef struct tag_NFSCFG{
DWORD dwSize;
struct{
char sNfsHostIPAddr[16];
BYTE sNfsDirectory[PATHNAME_LEN]; // PATHNAME_LEN =
128
}struNfsDiskParam[MAX_NFS_DISK]; // MAX_NFS_DISK=8
}NET_DVR_NFSCFG, *LPNET_DVR_NFSCFG;

5IP speed dome new functions


5.1 Add the selected area zoom in and zoom out
typedef struct tagPOINT_FRAME
{
int xTop; // x coordinate of the origination point of the pane
int yTop; // y coordinate of the origination point of the pane
int xBottom; // x coordinate of the end point of the pane
int yBottom; // y coordinate of the end point of the pane
int bCounter; //reserved
}NET_DVR_POINT_FRAME, *LPNET_DVR_POINT_FRAME;

NET_DVR_API BOOL __stdcall NET_DVR_PTZSelZoomIn(LONG lRealHandle,


LPNET_DVR_POINT_FRAME pStruPointFrame);
Function: selected PTZ image to zoom in and zoom out
Parameterr:

Page 9 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

lRealHandle: reture value of NET_DVR_RealPlay()


pStruPointFrame: pointer that point to NET_DVR_POINT_FRAME
reture value
TRUE means successful,FALSE means failed

5.2 Get the sequence


typedef struct tagCRUISE_RET{
struct{
BYTE PresetNum; //Preset
BYTE Dwell; //Dwell time
BYTE Speed; //Speed
BYTE Reserve;//Reserved
}struCruisePoint[32]; //Support 32 sequences at most
}NET_DVR_CRUISE_RET, *LPNET_DVR_CRUISE_RET;
NET_DVR_API BOOL __stdcall NET_DVR_GetPTZCruise(LONG lUserID,LONG
lChannel,LONG lCruiseRoute, LPNET_DVR_CRUISE_RET lpCruiseRet)
Function: get the PTZ cruise (IP speed dome)
Parameters:
lUserID: return value of the NET_DVR_Login()
lChannel: DVR channel NO.
lCruiseRoute: Sequence path, support 32 at most.
lpCruiseRetReturn NET_DVR_CRUISE_RET structure
Return value
TRUE means successful, FALSE means failed

6Add the configuration of sepqence and cruise:


#define FILL_PRE_SEQ 30 /* Add the preset to the sequence list */
#define SET_SEQ_DWELL 31 /* Set the sequence Dwell time */
#define SET_SEQ_SPEED 32 /* Set the Dwell Speed */
#define CLE_PRE_SEQ 33 /* Delete the preset from the sequence list */
#define STA_MEM_CRUISE 34 /* Start record the cruise */
#define STO_MEM_CRUISE 35 /* Stop record the cruise*/
#define RUN_CRUISE 36 /* Start cruise */
#define RUN_SEQ 37 /* Start sequence */
#define STOP_SEQ 38 /* Stop sequence */

7Add the API of the multi-channel decoder


#define MAX_CYCLE_CHAN 16
7.1Extend the network parameters
#define NET_DVR_GET_NETCFG_OTHER 244 //Get network
parameters(multi-channel decoder)
#define NET_DVR_SET_NETCFG_OTHER 245 //set network
parameters(multi-channel decoder)

Page 10 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

typedef struct tagNETCFG_OTHER{


DWORD dwSize;
char sFirstDNSIP[16];
char sSecondDNSIP[16];
char sRes[32];
}NET_DVR_NETCFG_OTHER,*LPNET_DVR_NETCFG_OTHER;

typedef struct tagDVRCHANINFO{


char sDVRIP[16]; /* DVR IP address */
WORD wDVRPort; /* port number */
BYTE byChannel; /* channel number */
BYTE byTransProtocol; /* transmit protocol type */
BYTE byTransMode; /* transmit stream type 0main stream 1
sub stream*/
BYTE byRes[3];
BYTE sUserName[NAME_LEN]; /* monitor host PC login account */
BYTE sPassword[PASSWD_LEN]; /* monitor host PC password */
}NET_DVR_MATRIX_DECINFO,*LPNET_DVR_MATRIX_DECINFO;

7.2Start/Stop dynamic decoding

// Start/Stop dynamic decoding


typedef struct tagDYNAMIC_TEST{
DWORD dwSize;
NET_DVR_MATRIX_DECINFO struDecChanInfo; /* dynamic decoding
channel Info */
}NET_DVR_MATRIX_DYNAMIC_DEC,*LPNET_DVR_MATRIX_DYNAMIC_DEC
;

NET_DVR_API BOOL __stdcall NET_DVR_MatrixStartDynamic(LONG lUserID,


DWORD dwDecChanNum, LPNET_MATRIX_DYNAMIC_DEC lpDynamicInfo);
Function: start dynamic link test
Parameters instruction:
lUserID: NET_DVR_Login() return value
dwDecChanNum: Decoding channel
lpDynamicInfo: point to NET_MATRIX_DYNAMIC_DEC pointer of structure
Return value
TRUE means successful, FALSE means failed

NET_DVR_API BOOL __stdcall NET_DVR_MatrixStopDynamic(LONG lUserID,


DWORD dwDecChanNum);
Function: stop dynamic link test
Parameters instruction:
lUserID: NET_DVR_Login() return value
dwDecChanNum: Decording channel
Return value

Page 11 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

TRUE means successful, FALSE means failed

7.3Set and get the parameters of the cycle decoding channel.

/*connected channel confihguration*/


typedef struct tagMATRIX_CHAN_INFO
{
DWORD dwEnable; /* whether to use, 0no 1yes*/
NET_DVR_MATRIX_DECINFO struDecChanInfo; /* The cycle
decoding channel Info */
}NET_DVR_MATRIX_CHAN_INFO,*LPNET_DVR_MATRIX_CHAN_INFO;

/* The configuration of each decoding channel*/


typedef struct tagLOOPDECINFO
{
DWORD dwSize;
DWORD dwPoolTime; /*cycle time */
NET_DVR_MATRIX_CHAN_INFO struchanConInfo[MAX_CYCLE_CHAN];
}NET_DVR_MATRIX_LOOP_DECINFO,
*LPNET_DVR_MATRIX_LOOP_DECINFO;

NET_DVR_API BOOL __stdcall NET_DVR_MatrixSetLoopDecChanInfo(LONG


lUserID, DWORD dwDecChanNum, LPNET_MATRIX_LOOP_DECINFO lpInter);
Function: set the cycle decoding channel
Parameters instruction:
lUserID: NET_DVR_Login() return value
dwDecChanNumDecoding channel
lpInter:The pointer that point to NET_MATRIX_LOOP_DECINFO structure
return value:
TRUE means successful, FALSE means failed

NET_DVR_API BOOL __stdcall NET_DVR_MatrixGetLoopDecChanInfo(LONG


lUserID, DWORD dwDecChanNum, LPNET_MATRIX_LOOP_DECINFO lpInter);
Function: get the cycle decoding channel
Parameters instruction:
lUserID: NET_DVR_Login() return value
dwDecChanNumDecoding channel
lpInter: pointer that point to the NET_MATRIX_LOOP_DECINFO structure
return value:
TRUE means successful, FALSE means failed

7.4Set and get the cycle decoding switch

NET_DVR_API BOOL __stdcall NET_DVR_MatrixSetLoopDecChanEnable(LONG


lUserID, DWORD dwDecChanNum, DWORD dwEnable);
Function: set the decoding channel cycle switch

Page 12 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

Parameters instruction:
lUserID: NET_DVR_Login() return value
dwDecChanNumdecoding channel
dwEnable:0 means turn off, 1 means turn on
return value:
TRUE means successful, FALSE means failed

NET_DVR_API BOOL __stdcall NET_DVR_MatrixGetLoopDecChanEnable(LONG


lUserID, DWORD dwDecChanNum, LPDWORD lpdwEnable);
Function: get the decoding channel cycle switch
Parametrers instruction:
lUserID: NET_DVR_Login() rturn value
dwDecChanNumdecoding channel
lpdwEnable: pointer that point ot the DWORDif get the value means turn off, 1 means
turn on
return value:
TRUE means successful, FALSE means failed

NET_DVR_API BOOL __stdcall NET_DVR_MatrixGetLoopDecEnable(LONG


lUserID, LPDWORD lpdwEnable);
Function: get all the cycle switch of all the decoding channel
Parameters instruction:
lUserID: NET_DVR_Login() return value
lpdwEnable: the pointer that point to DWORDuse bit show the value, beginning with
the lowest, 0 means turn off, 1 means turn on
return value:
TRUE means successful, FALSE means failed

7.5Get the status of the decoding channel


typedef struct tagDEC_MATRIX_CHAN_INFO
{
DWORD dwSize;
NET_DVR_MATRIX_DECINFO struDecChanInfo; /* Decoding channel
Info*/
DWORD dwDecState; /* 0-dynamic decode 1 cycle decode 2 playback
according to the file 3playback according to the time */
NET_DVR_TIME StartTime; /* the start time of playback according to the time
*/
NET_DVR_TIME StopTime; /* the stop time of playback according to the time
*/
char sFileName[128]; /* the file name of playback according to the file */
}NET_DVR_MATRIX_DEC_CHAN_INFO,*LPNET_DVR_MATRIX_DEC_CHAN_I
NFO;

NET_DVR_API BOOL __stdcall NET_DVR_MatrixGetDecChanInfo(LONG lUserID,

Page 13 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

DWORD dwDecChanNum, LPNET_DVR_MATRIX_DEC_CHAN_INFO lpInter);


Function: Get the decoding channel Info
Parameters instructiom:
lUserID: NET_DVR_Login() return value
dwDecChanNumdecoding channel
lpInter: the pointer that point to the NET_DVR_MATRIX_DEC_CHAN_INFO structure
return value:
TRUE means successful, FALSE means failed

typedef struct tagMATRIX_DEC_CHAN_STATUS


{
DWORD dwSize;
DWORD dwIsLinked; /* Network link status tag, 0: hasn't linked yet, 1:
linked */
DWORD dwStreamCpRate; /* Stream copy rate, X kbits/second */
char cRes[64]; /* reserved */
}NET_DVR_MATRIX_DEC_CHAN_STATUS,*LPNET_DVR_MATRIX_DEC_CHA
N_STATUS;

NET_DVR_API BOOL __stdcall NET_DVR_MatrixGetDecChanStatus(LONG lUserID,


DWORD dwDecChanNum, LPNET_DVR_MATRIX_DEC_CHAN_STATUS lpInter);
Function: get the status of the current decoding channel
Parametersinstruction:
lUserID: NET_DVR_Login() return value
dwDecChanNumdecoding channel
lpInter: the pointer that point ot NET_DVR_MATRIX_DEC_CHAN_ STATUS structure
return value:
TRUE means successful, FALSE means failed

7.6Set the switch of getting the decoding channel


NET_DVR_API BOOL __stdcall NET_DVR_MatrixSetDecChanEnable(LONG lUserID,
DWORD dwDecChanNum, DWORD dwEnable);
Function: set the switch of decoding channel
Parameters indtruction:
lUserID: NET_DVR_Login() return value
dwDecChanNumdecoding channel
dwEnable:0 emans turn off 1 means turn on
return value:
TRUE means successful, FALSE means failed

NET_DVR_API BOOL __stdcall NET_DVR_MatrixGetDecChanEnable(LONG


lUserID, DWORD dwDecChanNum, LPDWORD lpdwEnable);
Function: get the switch of the decoding channel
Parameters instruction:
lUserID: NET_DVR_Login() return value
dwDecChanNumDecoding channel

Page 14 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

lpdwEnable: the pointer that point to DWORDif get 0 means turn off, 1 means turn on
return value:
TRUE means successful, FALSE means failed

8New device type


#define DEC_MAT 20 //multi-channel decoder
#define NETRET_IPCAM 30 /*IP camera*/
#define NETRET_IPDOME 40 /*IP speed dome*/
#define NETRET_IPMOD 50 /*IP module*/

9Add the decoder type as below


/* PTZ type */
#define YOULI 0
#define LILIN_1016 1
#define LILIN_820 2
#define PELCO_P 3
#define DM_QUICKBALL 4
#define HD600 5
#define JC4116 6
#define PELCO_DWX 7
#define PELCO_D 8
#define VCOM_VC_2000 9
#define NETSTREAMER 10
#define SAE 11
#define SAMSUNG 12
#define KALATEL_KTD_312 13
#define CELOTEX 14
#define TLPELCO_P 15
#define TL_HHX2000 16
#define BBV 17
#define RM110 18
#define KC3360S 19
#define ACES 20
#define ALSON 21
#define INV3609HD 22
#define HOWELL 23
#define TC_PELCO_P 24
#define TC_PELCO_D 25
#define AUTO_M 26
#define AUTO_H 27
#define ANTEN 28
#define CHANGLIN 29
#define DELTADOME 30
#define XYM_12 31

Page 15 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

#define ADR8060 32
#define EVI 33
#define Demo_Speed 34
#define DM_PELCO_D 35
#define ST_832 36
#define LC_D2104 37
#define HUNTER 38
#define A01 39
#define TECHWIN 40
#define WEIHAN 41
#define LG 42
#define D_MAX 43
#define PANASONIC 44
#define KTD_348 45
#define INFINOVA 46
#define PIH_7625 47
#define IDOME_IVIEW_LCU 48
#define Dennar_dDome 49
#define Philips 50
#define SAMPLE 51
#define PLD 52
#define PARCO 53
#define HY 54
#define NAIJIE 55
#define CAT_KING 56
#define YH_06 57
#define SP9096X 58
#define M_PANEL 59
#define M_MV2050 60
#define SAE_QUICKBALL 61
#define RED_APPLE 62
#define NKO8G 63
#define DH_CC440 64
#define TX_CONTROL_232 65
#define VCL_SPEED_DOME 66
#define ST_2C160 67
#define TDWY 68
#define TWHC 69
#define USNT 70
#define KLT_NVD2200PS 71
#define VIDO_B01 72
#define LG_MULTIX 73
#define ENKEL 74
#define YT_PELCOD 75
#define HIKVISION 76
#define PE60 77

Page 16 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

#define LiAo 78
#define NK16 79
#define DaLi 80
#define HN_4304 81
#define VIDEOTEC 82
#define HNDCB 83
#define Lion_2007 84
#define LG_LVC_C372 85
#define Gold_Video 86
#define NVD1600PS 87
#define TC615P 88
#define NANWANG 89
#define NANWANG_1602 90
#define SieMens 91
#define WVCS850 92
#define PHLIPS_2 93
#define PHLIPS_3 94
#define AD 95
#define TYCO_AD 96
#define VICON 97
#define TKC676 98
#define YAAN_NEW 99
#define DL_NVS_1Z 100
#define I3_Z1200 101
#define I3_Z2200 102

10New call-back function extendtion

NET_DVR_API BOOL __stdcall NET_DVR_SetDVRMessCallBack_NEW(BOOL


(CALLBACK *fMessCallBack_NEW)(LONG lCommand,char *sDVRIP,char
*pBuf,DWORD dwBufLen, WORD dwLinkDVRPort));
Function: the call-back function of registering and getting the DVR message (use t he
DVR IP and DVR port to call-back)
Return value:
TRUE means successful, FALSE means failed

NET_DVR_API BOOL __stdcall NET_DVR_SetDVRMessageCallBack(BOOL


(CALLBACK *fMessageCallBack)(LONG lCommand,char *sDVRIP,char
*pBuf,DWORD dwBufLen, DWORD dwUser), DWORD dwUser);
Function: the call-back function of registering and getting the DVR message(carry the
user data)
Return value:
TRUE means successful, FALSE means failed

Page 17 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

11. Extend function of capturing picture

typedef struct
{
DWORD dwReturn; /* whether return the picture data directly*/
DWORD dwUploadFtp; /* whether upload to the Ftp server*/
DWORD dwSaveHd; /* whether saved into the device HDD*/
char sImageName[PATHNAME_LEN]; /*self-define the file anme of the
picture*/
char sOsdStr[16]; /* the OSD characters that need to add in the picture*/
WORD wOsdLen; /*the OSD length of the characters*/
}NET_DVR_GETJPEG, *LPNET_DVR_GETJPEG;
NET_DVR_API BOOL __stdcall NET_DVR_CaptureJPEGPicture_NEW(LONG
lUserID, LONG lChannel, LPNET_DVR_JPEGPARA lpJpegPara, char *sJpegPicBuffer,
DWORD dwPicSize, LPDWORD lpSizeReturned);
Function: capture the JPEG picture(extend);
Parameters:
lUserID: NET_DVR_Login() return value
lChannel: cahnnel NO.
lpJpegPara: the pointer that point to NET_DVR_JPEGPARA
sJpegPicBuffer:the buffer that save the JPEG data
dwPicSize: input the size of the buffer
lpSizeReturned:Return the size of the picture
return value:
TRUE means successful, FALSE means failed

12. Force I frame in the sub stream

NET_DVR_API BOOL __stdcall NET_DVR_MakeKeyFrameSub(LONG lUserID,


LONG lChannel);
Function: create a I frame in the subl stream
Parameters instruction:
lUserID: NET_DVR_Login() return value
lChannel: channel NO.
return value:
TRUE means successful, FALSE means failed

Version 2.1: (2007-1-19)


1. Add new time/date format type
BYTE byOSDType /* 4 ----- DD-MM-YYYY */

2. Add extended compression parameters


#define NET_DVR_GET_COMPRESSCFG_EX 204
//Get extended compression parameters

Page 18 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

#define NET_DVR_SET_COMPRESSCFG_EX 205


//Set extended compression parameters

typedef struct tagCOMPRESSION_INFO_EX


{
BYTE byStreamType; //0-Video stream, 1-Video&Audio stream,
BYTE byResolution; //0-DCIF, 1-CIF, 2-QCIF, 3-4CIF, 4-2CIF
BYTE byBitrateType; //0-Variable, 1-Fix
BYTE byPicQuality;
//0-Best, 1-Better, 2-Good, 3-Average, 4-Bad, 5-Worse
DWORD dwVideoBitrate;
//0-Reserved, 1-Reserved, 2-32Kbps, 3-48Kbps, 4-64Kbps, //5-80Kbps,
6-96Kbps, 7-128Kbps, 8-160Kbps, 9-192Kbps, //10-224Kbps, 11-256Kbps,
12-320Kbps, 13-384Kbps, 14-448Kbps, //15-512Kbps, 16-640Kbps,
17-768Kbps, 18-896Kbps, 19-1024Kbps, //20-1280Kbps, 21-1536Kbps,
22-1792Kbps, 23-2048Kbps
//If set the highest bit (31) as 1, it menas self-define bit rate value, and bit
0-30 menas the bit rate value (MIN-32K MAX-8192K).
DWORD dwVideoFrameRate;
//0-Full; 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-12FPS;
12-16FPS; 13-20FPS;
//V2.0 firmware can support 1415FPS;1518FPs;1622FPS;
WORD wIntervalFrameI; //I Frame interval
BYTE byIntervalBPFrame;
//0-BBP; 1-BP (Reserved); 2-P Frame
BYTE byRes;
}NET_DVR_COMPRESSION_INFO_EX,*LPNET_DVR_COMPRESSION_INFO
_EX;

typedef struct tagCOMPRESSIONCFG_EX


{
DWORD dwSize;
NET_DVR_COMPRESSION_INFO_EX struRecordPara; //Recording
NET_DVR_COMPRESSION_INFO_EX struNetPara; //Network transmission
}NET_DVR_COMPRESSIONCFG_EX,*LPNET_DVR_COMPRESSIONCFG_EX
;

3. Add ATM port configuration

NET_DVR_API BOOL __stdcall NET_DVR_SetATMPortCFG(LONG lUserID,


WORD wATMPort); //Setup ATM PORT
NET_DVR_API BOOL __stdcall NET_DVR_GetATMPortCFG(LONG lUserID,
WORD *lpOutATMPort); //Get ATM PORT

4. Add API to enable scaler function

Page 19 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

NET_DVR_API BOOL __stdcall NET_DVR_SetScaleCFG(LONG lUserID,


DWORD dwScale); //Setup
If you enable it, the live preview screen resolution will be 640*576/640*480
(PAL/NTSC), otherwise, the live preview screen resolution is 704*576/704*480
(PAL/NTSC).

NET_DVR_API BOOL __stdcall NET_DVR_GetScaleCFG(LONG lUserID,


DWORD *lpOutScale); //Get

5. Add following new PTZ type

#define TX_CONTROL_232 65
#define VCL_SPEED_DOME 66
#define ST_2C160 67
#define TDWY 68
#define TWHC 69
#define USNT 70
#define KLT_NVD2200PS 71
#define VIDO_B01 72
#define LG_MULTIX 73
#define ENKEL 74
#define YT_PELCOD 75

Rename RED_APPLE as PEARMAIN whose number is 62.

6. Add following DVR type

#define DVR_HC_S 14
#define DVR_HT_S 15
#define DVR_HF_S 16
#define DVR_HS_S 17
#define ATMDVR_S 18
#define LOWCOST_DVR 19

7. Add new frame rate type in structure


NET_DVR_COMPRESSION_INFO_EX for Version 2.0 firmware:
Please note V1.6 firmware can not support
14 ---- 15FPS
15 ---- 18FPS
16 ---- 22FPS

8. Add new API to support multi-display for client software


//support multi-display

Page 20 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

NET_DVR_API BOOL __stdcall NET_DVR_InitDDrawDevice();


NET_DVR_API BOOL __stdcall NET_DVR_ReleaseDDrawDevice();
NET_DVR_API LONG __stdcall NET_DVR_GetDDrawDeviceTotalNums();
NET_DVR_API BOOL __stdcall NET_DVR_SetDDrawDevice(LONG
lPlayPort, DWORD nDeviceNum);
//Pause
NET_DVR_API BOOL __stdcall NET_DVR_RefreshPlay(LONG lPlayHandle);
//JPEG captured in buffer
NET_DVR_API BOOL __stdcall
NET_DVR_CaptureJPEGPicture_NEW(LONG lUserID, LONG lChannel,
LPNET_DVR_JPEGPARA lpJpegPara, char *sJpegPicBuffer, DWORD
dwPicSize, LPDWORD lpSizeReturned);

Page 21 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

Version 1.5: (2006-5-4)


1. Add the following APIs for decode server (DS-6001DI/DS-6001FI). Please refer
to decode server programmer manual for detail information.
BOOL __stdcall NET_DVR_SetDecInfo(LONG lUserID, LONG lChannel,
LPNET_DVR_DECCFG lpDecoderInfo);

BOOL __stdcall NET_DVR_GetDecInfo(LONG lUserID, LONG lChannel,


LPNET_DVR_DECCFG lpDecoderInfo);

BOOL __stdcall NET_DVR_SetDecTransPort(LONG lUserID,


LPNET_DVR_PORTCFG lpTransPort);

BOOL __stdcall NET_DVR_GetDecTransPort(LONG lUserID,


LPNET_DVR_PORTCFG lpTransPort);

BOOL __stdcall NET_DVR_DecPlayBackCtrl(LONG lUserID, LONG


lChannel, DWORD dwControlCode, DWORD dwInValue, DWORD
*lpOutValue, LPNET_DVR_PLAYREMOTEFILE lpRemoteFileInfo);

BOOL __stdcall NET_DVR_StartDecSpecialCon(LONG lUserID, LONG


lChannel, LPNET_DVR_DECCHANINFO lpDecChanInfo);

BOOL __stdcall NET_DVR_StopDecSpecialCon(LONG lUserID, LONG


lChannel, LPNET_DVR_DECCHANINFO lpDecChanInfo);

BOOL __stdcall NET_DVR_DecCtrlDec(LONG lUserID, LONG lChannel,


DWORD dwControlCode);

BOOL __stdcall NET_DVR_DecCtrlScreen(LONG lUserID, LONG


lChannel, DWORD dwControl);

BOOL __stdcall NET_DVR_GetDecCurLinkStatus(LONG lUserID, LONG


lChannel, LPNET_DVR_DECSTATUS lpDecStatus);

2. Add new structure for overlay text function. It can max support overlay 4 lines
and each line can max support 44 English characters.
#define MAX_STRINGNUM 4
#define NET_DVR_GET_SHOWSTRING 130 //Get overlay character
number
#define NET_DVR_SET_SHOWSTRING 131 //Set overlay character
number
typedef struct{
DWORD dwShowString; //0 means displaying text on live video;
//1 means not displaying text on live video;
//Display area is 704*576(PAL) or 704*480
(NTSC)

Page 22 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

//Each character is 16*32;


WORD wShowStringTopLeftX; //Start displaying position;
WORD wShowStringTopLeftY; //Start displaying position;
Char sString[44]; //Displaying characters;
}NET_DVR_SHOWSTRINGINFO, *LPNET_DVR_SHOWSTRINGINFO;

typedef struct{
DWORD dwSize;
NET_DVR_SHOWSTRINGINFO
struStringInfo[MAX_STRINGNUM];
}NET_DVR_SHOWSTRING, *LPNET_DVR_SHOWSTRING;

3. Add the following PTZ types:


#define SAMPLE 51
#define PLD 52
#define PARCO 53
#define HY 54
#define NAIJIE 55
#define CAT_KING 56
#define YH_06 57
#define SP9096X 58
#define M_PANEL 59
#define M_MV2050 60
#define SAE_QUICKBALL 61
#define RED_APPLE 62
#define NK08G 63
#define DH_CC440 64

4. Add new API for voice talk function:


For original voice talk function, the API is named NET_DVR_StartVoiceCom.
The SDK will capture and compress the live voice from PC and send voice audio
data to DVR. Also SDK will decode the voice from DVR directly. The programmers
do not need to pay attention to sound encoding and decoding. In V1.5 SDK, we add
the new API named NET_DVR_StartVoiceCom_MR and
NET_DVR_VoiceComSendData. If you use these API to start voice talk function,
you can get the live voice sound from DVR and decode the compressed sound
individually by yourself. Also you must compress the voice and send the compressed
sound to DVR by yourself.
BOOL __stdcall NET_DVR_StartVoiceCom_MR(LONG lUserID,
void(CALLBACK *fVoiceDataCallBack)(LONG lVoiceComHandle, char
*pRecvDataBuffer, DWORD dwBufSize, BYTE byAudioFlag, DWORD
dwUser), DWORD dwUser);
BOOL __stdcall NET_DVR_VoiceComSendData(LONG lVoiceComHandle,
char *pSendBuf, DWORD dwBufSize);

5. Add APIs for sound (audio) encoding and decoding:

Page 23 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

a) Void* __stdcall NET_DVR_InitG722Decoder(int nBitrate);


This API is used to initialize audio decoding.
nBitrate is the sample rate 16000bps.
The return value is the handle of audio decoding.
b) BOOL __stdcall NET_DVR_DecodeG722Frame(void pDecHandle,
unsigned char* pInBuffer, unsigned char* pOutBuffer);
This API is used to decoding audio.
pDecHandle is the return value of NET_DVR_InitG722Decoder;
pInBuffer is the input buffer. The size is 80.
pOutBuffer is the output buffer. The size is 1280.

c) void __stdcall NET_DVR_ReleaseG722Decoder(void *pDecHandle);


This API is used to release audio decoding resources.

d) void __stdcall NET_DVR_InitG722Encoder();


This API is used to initialize audio encoding.

e) BOOL __stdcall NET_DVR_EncodeG722Frame(void pEncodeHandle,


unsigned char* pInBuffer, unsigned char* pOutBuffer);
This API is used to encoding audio.
pEncodeHandle is the return value of NET_DVR_InitG722Encoder.
pInBuffer is the input buffer. The size is 1280.
pOutBuffer is the output buffer. The size is 80.

f) void __stdcall NET_DVR_ReleaseG722Encoder(void *pEncodeHandle);


This API is used to release audio encoding resources.

The audio encoding and decoding sample standard must be:


const int SAMPLES_PER_SECOND = 16000;
const int CHANNEL = 1;
const int BITS_PER_SAMPLE = 16;
WAVEFORMATEX m_wavFormatEx;
m_wavFormatEx.cbSize = sizeof(m_wavFormatEx);
m_wavFormatEx.nBlockAlign = CHANNEL * BITS_PER_SAMPLE / 8;
m_wavFormatEx.nChannels = CHANNEL;
m_wavFormatEx.nSamplesPerSec = SAMPLES_PER_SECOND;
m_wavFormatEx.wBitsPerSample = BITS_PER_SAMPLE;
m_wavFormatEx.nAvgBytesPerSec =
SAMPLES_PER_SECOND*m_wavFormatEx.nBlockAlign.

6. Add the API to capture picture when using hardware decoding:


BOOL NET_DVR_CapturePicture_Card(LONG lRealHandle, char*
sPicFileName);

7. Add the API to capture JPEG image:


typedef struct{

Page 24 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

WORD wPicSize; //0 CIF, 1 -- QCIF, 2 4CIF;


WORD wPicQuality; //0 the best, 1 better, 2 average;
}NET_DVR_JPEGPARA, *LPNET_DVR_JPEGPARA;

BOOL __stdcall NET_DVR_CaptureJPEGPicture(LONG lUserID, LONG


lChannel, LPNET_DVR_JPEGPARA lpJpegPara, char* sPicFileName);

8. Add two DVR types:


#define DVR_HCS 12
#define DVS_A 13

9. The user rights of accessing DVR can be defined to each channel:


#define NET_DVR_GET_USERCFG_EX 202 //Get user
parameters
#define NET_DVR_SET_USERCFG_EX 203 //Set user
parameters
typedef struct{
BYTE sUserName[NAME_LEN]; //user name
BYTE sPassword[PASSWD_LEN]; //password
DWORD dwLocalRight[MAX_RIGHT]; //rights
DWORD dwLocalPlaybackRight; //bit0 channel 1
//bit1 channel 2
DWORD dwRemoteRight[MAX_RIGHT];
DWORD dwNetPreviewRight;
DWORD dwNetPlaybackRight;
Char sUserIP[16];
BYTE byMACAddr[MACADDR_LEN];
}NET_DVR_USER_INFO_EX, *LPNET_DVR_USER_INFO_EX;

typedef struct{
DWORD dwSize;
NET_DVR_USER_INFO_EX struUser[MAX_USERNUM];
}NET_DVR_USER_EX, *LPNET_DVR_USER_EX;

10. V1.5 SDK updates the software decoding lib (PlayM4.dll, PlayM4.lib) and
hardware decoding lib (DsSdk.dll, DsSdk.lib). The lib named tmman32.dll
does not need any more.

11. Add the function to remote setup aux output for DS-8016HSI DVR:
#define NET_DVR_GET_AUXOUTCFG 140 //Get aux output parameters
#define NET_DVR_SET_AUXOUTCFG 141 //Set aux output parameters

typedef struct tagAUXOUT{


DWORD dwSize;
DWORD dwAlarmOutChan; //0 main video output
//1 aux1 video output

Page 25 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

//2 aux2 video output


//3 aux3 video output
//4 aux4 video output
DWORD dwAlarmChanSwitchTime; //alarm image switch
time
DWORD dwAuxSwitchTime[MAX_AUXOUT]; //live preview switch
time
BYTE byAuxOrder[MAX_AUXOUT][MAX_WINDOW];
//preview sequence, 0xff
means not preview the camera.
}NET_DVR_AUXOUTCFG, *LPNET_DVR_AUXOUTCFG;

12. Add the API that can adjust PTZ speed:


BOOL __stdcall NET_DVR_PTZControlWithSpeed(LONG lRealHandle,
DWORD dwPTZCommand, DWORD dwStop, DWORD dwSpeed);

BOOL __stdcall NET_DVR_PTZControlWithSpeed_Other(LONG lUserID,


LONG lChannel, DWORD dwPTZCommand, DWORD dwStop, DWORD
dwSpeed);
The dwSpeed parameter is the PTZ control speed. Please refer to PTZ user
manual for spped value.

13. Support one new ATM machine:


#define DRS918 21

14. Add one sub exception type:


#define MINOR_NET_BROKEN 0x27 //Network broken

15. If alarm type is HDD error, HDD number is 0 means DVR has not HDD.

16. Add new message type:


#define EXCEPTION_EXCHANGE 0x8000
//Exception for network
communication

Page 26 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

Version 1.4:
1. In message call back function (fMessCallBack), add a new kind of message type
named COMM_TRADEINFO. It represents the ATM transaction information
that ATM DVR will upload to center.
#define COMM_TRADEINF 0x1500
//ATMDVR upload transaction information to center
The transacton information structure is defined as following:
typedef struct{
USHORT m_Year; /* Year */
USHORT m_Month; /* Month */
USHORT m_Day; /* Day */
USHORT m_Hour; /* Hour */
USHORT m_Minute; /* Minute */
USHORT m_Second; /* Second */
BYTE DeviceName[24]; /* Deveic name */
DWORD dwChannelNumer; /* Channel No. */
BYTE CardNumber[32]; /* Credit card number */
char cTradeType[12]; /* Transaction type */
DWORD dwCash; /* Transaction money */
}NET_DVR_TRADEINFO,*LPNET_DVR_TRADEINFO;

2. Add three extended PTZ control API:


a) BOOL __stdcall NET_DVR_TransPTZ_EX(LONG lRealHandle, char
*pPTZCodeBuf, DWORD dwBufSize);
b) BOOL __stdcall NET_DVR_PTZControl_EX(LONG lRealHandle,
DWORD dwPTZCommand, DWORD dwStop);
c) NET_DVR_PTZPreset_EX(LONG lRealHandle, DWORD
dwPTZPresetCmd, DWORD dwPresetIndex);
Their usage are the same as those old API (NET_DVR_TransPTZ();
NET_DVR_PTZControl(); NET_DVR_PTZPreset() ). But they are more efficient.

3. Add one new API to get decode card channel handle when you use decode card
to discompress the stream.
HANDLE __stdcall NET_DVR_GetChanHandle_Card(LONG lRealHandle)

4. Add new API to get and save the setup parameters of embedded DVRDVS
through network.
a) BOOL __stdcall NET_DVR_GetConfigFile(LONG lUserID, char
*sFileName)
b) BOOL __stdcall NET_DVR_SetConfigFile(LONG lUserID, char
*sFileName)
c) BOOL __stdcall NET_DVR_GetConfigFile_EX(LONG lUserID, char
*sOutBuffer, DWORD dwOutSize)
d) BOOL __stdcall NET_DVR_SetConfigFile_EX(LONG lUserID, char
*sInBuffer, DWORD dwInSize)

Page 27 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

5. Support maximum 128 PTZ preset number.


#define MAX_PRESET 128

6. In the struct of NET_DVR_NETCFG, add a new member named WORD


wHttpPort to support user self-definition. The default http port value is 80.

7. Support dual-stream function. When you start network preview, you can select
main stream or sub stream. The sub stream can only support CIF and QCIF video
resolution. In the network preview structure NET_DVR_CLIENTINFO and
NET_DVR_CARDINFO, the member named lLinkMode is modified as
following:
The highest bit (31st) definition: 0 means main stream, 1 means sub stream.
030 bits represent link mode.
8. You can set 4 mask areas for version1.4 firmware. Add two new macro definition
and one new structure named NET_DVR_PICCFG_EX.
#define NET_DVR_GET_PICCFG_EX 200 //get video parameter (extend)
#define NET_DVR_SET_PICCFG_EX 201 //set vdieo parameter (extend)

typedef struct{
WORD wHideAreaTopLeftX; /* x coordinate of mask area */
WORD wHideAreaTopLeftY; /* y coordinate of mask area */
WORD wHideAreaWidth; /* width of mask area */
WORD wHideAreaHeight; /* height of mask area*/
}NET_DVR_SHELTER,*LPNET_DVR_SHELTER;

#define MAX_SHELTERNUM 4 /* mask areas number */

typedef struct{
DWORD dwSize;
BYTE sChanName[NAME_LEN];
DWORD dwVideoFormat; /* read only 1-NTSC 2-PAL*/
BYTE byBrightness; /* 0-255*/
BYTE byContrast; /* 0-255*/
BYTE bySaturation; /* 0-255 */
BYTE byHue; /* 0-255*/
//Display channel name
DWORD dwShowChanName; /* 0-Not display,1-Display */
WORD wShowNameTopLeftX; /* x coordinate of channel name */
WORD wShowNameTopLeftY; /* y coordinate of channel name */
//Video lost alarm
NET_DVR_VILOST struVILost;
//Motion detection
NET_DVR_MOTION struMotion;
//View tampering alarm
NET_DVR_HIDEALARM struHideAlarm;
//Mask area

Page 28 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

DWORD dwEnableHide; /* 0-Disable, 1-Enable*/


NET_DVR_SHELTER struShelter[MAX_SHELTERNUM];
//OSD Display
DWORD dwShowOsd; /*0-Not display, 1-Display */
WORD wOSDTopLeftX; /* x coordinate of OSD */
WORD wOSDTopLeftY; /* y coordinate of OSD */
BYTE byOSDType; /* OSD type */
/* 0: XXXX-XX-XX Year Month Day */
/* 1: XX-XX-XXXX Month Day Year */
BYTE byDispWeek; /* Display weekday */
BYTE byOSDAttrib; /* OSD properties */
/* 1: Transparent&Flashing */
/* 2: Transparent&Steady */
/* 3: Opaque&Flashing */
/* 4: Opaque&Steady */
}NET_DVR_PICCFG_EX,*LPNET_DVR_PICCFG_EX;

Page 29 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

Version 1.3:
1. In the struct of motion detection (NET_DVR_MOTION), view tampering
(NET_DVR_HIDEALARM), video loss (NET_DVR_VILOST), a schedule
struct (NET_DVR_SCHEDTIME) is added. You can set the work schedule.
2. In the struct of NET_DVR_DEVICECFG and NET_DVR_DEVICEINFO, there
is a byte named byDVRType. We added the following type:

#define DVR 1
#define ATMDVR 2
#define DVS 3
#define DEC 4
#define ENC_DEC 5
#define DVR_HC 6
#define DVR_HT 7
#define DVR_HF 8
#define DVR_HS 9
#define DVR_HTS 10
#define DVR_HB 11

3. In the struct of NET_DVR_COMPRESSION_INFO, there is an element named


dwVideoBitrate. The minmum bitrate is 32kbps, and the maxmum bitrate is
8192kbps.
4. For the API named NET_DVR_GetUpgradeState(), return value 5 is added. It
means the firmware language is not matched. Add the following definition:
#define NET_DVR_UPGRADELANGMISMATCH 57
5. In the struct NET_DVR_EXCEPTION, modify the definition of array
struExceptionHandleType[MAX_EXCEPTIONNUM]. The definition is:
array0 ---- HDD full
array1 ---- HDD fail
array2 ---- network error,
array3 ---- IP conflict,
array4 ---- illegal access,
array5 ---- input and output video standard not match
6. In the struct of NET_DVR_ALARMINFO, add two alarm types. There are:
7-input and output video standard not match, 8-illegal access
7. The API named NET_DVR_GetPTZCtrl() and NET_DVR_GetPTZCtrl_Other()
are reserved.
8. Delete these three API NET_DVR_SetDspErrMsg_Card(),
NET_DVR_ResetDSP_Card() and NET_DVR_GetSerialNum_Card(). Please
use the API GetBoardDetail() to get the serial number of decode board
DS-4002MDI.
9. Add two new PTZ type:
#define Dennar_dDome 49
#define Philips 50
10. The embedded DVR can also support transaction text overlay function.
11. In the struct NET_DVR_COMPRESSION_INFO, dwVideoFrameRate is defined

Page 30 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

as following:
0-Full; 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;
12. Add the function to throw B frame when remote playback. It is added for the API
NET_DVR_PlayBackControl(). Add the following definition:
#define NET_DVR_THROWBFRAME 20//Thorw B frame
13. Add the API NET_DVR_MakeKeyFrame(LONG lUserID, LONG lChannel) that
can create the key frame if necessary in network preview mode.
14. Add the following extended API:
NET_DVR_API BOOL __stdcall NET_DVR_SetDVRMessCallBack_EX
(BOOL (CALLBACK *fMessCallBack_EX) (LONG lCommand, LONG
lUserID, char *pBuf, DWORD dwBufLen))
The callback can use ID to distinguish different devices with the same IP
address.

Version 1.2:
1. MAX_DISKNUM defined in HCNETSDK.h can support 16 HDD.
#define MAX_DISKNUM 16

Note:
If you use version1.2 above client SDK, please make sure the firmware of
embedded DVRDVS must be also version1.2 above.
If you use DS-4002MDI decode board, please make sure that you use the
version3.2 windows driver.

Page 31 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

Chapter 1 Introduction

1.1 Composition

Client-end Software Development Kit (SDK) is the supported product of


DS-8000HCI Series Embedded Net DVR. This manual gives the detailed introduction of
functions, usages and the relationship between every function in this SDK.
Client-end SDK is made up of Client-end operation and DVR-end operation:
Client-end operation: network preview, remote playback and download, PTZ control,
Set alarm/remove alarm, voice dialogue, log management, decode card ect.,
DVR-end operation: remote upgrading, remote reboot/ shut down, format hard disk,
parameter configuration (system configuration, channel configuration, serial ports
confirguration, alarm confirguration, motion detection configuration) etc.
This SDK includes the files as follows: HCNetSDK.lib, HCNetSDK.dll,
HCNetSDK.h, PlayM4.lib, PlayM4.dll, DsSdk.lib, DsSdk.dll, DataType.h, and
DecodeCardSdk.h. Among them PlayM4.lib, PlayM4.dll is the decode lib, DsSdk.lib,
DsSdk.dll, DataType.h, DecodeCardSdk are used for hardware decode.

1.2 Notice

1.2.1 Basic notice

This SDK can be used for DS-8002AI/ALI and DS-8000HCI series embedded net
DVR.
Support TCP, UDP, RTP and Multicast network transmission mode.
In client you can use software decode or hardware decode (using MD decode card).
They both support the image with such resolution as QCIF, CIF, 2CIF, 4CIF, DCIF.
DS-8002AI/ALI embedded net DVR can not support 4CIF resolution.
For one DVR, each channel can support 6 clint links and 24 client links in all for
network preview.

1.2.2 Notice for the graphic adapter of computer

The image display part in this SDK adopts our companys own player, while the
display part of the player adopts the DirectDraw technology. At present we use
off_screen and Blt operation. In the zooming in and zooming out of the picture, we
mainly depend on the support of the graphic adapter, because it will occupy a lot of CPU
resources when we using the software to do it. Thus we provide a interface

Page 32 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

NET_DVR_IsSupportfor testing the graphic adapter, you can use this API to test
whether this player can work or not in your system.. Furthermore the color in the display
property should be set as 16 bit or 32 bits, as to 24 bits, it is not supported.

The following is the graphic adapers that we have tested (Under Win2000)

Graphic Adapter Memory(M) Supoort color Support Zooming Support


Model switch or not in and out or not enlarge or
not
ATI Rage128 32 Yes Yes Yes
ATI Radeon LE 32 Yes Yes Yes
ATI Radeon 7200 64 Yes Yes Yes
nVidia TNT2 16 32 Yes Yes Yes
Model64
nVidia TNT2 Pro 32 Yes Yes Yes
Geforce2 Mx, 32 Yes Yes Yes
Mx200, Mx400
Geforce4 32 Yes Yes Yes
Mx420,Mx440
*****************************************************************************
Sis630 16 No No No
Sis305 32 Yes No No

Notes: the graphic adapter of the nVidia company should update the latest driver,
the old version driver cannot support the zooming out function; as to the other
graphic adapter does not tested, if there is some functions needed by the player
during testing, maybe you should try to install the latest driver of this graphic
adapter.

1.2.3 Notes for the hardware decode card

The DS400XMD serial decode card is adopted in this new serial devices, you can
refer to the relevant decode introduction for the detailed function of this decode card.
This decode card support video matrix function, and can decode 4CIF resolution images.
As MD has some new functions compared with D card, some new API functions are
also added. The added functions can be called directly without using the client-end, thus
when modifying the lib functions of decode cards, we need not to modify the SDK in
client-end. Please pay attention the initialation and set free functions can only be done
by once, usually it is done by client-end. The decode channel can be repeated opened,
the return handle at this time is the decode channel.

Page 33 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

Chapter 2 Program Guide

2.1 Program Introduction

1Initialization: If you want to use client-end SDK, please first initialize the
system NET_DVR_Init(), if you want to exit the SDK, please call
NET_DVR_Cleanup() to release the resources.

2System Check: Check system function NET_DVR_IsSupport () can be called


before NET_DVR_Init(). If system does not support, it cannot display the
pictures normally.

3User Register: Before access the DVR, user must register in the DVR through
the function NET_DVR_Login(), return back to the users ID value after
successfully registered. This ID value is like a key, to be use to accesse into this
DVR afterward. There are max 16 different users can be registered in each DVR
at the same time.To exit the operation of the DVR, user should log-out this ID No.
in this DVR through the function NET_DVR_Logout(), afterward this user has
no rights to access this DVR any more.

4Up to Center: All the message need to actively uploaded in the SDK (Except
Exception) should be uploaded through the callback function
NET_DVR_SetDVRMessCallBack() (refer to the function introduction for the
detailed callback content). The Exception message is received through the
message window set by the function NET_DVR_SetDVRMessage().

5Network delay and fluency: When in software decoding, through the function
NET_DVR_SetPlayerBufNumber() to adjust the Delay and Smoothness Degree
in the preview, if the value of dwBufNum is bigger, the fluency is better, the
corresponding delay will be longer; the smaller the value of dwBufNum, the
delay will be shorter, while when network is not so smooth, it will happen to
loose the frame, thus the preview is not so smooth. Usually the frame buffer
value is bigger than 6 frames, the audio preview will be normal. If you need not
to have audio preview, you can set the value of Video real-time to be smaller.
This function should be used right after NET_DVR_RealPlay(), it cannot be in
effect when it is set after playing! When using the hardware decoding, it will be
the corresponding hardware decoding functions to adjust the delay and
smoothness.

6PTZ control: There are two modes in PTZ control, one is to control through the

Page 34 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

handle of return from the network preview, and the other is no preview limit, to
control through ID No. Before controlling the PTZ, you must get the control
rights of the PTZ, return to whether this user has the rights to control the PTZ.
The aim to do this is to avoid the chaos when many different clients control it at
the same time. (Please refer to the function introduction)

7Transparent channel: We can choose 485 and 232 serial ports to be as the
transparent channel function, among them, when setting 232 serial port as the
transparent channel, you should choose the working mode as transparent channel
in 232 serial port configuration message (Structure NET_DVR_RS232CFG). By
this way 232 serial ports can be used as transparent channel.

8. Playback and download: When you use the API of palyback and download,
you must use NET_DVR_PLAYSTART to start the correspond operation, use
NET_DVR_PlayBackControl to implement. Before start play, use
NET_DVR_PlayBackSaveData() and NET_DVR_SetPlayDataCallBack() to save
data.

2.2 Sequence of calling the functions

A. Initializtion the SDK NET_DVR_Init()

Judge whether system supports player or not NET_DVR_IsSupport()


Set the connect timeout NET_DVR_SetConnectTime()
Set the callback function to receive DVR message
NET_DVR_SetDVRMessCallBack()
B. Set player display mode NET_DVR_SetShowMode()
Start listen thread to get the DVR message NET_DVR_StartListen()
If the DVR connects with client-end through analysis server (DNS),
client-end should first get the IP address from this analysis sever
NET_DVR_GetDVRIPByResolveSvr()
Set audio play mode NET_DVR_SetAudioMode()

C.
User register in the device NET_DVR_Login()

Network image preview NET_DVR_RealPlay()


Set frame buffer number of the player NET_DVR_SetPlayerBufNumber()
Set B frame number to be thrown in decoding NET_DVR_ThrowBFrame()
Pause/restart image preview NET_DVR_StopRealPause()
NET_DVR_StopRealRestart()
Set/ get video parameters NET_DVR_ClientSetVideoEffect()
NET_DVR_ClientGetVideoEffect()
Overlap the characters and images NET_DVR_RigisterDrawFun()
Sound control NET_DVR_OpenSound()
NET_DVR_CloseSound()
Page 35 Total 97
NET_DVR_OpenSoundShare()
NET_DVR_CloseSoundShare()
NET_DVR_Volume()
Data capture NET_DVR_SetRealDataCallBack()
NET_DVR_SaveRealData()
SDK Programmer Manual of Embedded Net DVRDVS

D.

Search file NET_DVR_FindFile()


NET_DVR_FindNextFile()
E NET_DVR_FindClose()
Playback NET_DVR_PlayBackByName()
NET_DVR_PlayBackByTime()
NET_DVR_PlayBackControl()
NET_DVR_StopPlayBack()
Capture data NET_DVR_PlayBackSaveData()
NET_DVR_StopPlayBackSave()
NET_DVR_SetPlayDataCallBack()
Capture pictures NET_DVR_PlayBackCaptureFile()
Download NET_DVR_GetFileByName()
NET_DVR_GetFileByTime()
NET_DVR_GetDownloadPos()
NET_DVR_StopGetFile()

Restore the defaulted para. NET_DVR_RestoreConfig()


Get the parameters NET_DVR_GetDVRConfig()
NET_DVR_SetDVRConfig()
Save parameters NET_DVR_SaveConfig()
Reboot/ shutdown NET_DVR_RebootDVR()
NET_DVR_ShutDownDVR()
F Remote upgrade NET_DVR_Upgrade()
NET_DVR_GetUpgradeState()
NET_DVR_CloseUpgradeHandle()
Remote format the hard disk NET_DVR_FormatDisk()
NET_DVR_GetFormatProgress()
NET_DVR_CloseFormatHandle()

Alarm NET_DVR_SetupAlarmChan()
NET_DVR_CloseAlarmChan()
NET_DVR_SetAlarmOut()
NET_DVR_GetAlarmOut()
G Voice Dialogue NET_DVR_StartVoiceCom()
NET_DVR_SetVoiceComClientVolume()
NET_DVR_StopVoiceCom()
Transparent channel NET_DVR_SerialStart()
NET_DVR_SerialSend()
NET_DVR_SerialStop()
Remote control local display NET_DVR_ClickKey()

NET_DVR_PlayControlLocDisplay()
Remote manually recording NET_DVR_StartDVRRecord()
NET_DVR_StopDVRRecord()
Log Page 36 Total 97
NET_DVR_FindDVRLog()
NET_DVR_FindNextLog()
NET_DVR_FindLogClose()
SDK Programmer Manual of Embedded Net DVRDVS

H Logout the user NET_DVR_Logout()

I Release the SDK resources NET_DVR_Cleanup()

The above is the sequence for the software decoding, among them the four parts
D, E, F, G , you need not to consider the sequence to call which part first. F part is
mainly to accomplish the configuration work of the device.
If using the hardware decoding, you only have to replace the D part by the
following

Initialize the decode card NET_DVR_InitDevice_Card()


Initialzie the OVERLAY surface of the decode card
NET_DVR_InitDDraw_Card()
Decode card preview image NET_DVR_RealPlay_Card()
NET_DVR_ResetPara_Card()
NET_DVR_OpenSound_Card()
NET_DVR_CloseSound_Card()
NET_DVR_SetVolume_Card()
NET_DVR_AudioPreview_Card()
Data Capture NET_DVR_SetRealDataCallBack()
NET_DVR_SaveRealData()
NET_DVR_StopSaveRealData()
PTZ control NET_DVR_GetPTZCtrl()
NET_DVR_PTZControl()
NET_DVR_TransPTZ()
NET_DVR_PTZPreset()
Stop preview NET_DVR_StopRealPlay()
Refresh the OVERLAY surface used by decode card
NET_DVR_RefreshSurface_Card()
Clear the OVERLAY surface used by decode card
NET_DVR_ClearSurface_Card()
Restore the OVERLAY surface used by decode card
NET_DVR_RestoreSurface_Card()
Get serial number of the decode card NET_DVR_GetSerialNum_Card()
Set the message sent to host when the DSP in decode card does not work
NET_DVR_SetDspErrMsg_Card()
Reset DSP NET_DVR_ResetDSP_Card()
Release the OVERLAY surface used by decode card
NET_DVR_ReleaseDDraw_Card()
Release decode card resources
NET_DVR_ReleaseDevice_Card()

Page 37 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

Chapter 3 Data Structure

3.1 Client-end data structure

3.1.1 device model define

#define DVR 1 /*undefined dvr model */


#define ATMDVR 2 /*atm dvr*/
#define DVS 3 /*DVS*/
#define DEC 4 /* 6001D */
#define ENC_DEC 5 /* 6001F */
#define DVR_HC 6 /*8000HC*/
#define DVR_HT 7 /*8000HT*/
#define DVR_HF 8 /*8000HF*/
#define DVR_HS 9 /* 8000HS DVR(no audio)
*/
#define DVR_HTS 10 /* 8016HTS DVR(no
audio) */
#define DVR_HB 11 /* HB DVR(SATA HD) */
#define DVR_HCS 12 /* 8000HCS DVR */
#define DVS_A 13 /* support HDD DVS */
#define DVR_HC_S 14 /* 8000HC-S */
#define DVR_HT_S 15 /* 8000HT-S */
#define DVR_HF_S 16 /* 8000HF-S */
#define DVR_HS_S 17 /* 8000HS-S */
#define ATMDVR_S 18 /* ATM-S */
#define DVR_7000H 19 /*7000 DVR*/
#define DEC_MAT 20 /*multi channel decoder*/
#define DVR_MOBILE 21 /* mobile DVR */
#define DVR_HD_S 22 /* 8000HD-S */
#define DVR_HD_SL 23 /* 8000HD-SL */
#define DVR_HC_SL 24 /* 8000HC-SL */
#define DVR_HS_ST 25 /* 8000HS-ST */
#define DVS_HW 26 /* 6000HW */
#define IPCAM 30 /*IP camera*/
#define IPDOME 40 /*IP speed dome*/
#define IPMOD 50 /*IP module*/

Page 38 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

3.1.2 Display mode

enum {NORMALMODE = 0,OVERLAYMODE};


NORMALMODE: can display multi windows at the same time, but it has some
requirement to the computer graphic adapter;
OVERLAYMODE: can only display one window, but it has no requirement to the
graphic adapter.

3.1.2 Network link mode

enum {PTOPTCPMODE =0, PTOPUDPMODE, MULTIMODE, RTPMODE,


AUDIODETACH};
PTOPTCPMODE: TCP mode
PTOPUDPMODE: UDP mode
MULTIMODE: Multi- play mode
RTPMODE: RTP mode
AUDIODETACH: Audio, video separated mode

3.1.3 Device message structure

typedef struct {
BYTE sSerialNumber[SERIALNO_LEN]; /* serial no. */
BYTE byAlarmInPortNum; /* DVR alarm input number */
BYTE byAlarmOutPortNum; /* DVR alarm output number */
BYTE byDiskNum; /* DVR hard disk number */
BYTE byDVRType; /* DVR type, 1:DVR 2:ATM DVR 3:DVS */
BYTE byChanNum; /* DVR channel number */
BYTE byStartChan; /* the start channel no., e.g. DVS-0, DVR 1
*/
}NET_DVR_DEVICEINFO, *LPNET_DVR_DEVICEINFO;

3.1.4 Network preview parameters

typedef struct{
LONG lChannel; /* channel no. */
LONG lLinkMode; /* If 31st bit is 0, it means connect main stream, is 1 means
sub stream. Bit 0bit 30 are used for link mode: 0: TCP mode, 1: UDP mode, 2:
Multi-play mode, 3: RTP mode, 4: audio, video separated mode */
HWND hPlayWnd; /* the play windows handle */
char* sMultiCastIP; /* Multi-cast group address */
BYTE byReserve; /* to adopt which channel to encode data when in double
encoding mode */
}NET_DVR_CLIENTINFO, *LPNET_DVR_CLIENTINFO;

Page 39 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

If set the parameter hPlayWnd as NULL, thus client-end will not decode after
receiving the data, but it can be recorded.

3.1.5 File information structure

typedef struct{
DWORD dwYear; /* year */
DWORD dwMonth; /* month */
DWORD dwDay; /* day */
DWORD dwHour; /* hour */
DWORD dwMinute; /* minute */
DWORD dwSecond; /* second */
} NET_DVR_TIME,*LPNET_DVR_TIME;

typedef struct
{
char sFileName[100]; /* file name */
NET_DVR_TIME struStartTime; /* the start time of the file */
NET_DVR_TIME struStoptime; /* the stop time of the file */
DWORD dwFileSize; /* the file size */
}NET_DVR_FIND_DATA,*LPNET_DVR_FIND_DATA;

3.1.6 Upload the alarm message

typedef struct{
DWORD dwAlarmType; /*0-switch alarm, 1- hard disk full, 2- video lost,
3- motion detection, 4- hard disk unformatted*/
DWORD dwAlarmInputNumber; /*alarm input port No.*/
DWORD dwAlarmOutputNumber[MAX_ALARMOUT]; /*the corresponding output
port to the alarm input, value as 1 means trigger the correspond output */
DWORD dwAlarmRelateChannel[MAX_CHANNUM]; /*the corresponding
recording channel to the alarm input, the channel as 1 means it is the recording channel,
dwAlarmRelateChannel[0] corresponds to the first channel */
DWORD dwChannel[MAX_CHANNUM]; /*dwAlarmType is 2 or 3 means
the corresponding channel, dwChannel[0] bit correspons to channel0*/
DWORD dwDiskNumber[MAX_DISKNUM]; /*dwAlarmType is 4 means the
hard disk */
}NET_DVR_ALARMINFO,*LPNET_DVR_ALARMINFO;

3.1.7 Alarm output status

typedef struct{
BYTE Output[MAX_ALARMOUT]; /* alarm output status 0: invalid 1: valid */
}NET_DVR_ALARMOUTSTATUS,*LPNET_DVR_ALARMOUTSTATUS;

Page 40 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

3.1.8 Hardware decoding preview struct

typedef struct{
long lToScreen; /* whether to output to the vga display, 1- yes, 0- no */
long lToVideoOut;/* whether to output to the monitor, 1- yes, 0- no */
long lLeft; /* the X axis of the output position up left point, corresponding
to the parent window, when lToScreen is 1, /it need be
appointed */
long lTop; /* the Y axis of the output position up left point, corresponding to
the father window, when lToScreen is 1, it need be
appointed */
long lWidth; /* the width of the output image, when lToScreen is 1, it need be
appointed */
long lHeight; /* the height of the output image, when lToScreen is 1, it need be
appointed */
long lReserved; /* reserved */
} NET_DVR_DISPLAY_PARA, *LP NET_DVR_DISPLAY_PARA;

typedef struct{
LONG lChannel; /* channel no. */
LONG lLinkMode; /* If 31st bit is 0, it means connect main stream, is 1 means sub
stream. Bit 0bit 30 are used for link mode: 0: TCP mode, 1:
UDP mode, 2: Multi-cast mode, 3- RTP mode, 4- video and
audio detach */
char* sMultiCastIP; /* Multi-cast IP address */
NET_DVR_DISPLAY_PARA struDisplayPara;
}NET_DVR_CARDINFO, *LPNET_DVR_CARDINFO;

3.1.9 Log message

/* Alarm */
//major type
#define MAJOR_ALARM 0x1
//minor type
#define MINOR_ALARM_IN 0x1 /* alarm input */
#define MINOR_ALARM_OUT 0x2 /* alarm output */
#define MINOR_MOTDET_START 0x3 /* motion detection alarm start*/
#define MINOR_MOTDET_STOP 0x4 /* motion detection alarm stop*/
#define MINOR_HIDE_ALARM_START 0x5 /* mask alarm start*/
#define MINOR_HIDE_ALARM_STOP 0x6 /* mask alarm stop*/

/* Exception */
//minor type
#define MAJOR_EXCEPTION 0x2
//subtype

Page 41 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

#define MINOR_VI_LOST 0x21 /* video lost */


#define MINOR_ILLEGAL_ACCESS 0x22 /* illegal acess */
#define MINOR_HD_FULL 0x23 /* hard disk full */
#define MINOR_HD_ERROR 0x24 /* hard disk error */
#define MINOR_DCD_LOST 0x25 /* MODEM offline */
#define MINOR_IP_CONFLICT 0x26 /* IP address conflict */

/* operation */
//major type
#define MAJOR_OPERATION 0x3
//minor type
#define MINOR_START_DVR 0x41 /* power on DVR */
#define MINOR_STOP_DVR 0x42 /* shut down DVR */
#define MINOR_STOP_ABNORMAL 0x43 /* shut down abnormal */

#define MINOR_LOCAL_LOGIN 0x50 /* Local Login */


#define MINOR_LOCAL_LOGOUT 0x51 /* Local logout */
#define MINOR_LOCAL_CFG_PARM 0x52 /* Local configure parameters */
#define MINOR_LOCAL_PLAYBYFILE 0x53 /* Local play back according the
files*/
#define MINOR_LOCAL_PLAYBYTIME 0x54 /* Local playback according time */
#define MINOR_LOCAL_START_REC 0x55 /* Local start record */
#define MINOR_LOCAL_STOP_REC 0x56 /* Local stop the record */
#define MINOR_LOCAL_PTZCTRL 0x57 /* Local control PTZ */
#define MINOR_LOCAL_PREVIEW 0x58 /* Local preview */
#define MINOR_LOCAL_MODIFY_TIME 0x59 /* Local modify system time */
#define MINOR_LOCAL_UPGRADE 0x5a /* Local upgrade */
#define MINOR_LOCAL_COPYFILE 0x5b /* Local backup file */

#define MINOR_REMOTE_LOGIN 0x70 /* Remote login */


#define MINOR_REMOTE_LOGOUT 0x71 /* Remote logout */
#define MINOR_REMOTE_START_REC 0x72 /* Remote start recording */
#define MINOR_REMOTE_STOP_REC 0x73 /* Remote stop recording */
#define MINOR_START_TRANS_CHAN 0x74 /* Start transparent channel
transmission */
#define MINOR_STOP_TRANS_CHAN 0x75 /* Stop transparent channel
transmission */
#define MINOR_REMOTE_GET_PARM 0x76 /* Remote get parameters */
#define MINOR_REMOTE_CFG_PARM 0x77 /* Remote configure parameters */
#define MINOR_REMOTE_GET_STATUS 0x78 /* Remote get status */
#define MINOR_REMOTE_ARM 0x79 /* Remote set alarm */
#define MINOR_REMOTE_DISARM 0x7a /* Remote dismiss alarm */
#define MINOR_REMOTE_REBOOT 0x7b /* Remote reboot */
#define MINOR_START_VT 0x7c /* Start voice dialogue */
#define MINOR_STOP_VT 0x7d /* Stop voice dialogue */
#define MINOR_REMOTE_UPGRADE 0x7e /* Remote upgrading */

Page 42 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

#define MINOR_REMOTE_PLAYBYFILE 0x7f /* Remote playback


according the files */
#define MINOR_REMOTE_PLAYBYTIME 0x80 /* Remote playback according
time */
#define MINOR_REMOTE_PTZCTRL 0x81 /* Remote control PTZ */

//dwParaType definition:
#define PARA_VIDEOOUT 0x1
#define PARA_IMAGE 0x2
#define PARA_ENCODE 0x4
#define PARA_NETWORK 0x8
#define PARA_ALARM 0x10
#define PARA_EXCEPTION 0x20
#define PARA_DECODER 0x40
#define PARA_RS232 0x80
#define PARA_PREVIEW 0x100
#define PARA_SECURITY 0x200
#define PARA_DATETIME 0x400
#define PARA_FRAMETYPE 0x800

typedef struct {
NET_DVR_TIME strLogTime;
DWORD dwMajorType; /* Major type 1-alarm; 2-abnormal; 3-operation;
0xff-all*/
DWORD dwMinorType; /* Minor type */
BYTE sPanelUser[MAX_NAMELEN]; /* users name for local panel operation*/
BYTE sNetUser[MAX_NAMELEN]; /* users name for network operation */
char sRemoteHostAddr[16]; /* remote host address */
DWORD dwParaType; /* parameter type */
DWORD dwChannel; /* channel no. */
DWORD dwDiskNumber; /* hard disk no. */
DWORD dwAlarmInPort; /* alarm input port */
DWORD dwAlarmOutPort; /* alarm output port */
}NET_DVR_LOG,*LPNET_DVR_LOG;

3.1.10 Devices status information

typedef struct {
DWORD dwVolume; /* the capacity of the hard disk */
DWORD dwFreeSpace; /* the free space of the hard disk */
DWORD dwHardDiskStatic; /* the hard disks status, according to bit: 1- sleep, 2-
abnormal ,3-sleep HDD error */
}NET_DVR_DISKSTATE,*LPNET_DVR_DISKSTATE;
typedef struct {
BYTE byRecordStatic; /* whether the channel is in recoring, 0- no, 1- yes */
BYTE bySignalStatic; /* video signal status, 0- normal, 1- lost */

Page 43 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

BYTE byHardwareStatic;/* the channel hardware status, 0- normal, 1- abnormal, e.g.


DSP is not work*/
char reservedData; /* reserved */
DWORD dwBitRate; /* the bitrate */
DWORD dwLinkNum; /* the client link numbers */
DWORD dwClientIP[MAX_LINK];/* the IP address of the client-end */
}NET_DVR_CHANNELSTATE,*LPNET_DVR_CHANNELSTATE;
typedef struct{
DWORD dwDeviceStatic; /* the devices status, 0- normal, 1- the occupancy of
CPU is too high, more than 85%, 2-hardware error, e.g.
the serial ports do not work */
NET_DVR_DISKSTATE struHardDiskStatic[MAX_DISKNUM]; /* harddisk
status */
NET_DVR_CHANNELSTATE struChanStatic[MAX_CHANNUM];/* channel
status */
BYTE byAlarmInStatic[MAX_ALARMIN]; /* alarm input status, 0- no alarm,
1-alarm */
BYTE byAlarmOutStatic[MAX_ALARMOUT]; /* alarm output status, 0-no
output, 1-alarm output */
DWORD dwLocalDisplay; /* Local display status, 0- normal, 1-abnormal
*/
}NET_DVR_WORKSTATE,*LPNET_DVR_WORKSTATE;

3.1.11 Transaction information ATM DVR upload to center

The structure of transaction information that ATM DVR will upload to center is
defined as following:
typedef struct{
USHORT m_Year; /* Year */
USHORT m_Month; /* Month */
USHORT m_Day; /* Day */
USHORT m_Hour; /* Hour */
USHORT m_Minute; /* Minute */
USHORT m_Second; /* Second */
BYTE DeviceName[24]; /* Deveic name */
DWORD dwChannelNumer; /* Channel No. */
BYTE CardNumber[32]; /* Credit card number */
char cTradeType[12]; /* Transaction type */
DWORD dwCash; /* Transaction money */
}NET_DVR_TRADEINFO, *LPNET_DVR_TRADEINFO;

3.2 Device-end parameter data structure

#define NAME_LEN 32
#define SERIALNO_LEN 48

Page 44 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

#define MACADDR_LEN 6
#define MAX_ETHERNET 2
#define PATHNAME_LEN 128
#define PASSWD_LEN 16
#define MAX_CHANNUM 16
#define MAX_ALARMOUT 4
#define MAX_TIMESEGMENT 4
#define MAX_PRESET 128
#define MAX_DAYS 7
#define PHONENUMBER_LEN 32
#define MAX_DISKNUM 8
#define MAX_WINDOW 16
#define MAX_VGA 1
#define MAX_USERNUM 16
#define MAX_EXCEPTIONNUM 16
#define MAX_LINK 6
#define MAXCARD_NUM 40
#define MAX_ALARMIN 16
#define MAX_SERIALNUM 2
#define CARDNUM_LEN 20
#define MAX_VIDEOOUT 2
#define MAX_DISPLAY_REGION 16
#define MAX_NAMELEN 16
#define MAX_RIGHT 32
#define MAX_SHELTERNUM 4

3.2.1 Device system configuration structure

typedef struct{
DWORD dwSize;
BYTE sDVRName[NAME_LEN]; /* DVR name */
DWORD dwDVRID; /* DVR ID, used for the infrared controller*/
DWORD dwRecycleRecord; /* whether recycle record, 0: no; 1: yes */
//the following cannot be modified
BYTE sSerialNumber[SERIALNO_LEN]; /* serial no */
DWORD dwSoftwareVersion; /* Software version, high 16 bit is the major
version, low 16 bit is the minor version */
DWORD dwSoftwareBuildDate; /* the software build date, 0xYYYYMMDD
*/
DWORD dwDSPSoftwareVersion; /* DSP software version, high 16 bit is the
major version, low 16 bit is the minor version */
DWORD dwDSPSoftwareBuildDate; /* DSP software build date, 0xYYYYMMDD
*/
DWORD dwPanelVersion; /* the Panel version, high 16 bit is the major
version, low 16 bit is the minor version */
DWORD dwHardwareVersion; /* hardware version, high 16 bit is the major

Page 45 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

version, low 16 bit is the minor version */


BYTE byAlarmInPortNum; /* DVR alarm input number */
BYTE byAlarmOutPortNum; /* DVR alarm output number */
BYTE byRS232Num; /* DVR 232 serial port number */
BYTE byRS485Num; /* DVR 485 serial port number */
BYTE byNetworkPortNum; /* Network port number */
BYTE byDiskCtrlNum; /* DVR hard disk control number */
BYTE byDiskNum; /* DVR hark disk number */
BYTE byDVRType; /* DVR type, 1: DVR 2: ATM DVR 3: DVS */
BYTE byChanNum; /* DVR channel number */
BYTE byStartChan; /* the start channel, e.g. DVS-0, DVR 1 */
BYTE byDecordChans; /* DVR decord channel */
BYTE byVGANum; /* VGA port number */
BYTE byUSBNum; /* USB port number */
char reservedData[3]; /* reserved */
}NET_DVR_DEVICECFG,*LPNET_DVR_DEVICECFG;

3.2.2 Network configuration structure

typedef struct {
char sDVRIP[16]; /* DVR IP address */
char sDVRIPMask[16]; /* DVR IP address mask */
DWORD dwNetInterface; /* 10M/100M self adaptable, appendix */
//1-10MBase - T
//2-10MBase-T full duplex
//3-100MBase - TX
//4-100M full duplex
//5-10M/100M self adaptable
WORD wDVRPort; /* network port */
BYTE byMACAddr[MACADDR_LEN]; /* the physical address of the device */
}NET_DVR_ETHERNET;
typedef struct{
DWORD dwSize;
NET_DVR_ETHERNET struEtherNet[MAX_ETHERNET]; /* Ethernet port */
char sManageHostIP[16]; /* Remote administrator host IP address */
WORD wManageHostPort; /* Remote administrator host port */
char sDNSIP[16]; /* DNS server IP address */
char sMultiCastIP[16]; /* Multi-cast IP address */
char sGatewayIP[16]; /* Gateway IP address */
char sNFSIP[16]; /* NFS host IP address */
BYTE sNFSDirectory[PATHNAME_LEN]; /* NFS directory */
DWORD dwPPPOE; /* 0-disenable, 1- enable */
BYTE sPPPoEUser[NAME_LEN]; /* PPPoE users name */
char sPPPoEPassword[PASSWD_LEN];/* PPPoE password */
WORD wHttpPort; /*http port number */
}NET_DVR_NETCFG,*LPNET_DVR_NETCFG;

Page 46 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

3.2.3 Channel image configuration structure

typedef struct
{
DWORD dwHandleType; /*handle type, the handle type or the result*/
/*0x00: no response*/
/*0x01: warn on the monitor*/
/*0x02: warn by beep*/
/*0x04: upload to centre*/
/*0x08: trigger the alarm output*/
BYTE byRelAlarmOut[MAX_ALARMOUT]; /* the alarm output, if it is 1 means
it trigger the output */
}NET_DVR_HANDLEEXCEPTION;

typedef struct{
BYTE byMotionScope[18][22]; /*motion detection areas, total 22*18 macro areas,
when it is 1 means the macro area set as motion detection area, 0 means not motion
detection area*/
BYTE byMotionSenstive; /*Motion detection sensibility, from 0 to 5, 5 means
the sensibility is the highest, 0xff closed*/
BYTE byEnableHandleMotion; /* whether to handle the motion detection or not
*/
NET_DVR_HANDLEEXCEPTION strMotionHandleType; /* handle type */
}NET_DVR_MOTION,*LPNET_DVR_MOTION;

//Mask alarm size of the area 704*576


typedef struct{
DWORD dwEnableHideAlarm; /* whether to enable the mask alarm,
0- no, 1- yes*/
WORD wHideAlarmAreaTopLeftX; /* the X axis of the mask area */
WORD wHideAlarmAreaTopLeftY; /* the Y axis of the mask area */
WORD wHideAlarmAreaWidth; /* the width of the mask area */
WORD wHideAlarmAreaHeight; /*the height of the mask area*/
NET_DVR_HANDLEEXCEPTION strHideAlarmHandleType; /* handle type */

}NET_DVR_HIDEALARM,*LPNET_DVR_HIDEALARM;

//signal lost alarm


typedef struct{
BYTE byEnableHandleVILost; //enable signal lost alarm
NET_DVR_HANDLEEXCEPTION strVILostHandleType; //handle mode
}NET_DVR_VILOST,*LPNET_DVR_VILOST;

typedef struct
{
DWORD dwSize; /* the size of the structure */

Page 47 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

BYTE sChanName[NAME_LEN]; /* channel name */


DWORD dwVideoFormat; /* output video format 1-NTSC 2-PAL (read
only)*/
BYTE byBrightness; /*brightness, 0-255*/
BYTE byContrast; /*contrast, 0-255*/
BYTE bySaturation; /*saturation, 0-255 */
BYTE byHue; /*hue, 0-255*/
//to display the channel name
DWORD dwShowChanName; /*whether to show the channel name in the
preview picures, 0- no, 1- show the size of the areas 704*576*/
WORD wShowNameTopLeftX; /* X axis of the channel name show position
*/
WORD wShowNameTopLeftY; /* Y axis of the channel name show position
*/
//video lost alarm
NET_DVR_VILOST struVILost;
//Motion detection
NET_DVR_MOTION struMotion;
//View tampering alarm
NET_DVR_HIDEALARM strHideAlarm;
//Mask area range is 704*576
DWORD dwEnableHide; /* whether to enable the mask, 0- no, 1-yes */
WORD wHideAreaTopLeftX; /* X axis of the mask area */
WORD wHideAreaTopLeftY; /* Y axis of the mask area */
WORD wHideAreaWidth; /* the width of the mask area */
WORD wHideAreaHeight; /*the height of the mask area*/
//OSD
DWORD dwShowOsd; /* whether to show OSD in the preview picures, 0-
no, 1-yes */
WORD wOSDTopLeftX; /* X axis of the OSD */
WORD wOSDTopLeftY; /* Y axis of the OSD */
BYTE byOSDType; /* OSD type (mainly the year, month, date format)*/
/* 0: XXXX-XX-XX year, month, date */
/* 1: XX-XX-XXXX date, month, year */
/* 2: XXXXyearXXmonthXXdate */
/* 3: XXmonthXXdateXXXXyear */
BYTE byDispWeek; /* whether to show the week */
BYTE byOSDAttrib; /* OSD attibute: transparent, twinkle */
/* 1: transparent, twinkle */
/* 2: transparent, non-twinkle */
/* 3: twinkle, non-transparent */
/* 4: non-transparent, non-twinkle */
}NET_DVR_PICCFG,*LPNET_DVR_PICCFG;

typedef struct{
WORD wHideAreaTopLeftX; /* x coordinate of mask area */

Page 48 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

WORD wHideAreaTopLeftY; /* y coordinate of mask area */


WORD wHideAreaWidth; /* width of mask area */
WORD wHideAreaHeight; /* height of mask area*/
}NET_DVR_SHELTER,*LPNET_DVR_SHELTER;

typedef struct{
DWORD dwSize;
BYTE sChanName[NAME_LEN];
DWORD dwVideoFormat; /* read only 1-NTSC 2-PAL*/
BYTE byBrightness; /* 0-255*/
BYTE byContrast; /* 0-255*/
BYTE bySaturation; /* 0-255 */
BYTE byHue; /* 0-255*/
//Display channel name
DWORD dwShowChanName; /* 0-Not display,1-Display */
WORD wShowNameTopLeftX; /* x coordinate of channel name */
WORD wShowNameTopLeftY; /* y coordinate of channel name */
//Video lost alarm
NET_DVR_VILOST struVILost;
//Motion detection
NET_DVR_MOTION struMotion;
//View tampering alarm
NET_DVR_HIDEALARM struHideAlarm;
//Mask area
DWORD dwEnableHide; /* 0-Disable, 1-Enable*/
NET_DVR_SHELTER struShelter[MAX_SHELTERNUM];
//OSD Display
DWORD dwShowOsd; /*0-Not display, 1-Display */
WORD wOSDTopLeftX; /* x coordinate of OSD */
WORD wOSDTopLeftY; /* y coordinate of OSD */
BYTE byOSDType; /* OSD type */
/* 0: XXXX-XX-XX Year Month Day */
/* 1: XX-XX-XXXX Month Day Year */
BYTE byDispWeek; /* Display weekday */
BYTE byOSDAttrib; /* OSD properties */
/* 1: Transparent&Flashing */
/* 2: Transparent&Steady */
/* 3: Opaque&Flashing */
/* 4: Opaque&Steady */
}NET_DVR_PICCFG_EX,*LPNET_DVR_PICCFG_EX;

Page 49 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

3.2.4 Compression parameter confirguration structure

typedef struct{
BYTE byStreamType; /* bitrate type 0- video stream, 1- mix stream */
BYTE byResolution; /* resolution: 0-DCIF 1-CIF, 2-QCIF, 3-4CIF,
4-2CIF */
BYTE byBitrateType; /* bitrate type 0: fixed bitrate, 1: variable bitrate
*/
BYTE byPicQuality; /* image quality */
DWORD dwVideoBitrate; /* upper limit bitrate */
DWORD dwVideoFrameRate; /* frame rate */
}NET_DVR_COMPRESSION_INFO,*LPNET_DVR_COMPRESSION_INFO;

typedef struct{
DWORD dwSize; /* the size of the structure */
NET_DVR_COMPRESSION_INFO struRecordPara; /* record */
NET_DVR_COMPRESSION_INFO struNetPara; /* network transmission */
}NET_DVR_COMPRESSIONCFG,*LPNET_DVR_COMPRESSIONCFG;

Note: For network sub stream, the resolution can only be set as CIF or QCIF.

3.2.5 Record parameter configuration structure

typedef struct{
//start time
BYTE byStartHour;
BYTE byStartMin;
//stop time
BYTE byStopHour;
BYTE byStopMin;
}NET_DVR_SCHEDTIME,*LPNET_DVR_SCHEDTIME;

typedef struct{
NET_DVR_SCHEDTIME struRecordTime;
BYTE byRecordType; /* 0: scheduled record, 1: Motion detection, 2: alarm
record, 3: motion detection| alarm, 4: motion detection & alarm 5: command trigger, 6:
manually record*/
char reservedData[3]; /* reserved */
}NET_DVR_RECORDSCHED,*LPNET_DVR_RECORDSCHED;

typedef struct {
WORD wAllDayRecord; /* whether to record for all day */
BYTE byRecordType; /* record type 0: scheduled record, 1: motion
detection, 2: alarm record, 3: motion detection|alarm, 4: motion detection & alarm 5:
command trigger, 6: manually record*/

Page 50 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

char reservedData;
}NET_DVR_RECORDDAY;

typedef struct {
DWORD dwSize; /* the size of the structure */
DWORD dwRecord; /*whether to record 0- no 1- yes*/
NET_DVR_RECORDDAY struRecAllDay[MAX_DAYS];
NET_DVR_RECORDSCHED
struRecordSched[MAX_DAYS][MAX_TIMESEGMENT];
DWORD dwRecordTime; /* the record time */
}NET_DVR_RECORD,*LPNET_DVR_RECORD;

3.2.6 PTZ parameter configuration structure

typedef struct{
DWORD dwSize; /* the size of the structure */
DWORD dwBaudRate; /* baudtate (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; */
BYTE byDataBit; /* the date bit: 0 5 bit, 1 6 bit, 2 7bit, 3 8 bit; */
BYTE byStopBit; /* stop bit: 0 1 bit, 1 2 bit; */
BYTE byParity; /* parity: 0 no parity, 1 odd, 2 even; */
BYTE byFlowcontrol; /* flow control: 0- no, 1 software, 2- hardware */
WORD wDecoderType; /* PTZ type, 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. */
WORD wDecoderAddress; /*PTZ address: 0 - 255*/
BYTE bySetPreset[MAX_PRESET]; /* whether to se the preset: 0- no, 1-
yes*/
BYTE bySetCruise[MAX_PRESET]; /* whether to set the sequence: 0- no, 1-
yes */
BYTE bySetTrack[MAX_PRESET]; /* whether to set cruise: 0- no, 1- yes*/
}NET_DVR_DECODERCFG,*LPNET_DVR_DECODERCFG;

3.2.7 Serial ports confirguration structure

typedef struct{
char sRemoteIP[16]; /* Remote IP address */
char sLocalIP[16]; /* Local IP address */
char sLocalIPMask[16]; /* Local IP address musk */
BYTE sUsername[NAME_LEN]; /* users name */
BYTE sPassword[PASSWD_LEN]; /* password */
BYTE byPPPMode; /* PPP mode, 0 active, 1 - passive*/
BYTE byRedial; /* whether to redial: 0- no,1- yes */
BYTE byRedialMode; /* redial mode, 0- appointed by dialer, 1- preset

Page 51 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

redial no. */
BYTE byDataEncrypt; /*data encrypt: 0-no,1-yes */
DWORD dwMTU; /* MTU */
char sTelephoneNumber[PHONENUMBER_LEN]; /* Telephone no. */
}NET_DVR_PPPCFG,*LPNET_DVR_PPPCFG;

typedef struct{
DWORD dwSize; /* the size of the structure */
DWORD dwBaudRate; /* baudrate (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; */
BYTE byDataBit; /* data bit: 0 5 bit, 1 6 bit, 2 7 bit, 3 8 bit;
*/
BYTE byStopBit; /* stop bit: 0 1 bit, 1 2 bit; */
BYTE byParity; /* parity: 0 no parity, 1 odd, 2 even */
BYTE byFlowcontrol; /*flow contro: 0 no, 1 software, 2 hardware
*/
DWORD dwWorkMode; /* work mode: 0 PSTN (PPP), 1 console, 2
transparent channel */
NET_DVR_PPPCFG struPPPConfig;
}NET_DVR_RS232CFG,*LPNET_DVR_RS232CFG;

3.2.8 Alarm input configuration structure

typedef struct{
DWORD dwSize; /* the size of this structure */
BYTE sAlarmInName[NAME_LEN]; /* name */
BYTE byAlarmType; /* alarm sensor type, 0: normal open, 1: normal
closed */
BYTE byAlarmInHandle; /* whether to handle */
NET_DVR_HANDLEEXCEPTION struAlarmHandleType; /* handle type */
NET_DVR_SCHEDTIME struAlarmTime[MAX_DAYS][MAX_TIMESEGMENT];
/*alarm input work schedule */
BYTE byRelRecordChan[MAX_CHANNUM]; /* the record channel
triggered by alarm input, when it is 1 means to trigger this channel */
BYTE byEnablePreset[MAX_CHANNUM]; /* whether to enable the preset
points */
BYTE byPresetNo[MAX_CHANNUM]; /* the enabled PTZ preset points
number, one alarm input can enable more than one channel PTZ preset points, 0xff means
it does not enable the preset points*/
BYTE byEnableCruise[MAX_CHANNUM]; /* whether to enable the
sequence */
BYTE byCruiseNo[MAX_CHANNUM]; /* sequence number */
BYTE byEnablePtzTrack[MAX_CHANNUM]; /* whether to enable the cruise
*/
BYTE byPTZTrack[MAX_CHANNUM]; /* the enabled PTZ cruise

Page 52 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

number */
}NET_DVR_ALARMINCFG,*LPNET_DVR_ALARMINCFG;

3.2.9 Alarm output configuration structure

typedef struct{
DWORD dwSize; /* the size of the structure */
BYTE sAlarmOutName[NAME_LEN]; /* name */
DWORD dwAlarmOutDelay; /* the output delay time (-1 no limit,
manually closed) */
NET_DVR_SCHEDTIME
struAlarmOutTime[MAX_DAYS][MAX_TIMESEGMENT];
/* alarm output schedule */
}NET_DVR_ALARMOUTCFG,*LPNET_DVR_ALARMOUTCFG;

3.2.10 Local preview parameter configuration structure

typedef struct{
DWORD dwSize; /* the size of the structure */
BYTE byPreviewNumber; /* the preview number, 0-1 screen, 1-4 screen, 2-9
screen, 3-16 screen, 0xff: the max screen*/
BYTE byEnableAudio; /* whether enable the audio preview, 0- no, 1- yes
*/
WORD wSwitchTime; /* switch time, 0- no switch, 1-5s, 2-10s, 3-20s,
4-60s, 5-120s, 6-300s */
BYTE bySwitchSeq[MAX_WINDOW]; /*switch sequence, if lSwitchSeq[i] is
0xff, it means it is not used*/
}NET_DVR_PREVIEWCFG,*LPNET_DVR_PREVIEWCFG;

3.2.11 Video output configuration structure

typedef struct {
WORD wResolution; /* VGA resolution */
WORD wFreq; /* refresh frequence */
DWORD dwBrightness; /* brightness */
}NET_DVR_VGAPARA;

typedef struct{
WORD wDisplayLogo; /* to display channel name */
WORD wDisplayOsd; /* to display time */
}NET_DVR_MATRIXPARA;

typedef struct{
BYTE byVideoFormat; /* output format, 0-PAL, 1-NTSC */

Page 53 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

BYTE byMenuAlphaValue; /* the contrast between menu and background


image */
WORD wScreenSaveTime; /* the screen save time */
WORD wVOffset; /* video output offset */
WORD wBrightness; /* video output brightness */
BYTE byStartMode; /* the output mode after reboot (0: menu, 1:
preview)*/
char reservedData;
}NET_DVR_VOOUT;

typedef struct {
DWORD dwSize;
NET_DVR_VOOUT struVOOut[MAX_VIDEOOUT];
NET_DVR_VGAPARA struVGAPara[MAX_VGA]; /* VGA parameter */
NET_DVR_MATRIXPARA struMatrixPara; /* MATRIX parameter */
}NET_DVR_VIDEOOUT,*LPNET_DVR_VIDEOOUT;

3.2.12 User parameter confirguration structure

typedef struct{
BYTE sUserName[NAME_LEN]; /* users name max 16 bit*/
BYTE sPassword[PASSWD_LEN]; /* password */
DWORD dwLocalRight[MAX_RIGHT]; /* user right */
/*array 0: local control PTZ*/
/*array 1: local manually record*/
/*array 2: local playback*/
/*array 3: local set parameters*/
/*array 4: local check status, log*/
/*array 5: local super operation ( upgrading,
format, reboot, shut down)*/
DWORD dwRemoteRight[MAX_RIGHT]; /* user right */
/*array 0: remote control PTZ*/
/*array 1: remote manually record*/
/*array 2: remote playback*/
/*array 3: remote set parameters*/
/*array 4: remote check status, log*/
/*array 5: remote advanced operation (upgrading,
format, reboot, shut down)*/
/*array 6: remote launch voice dialogue*/
/*array 7: remote preview*/
/*array 8: remote request alarm upload, alarm
output*/
/*array 9: remote control local output*/
/*array 10: remote control serial ports*/
char sUserIP[16]; /* User IP address ( if it is 0, it means it can
be any address) */

Page 54 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

BYTE byMACAddr[MACADDR_LEN]; /* physical address */


}NET_DVR_USER_INFO,*LPNET_DVR_USER_INFO;

typedef struct{
DWORD dwSize;
NET_DVR_USER_INFO struUser[MAX_USERNUM];
}NET_DVR_USER,*LPNET_DVR_USER;

3.2.13 Exception parameter configuration structure

typedef struct{
DWORD dwSize;
NET_DVR_HANDLEEXCEPTION
struExceptionHandleType[MAX_EXCEPTIONNUM];
/*array 0- hard disk is full, 1- hard disk is error, 2- signal lost, 3- network link is
broken, 4-MODEM is offline, 5- illegal access, 6- IP address conflict within LAN*/
}NET_DVR_EXCEPTION,*LPNET_DVR_EXCEPTION;

3.2.14 Frame configuration structure

//special for ATM DVR


typedef struct{
BYTE code[12]; /* code */
}NET_DVR_FRAMETYPECODE;

typedef struct{
DWORD dwSize;
char sATMIP[16]; /* ATM IP address */
DWORD dwATMType; /* ATM type */
DWORD dwInputMode; /* get transaction text method */
DWORD dwFrameSignBeginPos; /* the start position of the frame
ID*/
DWORD dwFrameSignLength; /* the length of the frame ID */
BYTE byFrameSignContent[12]; /* the content of the frame ID */
DWORD dwCardLengthInfoBeginPos; /*offset of credit card number
length information */
DWORD dwCardLengthInfoLength; /* the length of the card length
information */
DWORD dwCardNumberInfoBeginPos; /* the offset of the card number
information */
DWORD dwCardNumberInfoLength; /* the length of the card number
information */
DWORD dwBusinessTypeBeginPos; /* the offset of operation type
information*/
DWORD dwBusinessTypeLength; /* the length of the operation type

Page 55 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

information*/
NET_DVR_FRAMETYPECODE frameTypeCode[10];/* operation type code */
}NET_DVR_FRAMEFORMAT,*LPNET_DVR_FRAMEFORMAT;

3.2.15 the configure structure of characrer added in the encoder side

typedef struct
{
DWORD dwShowString; /* whether display the characters in the previre iamge,
0-not display, 1-display, area704*576, the single
character size is 32*32 */
WORD wStringSize; /* the length of this row, can not exceed 44
characters */
WORD wShowStringTopLeftX; /* the x coordinate of the character position*/
WORD wShowStringTopLeftY; /* the y coordinate of the character position */
char sString[44]; /* the display characters content */
}NET_DVR_SHOWSTRINGINFO, *LPNET_DVR_SHOWSTRINGINFO;

typedef struct
{
DWORD dwSize;
NET_DVR_SHOWSTRINGINFO struStringInfo[MAX_STRINGNUM]; /* the
disp
lay
char
acte
rs
cont
ent
*/
}NET_DVR_SHOWSTRING, *LPNET_DVR_SHOWSTRING;

typedef struct tagSHOWSTRING_EX


{
DWORD dwSize;
NET_DVR_SHOWSTRINGINFO struStringInfo[MAX_STRINGNUM_EX]; /* the
display characters content */
}NET_DVR_SHOWSTRING_EX, *LPNET_DVR_SHOWSTRING_EX;

3.2.16 6001D/F configuration structure

/*the connection channel configiration*/


typedef struct {

Page 56 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

char sDVRIP[16]; /* DVR IP address */


WORD wDVRPort; /* port */
BYTE sUserName[NAME_LEN]; /* user name */
BYTE sPassword[PASSWD_LEN]; /* password */
BYTE byChannel; /* channel NO. */
BYTE byLinkMode; /* connection mode */
BYTE byLinkType; /* connection mode 0-main stream 1-sub stream
*/
}NET_DVR_DECCHANINFO, *LPNET_DVR_DECCHANINFO;

/*each decode channel configuration */


typedef struct {
BYTE byPoolChans; /* the number of cycle channel in each channel, 4
channel at most, 0 means no decoding */
NET_DVR_DECCHANINFO struchanConInfo[MAX_DECPOOLNUM];
BYTE byEnablePoll; /*whether cycle decode, 0-NO 1-YES*/
BYTE byPoolTime; /*cycle time 0-reserved 1-10 seconds 2-15
seconds 3-20 seconds 4-30 seconds 5-45 seconds 6-1 minujtes7-2 minujtes 8-5 minujtes
*/
}NET_DVR_DECINFO, *LPNET_DVR_DECINFO;

/*the whole device decode configuration */


typedef struct {
DWORD dwSize;
DWORD dwDecChanNum; /* decode channel number*/
NET_DVR_DECINFO struDecInfo[MAX_DECNUM];
}NET_DVR_DECCFG, *LPNET_DVR_DECCFG;

/* decoder transparent channel setting */


typedef struct {
DWORD dwEnableTransPort;/* whether use the transparent channel, 0-NO, 1-YES.
*/
char sDecoderIP[16]; /* DVR IP address */
WORD wDecoderPort; /* port */
WORD wDVRTransPort; /* set the DVR to output from 485/232, 1 means
output from 232, 2 means output from 485. */
char cReserve[4];
}NET_DVR_PORTINFO, *LPNET_DVR_PORTINFO;

typedef struct {
DWORD dwSize;
NET_DVR_PORTINFO struTransPortInfo[MAX_TRANSPARENTNUM]; /*if
group is 0, it measn 232 group, if group is 1, it means 485 group */
}NET_DVR_PORTCFG, *LPNET_DVR_PORTCFG;

/* control the network file playback */

Page 57 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

typedef struct {
DWORD dwSize;
char sDecoderIP[16]; /* DVR IP address */
WORD wDecoderPort; /* port */
WORD wLoadMode; /* playback download mode, 1-by name, 2-by
time */
union
{
BYTE byFile[100]; /* the playback file name */
struct
{
DWORD dwChannel;
BYTE sUserName[NAME_LEN]; /*request video user name */
BYTE sPassword[PASSWD_LEN]; /* password */
NET_DVR_TIME struStartTime; /* start time when playback according to
the time */
NET_DVR_TIME struStopTime; /* stop time when playback according to
the time */
}bytime;
}mode_size;
}NET_DVR_PLAYREMOTEFILE,*LPNET_DVR_PLAYREMOTEFILE;

/* the device decode connection status */


typedef struct {
DWORD dwWorkType; /*work mode1cycle2dynamic connect decode 3
file playbackdownload 4playback download according to the time*/
char sDVRIP[16]; /*the connect device ip*/
WORD wDVRPort; /*connect port*/
BYTE byChannel; /* channel number */
BYTE byLinkMode; /*connect mode */
DWORD dwLinkType; /*connect type 0- main stream 1-sub stream*/
union
{
struct
{
BYTE sUserName[NAME_LEN]; /* request video user name */
BYTE sPassword[PASSWD_LEN]; /* password */
char cReserve[52];
}userInfo;
struct
{
BYTE fileName[100];
}fileInfo;
struct
{
DWORD dwChannel;

Page 58 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

BYTE sUserName[NAME_LEN]; /* request video user name */


BYTE sPassword[PASSWD_LEN]; /* password */
NET_DVR_TIME struStartTime; /* start time when playback
according to the time */
NET_DVR_TIME struStopTime; /* stop time when playback
according to the time */
}timeInfo;
}objectInfo;
}NET_DVR_DECCHANSTATUS, *LPNET_DVR_DECCHANSTATUS;

typedef struct {
DWORD dwSize;
NET_DVR_DECCHANSTATUS struDecState[MAX_DECNUM];
}NET_DVR_DECSTATUS, *LPNET_DVR_DECSTATUS;

3.2.17 HS device AUX output configuration structure

typedef struct tagAUXOUT{


DWORD dwSize;
DWORD dwAlarmOutChan; /* select the alarm output channel: 0-main channel.
1-AUX 1, 2- AUX 2, 3- AUX 3, 4-AUX 4 */
DWORD dwAlarmChanSwitchTime; /* alarm channel switch time:
1-1second, 10-10 seconds */
DWORD dwAuxSwitchTime[MAX_AUXOUT]; /* AUX outputswitch time:
0-dont switch,1-5s,2-10s,3-20s,4-30s,5-60s,6-120s,7-300s */
BYTE byAuxOrder[MAX_AUXOUT][MAX_WINDOW]; /* AUX output
preview sequence, 0xff means this screen do not preview */
}NET_DVR_AUXOUTCFG, *LPNET_DVR_AUXOUTCFG;

3.2.18 network parametersNTP/DDNS/EMAIL

typedef struct tagNTPPARA{


BYTE sNTPServer[64]; /* Domain Name or IP addr of NTP server */
WORD wInterval; /* adjust time interval(hours) */
BYTE byEnableNTP; /* enable NPT client 0-no1-yes*/
signed char cTimeDifferenceH; /* the time difference between the standard internal
time -12 ... +13 */
signed char cTimeDifferenceM;
BYTE res[11];
}NET_DVR_NTPPARA, *LPNET_DVR_NTPPARA;

typedef struct tagDDNSPARA{


BYTE sUsername[NAME_LEN]; /* DDNS account name and password */

Page 59 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

BYTE sPassword[PASSWD_LEN];
BYTE sDomainName[64]; /* domain name */
BYTE byEnableDDNS; /*whether to use 0-NO1-YES*/
BYTE res[15];
}NET_DVR_DDNSPARA, *LPNET_DVR_DDNSPARA;

typedef struct tagNET_DDNSPARA_EX{


BYTE byHostIndex; /* 0-Hikvision DNS(reserved) 1Dyndns 2
PeanutHull */
BYTE byEnableDDNS; /*whether to use DDNS 0-NO1-YES*/
WORD wDDNSPort; /* DDNS port */
BYTE sUsername[NAME_LEN]; /* DDNS user name*/
BYTE sPassword[PASSWD_LEN]; /* DDNS password */
BYTE sDomainName[MAX_DOMAIN_NAME]; /* domain name used in the
device */
BYTE sServerName[MAX_DOMAIN_NAME]; /* DDNS server address, it can be IP
or domainname. */
BYTE byRes[16];
}NET_DVR_DDNSPARA_EX, *LPNET_DVR_DDNSPARA_EX;

typedef struct tagNETAPPCFG{


DWORD dwSize;
char sDNSIp[16]; /* DNS server address */
NET_DVR_NTPPARA struNtpClientParam; /* NTP parameters */
NET_DVR_DDNSPARA struDDNSClientParam; /* DDNS parameters */
BYTE res[464]; /* reserved */
}NET_DVR_NETAPPCFG, *LPNET_DVR_NETAPPCFG;

typedef struct tagEMAILCFG


{ /* 12 bytes */
DWORD dwSize;
char sUserName[32];
char sPassWord[32];
char sFromName[32]; /* Sender */
char sFromAddr[48]; /* Sender address *///the first and last characters
in the character string can not be "@", and the character string mujst have "@"
char sToName1[32]; /* Receiver1 */
char sToName2[32]; /* Receiver2 */
char sToAddr1[48]; /* Receiver address1 */
char sToAddr2[48]; /* Receiver address2 */
char sEmailServer[32]; /* Email server address */
BYTE byServerType; /* Email server type: 0-SMTP*/
BYTE byUseAuthen; /* Email server authentication method: 1-enable,
0-disable */
BYTE byAttachment; /* enable attachment */
BYTE byMailinterval; /* mail interval 0-2s, 1-3s, 2-4s. 3-5s*/

Page 60 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

} NET_DVR_EMAILCFG, *LPNET_DVR_EMAILCFG;
Notes: if you change the DDNSNTP and EMAIL parameters, the device should be
reboot.

3.2.19 NFS configuration

typedef struct tag_NFSCFG{


DWORD dwSize;
struct{
char sNfsHostIPAddr[16];
BYTE sNfsDirectory[PATHNAME_LEN]; // PATHNAME_LEN =
128
}struNfsDiskParam[MAX_NFS_DISK]; // MAX_NFS_DISK=8
}NET_DVR_NFSCFG, *LPNET_DVR_NFSCFG;

the device should be reboot after the NFS is modified.

3.2.20 IPspeed dome configuration

typedef struct tagPOINT_FRAME


{
int xTop; // the x coordinate of the pane beginning dot.
int yTop; // the y coordinate of the pane beginning dot.

int xBottom; // the x coordinate of the pane stop dot.

int yBottom; // the y coordinate of the pane stop dot.

int bCounter; //reserved


}NET_DVR_POINT_FRAME, *LPNET_DVR_POINT_FRAME;

typedef struct tagCRUISE_RET{


struct{
BYTE PresetNum; //preset
BYTE Dwell; //dwelltime time
BYTE Speed; //speed
BYTE Reserve;//serverd
}struCruisePoint[32]; //support 32 sequense at most
}NET_DVR_CRUISE_RET, *LPNET_DVR_CRUISE_RET;

Page 61 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

3.2.21 multi-channel decoder parameters

typedef struct tagDVRCHANINFO{


char sDVRIP[16]; /* DVR IP address */
WORD wDVRPort; /* port number */
BYTE byChannel; /* channel number */
BYTE byTransProtocol; /* transmit protocol type */
BYTE byTransMode; /* transmit stream type 0main stream 1
sub stream*/
BYTE byRes[3];
BYTE sUserName[NAME_LEN]; /* monitor host PC login account */
BYTE sPassword[PASSWD_LEN]; /* monitor host PC password */
}NET_DVR_MATRIX_DECINFO,*LPNET_DVR_MATRIX_DECINFO;
//start/stop dynamic decode
typedef struct tagDYNAMIC_TEST{
DWORD dwSize;
NET_DVR_MATRIX_DECINFO struDecChanInfo; /* dynamic decode
channel info */
}NET_DVR_MATRIX_DYNAMIC_DEC,*LPNET_DVR_MATRIX_DYNAMIC_DEC
;

/*connect channel configuration*/

typedef struct tagMATRIX_CHAN_INFO


{
DWORD dwEnable; /* whether to use, 0-NO, 1- YES */
NET_DVR_MATRIX_DECINFO struDecChanInfo; /* cycle
decodechannel info */
}NET_DVR_MATRIX_CHAN_INFO,*LPNET_DVR_MATRIX_CHAN_INFO;

/* the configuration of each decode channel*/


typedef struct tagLOOPDECINFO
{
DWORD dwSize;
DWORD dwPoolTime; /*cycle time */
NET_DVR_MATRIX_CHAN_INFO struchanConInfo[MAX_CYCLE_CHAN];
}NET_DVR_MATRIX_LOOP_DECINFO,
*LPNET_DVR_MATRIX_LOOP_DECINFO;

typedef struct tagDEC_MATRIX_CHAN_INFO


{
DWORD dwSize;
NET_DVR_MATRIX_DECINFO struDecChanInfo; /* decode channel info
*/
DWORD dwDecState; /*0-dynamic decode 1-cycle decode 2-playback according

Page 62 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

to the file 3- playback according to the time */


NET_DVR_TIME StartTime; /* start time when playback according to the time
*/
NET_DVR_TIME StopTime; /* stop time when playback according to the time
*/
char sFileName[128]; /* the file name when playback according to the file */
}NET_DVR_MATRIX_DEC_CHAN_INFO,*LPNET_DVR_MATRIX_DEC_CHAN_I
NFO;

Page 63 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

Chapter 4 API function introduction

4.1 Client-end function

4.1.1 Initialization

BOOL NET_DVR_Init()
Function: initialize the SDK
Return value: TRUE means it is successful, FALSE means it is failed.

BOOL NET_DVR_Cleanup()
Function: to release SDK resources
Return value: TRUE means it is successful, FALSE means it is failed.

int NET_DVR_IsSupport()
Function: to judge the computer whether it can support network preview and remote
playback.
Return value: //19 bit respectively means the following (bit is true means it supports);
#define NET_DVR_SUPPORT_DDRAW 0x01
// support DIRECTDRAW, if it does not support, the player cannot
work ;
#define NET_DVR_SUPPORT_BLT 0x02
//graphic adapter support BLT operation, if it doest not support, the
player cannot work;
#define NET_DVR_SUPPORT_BLTFOURCC 0x04
//graphic adapter BLT supports color switch, if it does not support,
player will use RGB switch using software;
#define NET_DVR_SUPPORT_BLTSHRINKX 0x08
// graphic adapter BLT supports X axis shrink, if it does not support,
system will switch using software;
#define NET_DVR_SUPPORT_BLTSHRINKY 0x10
// graphic adapter BLT support Y axis shrink; if it does not support,
system will switch by using software;
#define NET_DVR_SUPPORT_BLTSTRETCHX 0x20
//graphic adapter BLT supports X axis enlarge; if it does not support,
system will switch by using software;
#define NET_DVR_SUPPORT_BLTSTRETCHY 0x40
//graphic adapter BLT support Y axis enlarge; if it does not support,
system will switch by using software;
#define NET_DVR_SUPPORT_SSE 0x80
//CPU support SSE command, more than Intel Pentium3 support SSE

Page 64 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

command;
#define NET_DVR_SUPPORT_MMX 0x100
//CPU support MMX command, more than Intel Pentium3 support SSE
command;

BOOL NET_DVR_SetConnectTime(DWORD dwWaitTime,DWORD dwTryTimes)


Function: set the connect time and the try times
Parameter introduction:
dwWaitTime: wait time, unit: millisecond (>300, <60*1000)
dwTryTimes: the try times (reserverd at present)
Return value: TRUE means it is successful, FALSE means it is failed.

BOOL NET_DVR_SetDVRMessage(UINT nMessage,HWND hWnd)


Function: set the window handle of the receiving DVR message
Parameter introduction:
nMessage: message
hWnd: the receiving message window handle

//Exception
#define EXCEPTION_AUDIOEXCHANGE 0x8001 //audio dialogue exception
#define EXCEPTION_ALARM 0x8002 //alarm exception
#define EXCEPTION_PREVIEW 0x8003 //network preview exception
#define EXCEPTION_SERIAL 0x8004 //transparent channel
exception
#define EXCEPTION_RECONNECT 0x8005 //reconnect when preview

Note: message handle function is as follows


void OnMyCommand(WPARAM wParam, LPARAM lParam)
{
char tempbuf[256];
DWORD dwType = wParam; //exception type
LONG lIndex = lParam; //the handle of the corresponding exceptions
ZeroMemory(tempbuf,256);
switch(dwType)
{
case EXCEPTION_AUDIOEXCHANGE: // network exception when in voice
dialogue
sprintf(tempbuf,"network exception in voice dialogue!!!");
TRACE("%s",tempbuf);
//TODO: close voice dialogue
break;
case EXCEPTION_ALARM: //network exception in alarm
uploading
sprintf(tempbuf,"network exception in alarm uploading!!!");
TRACE("%s",tempbuf);
//TODO: close alarm uploading

Page 65 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

break;
case EXCEPTION_PREVIEW: //exception in network preview
sprintf(tempbuf,"network exception in network preview!!!");
TRACE("%s",tempbuf);
//TODO: close network preview
break;
case EXCEPTION_SERIAL: //exception in transparent channel
transmission
sprintf(tempbuf,"network exception in transparent channel
transmission!!!");
TRACE("%s",tempbuf);
//TODO: close transparent channel
break;
case EXCEPTION_RECONNECT: //reconnect in preview
break;
default:
break;
}
}

BOOL NET_DVR_SetDVRMessCallBack(BOOL (CALLBACK


*fMessCallBack)(LONG lCommand,char *sDVRIP,char *pBuf,DWORD
dwBufLen))
Function: set the callback function of the receiving DVRs message
Parameter introduction:
fMessCallBack: callback function of the message, like the active request by DVR: alarm
info., log info., voice dialogue info.; and alarm message received through alarm
uploading channels will all use this callback function.
lCommand: the type of the message, definition is as follows:
#define COMM_ALARM 0x1100 //alarm message
#define COMM_LOG 0x1200 //log message
#define COMM_STARTVOICOM 0x1300 //active voice dialogue launched by
DVR
#define COMM_STOPVOICOM 0x1400 //DVR active stop the voice
dialogue
#define COMM_TRADEINFO 0x1500 //ATMDVR actively upload
the transaction information
sDVRIPIP address of the DVR
pBuf: the buffer to save the message, different type points to different structure
dwBufLen: the size of the buffer
Return value: TRUE means it is successful, FALSE means it is failed.

DWORD NET_DVR_GetSDKVersion()
Function: to get SDK version
Return value: 2 high byte means the major version, 2 low byte means the minor version,
e.g. 0x00020001 means version 2.1.

Page 66 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

BOOL NET_DVR_GetDVRIPByResolveSvr(char *sServerIP, WORD wServerPort,


BYTE *sDVRName,WORD wDVRNameLen,BYTE *sDVRSerialNumber,WORD
wDVRSerialLen,char* sGetIP)
Function: to get the dynamic IP address of the DVR through anaylsis server
Parameter introduction:
sServerIP: IP address of the anaylsis server
wServerPort: the server port of the analysis server
sDVRName: the name of the DVR, it can be NULL
wDVRNameLen: the length of the DVRs name
sDVRSerialNumber: the serial no of the DVR, can be NULL
wDVRSerialLen: the length of the serial no of the DVR
sGetIP: to save the get IP pointer
Return value: TRUE means it is successful, FALSE means it is failed.
Note: the name and the serial no. of the DVR cannot be NULL at the same time.

4.1.2 Set display mode

BOOL NET_DVR_SetShowMode(DWORD dwShowType,COLORREF colorKey)


Function: set player display mode, be set before playing. There are two play modes: the
common mode and OVERLAY mode. The advantage of OVERLAY mode is: most of the
graphic adapter support OVERLAY, using OVERLAY mode in some graphic adapter
which do not support BLT hardware shrink and enlarge and the switch of th color like SIS
series graphic adapters, it will greatly reduce the CPU resources and improve the picture
quality (which is correspondingly to using software to realize the shrink and enlarge,
switch of color). And the disadvantage is it can only play one channel picture at a time,
cannot realize large scale centralization surveillance.
There can only be one OVERLAY surface in the active status at one graphic adapter
and at the sametime. If at that time there is a program using OVERLAY in the system, the
player cannot establish an OVERLAY surface any more, it will change into the common
mode automatically, while not return to FALSE. Some common player possibly use
OVERLAY surface, thus the other program cannot use OVERLAY surface any more.

Parameter introduction:
dwShowType: show type
colorKey: the transparent color set by user, which should be set when in OVERLAY
mode. The transparent color just like a transparent film, the display picture only can go
through this color, while other colors will prevent the display picture. User should put the
color in the display window to show the display picture. Usually only one color are
chosen as the transparent color. colorKey is the value of 32 bit 0x00rrggbb, the highest
byte is 0, the last three byte is correspondingly refer to the value of r, g, b.
Return value: TRUE means it is successful, FALSE means it is failed.

Page 67 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

4.1.3 Start/Stop listen program

BOOL NET_DVR_StartListen (char *sLocalIP,WORD wLocalPort)


Function: to start listen program, to listen the request launched by DVR, receiving the
message of DVR
Parameter introduction:
sLocalIP: IP address of PC, if it is NULL, SDK will get the IP address of the PC
automatically, if there is more than one IP address in PC, you can
appoint one to listen.
WLocalPort: local listen port, set be user,
Return value: TRUE means it is successful, FALSE means it is failed.
Note: if you want client-end can receive the message sent by the DVR, you must set
the remote host IP address in the DVR network configuration to be the IP
address of the PC, remote host port no. to be the listen port no. of the PC.

BOOL NET_DVR_StopListen()
Function: to stop listen program

4.1.4 Get the error code

DWORD NET_DVR_GetLastError()
Function: to get the error code
Return value:
#define NET_DVR_NOERROR 0 // no error
#define NET_DVR_PASSWORD_ERROR 1 // users name and password
error
#define NET_DVR_NOENOUGHPRI 2 // no right
#define NET_DVR_NOINIT 3 // no initialization
#define NET_DVR_CHANNEL_ERROR 4 // channel no. is error
#define NET_DVR_OVER_MAXLINK 5
// the client-end connected to the DVR is over the maxlink
#define NET_DVR_VERSIONNOMATCH 6 //version doest not match
#define NET_DVR_NETWORK_FAIL_CONNECT 7 //failed to connect with
the DVR
#define NET_DVR_NETWORK_SEND_ERROR 8 // failed to send to the
DVR
#define NET_DVR_NETWORK_RECV_ERROR 9
//failed to receive the data from the DVR
#define NET_DVR_NETWORK_RECV_TIMEOUT 10
//timeout when receiving the data from the DVR
#define NET_DVR_NETWORK_ERRORDATA 11 // the data sent erroe
#define NET_DVR_ORDER_ERROR 12 // the called order error
#define NET_DVR_OPERNOPERMIT 13
//the privileged user is working, the operation cannot be done
#define NET_DVR_COMMANDTIMEOUT 14 //DVR command time

Page 68 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

out
#define NET_DVR_ERRORSERIALPORT 15 // port no error
#define NET_DVR_ERRORALARMPORT 16 //alarm port no error
#define NET_DVR_PARAMETER_ERROR 17 //parameter error
#define NET_DVR_CHAN_EXCEPTION 18 // servers channel is in
error status
#define NET_DVR_NODISK 19 // no hard disk
#define NET_DVR_ERRORDISKNUM 20 // hard disk no. error
#define NET_DVR_DISK_FULL 21 //server hark disk is full
#define NET_DVR_DISK_ERROR 22 //server hard disk error
#define NET_DVR_NOSUPPORT 23 //server does not support
#define NET_DVR_BUSY 24 // server is busy
#define NET_DVR_MODIFY_FAIL 25 //failed to modify in the
server
#define NET_DVR_PASSWORD_FORMAT_ERROR 26
//the password inputting format is not correct
#define NET_DVR_DISK_FORMATING 27 //hard disk is formatting,
operation cannot be done
#define NET_DVR_DVRNORESOURCE 28 //DVR no resources
#define NET_DVR_DVROPRATEFAILED 29 //DVR failed to opeartion
#define NET_DVR_OPENHOSTSOUND_FAIL 30 // failed open PC voice
#define NET_DVR_DVRVOICEOPENED 31 // server voice dialogue is
occupied
#define NET_DVR_TIMEINPUTERROR 32 // time input is not
correct
#define NET_DVR_NOSPECFILE 33 //there is no appointed file when
playback
#define NET_DVR_CREATEFILE_ERROR 34 // failed to create a file
#define NET_DVR_FILEOPENFAIL 35 // faile to open a file
#define NET_DVR_OPERNOTFINISH 36 //the last operation is not
finished
#define NET_DVR_GETPLAYTIMEFAIL 37 //faile to get the current
play time
#define NET_DVR_PLAYFAIL 38 // failed to play
#define NET_DVR_FILEFORMAT_ERROR 39 //the file input format is
not correct
#define NET_DVR_DIR_ERROR 40 // path error
#define NET_DVR_ALLOC_RESOUCE_ERROR 41 //resources allotting
error
#define NET_DVR_AUDIO_MODE_ERROR 42 //display card mode
error
#define NET_DVR_NOENOUGH_BUF 43 //buffer is not enough
#define NET_DVR_CREATESOCKET_ERROR 44 //establish SOCKET error
#define NET_DVR_SETSOCKET_ERROR 45 // establish SOCKET error
#define NET_DVR_MAX_NUM 46 //the max no
#define NET_DVR_USERNOTEXIST 47 // user doest not exit

Page 69 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

#define NET_DVR_WRITEFLASHERROR 48 // wirte FLASH eroor


#define NET_DVR_UPGRADEFAIL 49 //failed to upgrade DVR
#define NET_DVR_CARDHAVEINIT 50 //the decode card is initialed
#define NET_DVR_PLAYERFAILED 51 //player failed
#define NET_DVR_MAX_USERNUM 52 //the max user no.
#define NET_DVR_GETLOCALIPANDMACFAIL 53
//failed to get the IP address of the client-end or physical address

4.1.5 User login

LONG NET_DVR_Login(char *sDVRIP,WORD wDVRPort,char


*sUserName,char *sPassword ,LPNET_DVR_DEVICEINFO lpDeviceInfo)
Function: login user to the DVR
Parameter introduction:
sDVRIP: IP address of the DVR
wDVRPort: the port no of the DVR
sUserName: the users name
sPassword: password
lpDeviceInfo: the pointer to NET_DVR_DEVICEINFO stucture
return value: -1 means it is failed, the other value means the returned users ID value, this
ID value is allotted by SDK, the every users ID value in the client-end is special.

BOOL NET_DVR_Logout(LONG lUserID)


Function: logout certain user in DVR
Parameter introduction:
LUserID: users ID value, return from NET_DVR_Login
Return value: TRUE means it is successful, FALSE means it is failed.

4.1.6 Network preview

LONG NET_DVR_RealPlay(LONG lUserID,LPNET_DVR_CLIENTINFO


lpClientInfo)
Fucntion: to beeot picture real-time preview
Parameter introduction:
lUserID: the users ID, the return value of NET_DVR_Login
lpClientInfo: the pointer to NET_DVR_CLIENTINFO structure
return value: -1 means it is failed, the other value is as the parameter of the functions like
NET_DVR_StopRealPlay.

BOOL NET_DVR_StopRealPlay(LONG lRealHandle)


Function: to close picture preview function
Parameter introduction:
lRealHandle: the return value of NET_DVR_RealPlay
Return value: TRUE means it is successful, FALSE means it is failed.

Page 70 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

4.1.6.1 Video parameter

BOOL NET_DVR_ClientSetVideoEffect(LONG lRealHandle, DWORD


dwBrightValue, DWORD dwContrastValue, DWORD dwSaturationValue,DWORD
dwHueValue)
Function: to adjust the video parameter
Parameter introduction:
lRealHandle: the return value of NET_DVR_RealPlay()
dwBrightValue: the brightness (value is from 1 to 10)
dwContrastValue: the contrast (value is from 1 to 10))
dwSaturationValue: the saturation (value is from 1 to 10)
dwHueValue: hue (value is from 1 to 10)
Return value: TRUE means it is successful, FALSE means it is failed.

BOOL NET_DVR_ClientGetVideoEffect(LONG lRealHandle,DWORD


*pBrightValue,DWORD *pContrastValue, DWORD *pSaturationValue,DWORD
*pHueValue)
Function: to get the video parameter
Parameter introduction:
lRealHandle: the return value of NET_DVR_RealPlay()
pBrightValue: the pointer of saving the brightness value(from 1 to 10)
pContrastValue: pointer of saving the contrast value (from 1 to 10)
pSaturationValue: the pointer of saving the saturation value(from 1 to 10)
pHueValue: the pointer of saving hue value(from 1 to 10)
Return value: TRUE means it is successful, FALSE means it is failed.

4.1.6.2 Overlap characters and pictures

BOOL NET_DVR_RigisterDrawFun(LONG lRealHandle,void (CALLBACK*


fDrawFun)(LONG lRealHandle,HDC hDc,DWORD dwUser),DWORD dwUser)
Function: register a callback function, to get device context of the current surface. You
can draw (or write)in this DC just like draw in the client area in the window, while this
DC is not the DC in the client area in the window, but in the DC in the Off-Screen surface
of the player DirectDraw.

Parameter introduction:
lRealHandle: the return value of NET_DVR_RealPlay()
fDrawFun: the handle of the callback function
dwUser: the users data
callback function introduction: void fDrawFun(long lRealHandle,HDC hDc,DWORD
dwUser)
lRealHandle: the return value of NET_DVR_RealPlay()
hDc: the context of OffScreen surface device, you can operate it just like operating
display window client area

Page 71 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

dwUser: users data, that is the above input users data


Return value: TRUE means it is successful, FALSE means it is failed.

4.1.6.3 Play control

BOOL NET_DVR_SetPlayerBufNumber(LONG lRealHandle,DWORD


dwBufNum)
Function: to set the frame number of the player buffer
Parameter introduction:
lRealHandle: the return value of NET_DVR_RealPlay()
dwBufNum: the max frame number of the player frame buffer to be set, value is from (3
to 25), the bigger the buffer, the smoother the picture, the smaller the
buffer, the better the real time.
Return value: TRUE means it is successful, FALSE means it is failed.
Note: the function should be called right after function NET_DVR_RealPlay.

BOOL NET_DVR_ThrowBFrame(LONG lRealHandle,DWORD dwNum)


Function: to set B frame number to be thrown when in decoding, dwNum: 0 no throw, 1-
throw 1 frame, 2- throw 2 frames
Parameter introduction:
lRealHandle: the return value of NET_DVR_RealPlay()
m_ dwNum: the B frame number to be thrown, value is 0, 1, 2, 0- no throw, 1- throw 1 B
frame, 2- throw 2 B frames; when in more than one channel play, throw B
frame can reduce the CPU resources, while when in one channel playing,
itd better no throw the B frame.
Return value: TRUE means it is successful, FALSE means it is failed.

4.1.6.4 Audio control

BOOL NET_DVR_SetAudioMode(DWORD dwMode)


Function: to set audio play mode, is that audio card monopolistic mode or shared mode
Parameter introduction:
dwMode: set the audio card mode, 1- monopolistic mode, one channel audio; 2- shared
audio card, more than one channel audio mode;
Return value: TRUE means it is successful, FALSE means it is failed.
Note: this function should be set before network preview. If it is not set, SDK will
use the monopolistic mode as defaulted. When it is set as monopolistic mode, the
every channels audio is closed as defaulted; when it is set as shared, every channels
audio is opened.

BOOL NET_DVR_OpenSound(LONG lRealHandle)


Function: open the sound in monopolistic mode; when there is more than one channels,
calling this function will stop the other channels sound, preview one channel at a time.

Page 72 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

Parameter introduction:
lRealHandle: the return value of NET_DVR_RealPlay()
Return value: TRUE means it is successful, FALSE means it is failed.

BOOL NET_DVR_CloseSound()
Function: to close sound in monopolistic mode
Return value: TRUE means it is successful, FALSE means it is failed.

BOOL NET_DVR_OpenSoundShare(LONG lRealHandle)


Function: open one channel audio preview in shared mode
Parameter introduction:
lRealHandle: the return value of NET_DVR_RealPlay()
Return value: TRUE means it is successful, FALSE means it is failed.

BOOL NET_DVR_CloseSoundShare(LONG lRealHandle)


Function: close one channel audio preview in shared mode
Parameter introduction:
lRealHandle: the return value of NET_DVR_RealPlay()
Return value: TRUE means it is successful, FALSE means it is failed.

BOOL NET_DVR_Volume(LONG lRealHandle,WORD wVolume)


Function: to adjust volume
Parameter introduction:
lRealHandle: the return value of NET_DVR_RealPlay()
wVolume: the volumen after set, value if from 0 to 0xffff
Return value: TRUE means it is successful, FALSE means it is failed.

4.1.6.5 Capture data

BOOL NET_DVR_SetRealDataCallBack(LONG lRealHandle,void(CALLBACK


*fRealDataCallBack) (LONG lRealHandle, DWORD dwDataType, BYTE
*pBuffer,DWORD dwBufSize,DWORD dwUser),DWORD dwUser)
Function: set callback function, user handle the data received from the client-end
Parameter introduction:
lRealHandle: the return value of NET_DVR_RealPlay()
fRealDataCallBack: call back function
dwUser: users data
callback function introduction:
lRealHandle: the return value of NET_DVR_RealPlay()
dwDataType: the data type
#define NET_DVR_SYSHEAD 1 //system head data
#define NET_DVR_STREAMDATA 2 // stream data
pBuffer: buffer pointer to save data

Page 73 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

dwBufSize: the size of the buffer


dwUser: users data, that is above mentioned users data
Return value: TRUE means it is successful, FALSE means it is failed.
Note: this function includes start and stop the user to handle the data received from
the client-end, when fRealDataCallBack is not NULL, it means user start handle the
data received by client-end, when it is NULL, it means user stop handling the data
received from the client-end. When user start to receive the data, the first package is
a system head of 40 byte, user can user this file head to open player, the afterward
callback is the compression data stream.

BOOL NET_DVR_SaveRealData(LONG lRealHandle,char *sFileName)


Function: save the captured data to the appointed file (*.mp4)
Parameter introduction;
lRealHandle: the return value of NET_DVR_RealPlay()
sFileName: file name, suffix is .mp4
Return value: TRUE means it is successful, FALSE means it is failed.

BOOL NET_DVR_StopSaveRealData(LONG lRealHandle)


Functuion: stop capturing
Parameter introduction:
lRealHandle: the return value of NET_DVR_RealPlay()
Return value: TRUE means it is successful, FALSE means it is failed.

4.1.6.6 Capture picture

BOOL NET_DVR_CapturePicture(LONG lRealHandle,char *sPicFileName)


Function: capture picture and trun to 24 bit real color BMP bit picture
Parameter introduction:
lRealHandle: the return value of NET_DVR_RealPlay()
sPicFileName: the file name to save BMP pictures, suffix is .bmp, the length of the file is
less than 100 byte.
Return value: TRUE means it is successful, FALSE means it is failed.

4.1.7 PTZ control

BOOL NET_DVR_GetPTZCtrl(LONG lRealHandle)


Function: check PTZ control rights, must be called after the network preview.
Parameter introduction:
lRealHandle: the return value of NET_DVR_RealPlay()
Return value: TRUE meas it is successfully fet the control rights, can control the PTZ,
while FALSE menas failed, cannot control the PTZ, call function
NET_DVR_GetLastError() to check the error type.

BOOL NET_DVR_GetPTZCtrl_Other(LONG lUserID,LONG lChannel)

Page 74 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

Function: check PTZ control rights, need not to network preview.


Parameter introduction:
lUserID: the return value of NET_DVR_Login ()
lChannel: the channel no of the DVR
Return value: TRUE meas it is successfully fet the control rights, can control the PTZ,
while FALSE menas failed, cannot control the PTZ, call function
NET_DVR_GetLastError() to check the error type.

BOOL NET_DVR_PTZControl(LONG lRealHandle,DWORD


dwPTZCommand,DWORD dwStop)
Function : PTZ control, must be called after the network preview.
Parameter introduction:
lRealHandle: the return value of NET_DVR_RealPlay()
dwPTZCommand: PTZ control command
#define LIGHT_PWRON 2 /* turn on light power */
#define WIPER_PWRON 3 /* turn on wiper switch */
#define FAN_PWRON 4 /* turn on fan switch */
#define HEATER_PWRON 5 /* turn one heater switch */
#define AUX_PWRON 6 /* turn on aux device switch */
#define ZOOM_IN 11 /* zoom in */
#define ZOOM_OUT 12 /* zoom out */
#define FOCUS_IN 13 /* focus near */
#define FOCUS_OUT 14 /* focus far */
#define IRIS_ENLARGE 15 /* iris enlarge */
#define IRIS_SHRINK 16 /* iris shrink */
#define TILT_UP 21 /*PTZ tilt up */
#define TILT_DOWN 22 /* PTZ tilt down */
#define PAN_LEFT 23 /* Pan left */
#define PAN_RIGHT 24 /* Pan right */
#define PAN_AUTO 29 /* Pan automatically scan at the speed SS */
dwStop: let PTZ to stop or start action, 0- start, 1- stop, every action should call this API
twice, the first two parameters are the same, only dwStop one time is 0, one time is 1.
Return value: TRUE means it is successful, FALSE means it is failed.

BOOL NET_DVR_PTZControl_Other(LONG lUserID,LONG lChannel,DWORD


dwPTZCommand,DWORD dwStop)
Function: PTZ control, need not preview picture
Parameter introduction:
lUserID: the return value of NET_DVR_Login ()
lChannel: the channel no. of the DVR
dwPTZCommand: PTZ control command
dwStop is to let PTZ stop action or start action, 0- start, 1 - stop, every action should call
this interface twice, the first two parameters are the same, only dwStop one time is 0, one
time is 1.
Return value: TRUE means it is successful, FALSE means it is failed.

Page 75 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

BOOL NET_DVR_TransPTZ(LONG lRealHandle,char *pPTZCodeBuf,DWORD


dwBufSize)
Function: transparent PTZ control, must be called after the network preview
Parameter introduction:
lRealHandle: the return value of NET_DVR_RealPlay()
pPTZCodeBuf: the pointer to save PTZ control code buffer
dwBufSize: the size of the PTZ control code
Return value: TRUE means it is successful, FALSE means it is failed.

BOOL NET_DVR_TransPTZ_Other(LONG lUserID,LONG lChannel,char


*pPTZCodeBuf, DWORD dwBufSize)
Function: transparent PTZ control, need not to start network preview
Parameter introduction:
lUserID: the return value of NET_DVR_Login ()
lChannel: the channel no of the DVR, pointing out to which decoder to send the data.
pPTZCodeBuf: the pointer to save PTZ conrrol code buffer
dwBufSize: the size of the PTZ control code
Return value: TRUE means it is successful, FALSE means it is failed.

BOOL NET_DVR_PTZPreset(LONG lRealHandle,DWORD


dwPTZPresetCmd,DWORD dwPresetIndex)
Function: PTZ preset operation, must be called after the network preview
Parameter introduction:
lRealHandle: the return value of NET_DVR_RealPlay()
dwPTZPresetCmd: the PTZ preset command
define SET_PRESET 8 /* set preset */
define CLE_PRESET 9 /* clear preset */
define GOTO_PRESET 39 /* go to the preset */
dwPresetIndex: the index of the preset, max support 128 preset points.
Return value: TRUE means it is successful, FALSE means it is failed.

BOOL NET_DVR_PTZPreset_Other(LONG lUserID,LONG lChannel,DWORD


dwPTZPresetCmd,DWORD dwPresetIndex)
Function: PTZ preset operation, need not preview picture
Parameter introduction:
lUserID: the return value of NET_DVR_Login ()
lChannel: the channel of DVR
dwPTZPresetCmd: the PTZ preset command:
define SET_PRESET 8 /* set preset point */
define CLE_PRESET 9 /* clear preset point */
define GOTO_PRESET 39 /* go to the preset point */
dwPresetIndex: the index no of the preset, max support 128 preset points.

Page 76 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

Return value: TRUE means it is successful, FALSE means it is failed.


Note:
NET_DVR_PTZControl()
NET_DVR_PTZControl_Other()
NET_DVR_PTZPreset()
NET_DVR_PTZPreset_Other()
These four interfaces are all deceided to send what kind of PTZ control code by
DVR, while the client-end only need to call the corresponding macro definition.
Server (DVR) will send the PTZ control code according to the current set PTZ type
and PTZ address. If the current set PTZ is not needed, then it cannot use these four
interfaces to control.

NET_DVR_TransPTZ()
NET_DVR_TransPTZ_Other()
These two interfaces is launched by client-end to send control code to PTZ, it
need not to set the PTZ type and PTZ address in the server-end. Server (DVR)
receives the control code and sends them directly to RS-485 port without any
process.

BOOL __stdcall NET_DVR_TransPTZ_EX(LONG lRealHandle,char


*pPTZCodeBuf,DWORD dwBufSize)
Function:
Transparently control PTZ. You can use it after you start network preview. It is more
efficient than NET_DVR_TransPTZ().
Parameters description:
lRealHandle: The return value of NET_DVR_RealPlay().
pPTZCodeBuf: The buffer pointer to store the PTZ commands.
dwBufSize: The length of PTZ commands.
Return value:
TRUE means success and FALSE means failure.

BOOL __stdcall NET_DVR_PTZControl_EX(LONG lRealHandle,DWORD


dwPTZCommand, DWORD dwStop)
Function:
PTZ control. You can use it after you start network preview. It is more efficient than
NET_DVR_PTZControl().
Parameters description:
lRealHandle: The return value of NET_DVR_RealPlay().
dwPTZCommand: PTZ control command type.
dwStop: Start or stop controlling PTZ. 0 means start and 1 means stop. For each PTZ
motion, you must adjust this API two times, one is start and the other is stop.
Return value:
TRUE means success and FALSE means failure.

Page 77 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

BOOL __stdcall NET_DVR_PTZPreset_EX(LONG lRealHandle,DWORD


dwPTZPresetCmd, DWORD dwPresetIndex)
Function:
Control PTZ preset. You can use it after you start network preview. It is more
efficient than NET_DVR_PTZPreset().
Parameters description:
lRealHandle: The return value of NET_DVR_RealPlay().
dwPTZPresetCmd: PTZ preset control command type.
dwPresetIndex: PTZ preset index. It can support 128 PTZ preset number.
Return value:
TRUE means success and FALSE means failure.

Page 78 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

4.1.8 Playback and download

4.1.8.1 Search file

LONG NET_DVR_FindFile(LONG lUserID,LONG lChannel,DWORD dwFileType,


LPNET_DVR_TIME lpStartTime, LPNET_DVR_TIME lpStopTime)
Function: search recorded files in DVR
Parameter introduction:
lUserID: the return value of NET_DVR_Login ()
lChannel: channel no.
dwFileType: the file type to be found, 0xff all, 0 schedule record, 1 motion
detection, 2 alarm record, 3 alarm | motin detection, 4 - alarm &
motion detection, 5 command trigger, 6 manually record
lpStartTime: the start time
lpStopTime: the stop time
return value: -1 means it is failed, the others are used as the parameter of the function
NET_DVR_FindClose().
Note: when this interface successfully returned, you can call the interface
NET_DVR_FindNextFile to get the file information.

LONG NET_DVR_FindFileByCard(LONG lUserID,LONG lChannel,DWORD


dwFileType, , BOOL bNeedCardNum, BYTE *sCardNumber, LPNET_DVR_TIME
lpStartTime, LPNET_DVR_TIME lpStopTime);
Function: to find the file according the credit card no., this is specially designed for
ATM/POS DVR
Parameter introduction:
lUserID: the return value NET_DVR_Login ()
lChannel: the channel no.
dwFileType: the file type to be found, 0xFF full, 0 scheduled record, 1
motion detection,
2 approach alarm, 3 cash out alarm, 4 cash in alarm, 5
command trigger, 6 manually record, 7 vibration alarm
bNeedCardNum: whether need credit card information, TRUE: need, FALSE: no need
sCardNumber: credit card information
lpStartTime: the start time
lpStopTime: the stop time
return value: -1 means failed, the other value is used as the paramerter of the function of
NET_DVR_FindClose
Note:after the interface is successfully returned, you can call the interface
NET_DVR_FindNextFile to get the file information.

LONG NET_DVR_FindNextFile(LONG lFindHandle,LPNET_DVR_FIND_DATA


lpFindData)
Function: to get file information

Page 79 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

Parameter introduction:
lFindHandle : file find handle, return from NET_DVR_FindFile
lpFindData: the pointer to save file information
return value: -1 means it is failed, NET_DVR_SUCCESS means it is successfully get the
file information; NET_DVR_ISFINDING means it is searching, please wait;
NET_DVR_NOMOREFILE means there is no more files, end of finding;
NET_DVR_FILE_NOFIND means no files is found; other values is exception.
//return value of functions
#define NET_DVR_FILE_SUCCESS 1000 //to get the file
information
#define NET_DVR_FILE_NOFIND 1001 //no file
#define NET_DVR_ISFINDING 1002 //is finding the file
#define NET_DVR_NOMOREFILE 1003 //no more files
#define NET_DVR_FILE_EXCEPTION 1004 //exceptions when in
finding files

BOOL NET_DVR_FindClose(LONG lFindHandle)


Function: stop the handle establishd by NET_DVR_FindFile to release the sources
Parameter introduction:
lFindHandle: file finds the handle, return from NET_DVR_FindFile
Return value: TRUE means it is successful, FALSE means it is failed.

4.1.8.2 Playback

LONG NET_DVR_PlayBackByName(LONG lUserID,char *sPlayBackFileName ,


HWND hWnd)
Function: playback according to file names
Parameter introduction:
lUserID: the return value of NET_DVR_Login ()
sPlayBackFileName: the file name to be playback
hWnd: the window handle to display the playback file
return value: -1 means it is failed, other is as the parameters of
NET_DVR_StopPlayBack.

LONG NET_DVR_PlayBackByTime(LONG lUserID,LONG lChannel,


LPNET_DVR_TIME lpStartTime, LPNET_DVR_TIME lpStopTime , HWND
hWnd)
Function: playback according to time
Parameter introduction
lUserID: return value of NET_DVR_Login ()
lChanne: channel no.
lpStartTime: file start time
lpStopTime: file stop time
hWnd: window handle to display the playback
return value: -1 means it is failed, others is as the parameters of functions

Page 80 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

NET_DVR_StopPlayBack

BOOL NET_DVR_StopPlayBack(LONG lPlayHandle)


Function: stop playback
Parameter introduction:
lPlayHandle: play handle, the return value of NET_DVR_PlayBackByName() or
NET_DVR_PlayBackByTime()
Return value: TRUE means it is successful, FALSE means it is failed.

4.1.8.3 Play control

BOOL NET_DVR_PlayBackControl(LONG lPlayHandle,DWORD


dwControlCode,DWORD dwInValue,DWORD *lpOutValue)
Function: the status when controlling playback
Parameter introduction:
lPlayHandle: the play handle, the return value of NET_DVR_PlayBackByName() or
NET_DVR_PlayBackByTime()
dwControlCode: control command
#define NET_DVR_PLAYSTART 1//start play
#define NET_DVR_PLAYSTOP 2//stop play
#define NET_DVR_PLAYPAUSE 3//pause
#define NET_DVR_PLAYRESTART 4//restart play
#define NET_DVR_PLAYFAST 5//play fast
#define NET_DVR_PLAYSLOW 6//play slow
#define NET_DVR_PLAYNORMAL 7//normal play
#define NET_DVR_PLAYFRAME 8//play frame by frame
#define NET_DVR_PLAYSTARTAUDIO 9//open the audio
#define NET_DVR_PLAYSTOPAUDIO 10//close the audio
#define NET_DVR_PLAYAUDIOVOLUME 11//adjust the volume
#define NET_DVR_PLAYSETPOS 12//modify file playback speed
#define NET_DVR_PLAYGETPOS 13//get the file playback speed
#define NET_DVR_PLAYGETTIME 14//get current played time
#define NET_DVR_PLAYGETFRAME 15//get current played frames
#define NET_DVR_GETTOTALFRAMES 16//get total frame numbers of current
played file
#define NET_DVR_GETTOTALTIME 17//get the total time of current played
file

dwInValue: input parameters, e.g. set the file progress of playback, this parameter
indicates the progress value.
lpOutValue: output parameter, e.g. get the total time of current played file, this parameter
is the total time.
Return value: TRUE means it is successful, FALSE means it is failed.

Page 81 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

4.1.8.4 Capture data

BOOL NET_DVR_PlayBackSaveData(LONG lPlayHandle,char *sFileName)


Function: save playback data
Parameter introduction:
lPlayHandle: play handle, the return value of NET_DVR_PlayBackByName() or
NET_DVR_PlayBackByTime()
sFileName: saved file name
Return value: TRUE means it is successful, FALSE means it is failed.

BOOL NET_DVR_StopPlayBackSave(LONG lPlayHandle)


Function: stop saving
Parameter introduction:
lPlayHandle: play handle, the return value of NET_DVR_PlayBackByName() or
NET_DVR_PlayBackByTime()
Return value: TRUE means it is successful, FALSE means it is failed.

BOOL NET_DVR_SetPlayDataCallBack(LONG lPlayHandle,void(CALLBACK


*fPlayDataCallBack) (LONG lPlayHandle, DWORD dwDataType, BYTE
*pBuffer,DWORD dwBufSize,DWORD dwUser),DWORD dwUser)
Function: set playback function, user handle the stream data himself
Parameter introduction:
lPlayHandle: play handle, the return value of NET_DVR_PlayBackByName() or
NET_DVR_PlayBackByTime()
fPlayDataCallBack: callback function
dwUser: users data
callback function introduction:
lPlayHandle: play handle, the return value of NET_DVR_PlayBackByName() ot
NET_DVR_PlayBackByTime()
dwDataType: data type
#define NET_DVR_SYSHEAD 1 //system data head
#define NET_DVR_STREAMDATA 2 // stream data
pBuffer: buffer pointer to save data
dwBufSize: the size of the buffer
dwUser: users data, that is the above input users data
Return value: TRUE means it is successful, FALSE means it is failed.
Note: this function includes start and stop user handling the stream data, when
fPlayDataCallBack is not NULL means user start handling the data received, when
it is NULL, it means user stop handling the data received. When user start receiving
data, the first package is the file head of 40 bytes, the user can user this head to open
player, the afterward called is the data stream.

Page 82 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

4.1.8.5 Get OSD time

BOOL NET_DVR_GetPlayBackOsdTime(LONG lPlayHandle,


LPNET_DVR_TIME lpOsdTime)
Function: get displayed OSD time in playback
Parameter introduction:
lPlayHandle: play handke, the return value of NET_DVR_PlayBackByName() or
NET_DVR_PlayBackByTime()
lpOsdTime: the OSD time got, a pointer to NET_DVR_TIME structure
Return value: TRUE means it is successful, FALSE means it is failed.

4.1.8.6 Capture picture

BOOL NET_DVR_PlayBackCaptureFile(LONG lPlayHandle,char *sFileName)


Function: capture pictures when playback
Parameter introduction:
lPlayHandle: play handle, the return value of NET_DVR_PlayBackByName() or
NET_DVR_PlayBackByTime()
sFileName: the file name to save the picture, the length of the file name must be less or
equal 100 bytes.
Return value: TRUE means it is successful, FALSE means it is failed.

4.1.8.7 Download

LONG NET_DVR_GetFileByName(LONG lUserID,char *sDVRFileName,char


*sSavedFileName)
Function: download according file name
Parameter introduction:
lUserID: the return value of NET_DVR_Login ()
sDVRFileName: the file name to be downloaded
sSavedFileName: the files name saved in the computer after downloaded

LONG NET_DVR_GetFileByTime(LONG lUserID,LONG lChannel,


LPNET_DVR_TIME lpStartTime, LPNET_DVR_TIME lpStopTime, char
*sSavedFileName)
Function: download according to time
Parameter introduction:
lUserID: the return value of NET_DVR_Login ()
lChannel: channel no.
lpStartTime: start time
lpStopTime: stop time

Page 83 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

sSavedFileName: the file name saved in the computer after downloaded


Return value: -1 means it is failed, other value means successful, used as the parameter of
the function NET_DVR_StopGetFile.

BOOL NET_DVR_StopGetFile(LONG lFileHandle)


Function: stop downloading
Parameter introduction:
lFileHandle: download handle, the return value of NET_DVR_GetFileByName() or
NET_DVR_GetFileByTime()
Return value: TRUE means it is successful, FALSE means it is failed.

int NET_DVR_GetDownloadPos(LONG lFileHandle)


Function: get the progress of downloading
Parameter introduction:
lFileHandle: download handle, the return value of NET_DVR_GetFileByName() or
NET_DVR_GetFileByTime()
Return value: -1 means it is failed, 0-100: the progress of the downloading, 100 means
the end of download, >100: due to the network problem or busy of DVR, download is
stopped exceptionally.

4.1.9 Alarm

LONG NET_DVR_SetupAlarmChan(LONG lUserID)


Function: establish alarm upload tunnel
Parameter introduction:
lUserID: the return value of NET_DVR_Login ()
return value: -1 means it is failed, the others is used as the parameter of functions such as
NET_DVR_CloseAlarmChan()

BOOL NET_DVR_CloseAlarmChan(LONG lAlarmHandle)


Function: dismiss the alarm upload tunnel
Parameter introduction:
lAlarmHandle: the return value of NET_DVR_SetupAlarmChan
Return value: TRUE means it is successful, FALSE means it is failed.

BOOL NET_DVR_SetAlarmOut(LONG lUserID,LONG lAlarmOutPort,LONG


lAlarmOutStatic)
Function: set alarm output
Parameter introduction:
lUserID: the return value of NET_DVR_Login ()
lAlarmOutPort: alarm output port, begins from 0, 0xff means all.
lAlarmOutStatic: alarm output status, 0 stop alarm output, 1 start alarm output
Return value: TRUE means it is successful, FALSE means it is failed.

Page 84 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

BOOL NET_DVR_GetAlarmOut(LONG lUserID,


LPNET_DVR_ALARMOUTSTATUS lpAlarmOutState)
Function: get alarm output status
Parameter introduction:
lUserID: the return value of NET_DVR_Login ()
lpAlarmOutState: the pointer to NET_DVR_ALARMOUTSTATUS structure
Return value: TRUE means it is successful, FALSE means it is failed.

4.1.10 Voice dialogue

LONG NET_DVR_StartVoiceCom(LONG lUserID)


Function: start voice dialogue
Parameter introduction:
lUserID: the return value of NET_DVR_Login ()
Return value: -1 means it is failed, the other value is used as the parameter of the function
NET_DVR_SetVoiceComClientVolume ()

BOOL NET_DVR_SetVoiceComClientVolume(LONG lVoiceComHandle,WORD


wVolume)
Functtion: set the PC-end volume in voice dialogue
Parameter introduction:
lVoiceComHandle: the return value of NET_DVR_StartVoiceCom
wVolume: the volume after setting, from 0 to 0xffff
Return value: TRUE means it is successful, FALSE means it is failed.

BOOL NET_DVR_StopVoiceCom(LONG lVoiceComHandle)


Function: stop voice dialogue
Parameter introduction:
lVoiceComHandle: the return value of NET_DVR_StartVoiceCom
Return value: TRUE means it is successful, FALSE means it is failed.

4.1.11 Voice broadcast

BOOL NET_DVR_ClientAudioStart()
Function: start PC-end voice capture, the voice is from the sound adapter.
Return value: TRUE means it is successful, FALSE means it is failed.

BOOL NET_DVR_ClientAudioStop()
Function: stop PC-end voice capture
Return value: TRUE means it is successful, FALSE means it is failed.

Page 85 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

BOOL NET_DVR_AddDVR(LONG lUserID)


Function: add one DVR to the group which can receive the PC voice
Parameter introduction:
lUserID: the return value of NET_DVR_Login ()
Return value: TRUE means it is successful, FALSE means it is failed.

BOOL NET_DVR_DelDVR(LONG lUserID)


Function: delete the DVR which has been added to the group
Parameter introduction:
lUserID: the return value of NET_DVR_Login ()
Return value: TRUE means it is successful, FALSE means it is failed.

4.1.12 Transparent channel

LONG NET_DVR_SerialStart(LONG lUserID,LONG


lSerialPort,void(CALLBACK *fSerialDataCallBack)(LONG lSerialHandle,char
*pRecvDataBuffer,DWORD dwBufSize,DWORD dwUser),DWORD dwUser)
Function: establish transparent channel
Parameter introduction:
lUserID: the return value of NET_DVR_Login ()
lSerialPort: serial port no., 1-232 serial port, 2-485 serial port
dwUser: users data
fSerialDataCallBack: call back function
callback function introduction:
lSerialHandle: the return value of NET_DVR_SerialStart()
pRecvDataBuffer: the buffer pointer to save received data
dwBufSize: the size of buffer
dwUser: the above users data
Return value: -1 means it is failed, the other values is as the parameters of the function
NET_DVR_SerialSend()

BOOL NET_DVR_SerialSend(LONG lSerialHandle,LONG lChannel,char


*pSendBuf,DWORD dwBufSize)
Function: send the data to DVR serial port through transparent channel
Parameter introduction:
lSerialHandle: the return value of NET_DVR_SerialStart
lChannel: the channel no. of DVR, it is valid when establish transparent channel using
485, indicating to which channel the data be sent. Set it as 0 when establish
transparent channel using 232;
pSendBuf: the buffer pointer to send data
dwBufSize: the size of the buffer
Return value: TRUE means it is successful, FALSE means it is failed.

Page 86 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

BOOL NET_DVR_SerialStop(LONG lSerialHandle)


Function: to dismiss the transparent channel
Parameter introduction:
lSerialHandle: the return value of NET_DVR_SerialStart
Return value: TRUE means it is successful, FALSE means it is failed.

4.1.13 Remote control local display

BOOL NET_DVR_ClickKey(LONG lUserID,LONG lKeyIndex)


Function: remote control the keys in the front panel of DVR
Parameter introduction:
lUserID: the return value of NET_DVR_Login ()
lKeyIndex
1 - key1, 2- key 2......9- key 9, 10 key 0, 11-POWER,12MENU,13ENTER,14
"ESC",15-"Up" or "Start Tilt up", 16-"Down" or "Start Tilt down", 17 - "Left" or "Start
Pan left", 18 - "Right" or "start Pan right", 19-"EDIT" or "Iris+
start",22-"PLAY",23-"REC",24-"PAN" or "Iris- start", 25-"Mutli preview" or "Focus-
start", 26 - "input mode (A)" or " Focus+ start", 27-"dialogue (VOIP)", 28-"system
information", 29-"Fast forward", 30-"Fast backward", 32-"End Tilt up", 33-"End Tilt
down", 34-"End Pan left ", 35-"End Pan right", 36-"Iris+ end", 37-"Iris- end",
38-"Focus+ end",39-"Focus- end", 40-"Zoom+ start", 41-"Zoom+ end", 42-"Zoom-
start", 43-"Zoom- end"
Return value: TRUE means it is successful, FALSE means it is failed.

4.1.14 Remote manually record

BOOL NET_DVR_StartDVRRecord(LONG lUserID,LONG lChannel ,LONG


lRecordType)
Function: client-end remote start DVR local record
Parameter introduction:
lUserID: the return value of NET_DVR_Login ()
lChannel: channel no.
lRecordType: record type
Return value: TRUE means it is successful, FALSE means it is failed.

BOOL NET_DVR_StopDVRRecord(LONG lUserID,LONG lChannel)


Function: client-end remote stop DVR local record
Parameter introduction:
lUserID: the return value of NET_DVR_Login ()
lChannel: channel no
Return value: TRUE means it is successful, FALSE means it is failed.

Page 87 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

4.1.15 Decode card

BOOL NET_DVR_InitDevice_Card(long *pDeviceTotalChan)


Function: initialize the decode card
Parameter introduction:
pDeviceTotalChan: the pointer to save decorder channel number.
Return value: TRUE means it is successful, FALSE means it is failed.

BOOL NET_DVR_ReleaseDevice_Card()
Function: to release decode card resources
Return value: TRUE means it is successful, FALSE means it is failed.

BOOL NET_DVR_InitDDraw_Card(HWND hParent,COLORREF colorKey)


Function: initialize decode card OVERLAY surface
Parameter introduction:
hParent: parent window handle
colorKey: the transparent color set by user
Return value: TRUE means it is successful, FALSE means it is failed.

BOOL NET_DVR_ReleaseDDraw_Card()
Function: release OVERLAY surface used by decode card
Return value: TRUE means it is successful, FALSE means it is failed.

LONG NET_DVR_RealPlay_Card(LONG lUserID,LPNET_DVR_CARDINFO


lpCardInfo,long lChannelNum)
Function: preview pictures using decode card
Parameter introduction:
lUserID: the return value of NET_DVR_Login ()
lpCardInfo: the pointer to NET_DVR_CARDINFO structure
lChannelNum: use which channel of the decode card to decode, begins from 0
return value: -1 menas it is failed, others is used as the parameter of the function
NET_DVR_ResetPara_Card ()

BOOL NET_DVR_ResetPara_Card(LONG lRealHandle,LPDISPLAY_PARA


lpDisplayPara)
Function: reset decode card display parameter
Parameter introduction:
lRealHandle: play handle, the return value of NET_DVR_RealPlay_Card()
lpDisplayPara: the pointer to DISPLAY_PARA structure
Return value: TRUE means it is successful, FALSE means it is failed.

Page 88 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

BOOL NET_DVR_RefreshSurface_Card()
Function: refresh the OVERLAY surface used by decode card
Return value: TRUE means it is successful, FALSE means it is failed.

BOOL NET_DVR_ClearSurface_Card()
Function: clear OVERLAY surface used by decode card
Return value: TRUE means it is successful, FALSE means it is failed.

BOOL NET_DVR_RestoreSurface_Card()
Function: restore the OVERLAY surface used by decode card
Return value: TRUE means it is successful, FALSE means it is failed.

BOOL NET_DVR_GetSerialNum_Card(long lChannelNum,DWORD


*pDeviceSerialNo)
Function: get decode card serial no.
Parameter introduction:
lChannelNum: decode card channel
pDeviceSerialNo: pointer to save decode card serial no.
Return value: TRUE means it is successful, FALSE means it is failed.

BOOL NET_DVR_OpenSound_Card(LONG lRealHandle)


Function: output certain channels sound
Parameter introduction:
lRealHandle: play handle, the return value of NET_DVR_RealPlay_Card()
Return value: TRUE means it is successful, FALSE means it is failed.

BOOL NET_DVR_CloseSound_Card(LONG lRealHandle)


Function: close certain channels sound
Parameter introduction:
lRealHandle: play handle, the return value of NET_DVR_RealPlay_Card()
Return value: TRUE means it is successful, FALSE means it is failed.

BOOL NET_DVR_SetVolume_Card(LONG lRealHandle,WORD wVolume)


Function: to adjust certain channels volume
Parameter introduction:
lRealHandle: play handle, the return value of NET_DVR_RealPlay_Card()
wVolume: the set volume
Return value: TRUE means it is successful, FALSE means it is failed.

Page 89 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

BOOL NET_DVR_AudioPreview_Card(LONG lRealHandle,BOOL bEnable)


Function: preview sound in PC
Parameter introduction:
lRealHandle: play handle, the return value of NET_DVR_RealPlay_Card()
bEnable: TRUE means to open the sound preview, FALSE means to close
Return value: TRUE means it is successful, FALSE means it is failed.

BOOL NET_DVR_SetDspErrMsg_Card(UINT nMessage,HWND hWnd)


Function: set the message sent to the host when the DSP in the decode card error.
Parameter introduction:
nMessage: the message sent to host when DSP is error, wParam return the channel no of
the decode card.
hWnd: the window to send message
Return value: TRUE means it is successful, FALSE means it is failed.
Note: We can use #define WM_MYCOMMAND WM_USER+1 to define a
self-defined message, the handling function of this message is void
OnMyCommand(WPARAM wParam, LPARAM lParam), wParam return the
decode card channel No., the mapped relationship between them is realized by
ON_MESSAGE(WM_MYCOMMAND,OnMyCommand), at this time, we can call
the function as: NET_DVR_SetDspErrMsg_Card (WM_MYCOMMAND,hWnd).

BOOL NET_DVR_ResetDSP_Card(long lChannelNum)


Function: reset DSP, when user receive the message that the DSP cannot work, you can
call this interface to reset DSP
Parameter introduction:
lChannelNum: decode card channel no.
Return value: TRUE means it is successful, FALSE means it is failed.

HANDLE __stdcall NET_DVR_GetChanHandle_Card(LONG lRealHandle)


Function:
Get the channel handle of decode card.
Parameters description:
lRealHandle: Play handle, the return value of NET_DVR_RealPlay_Card().
Return value:
TRUE means success and FALSE means failure.

Page 90 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

4.1.16 Log

LONG NET_DVR_FindDVRLog(LONG lUserID,LONG lSelectMode, DWORD


dwMajorType,DWORD dwMinorType, LPNET_DVR_TIME lpStartTime,
LPNET_DVR_TIME lpStopTime)
Function: get DVR log
Parameter introduction:
lUserID: the return value of NET_DVR_Login ()
lSelectMode: search mode: 0 full, 1- according to type, 2 according to time, 3
according to time and type
dwMajorType: major type
dwMinorType: minor type
lpStartTime: start time
lpStopTime: stop time
Return value: -1 means it is failed, the other value is used as the parameter of the
functions such as NET_DVR_FindNextLog ()

LONG NET_DVR_FindNextLog(LONG lLogHandle,LPNET_DVR_LOG


lpLogData)
Function: get log message
Parameter introduction:
lLogHandle: the return value of NET_DVR_FindDVRLog
lpLogData: the returned log message
Return value: as the following definition:
#define NET_DVR_FILE_SUCCESS 1000 //get file information
#define NET_DVR_FILE_NOFIND 1001 //no file
#define NET_DVR_ISFINDING 1002 //is finding the file
#define NET_DVR_NOMOREFILE 1003 //no more file when finding the
file
#define NET_DVR_FILE_EXCEPTION 1004 //exception when finding
the file

BOOL NET_DVR_FindLogClose(LONG lLogHandle)


Function: release the resources of finding the log
Parameter introduction:
lLogHandle: the return value of NET_DVR_FindDVRLog
Return value: TRUE means it is successful, FALSE means it is failed.

4.1.17 Get device status

BOOL NET_DVR_GetDVRWorkState(LONG
lUserID,LPNET_DVR_WORKSTATE lpWorkState)
Function: get DVR work status

Page 91 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

Parameter introduction:
lUserID: the return value of NET_DVR_Login ()
lpWorkState: save the work status message got

4.2 DVR-end configuration function

4.2.1 Parameter configuration

BOOL NET_DVR_GetDVRConfig(LONG lUserID, DWORD dwCommand,LONG


lChannel, LPVOID lpOutBuffer,DWORD dwOutBufferSize,LPDWORD
lpBytesReturned)
Function: get DVR parameter
Parameter introduction:
lUserID: the return value of NET_DVR_Login ()
dwCommand: parameter type
lChannel: channel no., if it is not the channel parameter, do not use lChannel, set it as -1.
lpOutBuffer: the buffer to save the output parameters
dwOutBufferSize: the size of the buffer
lpBytesReturned: the size of the returned buffer
Return value: TRUE means it is successful, FALSE means it is failed.

BOOL NET_DVR_SetDVRConfig(LONG lUserID, DWORD dwCommand,LONG


lChannel, LPVOID lpInBuffer,DWORD dwInBufferSize)
Set DVR parameters
Parameter introduction:
lUserID: the return value of NET_DVR_Login ()
dwCommand: parameter type
lChannel: channel no, if it is not the channel parameter, do not use lChannel, set it as 0
lpInBuffer: the buffer to save input parameter
dwInBufferSize: the size of buffer
Return value: TRUE means it is successful, FALSE means it is failed.

The type definition of dwCommand is as follows:


#define NET_DVR_GET_DEVICECFG 100 //get device parameter
#define NET_DVR_SET_DEVICECFG 101 //set device parameter
#define NET_DVR_GET_NETCFG 102 //get network parameter
#define NET_DVR_SET_NETCFG 103 //set network parameter
#define NET_DVR_GET_PICCFG 104 //get video parameter
#define NET_DVR_SET_PICCFG 105 //set video parameter
#define NET_DVR_GET_COMPRESSCFG 106 //get compression parameter
#define NET_DVR_SET_COMPRESSCFG 107 //set compression parameter
#define NET_DVR_GET_RECORDCFG 108 //get record time
parameter

Page 92 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

#define NET_DVR_SET_RECORDCFG 109 //set record time parameter


#define NET_DVR_GET_DECODERCFG 110 //get PTZ parameter
#define NET_DVR_SET_DECODERCFG 111 //set PTZ parameter
#define NET_DVR_GET_RS232CFG 112 //get 232 serial port parameter
#define NET_DVR_SET_RS232CFG 113 //set 232 serial port
parameter
#define NET_DVR_GET_ALARMINCFG 114 //get alarm input parameter
#define NET_DVR_SET_ALARMINCFG 115 //set alarm input
parameter
#define NET_DVR_GET_ALARMOUTCFG 116 //get alarm output
parameter
#define NET_DVR_SET_ALARMOUTCFG 117 //set alarm output parameter
#define NET_DVR_GET_TIMECFG 118 //get DVR sytem time
#define NET_DVR_SET_TIMECFG 119 //set DVR sytem time
#define NET_DVR_GET_PREVIEWCFG 120 //get preview parameter
#define NET_DVR_SET_PREVIEWCFG 121 //set preview parameter
#define NET_DVR_GET_VIDEOOUTCFG 122 //get video output parameter
#define NET_DVR_SET_VIDEOOUTCFG 123 //set video output parameter
#define NET_DVR_GET_USERCFG 124 //gat user parameter
#define NET_DVR_SET_USERCFG 125 //set user parameter
#define NET_DVR_GET_EXCEPTIONCFG 126 //get exception parameter
#define NET_DVR_SET_EXCEPTIONCFG 127 //set exception parameter
#define NET_DVR_GET_PICCFG_EX 200 //get video parameter (extend)
#define NET_DVR_SET_PICCFG_EX 201 //set video parameter (extend)

Note: take get device parameter and set device parameter as an example, the
code is as follows:
//get device parameter
NET_DVR_DEVICECFG devicecfg;
DWORD BytesReturned;
NET_DVR_GetDVRConfig(lUserID, NET_DVR_GET_DEVICECFG, 0,
&devicecfg, sizeof(NET_DVR_DEVICECFG), &BytesReturned);
//set devices parameter
NET_DVR_DEVICECFG devicecfg;
NET_DVR_SetDVRConfig(lUserID, NET_DVR_SET_DEVICECFG, 0, &devicecfg,
sizeof(NET_DVR_DEVICECFG));

BOOL __stdcall NET_DVR_GetConfigFile(LONG lUserID, char *sFileName)


Function:
Get the setup parameters of embedded DVRDVS through network and save them
into one binary file.
Parameters description:
lUserID: The return value of NET_DVR_Login().
sFileName: The file name to save the parameters of embedded DVRDVS.
Return value:

Page 93 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

TRUE means success and FALSE means failure.

BOOL __stdcall NET_DVR_SetConfigFile(LONG lUserID, char *sFileName)


Function:
Read the setup parameter binary file and save the parameter back to embedded
DVRDVS.
Parameters description:
lUserID: The return value of NET_DVR_Login().
sFileName: The file name saving the binary parameters of embedded DVRDVS.
Return value:
TRUE means success and FALSE means failure.

BOOL __stdcall NET_DVR_GetConfigFile_EX(LONG lUserID, char *sOutBuffer,


DWORD dwOutSize)
Function:
Get the setup parameters of embedded DVRDVS through network and store them in
one buffer.
Parameters description:
lUserID: The return value of NET_DVR_Login().
sOutBuffer: The buffer to store the setup parameters of embedded DVRDVS.
dwOutSize: The buffer size.
Return value:
TRUE means success and FALSE means failure.

BOOL __stdcall NET_DVR_SetConfigFile_EX(LONG lUserID, char *sInBuffer,


DWORD dwInSize)
Function:
Save the setup parameters in buffer back to embedded DVRDVS.
Parameters description:
lUserID: The return value of NET_DVR_Login().
sInBuffer: The buffer storing the setup parameters of embedded DVRDVS.
dwInSize: The buffer size.
Return value:
TRUE means success and FALSE means failure.

Page 94 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

4.2.2 Restore the default parameters

BOOL NET_DVR_RestoreConfig(LONG lUserID)


Function: restore DVR default parameter
Parameter introduction:
lUserID: the return value of NET_DVR_Login ()
Return value: TRUE means it is successful, FALSE means it is failed.

4.2.3 Save parameter

BOOL NET_DVR_SaveConfig(LONG lUserID)


Function: save the parameter to FLASH
Parameter introduction:
lUserID: the return value of NET_DVR_Login ()
Return value: TRUE means it is successful, FALSE means it is failed.

4.2.4 Reboot/shut down device

BOOL NET_DVR_RebootDVR(LONG lUserID)


Function: reboot DVR
Parameter introdunction:
lUserID: the return value of NET_DVR_Login ()
Return value: TRUE means it is successful, FALSE means it is failed.

BOOL NET_DVR_ShutDownDVR(LONG lUserID)


Function: shut down DVR
Parameter introduction:
lUserID: return value of NET_DVR_Login ()
Return value: TRUE means it is successful, FALSE means it is failed.

4.2.5 Remote upgrading

LONG NET_DVR_Upgrade(LONG lUserID,char *sFileName)


Function: remote upgrading
Parameter introduction:
lUserID: the return value of NET_DVR_Login ()
sFileName: the file name for upgrading, the size of the file should less or equal 100 bytes.
Return value: -1 means it is failed, others are used as the parameters of functions such as
NET_DVR_GetUpgradeState

BOOL NET_DVR_CloseUpgradeHandle(LONG lUpgradeHandle)


Function: shut down the handle established by NET_DVR_Upgrade interface to release

Page 95 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

resources
Parameter introduction:
lUpgradeState: the return value of NET_DVR_Upgrade()
Return value: TRUE means it is successful, FALSE means it is failed.

int NET_DVR_GetUpgradeState(LONG lUpgradeHandle)


Function: get the upgrading status
Parameter introduction:
lUpgradeState: the return value of NET_DVR_Upgrade()
Return value: -1 means it is failed, other values definition is as follows:
1: successfully upgrading
2: is upgrading
3: failed upgrading
4: network disconnected, the status is unknown

4.2.6 Remote format hard disk

LONG NET_DVR_FormatDisk(LONG lUserID,LONG lDiskNumber)


Function: remote format hard disk
Parameter introduction:
lUserID: the return value of NET_DVR_Login ()
lDiskNumber: hard disk no., begins from 0, 0xff means all disk
Return value: -1 means it is failed, others are used as the parameters of
NET_DVR_CloseFormatHandle

BOOL NET_DVR_CloseFormatHandle(LONG lFormatHandle)


Function: close the handle established by NET_DVR_FormatDisk interface to release the
resources
Parameter introduction:
lFormatHandle: the return value NET_DVR_ FormatDisk()
Return value: TRUE means it is successful, FALSE means it is failed.

BOOL NET_DVR_GetFormatProgress(LONG lFormatHandle,LONG


*pCurrentFormatDisk,LONG *pCurrentDiskPos,LONG *pFormatFinish)
Function : get the progress of formatting
Parameter introduction:
lFormatHandle: the return value when calling NET_DVR_FormatDisk
pCurrentFormatDisk: the pointer to the hard disk no. which is formatting, the hard disk
no. begins from 0, -1 is the initial status
pCurrentDiskPos: the pointer to save the preogress of the currect formatting hard disk,
progress is from 0 to100
pFormatStatic: the pointer to save the hard disk formatting status, when *pFormatStatic is
1, it means finish the formatting of hard disk, 0 means it is formatting, 2 means
exceptions when formatting (including network exception), 3 the network HDD lost(such

Page 96 Total 97
SDK Programmer Manual of Embedded Net DVRDVS

as network failure), can not format.


Return value: TRUE means it is successful, FALSE means it is failed.

4.2.7 Configure transaction information (ATM/POS DVR)

BOOL NET_DVR_ClientGetframeformat(LONG lUserID,


LPNET_DVR_FRAMEFORMAT lpFrameFormat);
Function: get the frame format of ATM/POS DVR.
Parameter introduction:
lUserID: the return value of NET_DVR_Login ()
lpFrameFormat: the pointer to NET_DVR_FRAMEFORMAT structure
Return value: TRUE means it is successful, FALSE means it is failed.

BOOL NET_DVR_ClientSetframeformat(LONG lUserID,


LPNET_DVR_FRAMEFORMAT lpFrameFormat);
Function: set the frame format of ATM/POS DVR
Parameter introduction:
lUserID: the return value of NET_DVR_Login ()
lpFrameFormat: the pointer to NET_DVR_FRAMEFORMAT structure
Return value: TRUE means it is successful, FALSE means it is failed.

Page 97 Total 97