NetSDK Programming Manual (Camera)
NetSDK Programming Manual (Camera)
(Camera)
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
A type of video stream that usually has better resolution and clarity
Main Stream and provides a better experience if the network resource is not
restricted.
A type of video stream that usually has lower resolution and clarity
than the main stream but demands less network resources. The
Sub Stream
user can choose the stream type according to the particular
scenes.
The video is numbered from 0 and each video receives a channel
Video Channel number. Currently, except the TPC, the other types of devices
usually have only one channel that is numbered as 0.
The first step to access to the device is login (authentication). The
device receives a unique ID that refers to the login handle upon
Login Handle
the successful login. This handle will be used by the subsequent
procedures and stay valid until logout.
A fast positioning method in PTZ control by providing the
difference value of the PTZ coordinates (X-axis and Y-axis) to the
Relative Positioning device which accord to the present PTZ location and the difference
value to calculate and transfer to the final location. This method
also supports ZOOM control.
A fast positioning method in PTZ control which provides certain
horizontal and vertical coordinates (angular coordinate) to the
Absolute Positioning
device. The device directly transfers to the user specified location.
This method also supports ZOOM control.
Pulse Code Modulation is one of the coding methods of digital
communication and converts the analog signal into digital signal
PCM
without encoding loss. It is suitable for the user who requires
higher data transfer rate and bandwidth.
PTZ Pan Tilt Zoom is all-round movement and lens zoom control.
Corresponds to the temperature distribution data of a scene and
Heat Map (Temperature)
each pixel has a data point.
Heat Map (Activity) Indicates a picture using different colors to show the statistical
activity of an area during a certain period.
Glossary III
Table of Contents
Foreword .................................................................................................................................................... I
Glossary ................................................................................................................................................... III
1 Overview ................................................................................................................................................. 1
1.1 General .......................................................................................................................................... 1
1.2 Applicability .................................................................................................................................... 2
2 Function Modules .................................................................................................................................. 3
2.1 SDK Initialization ........................................................................................................................... 3
2.1.1 Introduction ......................................................................................................................... 3
2.1.2 Interface Overview .............................................................................................................. 3
2.1.3 Process ............................................................................................................................... 3
2.1.4 Example Code .................................................................................................................... 4
2.2 Device Initialization ........................................................................................................................ 5
2.2.1 Introduction ......................................................................................................................... 5
2.2.2 Interface Overview .............................................................................................................. 5
2.2.3 Process ............................................................................................................................... 5
2.2.4 Example Code .................................................................................................................... 8
2.3 Device Login ................................................................................................................................ 10
2.3.1 Introduction ....................................................................................................................... 10
2.3.2 Interface Overview ............................................................................................................ 10
2.3.3 Process ............................................................................................................................. 10
2.3.4 Example Code ...................................................................................................................11
2.4 Real-time Monitoring ................................................................................................................... 12
2.4.1 Introduction ....................................................................................................................... 12
2.4.2 Interface Overview ............................................................................................................ 12
2.4.3 Process ............................................................................................................................. 12
2.4.4 Example Code .................................................................................................................. 16
2.5 Video Snapshot ........................................................................................................................... 17
2.5.1 Introduction ....................................................................................................................... 17
2.5.2 Interface Overview ............................................................................................................ 17
2.5.3 Process ............................................................................................................................. 17
2.5.4 Example Code .................................................................................................................. 20
2.6 PTZ Control ................................................................................................................................. 20
2.6.1 Introduction ....................................................................................................................... 20
2.6.2 Interface Overview ............................................................................................................ 21
2.6.3 Process ............................................................................................................................. 21
2.6.4 Example Code .................................................................................................................. 23
2.7 Voice Talk ..................................................................................................................................... 23
2.7.1 Introduction ....................................................................................................................... 23
2.7.2 Interface Overview ............................................................................................................ 23
2.7.3 Process ............................................................................................................................. 24
2.7.4 Example Code .................................................................................................................. 25
Table of Contents IV
2.8 Heat Map (Temperature) ............................................................................................................. 26
2.8.1 Introduction ....................................................................................................................... 26
2.8.2 Interface Overview ............................................................................................................ 26
2.8.3 Process ............................................................................................................................. 27
2.8.4 Example Code .................................................................................................................. 28
2.9 Heat Map (Activity) ...................................................................................................................... 29
2.9.1 Introduction ....................................................................................................................... 29
2.9.2 Interface Overview ............................................................................................................ 29
2.9.3 Process ............................................................................................................................. 29
2.9.4 Example Code .................................................................................................................. 30
3 Interface Definition .............................................................................................................................. 32
3.1 SDK Initialization ......................................................................................................................... 32
3.1.1 SDK CLIENT_Init .............................................................................................................. 32
3.1.2 CLIENT_Cleanup.............................................................................................................. 32
3.1.3 CLIENT_SetAutoReconnect ............................................................................................. 32
3.1.4 CLIENT_SetNetworkParam.............................................................................................. 33
3.2 Device Initialization ...................................................................................................................... 33
3.2.1 CLIENT_StartSearchDevices ........................................................................................... 33
3.2.2 CLIENT_InitDevAccount................................................................................................... 33
3.2.3 CLIENT_GetDescriptionForResetPwd ............................................................................. 34
3.2.4 CLIENT_CheckAuthCode................................................................................................. 35
3.2.5 CLIENT_ResetPwd........................................................................................................... 35
3.2.6 CLIENT_GetPwdSpecification.......................................................................................... 36
3.2.7 CLIENT_StopSearchDevices ........................................................................................... 36
3.3 Device Login ................................................................................................................................ 36
3.3.1 CLIENT_LoginEx2 ............................................................................................................ 36
3.3.2 CLIENT_Logout ................................................................................................................ 37
3.4 Real-time Monitoring ................................................................................................................... 38
3.4.1 CLIENT_RealPlayEx ........................................................................................................ 38
3.4.2 CLIENT_StopRealPlayEx ................................................................................................. 39
3.4.3 CLIENT_SaveRealData .................................................................................................... 39
3.4.4 CLIENT_StopSaveRealData ............................................................................................ 39
3.4.5 CLIENT_SetRealDataCallBackEx2 .................................................................................. 40
3.5 Video Snapshot ........................................................................................................................... 40
3.5.1 CLIENT_SnapPictureToFile.............................................................................................. 40
3.5.2 CLIENT_CapturePictureEx............................................................................................... 41
3.6 PTZ Control ................................................................................................................................. 41
3.6.1 CLIENT_DHPTZControlEx2 ............................................................................................. 41
3.7 Voice Talk ..................................................................................................................................... 45
3.7.1 CLIENT_StartTalkEx ......................................................................................................... 45
3.7.2 CLIENT_StopTalkEx ......................................................................................................... 46
3.7.3 CLIENT_RecordStartEx ................................................................................................... 46
3.7.4 CLIENT_RecordStopEx .................................................................................................... 46
3.7.5 CLIENT_TalkSendData .................................................................................................... 47
3.7.6 CLIENT_AudioDecEx ....................................................................................................... 47
3.8 Heat Map (Temperature) ............................................................................................................. 48
3.8.1 CLIENT_RadiometryAttach .............................................................................................. 48
Table of Contents V
3.8.2 CLIENT_RadiometryDetach ............................................................................................. 48
3.8.3 CLIENT_RadiometryFetch ............................................................................................... 48
3.8.4 CLIENT_RadiometryDataParse ....................................................................................... 49
3.9 Heat Map (Activity) ...................................................................................................................... 49
3.9.1 CLIENT_QueryDevState .................................................................................................. 49
4 Callback Definition .............................................................................................................................. 51
4.1 fSearchDevicesCB ...................................................................................................................... 51
4.2 fDisConnect ................................................................................................................................. 51
4.3 fHaveReConnect ......................................................................................................................... 51
4.4 fRealDataCallBackEx2 ................................................................................................................ 52
4.5 pfAudioDataCallBack................................................................................................................... 53
4.6 fRadiometryAttachCB .................................................................................................................. 53
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, PTZ control, voice talk, video snapshot,
heat map (temperature) and heat map (activity).
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
Overview 1
Library type Library file name Library file description
Infra.dll Infrastructure library
json.dll JSON library
Dependent library of
NetFramework.dll Network infrastructure library
"avnetsdk.dll"
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
Dependent 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
2 Function Modules
There are seven function modules in this chapter. Each function module includes SDK
initialization, device login, logout, and SDK resource release. The optional processes do not
affect the use of other processes.
2.1.3 Process
For the process of SDK initialization, see Figure 2-1.
Function Modules 3
Figure 2-1
Process Description
Call CLIENT_Init and CLIENT_Cleanup in pairs. It supports single thread multiple calling
but it is suggested to call the pair for only one time overall.
Initialization: Calling CLIENT_Init multiple times is only for internal count without repeating
applying resources.
Cleaning up: The interface CLIENT_Cleanup clears all the opened processes, such as
login, real-time monitoring, and alarm subscription.
Reconnection: SDK can set the reconnection function for the situations such as network
disconnection and power off. SDK will keep logging the device until succeeded. Only the
real-time monitoring, alarm and snapshot subscription can be resumed after reconnection
is successful.
Function Modules 4
{
printf("Call DisConnectFunc: lLoginID[0x%x]\n", lLoginID);
}
// Initialize SDK
CLIENT_Init(DisConnectFunc, 0);
2.2.3 Process
Function Modules 5
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 6
2.2.3.2 Password Reset
For the process of device initialization, see Figure 2-3.
Figure 2-3
Process Description
Function Modules 7
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 8
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 9
2.3 Device Login
2.3.1 Introduction
Device login, also called user authentication, is the precondition of all the other function
modules.
You will obtain a unique login ID upon login 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
Process Description
Function Modules 10
Step 1 Call CLIENT_Init to initialize SDK.
Step 2 Call CLIENT_LoginEx2 to login the device.
Step 3 After successful login, you can realize the required function module.
Step 4 After using the function module, call CLIENT_Logout to logout the device.
Step 5 After using all SDK functions, call CLIENT_Cleanup to release SDK resource.
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 11
int nError = 0;
// Login the device
LLONG lLoginHandle = CLIENT_LoginEx2(szDevIp, nPort, szUserName, szPasswd,
EM_LOGIN_SPEC_CAP_TCP, NULL, &stDevInfo, &nError);
2.4.3 Process
You can realize the real-time monitoring through SDK decoding library or your play library.
Function Modules 12
2.4.3.1 SDK Decoding Play
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 13
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 the one entire logged in status. 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 14
Start
Initialize SDK
CLIENT_Init
Logout
CLIENT_Logout
Stop
Figure 2-6
Process Description
Function Modules 15
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 16
// Stop preview
if (0 != lRealHandle)
{
CLIENT_StopRealPlayEx(lRealHandle);
}
2.5.3 Process
Video snapshot is consisted of network snapshot and local snapshot.
Function Modules 17
2.5.3.1 Network Snapshot
For the process of network snapshot, see Figure 2-7.
Figure 2-7
Process Description
Picture size limit: SDK allocates the fixed memory to receive the picture data returned from
the device. If the picture is larger than the fixed memory, SDK will return the truncated data.
SDK provides the interface to modify the default memory. If the picture (for example, the
high definition picture) is truncated, you can modify the value of nPicBufSize bigger. The
example code is as follows. After calling CLIENT_Init, call the example code just one time.
NET_PARAM stuNetParam = {0};
stuNetParam. nPicBufSize = 4*1024*1024; // unit byte
CLIENT_SetNetworkParam (&stuNetParam);
Multi-thread calling: Multi-thread calling is not supported for the functions within the same
Function Modules 18
login session.
Snapshot configuration: You can configure the items such as quality and definition for the
snapshot. However, if the default configurations are satisfactory, do not modify them. For
more details of the example code, see the SDK package on the website
Picture save format: The picture data returns as memory and the interface supports saving
it as file (the precondition is that you have set the szFilePath field of
NET_IN_SNAP_PIC_TO_FILE_PARAM).
Figure 2-8
Process Description
Function Modules 19
Step 4 Call CLIENT_CapturePictureEx to introduce the monitoring handle.
Step 5 Call CLIENT_StopRealPlayEx to stop the real-time monitoring.
Step 6 Call CLIENT_Logout to logout the device.
Step 7 After using all SDK functions, call CLIENT_Cleanup to release SDK resource.
// Example of local snapshot. The handle hPlayHandle is obtained from opening monitoring.
if (FALSE == CLIENT_CapturePictureEx(hPlayHandle, “test.jpg”, NET_CAPTURE_JPEG))
{
printf("CLIENT_CapturePictureEx Failed!Last Error[%x]\n", CLIENT_GetLastError());
}
Function Modules 20
2.6.2 Interface Overview
Interface Implication
CLIENT_DHPTZControlEx2 PTZ control extension interface
Table 2-7
2.6.3 Process
Direction control, focus, zoom and iris are the continuous operations. SDK provides start and
stop interfaces to you for timing control.
For the process of PTZ control, see Figure 2-9.
Figure 2-9
Both fast positioning and 3-dimensional positioning belong to one-time action, which needs to
call the PTZ control interface just one time.
For the process of one-time operation of PTZ control, see Figure 2-10.
Function Modules 21
Figure 2-10
Process Description
Fast positioning: For the SD, take the current monitoring image center as origin, and the
valid range of horizontal and vertical coordinates is [–8191, 8191]. For example, if the
horizontal coordinate is 2000 and the vertical is 2000, the SD moves toward upper right
and gets a new origin, which means the coordinate specified every time is only relative to
the current location.
3-dimensional positioning: For the SD, there is an initial position first. The horizontal
coordinate is [0, 3600] and the vertical is [–1800, 1800]. The coordinate specified each
time is the absolute coordinate and is irrelevant to the location of the SD image last time.
For more example code see the SDK package on the website.
Function Modules 22
2.6.4 Example Code
LONG lParam1 = 0; // Rotating speed in horizontal direction.
LONG lParam2 = 4; // Rotating speed in vertical direction.
LONG lParam3 = 0;
// Continuous operation: take moving upward as example.
// Start moving upward.
BOOL bRet = CLIENT_DHPTZControlEx2(lLoginHandle, nChannelId, DH_PTZ_UP_CONTROL, lParam1,
lParam2, lParam3, FALSE, NULL);
// Stop moving upward.
bRet = CLIENT_DHPTZControlEx2(lLoginHandle, nChannelId, DH_PTZ_UP_CONTROL, lParam1, lParam2,
lParam3, TRUE, NULL);
Function Modules 23
2.7.3 Process
When SDK has collected the audio data from the local audio card, or SDK has received the
audio data from the front-end devices, SDK will call the callback of audio data.
You can call the SDK interface in the callback parameters to send the local audio data to the
front-end devices, or call SDK interface to decode and play the audio data received from the
front-end devices.
This process is valid only in Windows system. For the process of voice talk, see Figure 2-11.
Start
Initialize SDK
CLIENT_Init
byAudioFlag
Start recording at PC value
CLIENT_RecordStartEx
Stop
Figure 2-11
Process Description
Function Modules 24
Step 3 Call CLIENT_SetDeviceMode to set decoding information of voice talk. Set parameter
emType as DH_TALK_ENCODE_TYPE.
Step 4 Call CLIENT_StartTalkEx to set callback and start voice talk. In the callback, call
CLIENT_AudioDec to decode the audio data that is sent from the decoding device,
and call CLIENT_TalkSendData to send the audio data of the PC end to the device.
Step 5 Call CLIENT_RecordStartEx to start recording at PC. After this interface is called, the
voice talk callback in CLIENT_StartTalkEx will receive the local audio data.
Step 6 After using the voice talk function, call CLIENT_RecordStopEx to stop recording.
Step 7 Call CLIENT_StopTalkEx to stop voice talk.
Step 8 After using the function module, call CLIENT_Logout to logout the device.
Step 9 After using all SDK functions, call CLIENT_Cleanup to release SDK resource.
Voice encoding format: The example uses the common PCM format. SDK supports
accessing the voice encoding format supported by the device. For more details of the
example code, see the SDK package on the website. If the default PCM can satisfy the
requirement, it is not recommended to obtain the voice encoding format from the device.
No sound at the device: The audio data needs to be collected by the device such as
microphone. It is recommended to check if the microphone or other equivalent device is
plugged in and if the CLIENT_RecordStartEx succeeded in returning.
Function Modules 25
// Stop voice talk
if (0 != lTalkHandle)
{
CLIENT_StopTalkEx(lTalkHandle);
}
void CALLBACK AudioDataCallBack(LLONG lTalkHandle, char *pDataBuf, DWORD dwBufSize, BYTE
byAudioFlag, LDWORD dwUser)
{
if(0 == byAudioFlag)
{
// Send the sound data detected by the PC to the device
LONG lSendLen = CLIENT_TalkSendData(lTalkHandle, pDataBuf, dwBufSize);
if(lSendLen != (LONG)dwBufSize)
{
printf("CLIENT_TalkSendData Failed!Last Error[%x]\n" , CLIENT_GetLastError());
}
}
else if(1 == byAudioFlag)
{
// Send the voice data from the device to SDK for encoding and play.
CLIENT_AudioDec(pDataBuf, dwBufSize);
}
}
Only the devices equipped with temperature measurement support this function.
Function Modules 26
Interface Implication
Unzip the heat map data and convert it to the gray data
CLIENT_RadiometryDataParse
and temperature data in the unit of pixel.
Table 2-9
2.8.3 Process
For the process of heat map (temperature), see Figure 2-12.
Start
Initialize SDK
CLIENT_Init
Subscribe temperature
distribution data State callback
CLIENT_RadiometryAttach fRadiometryAttachCB gets
Set state callback temperature distribution data
fRadiometryAttachCB
Logout
CLIENT_Logout
Stop
Figure 2-12
Process Description
Function Modules 27
Step 4 Call CLIENT_RadiometryFetch to inform the device to start obtaining the heat map
data. Call this interface whenever you need the heat map data.
Step 5 After receiving the temperature status information, call
CLIENT_RadiometryDataParse to get the gray data and temperature data of each
pixel.
Step 6 Call CLIENT_RadiometryDetach to cancel subscribing the temperature distribution
data after finishing use.
Step 7 After using the function module, call CLIENT_Logout to logout the device.
Step 8 After using all SDK functions, call CLIENT_Cleanup to release SDK resource.
No uploaded heat map data: You will get the heat map data only after calling
CLIENT_RadiometryFetch. If you call CLIENT_RadiometryDetach before receiving the
heat map data, you will not receive the heat map data.
Subscribing the channel number: If the camera has only one sensor, the subscription
channel number is 0; if the camera has double sensors, the subscription channel is 0 or 1.
For the TPC with double sensors, the second channel is TPC.
The heat map data returned by the interface is not picture and needs to be converted to
pictures based on the rules provided by the device.
CLIENT_RadiometryDataParse(pBuf,pGray,pTemp);
delete[] pGray;
delete[] pTemp;
}
Function Modules 28
LLONG attachHandle = CLIENT_RadiometryAttach(loginId, &stIn, &stOut, 3000);
if (NULL == attachHandle)
{
// Subscription failed
}
The Heat map (activity) here is different from that of temperature in "2.8 Heat Map
(Temperature)".
2.9.3 Process
For the process of heat map (activity), see Figure 2-13.
Function Modules 29
Start
Initial SDK
CLIENT_Init
Logout
CLIENT_Logout
Stop
Figure 2-13
Process Description
The heat map data returned by the interface is not picture data and needs to be converted to
pictures based on the rules provided by the device.
Function Modules 30
default
stHeatMap.stuOut.nBufLen = 10*1024*1024;
stHeatMap.stuOut.pBufData = new char[stHeatMap.stuOut.nBufLen]; // Apply for memory according to
stHeatMap.stuOut.nBufLen
memset(stHeatMap.stuOut.pBufData, 0, stHeatMap.stuOut.nBufLen);
CLIENT_QueryDevState(g_lLoginHandle, DH_DEVSTATE_GET_HEAT_MAP,(char
*)&stHeatMap,stHeatMap.dwSize, &nRetLen ,3000);
Function Modules 31
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 callback.
void CLIENT_SetAutoReconnect(
fHaveReConnect cbAutoConnect,
Function
LDWORD dwUser
);
[in]cbAutoConnect Reconnection callback.
Parameter
[in]dwUser User parameter of disconnection callback.
Interface Definition 32
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 33
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 34
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 35
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 36
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 code for 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 User logout the device.
Interface Definition 37
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 38
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 39
Item Description
Note None.
3.4.5 CLIENT_SetRealDataCallBackEx2
Item Description
Name Set the callback of real-time monitoring data.
BOOL CLIENT_SetRealDataCallBackEx(
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 40
Item Description
[in] pOutParam Output parameter.
[in] nWaitTime Timeout. The unit is millisecond.
Success: TRUE.
Return value
Failure: FALSE.
Synchronous interface. The device captures snapshot and sends to
Note the user through internet.
The device is required to support this function.
3.5.2 CLIENT_CapturePictureEx
Item Description
Name Snapshot.
BOOL CLIENT_CapturePictureEx(
LLONG hPlayHandle,
Function const char *pchPicFileName,
NET_CAPTURE_FORMATS eFormat
);
[in] hPlayHandle Return value of CLIENT_RealPlayEx.
Parameter [in] pchPicFileName Save path.
[in] eFormat Picture format.
Success: TRUE.
Return value
Failure: FALSE.
Synchronous interface. Directly write the picture data as file.
Note Capture the pictures from the real-time monitoring data stream from
device.
Interface Definition 41
Item Description
[in] lLoginID Return value of CLIENT_LoginEx2.
Video channel number that is a round number
[in] nChannelID
starting from 0.
[in] dwPTZCommand Control command type.
[in] lParam1 Parameter 1.
[in] lParam2 Parameter 2.
[in] lParam3 Parameter 3.
Stop mark, which is valid for operations of eight
[in] dwStop directions. When performing other operations,
Parameter enter FALSE for this parameter.
Support the following extension command:
DH_EXTPTZ_MOVE_ABSOLUTELY
DH_EXTPTZ_MOVE_CONTINUOUSLY
DH_EXTPTZ_GOTOPRESET
[in] param4 DH_EXTPTZ_SET_VIEW_RANGE
DH_EXTPTZ_FOCUS_ABSOLUTELY
DH_EXTPTZ_HORSECTORSCAN
DH_EXTPTZ_VERSECTORSCAN
DH_EXTPTZ_SET_FISHEYE_EPTZ
Success: TRUE.
Return value
Failure: FALSE.
For the relationship between dwPTZCommand and Param1, Param2 and
Note
Param3, see Table 3-4.
For the relationship between dwPTZCommand and Param1, Param2 and Param3, see Table
3-4.
dwPTZCommand macro
Function param1 param2 param3
definition
DH_PTZ_UP_CONTRO Vertical speed
Up None None
L (1–8)
DH_PTZ_DOWN_CONT Vertical speed
Down None None
ROL (1–8)
DH_PTZ_LEFT_CONTR Horizontal
Left None None
OL speed (1–8)
DH_PTZ_RIGHT_CONT Horizontal
Right None None
ROL speed (1–8)
DH_PTZ_ZOOM_ADD_
Zoom+ None Multi-speed None
CONTROL
DH_PTZ_ZOOM_DEC_
Zoom- None Multi-speed None
CONTROL
DH_PTZ_FOCUS_ADD
Focus+ None Multi-speed None
_CONTROL
DH_PTZ_FOCUS_DEC
Focus- None Multi-speed None
_CONTROL
DH_PTZ_APERTURE_A
Aperture+ None Multi-speed None
DD_CONTROL
Interface Definition 42
dwPTZCommand macro
Function param1 param2 param3
definition
DH_PTZ_APERTURE_
Aperture- None Multi-speed None
DEC_CONTROL
DH_PTZ_POINT_MOVE Move to preset Value of
None None
_CONTROL point preset point
DH_PTZ_POINT_SET_ Value of
Set None None
CONTROL preset point
DH_PTZ_POINT_DEL_ Value of
Delete None None
CONTROL preset point
76: Start
DH_PTZ_POINT_LOOP Cruise among
Cruise route None 99: Automatic
_CONTROL points
96: Stop
DH_PTZ_LAMP_CONT 0x01: Start
Lamp wiper None None
ROL x00: Stop
Vertical speed Horizontal
DH_EXTPTZ_LEFTTOP Left top None
(1–8) speed (1–8)
DH_EXTPTZ_RIGHTTO Vertical speed Horizontal
Right top None
P (1–8) speed (1–8)
DH_EXTPTZ_LEFTDO Vertical speed Horizontal
Left bottom None
WN (1–8) speed (1–8)
DH_EXTPTZ_RIGHTDO Vertical speed Horizontal
Right bottom None
WN (1–8) speed (1–8)
DH_EXTPTZ_ADDTOL Add preset Value of
Tour route None
OOP point to tour preset point
DH_EXTPTZ_DELFRO Delete preset Value of
Cruise route None
MLOOP point in cruise preset point
DH_EXTPTZ_CLOSELO
Delete cruise Cruise route None None
OP
DH_EXTPTZ_STARTPA Start horizontal
None None None
NCRUISE rotation
DH_EXTPTZ_STOPPAN Stop horizontal
None None None
CRUISE rotation
DH_EXTPTZ_SETLEFT
Set left border None None None
BORDER
DH_EXTPTZ_RIGHTBO
Set right border None None None
RDER
DH_EXTPTZ_STARTLI
Start line scan None None None
NESCAN
DH_EXTPTZ_CLOSELI
Stop line scan None None None
NESCAN
DH_EXTPTZ_SETMOD
Set mode start Mode route None None
ESTART
DH_EXTPTZ_SETMOD
Set mode stop Mode route None None
ESTOP
Interface Definition 43
dwPTZCommand macro
Function param1 param2 param3
definition
DH_EXTPTZ_RUNMOD
Running mode Mode route None None
E
DH_EXTPTZ_STOPMO
Stop mode Mode route None None
DE
DH_EXTPTZ_DELETEM
Delete mode Mode route None None
ODE
DH_EXTPTZ_REVERS Reverse
None None None
ECOMM command
Horizontal Vertical
DH_EXTPTZ_FASTGOT Fast
coordinate (0– coordinate Zoom (4)
O positioning
8192) (0–8192)
DH_EXTPTZ_AUXIOPE Open auxiliary
Auxiliary point None None
N switch
DH_EXTPTZ_AUXICLO Close auxiliary
Auxiliary point None None
SE switch
DH_EXTPTZ_OPENME
Open SD menu None None None
NU
DH_EXTPTZ_CLOSEM
Close menu None None None
ENU
DH_EXTPTZ_MENUOK Menu confirm None None None
DH_EXTPTZ_MENUCA
Menu cancel None None None
NCEL
DH_EXTPTZ_MENUUP Menu up None None None
DH_EXTPTZ_MENUDO
Menu down None None None
WN
DH_EXTPTZ_MENULE
Menu left None None None
FT
DH_EXTPTZ_MENURIG
Menu right None None None
HT
Alarm action
type: Linkage
DH_EXTPTZ_ALARMH Alarm action Alarm input Preset value, such
ANDLE with PTZ channel point as preset
Line scan point number
Cruise
Monitor
device
DH_EXTPTZ_MATRIXS Video input Matrix
Matrix switch number (video
WITCH number number
output
number)
Refer to
DH_EXTPTZ_LIGHTCO DH_PTZ_LA
Light controller None None
NTROL MP_CONTRO
L
Interface Definition 44
dwPTZCommand macro
Function param1 param2 param3
definition
Horizontal Vertical
DH_EXTPTZ_EXACTG Zoom (1–
3D positioning angle (0– coordinate (0–
OTO 128)
3600) 900)
DH_EXTPTZ_RESETZE
Reset to zero None None None
RO
DH_EXTPTZ_UP_TELE UP +TELE Speed (1–8) None None
DH_EXTPTZ_DOWN_T
DOWN +TELE Speed (1–8) None None
ELE
DH_EXTPTZ_LEFT_TE
LEFT +TELE Speed (1–8) None None
LE
DH_EXTPTZ_RIGHT_T
RIGHT +TELE Speed (1–8) None None
ELE
DH_EXTPTZ_LEFTUP_ LEFTUP
Speed (1–8) None None
TELE +TELE
DH_EXTPTZ_LEFTDO LEFTDOWN
Speed (1–8) None None
WN_TELE +TELE
DH_EXTPTZ_TIGHTUP TIGHTUP
Speed (1–8) None None
_TELE +TELE
DH_EXTPTZ_RIGHTDO RIGHTDOWN
Speed (1–8) None None
WN_TELE +TELE
DH_EXTPTZ_UP_WIDE UP +WIDE Speed (1–8) None None
DH_EXTPTZ_DOWN_W
DOWN +WIDE Speed (1–8) None None
IDE
DH_EXTPTZ_LEFT_WI
LEFT +WIDE Speed (1–8) None None
DE
DH_EXTPTZ_RIGHT_W
RIGHT +WIDE Speed (1–8) None None
IDE
DH_EXTPTZ_LEFTUP_ LEFTUP
Speed (1–8) None None
WIDE +WIDE
DH_EXTPTZ_LEFTDO LEFTDOWN
Speed (1–8) None None
WN_WIDE +WIDE
DH_EXTPTZ_RIGHTUP RIGHTUP
Speed (1–8) None None
_WIDE +WIDE
DH_EXTPTZ_RIGHTDO RIGHTDOWN
Speed (1–8) None None
WN_WIDE +WIDE
Table 3-4
Interface Definition 45
Item Description
Name Start voice talk.
LLONG CLIENT_StartTalkEx(
LLONG lLoginID,
Function pfAudioDataCallBack pfcb,
LDWORD dwUser
);
[in] lLoginID Return value of CLIENT_LoginEx2.
Parameter [in] pfcb Audio data callback.
[in] dwUser Parameter of audio data callback.
Success: Not 0.
Return value
Failure: 0.
Note None.
3.7.2 CLIENT_StopTalkEx
Item Description
Name Stop voice talk.
BOOL CLIENT_StopTalkEx(
Function LLONG lTalkHandle
);
Parameter [in] lTalkHandle Return value of CLIENT_StartTalkEx.
Success: TRUE.
Return value
Failure: FALSE.
Note None.
3.7.3 CLIENT_RecordStartEx
Item Description
Name Start local recording.
BOOL CLIENT_RecordStartEx(
Function LLONG lLoginID
);
Parameter [in] lLoginID Return value of CLIENT_LoginEx2.
Success: TRUE.
Return value
Failure: FALSE.
Note Valid only in Windows system.
3.7.4 CLIENT_RecordStopEx
Item Description
Name Stop local recording.
BOOL CLIENT_RecordStopEx(
Function LLONG lLoginID
);
Interface Definition 46
Item Description
Parameter [in] lLoginID Return value of CLIENT_LoginEx2.
Success: TRUE.
Return value
Failure: FALSE.
Note Valid only in Windows system.
3.7.5 CLIENT_TalkSendData
Item Description
Name Send audio data to device.
Function LONG CLIENT_TalkSendData(
LLONG lTalkHandle,
char *pSendBuf,
DWORD dwBufSize
);
Parameter [in] lTalkHandle Return value of CLIENT_StartTalkEx.
[in] pSendBuf Pointer of audio data block that needs to be sent.
[in] dwBufSize Length of audio data black that needs to be sent.
The unit is byte.
Return value Success: Length of audio data block.
Failure: -1.
Note None.
3.7.6 CLIENT_AudioDecEx
Item Description
Name Decode audio data.
BOOL CLIENT_AudioDecEx(
LLONG lTalkHandle,
Function char *pAudioDataBuf,
DWORD dwBufSize
);
[in] lTalkHandle Return value of CLIENT_StartTalkEx.
[in] pAudioDataBuf Pointer of audio data block that needs decoding.
Parameter
Length of audio data black that needs decoding.
[in] dwBufSize
The unit is byte.
Success: TRUE.
Return value
Failure: FALSE.
Note None.
Interface Definition 47
3.8 Heat Map (Temperature)
3.8.1 CLIENT_RadiometryAttach
Item Description
Name Start subscribing heat map data.
LLONG CLIENT_RadiometryAttach(
LLONG lLoginID,
const NET_IN_RADIOMETRY_ATTACH* pInParam,
Function
NET_OUT_RADIOMETRY_ATTACH* pOutParam,
int nWaitTime
);
[in] lLoginID Return value of CLIENT_LoginEx2.
[in] pInParam Input parameter.
Parameter
[in] pOutParam Output parameter.
[in] nWaitTime Timeout. The unit is millisecond.
Success: Not 0.
Return value
Failure: 0.
Note None.
3.8.2 CLIENT_RadiometryDetach
Item Description
Name Stop subscribing heat map data.
BOOL CLIENT_RadiometryDetach(
Function LLONG lAttachHandle
);
Parameter [in] lAttachHandle Return value of CLIENT_ RadiometryAttach.
Success: TRUE.
Return value
Failure: FALSE.
Note None.
3.8.3 CLIENT_RadiometryFetch
Item Description
Name Capture heat map data.
BOOL CLIENT_RadiometryFetch(
LLONG lLoginID,
const NET_IN_RADIOMETRY_FETCH* pInParam,
Function
NET_OUT_RADIOMETRY_FETCH* pOutParam,
int nWaitTime
);
[in] lLoginID Return value of CLIENT_LoginEx2.
Parameter
[in] pInParam Input parameter.
Interface Definition 48
Item Description
[in] pOutParam Output parameter.
[in] nWaitTime Timeout. The unit is millisecond.
Success: TRUE.
Return value
Failure: FALSE.
Note None.
3.8.4 CLIENT_RadiometryDataParse
Item Description
Name Parse heat map data.
BOOL CLIENT_RadiometryDataParse(
const NET_RADIOMETRY_DATA* pBuf,
Function unsigned short* pImg,
float* pTemp
);
[in] pBuf Heat map data.
Unzipped data is a gray map.
[in out] pImg Introducing null pointer indicates this data is not
Parameter needed.
Temperature data of each pixel.
[in out] pTemp Introducing null pointer indicates this data is not
needed.
Success: TRUE.
Return value
Failure: FALSE.
Note None.
Interface Definition 49
Item Description
Buffer used to receive the data returned by the query.
[out] pBuf The data structure of returned data is different
according to the type of query.
[in]nBufLen Buffer length. The unit is byte.
[out]pRetLen The data length returned actually. The unit is byte.
Waiting time for query state. The default waiting time
[in]waittime
is 1000ms. It can be set according to the needs.
Success: TRUE.
Return value
Failure: FALSE.
Note None.
Interface Definition 50
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 51
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.
Parameter
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 Definition 52
Item Description
Callback parameter structure. Different dwDataType
value corresponds to different type.
The param is blank pointer when dwDataType is
0.
The param is the pointer of
tagVideoFrameParam structure when
[out] param dwDataType is 1.
The param is the pointer of
tagCBYUVDataParam structure when
dwDataType is 2.
The param is the pointer of
tagCBPCMDataParam structure when
dwDataType is 3.
[out] dwUser User parameter of the callback.
Return value None.
Note None.
4.5 pfAudioDataCallBack
Item Description
Name Audio data callback of voice talk.
typedef void (CALLBACK *pfAudioDataCallBack)(
LLONG lTalkHandle,
char *pDataBuf,
Function DWORD dwBufSize,
BYTE byAudioFlag,
LDWORD dwUser
);
[out] lTalkHandle Return value of CLIENT_StartTalkEx.
[out] pDataBuf Address of audio data block.
[out] dwBufSize Length of the audio data block. The unit is byte.
Parameter Data type:
[out] byAudioFlag 0: Local collecting.
1: Sending from device.
[out] dwUser User parameter of the callback.
Return value None.
Note None.
4.6 fRadiometryAttachCB
Item Description
Callback Definition 53
Name Callback of temperature distribution data.
typedef void (CALLBACK *fRadiometryAttachCB)(
LLONG lAttachHandle,
NET_RADIOMETRY_DATA* pBuf,
Function
int nBufLen,
LDWORD dwUser
);
[out] lAttachHandle Return value of CLIENT_RadiometryAttach.
[out] pBuf Address of data block.
Parameter
[out] nBufLen Length of the data block. The unit is byte.
[out] dwUser User parameter of the callback.
Return value None.
Note None.
Callback Definition 54