NetSDK Programming Manual (Intelligent Analysis Server)
NetSDK Programming Manual (Intelligent Analysis Server)
V1.0.0
Foreword
Purpose
Reader
Signals
The following categorized signal words with defined meaning might appear in the Manual.
Signal Words Meaning
Revision History
The Manual is for reference only. If there is inconsistency between the Manual and the
actual product, the actual product shall govern.
Foreword I
All the designs and software are subject to change without prior written notice. The product
updates might cause some differences between the actual product and the Manual. Please
contact the customer service for the latest program and supplementary documentation.
There still might be deviation between the actual value of some data and the value
provided, if there is any doubt or dispute, please refer to our final explanation.
Please contact the supplier or customer service if there is any problem occurred when
using the device.
We are not liable for any loss caused by the operations that do not comply with the Manual.
All trademarks, registered trademarks and the company names in the Manual are the
properties of their respective owners.
Please visit our website or contact your local service engineer for more information. If there
is any uncertainty or controversy, please refer to our final explanation.
Foreword II
Glossary
This chapter provides the definitions to some of the terms appear in the Manual to help you
understand the function of each module.
Term Definition
Main Stream A type of video stream that usually has better resolution and clarity
and provides a better experience if the network resource is not
restricted.
Sub Stream A type of video stream that usually has lower resolution and clarity
than the main stream but demands less network resources. The user
can choose the stream type according to the particular scenes.
Video Channel A channel number for video stream transmission between SDK and
devices. For example, if NVR communicates with the front-end
devices such as SD, IPC, NVR manages SD or IPC as a video
channel. If SDK directly connects to a front-end device, usually the
channel number is 0.
Login Handle A unique ID for communication with device. It is of a round number
and not 0 and maintained within SDK.
Monitoring Handle A unique ID for data transmission with a video channel. It is of a round
number and not 0.
Subscription Handle A unique ID for subscribing real-time upload of intelligent event. It is of
a round number and not 0.
Capability Set A set of capabilities for a single function or a set of functions. The
capability set might be different dependent on device model.
Detection of Crossing Automatic detection of crossing fence behavior.
fence
Detection of Invading Automatic detection of invading tripwire behavior.
Tripwire
Detection of Invading Automatic detection of invading warning area behavior: Crossing area
Area and staying in the area.
Detection of Automatic detection of the emerging and still objects.
Abandoning Objects
Detection of Alarm for the selected objects that has been shaded for a long time or
Safeguarding Objects moved from the place.
Detection of Moving Alarm for the objects that has been moved from the detection covered
Objects place.
Detection of Automatic detection of invading behavior that stays longer than the
Wandering preset time.
Detection of Video Automatic detection of abnormal behaviors such as scene changes,
Abnormal video loss, video shade, excessive brightness, excessive darkness,
definition, stripe, noise, and color cast.
Detection of Climbing Automatic detection of climbing behavior in the warning area.
Glossary III
Detection of Fighting Automatic detection of fighting behavior in the warning area.
Detection of Off-post Automatic detection of leaving the post in the warning area.
Detection on Getting Automatic detection when the target is getting up.
up
Detection on Automatic detection of crossing over warning line.
Crossing Over
Warning Line
Detection on Automatic detection of invading warning line, including entering
Invading Warning warning area, leaving warning area, and within the warning area.
Line
Detection of Normal Detection of normal face in face monitoring video.
Face
Detection of Detection of abnormal face in face monitoring video, including
Abnormal Face covering of mouse or eyes.
Detection of Detection of two faces that appear in the monitoring area indicating
Neighboring Faces one is following the other.
Illegal Sticky Notes The sticky notes on the cash slot monitoring video.
Detection of Entering Detection of entering operation area in the cash slot monitoring video.
Operation Area
Detection of Leaving Detection of leaving operation area in the cash slot monitoring video.
Operation Area
Detection of Staying Detection of staying operation area in the cash slot monitoring video.
Operation Area
Glossary IV
Table of Contents
Foreword .................................................................................................................................................... I
Glossary ................................................................................................................................................... III
1 Overview ................................................................................................................................................. 1
1.1 General .......................................................................................................................................... 1
1.2 Applicability .................................................................................................................................... 2
1.3 Application Scenario ...................................................................................................................... 3
2 Function Modules .................................................................................................................................. 4
2.1 SDK Initialization ........................................................................................................................... 4
2.1.1 Introduction ......................................................................................................................... 4
2.1.2 Interface Overview .............................................................................................................. 4
2.1.3 Process ............................................................................................................................... 4
2.1.4 Example Code .................................................................................................................... 5
2.2 Device Initialization ........................................................................................................................ 6
2.2.1 Introduction ......................................................................................................................... 6
2.2.2 Interface Overview .............................................................................................................. 6
2.2.3 Process ............................................................................................................................... 6
2.2.4 Example Code .................................................................................................................... 9
2.3 Device Login .................................................................................................................................11
2.3.1 Introduction ........................................................................................................................11
2.3.2 Interface Overview .............................................................................................................11
2.3.3 Process ..............................................................................................................................11
2.3.4 Example Code .................................................................................................................. 13
2.4 Real-time Monitoring ................................................................................................................... 13
2.4.1 Introduction ....................................................................................................................... 13
2.4.2 Interface Overview ............................................................................................................ 13
2.4.3 Process ............................................................................................................................. 13
2.4.4 Example Code .................................................................................................................. 17
2.5 Detention Dedicated .................................................................................................................... 18
2.5.1 Introduction ....................................................................................................................... 18
2.5.2 Interface Overview ............................................................................................................ 19
2.5.3 Process ............................................................................................................................. 19
2.5.4 Example Code .................................................................................................................. 20
2.6 Intelligent ATM ............................................................................................................................. 23
2.6.1 Introduction ....................................................................................................................... 23
2.6.2 Interface Overview ............................................................................................................ 23
2.6.3 Process ............................................................................................................................. 24
2.6.4 Example Code .................................................................................................................. 25
2.7 Guest Flow Statistics ................................................................................................................... 28
2.7.1 Introduction ....................................................................................................................... 28
2.7.2 Interfaces Overview .......................................................................................................... 29
2.7.3 Process ............................................................................................................................. 29
Table of Contents V
2.7.4 Example Code .................................................................................................................. 32
3 Interface Definition .............................................................................................................................. 37
3.1 SDK Initialization ......................................................................................................................... 37
3.1.1 SDK CLIENT_Init .............................................................................................................. 37
3.1.2 CLIENT_Cleanup.............................................................................................................. 37
3.1.3 CLIENT_SetAutoReconnect ............................................................................................. 37
3.1.4 CLIENT_SetNetworkParam.............................................................................................. 38
3.2 Device Initialization ...................................................................................................................... 38
3.2.1 CLIENT_StartSearchDevices ........................................................................................... 38
3.2.2 CLIENT_InitDevAccount................................................................................................... 38
3.2.3 CLIENT_GetDescriptionForResetPwd ............................................................................. 39
3.2.4 CLIENT_CheckAuthCode................................................................................................. 40
3.2.5 CLIENT_ResetPwd........................................................................................................... 40
3.2.6 CLIENT_GetPwdSpecification.......................................................................................... 41
3.2.7 CLIENT_StopSearchDevices ........................................................................................... 41
3.3 Device Login ................................................................................................................................ 41
3.3.1 CLIENT_LoginEx2 ............................................................................................................ 41
3.3.2 CLIENT_Logout ................................................................................................................ 42
3.4 Real-time Monitoring ................................................................................................................... 43
3.4.1 CLIENT_RealPlayEx ........................................................................................................ 43
3.4.2 CLIENT_StopRealPlayEx ................................................................................................. 44
3.4.3 CLIENT_SaveRealData .................................................................................................... 44
3.4.4 CLIENT_StopSaveRealData ............................................................................................ 44
3.4.5 CLIENT_SetRealDataCallBackEx2 .................................................................................. 45
3.5 Subscription of Intelligent Event .................................................................................................. 45
3.5.1 CLIENT_RealLoadPictureEx ............................................................................................ 45
3.5.2 CLIENT_StopLoadPic ...................................................................................................... 47
3.6 Guest Flow Statistics ................................................................................................................... 47
3.6.1 CLIENT_AttachVideoStatSummary ................................................................................. 47
3.6.2 CLIENT_DetachVideoStatSummary ................................................................................ 48
3.6.3 CLIENT_StartFindNumberStat ......................................................................................... 48
3.6.4 CLIENT_DoFindNumberStat ............................................................................................ 48
3.6.5 CLIENT_StopFindNumberStat ......................................................................................... 49
4 Callback Definition .............................................................................................................................. 50
4.1 fSearchDevicesCB ...................................................................................................................... 50
4.2 fDisConnect ................................................................................................................................. 50
4.3 fHaveReConnect ......................................................................................................................... 50
4.4 fRealDataCallBackEx2 ................................................................................................................ 51
4.5 fAnalyzerDataCallBack ................................................................................................................ 52
4.6 fVideoStatSumCallBack .............................................................................................................. 52
Table of Contents VI
1 Overview
1.1 General
The Manual introduces SDK interfaces reference information that includes main function
modules, interface definition, and callback definition.
The following are the main functions:
SDK initialization, device login, real-time monitoring, report and snapshot of intelligent events,
and guest flow statistics.
The development kit might be different dependent on the environment.
For the files included in Windows development kit, see Table 1-1.
Library type Library file name Library file description
dhnetsdk.h Header file
dhnetsdk.lib Lib file
Function library
dhnetsdk.dll Library file
avnetsdk.dll Library file
avglobal.h Header file
dhconfigsdk.h Configuration Header file
Configuration library
dhconfigsdk.lib Lib file
dhconfigsdk.dll Library file
dhplay.dll Playing library
aacdec.dll AAC audio decoding library
amrenc.dll AMR audio decoding library
g729dec.dll G729 audio decoding library
g7221dec.dll G7221 audio decoding library
h264dec.dll H264 video decoding library
mjpegdec.dll MJPEG video decoding library
mp3dec.dll MP3 audio decoding library
Auxiliary library of hevcdec.dll H265 video decoding library
playing (coding and mp2dec.dll MP2 audio decoding library
decoding) mpeg4dec.dll MPEG4 video decoding library
oggdec.dll OGG audio decoding library
adpcmdec.dll ADPCM audio decoding library
svac_dec.dll SVAC video decoding library
fisheye.dll Fisheye correction library
Library used for fisheye and speed dome
MCL_FPTZ.dll
linkage, matching of fisheye correction library
postproc.dll Image processing library
swscale.dll Library used for GDI display
Dependent library of Infra.dll Infrastructure library
Overview 1
Library type Library file name Library file description
"avnetsdk.dll" json.dll JSON library
NetFramework.dll Network infrastructure library
Stream.dll Media transmission structure package library
StreamSvr.dll Streaming service
Auxiliary library of
IvsDrawer.dll Image display library
"dhnetsdk.dll"
Table 1-1
For the files included in Linux development kit, see Table 1-2.
Library type Library file name Library file description
dhnetsdk.h Header file
Function library libdhnetsdk.so Library file
libavnetsdk.so Library file
avglobal.h Header file
Configuration library dhconfigsdk.h Configuration Header file
libdhconfigsdk.so Configuration library
libInfra.so Infrastructure library
Auxiliary library of libNetFramework.so Network infrastructure library
"libavnetsdk.so" libStream.so Media transmission structure package library
libStreamSvr.so Streaming service
Table 1-2
1.2 Applicability
Recommended memory: No less than 512 M
System supported by SDK:
Windows
Windows 10/Windows 8.1/Windows 7 and Windows Server 2008/2003
Linux
The common Linux systems such as Red Hat/SUSE
Overview 2
1.3 Application Scenario
General functions such as login, monitoring, voice talk, and alarm.
Functions as a client to subscribe the intelligent event from the intelligent analysis server,
handle the report service of intelligent events, subscribe guest flow statistics, and report
the statistics result.
.
Overview 3
2 Function Modules
2.1.3 Process
For the process of SDK initialization, see Figure 2-1.
Function Modules 4
Figure 2-1
Process Description
Function Modules 5
void CALLBACK DisConnectFunc(LLONG lLoginID, char *pchDVRIP, LONG nDVRPort, DWORD dwUser)
{
printf("Call DisConnectFunc: lLoginID[0x%x]\n", lLoginID);
}
// Initialize SDK
CLIENT_Init(DisConnectFunc, 0);
2.2.3 Process
Function Modules 6
Figure 2-2
Process Description
Because the interface is working in multicast, the host PC and device must be in the same
multicast group.
Function Modules 7
2.2.3.2 Password Reset
For the process of device initialization, see Figure 2-3.
Figure 2-3
Process Description
Function Modules 8
Step 7 Call CLIENT_StopSearchDevices to stop searching.
Step 8 Call CLIENT_LoginEx2 and login the admin account with the configured password.
Step 9 After using the function module, call CLIENT_Logout to logout the device.
Step 10 After using all SDK functions, call CLIENT_Cleanup to release SDK resource.
Because the interface is working in multicast, the host PC and device must be in the same
multicast group.
//Device initialization
NET_IN_INIT_DEVICE_ACCOUNT sInitAccountIn = {sizeof(sInitAccountIn)};
NET_OUT_INIT_DEVICE_ACCOUNT sInitAccountOut = {sizeof(sInitAccountOut)};
sInitAccountIn.byPwdResetWay = 1;//1 stands for password reset by mobile phone number, and 2 stands for
password reset by email
strncpy(sInitAccountIn.szMac, szMac, sizeof(sInitAccountIn.szMac) - 1);//Set mac value
strncpy(sInitAccountIn.szUserName, szUserName, sizeof(sInitAccountIn.szUserName) - 1);//Set user name
strncpy(sInitAccountIn.szPwd, szPwd, sizeof(sInitAccountIn.szPwd) - 1);//Set password
strncpy(sInitAccountIn.szCellPhone, szRig, sizeof(sInitAccountIn.szCellPhone) - 1);//If the byPwdResetWay is
set as 1, please set szCellPhone field; if the byPwdResetWay is set as 2, please set sInitAccountIn.szMail field.
CLIENT_InitDevAccount(&sInitAccountIn, &sInitAccountOut, 5000, NULL);
Function Modules 9
strncpy(stIn.szUserName, szUserName, sizeof(stIn.szUserName) - 1);//Set user name
stIn.byInitStatus = bStstus; //bStstus is the value of return field byInitStatus of device search interface (Callback
of CLIENT_SearchDevices and CLIENT_StartSearchDevice, and CLIENT_SearchDevicesByIPs)
NET_OUT_DESCRIPTION_FOR_RESET_PWD stOut = {sizeof(stOut)};
char szTemp[360];
stOut.pQrCode = szTemp;
CLIENT_GetDescriptionForResetPwd(&stIn, &stOut, 3000, NULL);//In the case of single network card, the last
parameter can be left unfilled; in the case of multiple network card, enter the host PC IP for the last parameter.
After successful connection, stout will output a QR code with address of stOut.pQrCode. Scan this QR code to get
the security code for password reset. This security code will be sent to the reserved mobile phone or email box.
//(Optional) Check the security code
NET_IN_CHECK_AUTHCODE stIn1 = {sizeof(stIn1)};
strncpy(stIn1.szMac, szMac, sizeof(stIn1.szMac) - 1); //Set mac value
strncpy(stIn1.szSecurity, szSecu, sizeof(stIn1.szSecurity) - 1); // szSecu is the security code sent to the reserved
mobile phone or email box
NET_OUT_CHECK_AUTHCODE stOut1 = {sizeof(stOut1)};
bRet = CLIENT_CheckAuthCode(&stIn1, &stOut1, 3000, NULL); //In the case of single network card, the last
parameter can be left unfilled; in the case of multiple network card, enter the host PC IP for the last parameter
//Get password rules
NET_IN_PWD_SPECI stIn2 = {sizeof(stIn2)};
strncpy(stIn2.szMac, szMac, sizeof(stIn2.szMac) - 1); //Set mac value
NET_OUT_PWD_SPECI stOut2 = {sizeof(stOut2)};
CLIENT_GetPwdSpecification(&stIn2, &stOut2, 3000, NULL);// In the case of single network card, the last
parameter can be left unfilled; in the case of multiple network card, enter the host PC IP for the last parameter. Set
the password according to the rules which are used for preventing user from setting the passwords that are not
supported by the device
//Reset password
NET_IN_RESET_PWD stIn3 = {sizeof(stIn3)};
strncpy(stIn3.szMac, szMac, sizeof(stIn3.szMac) - 1); //Set mac value
strncpy(stIn3.szUserName, szUserName, sizeof(stIn3.szUserName) - 1); //Set user name
strncpy(stIn3.szPwd, szPassWd, sizeof(stIn3.szPwd) - 1); //szPassWd is the password reset according to the rules
strncpy(stIn3.szSecurity, szSecu, sizeof(stIn1.szSecurity) - 1); //szSecu is the security code sent to the reserved
mobile phone or email box
stIn3.byInitStaus = bStstus; //bStstus is the value of return field byInitStatus of device search interface (Callback
of CLIENT_SearchDevices and CLIENT_StartSearchDevice, and CLIENT_SearchDevicesByIPs)
stIn3.byPwdResetWay = bPwdResetWay; // bPwdResetWay is the value of return field byPwdResetWay of device
search interface (Callback of CLIENT_SearchDevices and CLIENT_StartSearchDevice, and
CLIENT_SearchDevicesByIPs)
NET_OUT_RESET_PWD stOut3 = {sizeof(stOut3)};
CLIENT_ResetPwd(&stIn3, &stOut3, 3000, NULL);//In the case of single network card, the last parameter can be
left unfilled; in the case of multiple network card, enter the host PC IP for the last parameter.
Function Modules 10
2.3 Device Login
2.3.1 Introduction
Device login, also called user authentication, is the precondition of all the other function
modules.
You can obtain a unique login ID upon logging in to the device and should call login ID before
using other SDK interfaces. The login ID becomes invalid once logged out.
2.3.3 Process
For the process of login, see Figure 2-4.
Figure 2-4
Function Modules 11
Process Description
Login handle: When the login is successful, the returned value is not 0 (even the handle is
smaller than 0, the login is also successful). One device can login multiple times with
different handle at each login. If there is not special function module, it is suggested to login
only one time. The login handle can be repeatedly used on other function modules.
Logout: The interface will release the opened functions internally, but it is not suggested to
rely on the cleaning up function. For example, if you opened the monitoring function, you
should call the interface that stops the monitoring function when it is no longer required.
Use login and logout in pairs: The login consumes some memory and socket information
and release sources once logout.
Login failure: It is suggested to check the failure through the error parameter of the login
interface. For the common error code, see Table 2-4.
Error code Meaning
1 Password is wrong.
2 User name does not exist.
3 Login timeout.
4 The account has been logged in.
5 The account has been locked.
6 The account is blacklisted.
7 Out of resources, the system is busy.
8 Sub connection failed.
9 Main connection failed.
10 Exceeded the maximum user connections.
11 Lack of avnetsdk or avnetsdk dependent library.
USB flash disk is not inserted into device, or the USB flash disk
12
information error.
13 The client IP is not authorized with login.
Table 2-4
The example code to avoid error code 3 is as follows.
NET_PARAM stuNetParam = {0};
stuNetParam.nWaittime = 8000; // unit ms
CLIENT_SetNetworkParam (&stuNetParam);
For more information about error codes, see "CLIENT_LoginEx2 interface" in Network SDK
Development Manual.chm.
Function Modules 12
2.3.4 Example Code
NET_DEVICEINFO_Ex stDevInfo = {0};
int nError = 0;
// Login the device
LLONG lLoginHandle = CLIENT_LoginEx2(szDevIp, nPort, szUserName, szPasswd,
EM_LOGIN_SPEC_CAP_TCP, NULL, &stDevInfo, &nError);
// Logout the device
if (0 != lLoginHandle)
{
CLIENT_Logout(lLoginHandle);
}
2.4.3 Process
You can realize the real-time monitoring through SDK decoding library or your play library.
Function Modules 13
2.4.3.1 SDK Decoding Library
Call PlaySDK library from the SDK auxiliary library to realize real-time play.
For the process of playing by SDK decoding library, see Figure 2-5.
Start
Initialize SDK
CLIENT_Init
Close
Mandotory Optional
Figure 2-5
Process Description
Function Modules 14
Notes for Process
SDK decoding play only supports Windows system. You need to call the decoding after
getting the stream in other systems.
Multi-thread calling: Multi-thread calling is not supported for the functions within the same
login session; however, multi-thread calling can deal with the functions of different login
sessions although such calling is not recommended.
Timeout: The request on applying for monitoring resources should have made some
agreement with the device before requiring the monitoring data. There are some timeout
settings (see "NET_PARAM structure"), and the field about monitoring is
nGetConnInfoTime. If there is timeout due to the reasons such as bad network connection,
you can modify the value of nGetConnInfoTime bigger.
The example code is as follows. Call it for only one time after having called CLIENT_Init.
NET_PARAM stuNetParam = {0};
stuNetParam. nGetConnInfoTime = 5000; // unit ms
CLIENT_SetNetworkParam (&stuNetParam);
Failed to repeat opening: For some models, the same channel cannot be opened for
multiple times during a login. If you are trying to open it repeatedly, you will success in the
first try but get failed afterwards. In this case, you can try the following:
Close the opened channel. For example, if you already opened the main stream video
on the channel 1 and still want to open the sub stream video on the same channel, you
can close the main stream first and then open the sub stream.
Login twice to obtain two login handles to deal with the main stream and sub stream
respectively.
Calling succeeded but no image: SDK decoding needs to use dhplay.dll. It is suggested to
check if dhplay.dll and its auxiliary library are missing under the running directory. See
Table 1-1.
If the system resource is insufficient, the device might return error instead of stream. You
can receive an event DH_REALPLAY_FAILD_EVENT in the alarm callback that is set in
CLIENT_SetDVRMessCallBack. This event includes the detailed error codes. See
"DEV_PLAY_RESULT Structure" in Network SDK Development Manual.chm.
32 channels limit: The decoding consumes resources especially for the high definition
videos. Considering the limited resources at the client, currently the maximum channels
are set to be 32. If more than 32, it is suggested to use third party play library. See "2.4.3.2
Call Third Party Play Library."
Function Modules 15
Start
Initialize SDK
CLIENT_Init
Logout
CLIENT_Logout
Stop
Figure 2-6
Process Description
Function Modules 16
SDK callbacks can only moves into the next process after returning from you. It is not
recommended for you to consume time for the unnecessary operations; otherwise the
performance could be affected.
Function Modules 17
// Stop preview
if (0 != lRealHandle)
{
CLIENT_StopRealPlayEx(lRealHandle);
}
Product Description
Prison dedicated function integrates audio & video data collecting, wire transmission, storage,
and intelligent detection and alarm. Besides the common outdoor intelligent detection functions,
it has the functions such as fight detecting, detecting on getting up, off-post detecting, detecting
on climbing, and video abnormal. This product is widely used in the particular places such as
prison and detention house.
Product Model
You can access to SDK to subscribe the intelligent event of behavior analysis from the
DH-IVS-IP7200 series device, and obtains the subscribed intelligent event and data
information.
Before subscribing the behavior detecting event, you need to configure the rules triggered by
behavior detecting at Web.
For the behavior detecting supported by the DH-IVS-IP7200 series product, see Table 2-6.
Scenario Supported behavior detection
Function Modules 18
Scenario Supported behavior detection
Analyze and detect the behaviors such as crossing fence, invading tripwire,
Ordinary abandoning objects, safeguarding objects, moving objects, wandering
detecting, and video abnormal.
Analyze and detect the behaviors such as sound abnormal, invading area,
Detention climbing detection, fighting detection, off-post detection, detecting upon
getting up, video abnormal, and wandering detection.
Table 2-6
2.5.3 Process
For the process of subscribing intelligent events on behaviors analysis, see Figure 2-7.
Figure 2-7
Function Modules 19
Process Description
Set data receiving cache: Because SDK default cache is 2 M, when the data is over 2 M,
call CLIENT_SetNetworkParam to set the receiving cache, otherwise the data pack will
be lost.
Handle the data of callback: It is not recommended to perform the time consuming
operations such as I/O or delay in parameter fAnalyzerDataCallBack, for example, local
picture saving, database insertion. In Windows system, you can use postMessage to throw
out the data and start threading treatment.
// "nSequence" represents the situation when the reported pictures are the same. "0" represents the first appearance,
"2" represents the last appearance or the appearance only once, and "1" represents there will be more
appearances from now on.
// "int nState = *(int*) reserved" represents the current status of the callback data. "0" represents the current is
real-time data, "1" represents the current callback data is offline, and "2" represents the offline data transmission
finished.
switch(dwAlarmType)
case EVENT_IVS_CROSSFENCEDETECTION:
Function Modules 20
DEV_EVENT_CROSSFENCEDETECTION_INFO* pCrossFence = NULL;
pCrossFence = (DEV_EVENT_CROSSFENCEDETECTION_INFO*)pAlarmInfo;
ivsInfoEx.stuEventInfo[0].alarmAction = pCrossFence->bEventAction;
ivsInfoEx.stuEventInfo[0].alarmType = dwAlarmType;
strncpy(ivsInfoEx.stuEventInfo[0].szRuleName, pCrossFence->szName,
? sizeof(ivsInfoEx.stuEventInfo[0].szRuleName) : sizeof(pCrossFence->szName)));
ivsInfoEx.stuEventInfo[0].nObjectNum = 1;
memcpy(&ivsInfoEx.stuEventInfo[0].stuObject[0],&pCrossFence->stuObject,
sizeof(pCrossFence->stuObject));
break;
case EVENT_IVS_CROSSLINEDETECTION:
//....................................................
break;
.......
default:
break;
// Download picture
// In order to prevent receiving several pictures simultaneously, use " i " to remark.
static int i;
time_t stuTime;
time(&stuTime);
Function Modules 21
FILE* pFile = fopen(szPicturePath, "wb");
if (NULL == pFile)
return 0;
int nWrite = 0;
while(nWrite != dwBufSize)
fclose(pFile);
return 1;
}
{
// Resource initialization
....................................................
// Device login
....................................................
LDWORD dwUser = 0;
int nChannel = 0;
// If you need to set the channel to upload all types of events, you can set dwAlarmType as
EVENT_IVS_ALL.
// If you need to set one channel to upload two types of event, please call CLIENT_RealLoadPictureEx
twice and import different types of events.
//....................................................
CLIENT_StopLoadPic(lRealLoadHandle))
Function Modules 22
// Exit
CLIENT_Logout(lLoginHandle))
CLIENT_Cleanup();
Product Description
The intelligent Automatic Teller Machine (ATM) detects and analyzes the front-end devices
according to the analysis videos, rules and functions configured by the platform, and gives an
alarm when the illegal situations such as sticky notes, abnormal faces, wandering, abandoned
objects. This product mainly applies to Dahua intelligent analysis server DH-IVS-IF70XX series
of financial industry.
Product Model
You can access to SDK to subscribe the intelligent event of behavior analysis from the
DH-IVS-IF70XX series device, and obtain the subscribed intelligent event and data information.
Before subscribing the behavior detecting event, you need to configure the rules triggered by
behavior detecting at Web.
DH-IVS-IF70XX series product support the following behaviors detection: crossing the warning
line, invading the warning area, wandering, objects abandoning, objects moving, face abnormal,
similar faces, illegal sticky notes, and entering, leaving and staying in the operation area.
Function Modules 23
Interface Implication
subscribing data.
Stop analyzing intelligent events and
CLIENT_StopLoadPic
subscribing data.
fAnalyzerDataCallBack Intelligent events analysis data.
Table 2-8
2.6.3 Process
For the process of subscribing intelligent events on behaviors analysis in the intelligent ATM,
see Figure 2-8.
Figure 2-8
Process Description
Function Modules 24
Set data receiving cache: Because SDK default cache is 2 M, when the data is over 2 M,
call CLIENT_SetNetworkParam to set the receiving cache, otherwise the data pack will
be lost.
Handle the data of callback: It is not recommended to perform the time consuming
operations such as I/O or delay in parameter fAnalyzerDataCallBack, for example, local
picture saving, database insertion. In Windows system, you can use postMessage to throw
out the data and start threading treatment.
// "nSequence" represents the situation when the reported pictures are the same. "0" represents the first appearance,
"2" represents the last appearance or the appearance only once, and "1" represents there will be more
appearances from now on.
// "int nState = *(int*) reserved" represents the current status of the callback data. "0" represents the current is
real-time data, "1" represents the current callback data is offline, and "2" represents the offline data transmission
finished.
int nAlarmChn = 0;
ivsInfoEx.nEventsNum = 1;
switch(dwAlarmType)
case EVENT_IVS_CROSSFENCEDETECTION:
pCrossFence = (DEV_EVENT_CROSSFENCEDETECTION_INFO*)pAlarmInfo;
ivsInfoEx.stuEventInfo[0].alarmAction = pCrossFence->bEventAction;
ivsInfoEx.stuEventInfo[0].alarmType = dwAlarmType;
strncpy(ivsInfoEx.stuEventInfo[0].szRuleName, pCrossFence->szName,
Function Modules 25
? sizeof(ivsInfoEx.stuEventInfo[0].szRuleName) : sizeof(pCrossFence->szName)));
ivsInfoEx.stuEventInfo[0].nObjectNum = 1;
memcpy(&ivsInfoEx.stuEventInfo[0].stuObject[0],&pCrossFence->stuObject,
sizeof(pCrossFence->stuObject));
break;
case EVENT_IVS_CROSSLINEDETECTION:
//....................................................
break;
.......
default:
break;
// Download picture
// In order to prevent receiving several pictures simultaneously, use " i " to remark.
static int i;
time_t stuTime;
time(&stuTime);
if (NULL == pFile)
return 0;
int nWrite = 0;
Function Modules 26
while(nWrite != dwBufSize)
fclose(pFile);
return 1;
}
{
// Resource initialization
....................................................
// Device login
....................................................
LDWORD dwUser = 0;
int nChannel = 0;
// If you need to set the channel to upload all types of events, you can set dwAlarmType as
EVENT_IVS_ALL.
// If you need to set one channel to upload two types of event, please call CLIENT_RealLoadPictureEx twice
and import different types of events.
//....................................................
CLIENT_StopLoadPic(lRealLoadHandle))
CLIENT_Logout(lLoginHandle))
CLIENT_Cleanup();
Function Modules 27
2.7 Guest Flow Statistics
2.7.1 Introduction
Product Description
The intelligent analysis server can accord to the front-end devices that are installed in the
business area to calculate accurately the guest flow through each entrance. Such function is
widely applied to the industries such as large-scale commercial complex, tourism, public
security, cultural expo, and chain operation business.
Figure 2-9
Product Model
Before subscribing the service of guest flow statistics, you need to configure the rules of guest
flow statistics at Web.
Function Modules 28
2.7.2 Interfaces Overview
Interface Description
CLIENT_AttachVideoStatSummary Start subscribing the real-time guest flow statistics.
CLIENT_DetachVideoStatSummary Stop subscribing the real-time guest flow statistics.
fVideoStatSumCallBack Guest flow information.
CLIENT_StartFindNumberStat Start querying the historical guest flow information.
CLIENT_DoFindNumberStat Continue to inquire the historical guest flow information.
CLIENT_StopFindNumberStat Stop querying the historical guest flow information.
Table 2-9
2.7.3 Process
The guest flow statistics mainly apply to the following two scenarios:
Real-time guest flow statistics
After SDK has subscribed the guest flow service from the device, the device will report the
real-time guest flow information to SDK.
Query of historical guest flow information
You can specify the start time and end time to inquire the guest flow information, and the
device returns the guest flow information for the specified period.
Function Modules 29
Figure 2-10
Process Description
Function Modules 30
Figure 2-11
Process Description
Function Modules 31
2.7.4 Example Code
//
#include "stdafx.h"
#include "dhnetsdk.h"
#pragma comment(lib,"dhnetsdk.lib")
printf("Infomation:\n");
// Initialization
CLIENT_Init(NULL,0);
.........
// Login
if (lLoginID)
NET_IN_ATTACH_VIDEOSTAT_SUM InParam={sizeof(NET_IN_ATTACH_VIDEOSTAT_SUM)};
InParam.nChannel=0;
InParam.cbVideoStatSum=VideoStatSumCallback;
NET_OUT_ATTACH_VIDEOSTAT_SUM OutParam={0};
OutParam.dwSize=sizeof(OutParam);
LLONG attachHnd = 0;
Function Modules 32
attachHnd = CLIENT_AttachVideoStatSummary(lLoginID,&InParam,&OutParam,nWaitTime)
if(attachHnd)
printf("CLIENT_AttachVideoStatSummary sucess\n");
else
printf("error number:%x",CLIENT_GetLastError());
else
printf("login fail\n");
.......
CLIENT_DetachVideoStatSummary(attachHnd);
CLIENT_Logout(lLoginHandle));
CLIENT_Cleanup();
return 0;
//
#include "stdafx.h"
#include "dhnetsdk.h"
#pragma comment(lib,"dhnetsdk.lib")
printf("Infomation:\n");
Function Modules 33
printf("Channel ID:%d;\n rule name:%s;\n entered subtotal:%d;\n exited
subtotal:%d\n",pBuf->nChannelID,pBuf->szRuleName,pBuf->stuEnteredSubtotal.nTotal,pBuf->stuExitedSubtota
l.nTotal);
// Initialization
CLIENT_Init(NULL,0);
.........
// Login
if (lLoginID == 0)
CLIENT_Cleanup();
return 0;
NET_IN_FINDNUMBERSTAT inParam ;
inParam.dwSize = (uint)Marshal.SizeOf(inParam);
// Set the inquiry start time and end time to the hour for the moment.
......
NET_OUT_FINDNUMBERSTAT outParam;
outParam.dwSize = sizeof(outParam);
//
if (findHand == 0)
goto e_clear;;
NET_IN_DOFINDNUMBERSTAT inDoFind;
Function Modules 34
inDoFind.dwSize = sizeof(inDoFind);
NET_OUT_DOFINDNUMBERSTAT outStuDoFindNumStat =
{sizeof(NET_OUT_DOFINDNUMBERSTAT)};
outStuDoFindNumStat.pstuNumberStat[i].dwSize = sizeof(DH_NUMBERSTAT);
outStuDoFindNumStat.nBufferLen = 10 * sizeof(DH_NUMBERSTAT);
int index = 0;
do
// Query result
else
break;
........
CLINET_StopFindNumberStat(findHand);
Function Modules 35
e_clear:
CLIENT_Logout(lLoginID))
CLIENT_Cleanup();
return 0;
Function Modules 36
3 Interface Definition
3.1.2 CLIENT_Cleanup
Item Description
Name Clean up SDK.
Function void CLIENT_Cleanup();
Parameter None.
Return value None.
Note Call the SDK cleanup interface before the process ends.
3.1.3 CLIENT_SetAutoReconnect
Item Description
Name Set auto reconnection for callback.
void CLIENT_SetAutoReconnect(
fHaveReConnect cbAutoConnect,
Function
LDWORD dwUser
);
[in]cbAutoConnect Reconnection callback.
Parameter
[in]dwUser User parameter of disconnection callback.
Interface Definition 37
Item Description
Return value None.
Set the reconnection callback interface. If the callback is set as NULL, it will
Note
not connect automatically.
3.1.4 CLIENT_SetNetworkParam
Item Description
Name Set the related parameters for network environment.
void CLIENT_SetNetworkParam(
Function NET_PARAM *pNetParam
);
Parameters such as network delay, reconnection
Parameter [in]pNetParam
times, and cache size.
Return value None.
Note Adjust the parameters according to the actual network environment.
3.2.2 CLIENT_InitDevAccount
Item Description
Name Initialize the device.
Interface Definition 38
Item Description
BOOL CLIENT_InitDevAccount(
const NET_IN_INIT_DEVICE_ACCOUNT *pInitAccountIn,
NET_OUT_INIT_DEVICE_ACCOUNT *pInitAccountOut,
Function
DWORD dwWaitTime,
char *szLocalIp
);
Corresponds to structure of
[in]pInitAccountIn
NET_IN_INIT_DEVICE_ACCOUNT.
Corresponds to structure of.
[out]pInitAccountOut
NET_OUT_INIT_DEVICE_ACCOUNT.
Parameter [in]dwWaitTime Timeout.
In case of single network card, the last
parameter is not required to be filled.
[in]szLocalIp
In case of multiple network card, enter the IP
of the host PC for the last parameter.
Success: TRUE.
Return value
Failure: FALSE.
Note None.
3.2.3 CLIENT_GetDescriptionForResetPwd
Name Description
Name Get information for password reset.
BOOL CLIENT_GetDescriptionForResetPwd(
const NET_IN_DESCRIPTION_FOR_RESET_PWD *pDescriptionIn,
NET_OUT_DESCRIPTION_FOR_RESET_PWD
Function *pDescriptionOut,
DWORD dwWaitTime,
char *szLocalIp
);
Corresponds to structure of
[in]pDescriptionIn
NET_IN_DESCRIPTION_FOR_RESET_PWD.
Corresponds to structure of
[out]pDescriptionOut
NET_OUT_DESCRIPTION_FOR_RESET_PWD.
Parameter [in]dwWaitTime Timeout.
In case of single network card, the last
parameter is not required to be filled.
[in]szLocalIp
In case of multiple network card, enter the IP
of the host PC for the last parameter.
Success: TRUE.
Return value
Failure: FALSE.
Note None.
Interface Definition 39
3.2.4 CLIENT_CheckAuthCode
Item Description
Name Check the validity of security code.
BOOL CLIENT_CheckAuthCode(
const NET_IN_CHECK_AUTHCODE *pCheckAuthCodeIn,
NET_OUT_CHECK_AUTHCODE *pCheckAuthCodeOut,
Function
DWORD dwWaitTime,
char *szLocalIp
);
[in]pCheckAuthCodeI Corresponds to structure of
n NET_IN_CHECK_AUTHCODE.
[out]pCheckAuthCod Corresponds to structure of
eOut NET_OUT_CHECK_AUTHCODE.
Parameter [in]dwWaitTime Timeout.
In case of single network card, the last
parameter is not required to be filled.
[in]szLocalIp
In case of multiple network card, enter the IP
of the host PC for the last parameter.
Success: TRUE.
Return value
Failure: FALSE.
Note None.
3.2.5 CLIENT_ResetPwd
Item Description
Name Reset the password.
BOOL CLIENT_ResetPwd(
const NET_IN_RESET_PWD *pResetPwdIn,
NET_OUT_RESET_PWD *pResetPwdOut,
Function
DWORD dwWaitTime,
char *szLocalIp
);
Corresponds to structure of
[in]pResetPwdIn
NET_IN_RESET_PWD.
Corresponds to structure of
[out]pResetPwdOut
NET_OUT_RESET_PWD.
Parameter [in]dwWaitTime Timeout.
In case of single network card, the last
parameter is not required to be filled.
[in]szLocalIp
In case of multiple network card, enter the IP
of the host PC for the last parameter.
Success: TRUE.
Return value
Failure: FALSE.
Note None.
Interface Definition 40
3.2.6 CLIENT_GetPwdSpecification
Item Description
Name Get password rules.
BOOL CLIENT_GetPwdSpecification(
const NET_IN_PWD_SPECI *pPwdSpeciIn,
NET_OUT_PWD_SPECI *pPwdSpeciOut,
Function
DWORD dwWaitTime,
char *szLocalIp
);
Corresponds to structure of
[in]pPwdSpeciIn
NET_IN_PWD_SPECI.
Corresponds to structure of
[out]pPwdSpeciOut
NET_OUT_PWD_SPECI.
Parameter [in]dwWaitTime Timeout.
In case of single network card, the last
parameter is not required to be filled.
[in]szLocalIp
In case of multiple network card, enter the IP
of the host PC for the last parameter.
Success: TRUE.
Return value
Failure: FALSE.
Note None.
3.2.7 CLIENT_StopSearchDevices
Item Description
Name Stop searching.
BOOL CLIENT_StopSearchDevices (
Function LLONG lSearchHandle
);
Parameter [in] lSearchHandle Searching handle.
Success: TRUE.
Return value
Failure: FALSE.
Note Multi-thread calling is not supported.
Interface Definition 41
Item Description
LLONG CLIENT_LoginEx2(
const char *pchDVRIP,
WORD wDVRPort,
const char *pchUserName,
const char *pchPassword,
Function
EM_LOGIN_SPAC_CAP_TYPE emSpecCap,
void* pCapParam,
LPNET_DEVICEINFO_Ex lpDeviceInfo,
int *error
);
[in]pchDVRIP Device IP
[in]wDVRPort Device port
[in]pchUserName User name
[in]pchPassword Password
Parameter
[in]emSpecCap Login category
[in]pCapParam Login category parameter
[out]lpDeviceInfo Device information
[out]error Error for login failure
Success: Not 0
Return value
Failure: 0
Note None
The following table shows information about error code:
Code of error Meaning
1 Wrong password.
2 The user name does not exist.
3 Login timeout.
4 The account has logged in.
5 The account has been locked.
6 The account has been blacklisted.
7 The device resource is insufficient and the system is busy.
8 Sub connection failed.
9 Main connection failed.
10 Exceeds the maximum allowed number of user connections.
11 Lacks the dependent libraries such as avnetsdk or avnetsdk.
12 USB flash disk is not inserted or the USB flash disk information is wrong.
13 The IP at client is not authorized for login.
Table 3-1
3.3.2 CLIENT_Logout
Item Description
Name Logout the device
Interface Definition 42
Item Description
BOOL CLIENT_Logout(
Function LLONG lLoginID
);
Parameter [in]lLoginID Return value of CLIENT_LoginEx2
Success: TRUE
Return value
Failure: FALSE
Note None
Interface Definition 43
Preview type Meaning
DH_RType_Multiplay_9 Multi-picture preview—9 pictures
DH_RType_Multiplay_16 Multi-picture preview—16 pictures
DH_RType_Multiplay_6 Multi-picture preview—6 pictures
DH_RType_Multiplay_12 Multi-picture preview—12 pictures
DH_RType_Multiplay_25 Multi-picture preview—25 pictures
DH_RType_Multiplay_36 Multi-picture preview—36 pictures
Table 3-2
3.4.2 CLIENT_StopRealPlayEx
Item Description
Name Stop the real-time monitoring
BOOL CLIENT_StopRealPlayEx(
Function LLONG lRealHandle
);
Parameter [in]lRealHandle Return value of CLIENT_RealPlayEx
Success: TRUE
Return value
Failure: FALSE
Note None
3.4.3 CLIENT_SaveRealData
Item Description
Name Save the real-time monitoring data as file
BOOL CLIENT_SaveRealData(
LLONG lRealHandle,
Function
const char *pchFileName
);
[in] lRealHandle Return value of CLIENT_RealPlayEx
Parameter
[in] pchFileName Save path
Success: TRUE
Return value
Failure: FALSE
Note None
3.4.4 CLIENT_StopSaveRealData
Item Description
Name Stop saving the real-time monitoring data as file
BOOL CLIENT_StopSaveRealData(
Function LLONG lRealHandle
);
Parameter [in] lRealHandle Return value of CLIENT_RealPlayEx
Success: TRUE
Return value
Failure: FALSE
Interface Definition 44
Item Description
Note None
3.4.5 CLIENT_SetRealDataCallBackEx2
Item Description
Name Set the callback of real-time monitoring data
BOOL CLIENT_SetRealDataCallBackEx2(
LLONG lRealHandle,
fRealDataCallBackEx2 cbRealData,
Function
LDWORD dwUser,
DWORD dwFlag
);
[in] lRealHandle Return value of CLIENT_RealPlayEx.
[in] cbRealData Callback of monitoring data flow.
[in] dwUser Parameter of callback for monitoring data flow.
Parameter
Type of monitoring data in callback. The type is
[in] dwFlag EM_REALDATA_FLAG and supports OR
operation.
Success: TRUE
Return value
Failure: FALSE
Note None
The following table shows information about parameter dwFlag:
dwFlag Meaning
REALDATA_FLAG_RAW_DATA Initial data labels.
REALDATA_FLAG_DATA_WITH_FRAME_INFO Data labels with frame information.
REALDATA_FLAG_YUV_DATA YUV data labels.
REALDATA_FLAG_PCM_AUDIO_DATA PCM audio data labels.
Table 3-3
Interface Definition 45
Item Description
LLONG CALL_METHOD CLIENT_RealLoadPictureEx(
LLONG lLoginID,
int nChannelID,
DWORD dwAlarmType,
Function BOOL bNeedPicFile,
fAnalyzer DataCallBack cbAnalyzerData,
LDWORD dwUser,
void* Reserved
);
[in] lLoginID Login handle.
[in] nChannelID Device channel number.
[in] dwAlarmType Subscribed alarm events type.
Parameter [in] bNeedPicFile Whether to subscribe the picture file.
[in] cbAnalyzerData Intelligent event callback.
[in] dwUser Customized data type.
[in] Reserved Reserved field.
Success: Subscription handle of LLONG type.
Return value
Failure: 0.
Note Interface returns failed. Use CLIENT_GetLastError to obtain the error code.
The following table shows the type of intelligent alarm event:
Macro
Call corresponding
dwAlarmType macro definition definition Meaning
structure of pAlarmInfo
value
EVENT_IVS_ALL 0x00000001 All events No
EVENT_IVS_CROSSFENCEDE Crossing DEV_EVENT_CROSSFE
0x0000011F
TECTION fence NCEDETECTION_INFO
EVENT_IVS_CROSSLINEDET Tripwire DEV_EVENT_CROSSLIN
0x00000002
ECTION invasion E_INFO
EVENT_IVS_CROSSREGIOND DEV_EVENT_CROSSRE
0x00000003 Area invasion
ETECTION GION_INFO
Abandoned DEV_EVENT_LEFT_INF
EVENT_IVS_LEFTDETECTION 0x00000005
objects O
Safeguarding DEV_EVENT_PRESERV
EVENT_IVS_PRESERVATION 0x00000008
objects ATION_INFO
EVENT_IVS_TAKENAWAYDET moving DEV_EVENT_TAKENAW
0x00000115
ECTION objects, AYDETECTION_INFO
EVENT_IVS_WANDERDETECT Wandering DEV_EVENT_WANDER_
0x00000007
ION events INFO
DEV_EVENT_VIDEOAB
EVENT_IVS_VIDEOABNORMA Video
0x00000013 NORMALDETECTION_IN
LDETECTION abnormal
FO
DEV_EVENT_IVS_AUDI
EVENT_IVS_AUDIO_ABNORM Sound
0x00000126 O_ABNORMALDETECTI
ALDETECTION abnormal
ON_INFO
Interface Definition 46
Macro
Call corresponding
dwAlarmType macro definition definition Meaning
structure of pAlarmInfo
value
EVENT_IVS_CLIMBDETECTIO Climbing DEV_EVENT_IVS_CLIM
0x00000128
N detection B_INFO
EVENT_IVS_FIGHTDETECTIO Fighting DEV_EVENT_FLOWSTA
0x0000000E
N detection T_INFO
EVENT_IVS_LEAVEDETECTIO Off-post DEV_EVENT_IVS_LEAV
0x00000129
N detection E_INFO
DEV_EVENT_PRISONE
EVENT_IVS_PRISONERRISED Detection on
0x0000011E RRISEDETECTION_INF
ETECTION getting up
O
Detection on
EVENT_IVS_PASTEDETECTIO DEV_EVENT_PASTE_IN
0x00000004 illegal sticky
N FO
notes
Table 3-4
3.5.2 CLIENT_StopLoadPic
Item Description
Name Stop subscription of intelligent events.
BOOL CALL_METHOD CLIENT_StopRealPlayEx(
Function LLONG lRealHandle
);
Parameter [in] lRealHandle Subscription handle of intelligent event.
BOOL type:
Return value Success: TRUE.
Failure: FALSE.
Note Interface returns failed. Use CLIENT_GetLastError to obtain the error code.
Interface Definition 47
Item Description
[in]pInParam Input parameter of guest flow statistics.
[out] pOutParam Output parameter of guest flow statistics.
[in]nWaitTime Timeout period.
LLONG type:
Return value Success: Not 0.
Failure: 0.
Note Interface returns failed. Use CLIENT_GetLastError to obtain the error code.
3.6.2 CLIENT_DetachVideoStatSummary
Item Description
Name Stop subscribing guest flow statistics.
BOOL CALL_METHOD CLIENT_DetachVideoStatSummary(
Function LLONG lAttachHandle
);
Parameter [in] lAttachHandle Subscription handle.
BOOL type:
Return value Success: TRUE.
Failure: FALSE.
Note Interface returns failed. Use CLIENT_GetLastError to obtain the error code.
3.6.3 CLIENT_StartFindNumberStat
Item Description
Name Start querying guest flow statistics.
LLONG CALL_METHOD CLIENT_StartFindNumberStat(
LLONG lLoginID,
Function NET_IN_FINDNUMBERSTAT* pstInParam,
NET_OUT_FINDNUMBERSTAT* pstOutParam
);
[in] lLoginID Login handle.
Parameter [in] pstInParam Input parameter.
[out] pstOutParam Output parameter.
LLONG type:
Return value Success: Not 0
Failure: 0
Note Interface returns failed. Use CLIENT_GetLastError to obtain the error code.
3.6.4 CLIENT_DoFindNumberStat
Item Description
Name Continue to query guest flow statistics.
Interface Definition 48
Item Description
int CALL_METHOD CLIENT_DoFindNumberStat(
LLONG lFindHandle,
Function NET_IN_DOFINDNUMBERSTAT* pstInParam,
NET_OUT_DOFINDNUMBERSTAT* pstOutParam
);
[in] lFindHandle Login handle.
Parameter [in]pstInParam Input parameter.
[out]pstOutParam Output parameter.
int type:
Return value Success: 1.
Failure: -1.
Note Interface returns failed. Use CLIENT_GetLastError to obtain the error code.
3.6.5 CLIENT_StopFindNumberStat
Item Description
Name Stop querying guest flow statistics.
BOOL CALL_METHOD CLIENT_StopFindNumberStat(
Function LLONG lFindHandle
);
Parameter [in] lFindHandle Login handle.
BOOL type:
Return value Success: TRUE.
Failure: FALSE.
Note Interface returns failed. Use CLIENT_GetLastError to obtain the error code.
Interface Definition 49
4 Callback Definition
4.1 fSearchDevicesCB
Item Description
Name Callback of searching devices.
typedef void(CALLBACK *fSearchDevicesCB)(
DEVICE_NET_INFO_EX * pDevNetInfo,
Function
void* pUserData
);
[out]pDevNetInfo The searched device information.
Parameter
[out]pUserData User data.
Return value None.
Note None.
4.2 fDisConnect
Item Description
Name Disconnection callback.
typedef void (CALLBACK *fDisConnect)(
LLONG lLoginID,
char *pchDVRIP,
Function
LONG nDVRPort,
LDWORD dwUser
);
[out] lLoginID Return value of CLIENT_LoginEx2.
[out] pchDVRIP IP of the disconnected device.
Parameter
[out] nDVRPort Port of the disconnected device.
[out] dwUser User parameter of the callback.
Return value None.
Note None.
4.3 fHaveReConnect
Item Description
Name Reconnection callback.
Callback Definition 50
Item Description
typedef void (CALLBACK *fHaveReConnect)(
LLONG lLoginID,
char *pchDVRIP,
Function
LONG nDVRPort,
LDWORD dwUser
);
[out] lLoginID Return value of CLIENT_LoginEx2.
[out] pchDVRIP IP of the reconnected device.
Parameter
[out] nDVRPort Port of the reconnected device.
[out] dwUser User parameter of the callback.
Return value None.
Note None.
4.4 fRealDataCallBackEx2
Item Description
Name Callback of real-time monitoring data.
typedef void (CALLBACK *fRealDataCallBackEx2)(
LLONG lRealHandle,
DWORD dwDataType,
BYTE *pBuffer,
Function
DWORD dwBufSize,
LLONG param,
LDWORD dwUser
);
[out] lRealHandle Return value of CLIENT_RealPlayEx.
Data type:
0: Initial data.
[out] dwDataType 1: Data with frame information.
2: YUV data.
3: PCM audio data.
[out] pBuffer Address of monitoring data block.
[out] dwBufSize Length (unit: byte) of the monitoring data block.
Callback parameter structure. Different
Parameter dwDataType value corresponds to different type.
The param is blank pointer when dwDataType
is 0.
The param is the pointer of
[out] param tagVideoFrameParam structure when
dwDataType is 1.
The param is the pointer of
tagCBYUVDataParam structure when
dwDataType is 2.
The param is the pointer of
Callback Definition 51
Item Description
tagCBPCMDataParam structure when
dwDataType is 3.
[out] dwUser User parameter of the callback.
Return value None.
Note None.
4.5 fAnalyzerDataCallBack
Item Description
Name Intelligent event callback.
typedef int (CALLBACK *fAnalyzerDataCallBack)(
LLONG lAnalyzerHandle,
DWORD dwAlarmType,
void* pAlarmInfo,
BYTE *pBuffer,
Function
DWORD dwBufSize,
LDWORD dwUser,
int nSequence,
void *reserved
);
[out]lAnalyzerHandle Return value of CLIENT_RealLoadPictureEx.
[out]dwAlarmType Type of intelligent event.
[out]pAlarmInfo Cache of event information.
Parameter [out]pBuffer Cache of pictures.
[out]dwBufSize Cache size of pictures.
[out]dwUser User parameter of the callback.
[out]reserved Reserved.
Return value None
Note None
4.6 fVideoStatSumCallBack
Item Description
Name Guest flow statistics callback
Typedef void (CALLBACK *fVideoStatSumCallBack) (
LLONG lAttachHandle,
NET_VIDEOSTAT_SUMMARY* pBuf,
Function
DWORD dwBufLen,
LDWORD dwUser
);
Parameter [in] lAttachHandle Subscription handle.
Callback Definition 52
Item Description
[out] pBuf Callback data.
[out] dwBufLen Callback data length.
[out] dwUser User parameter of the callback.
Return value Void.
Note None.
Callback Definition 53