当前位置:网站首页>Easycvr implementation of adding preset point position function of Dahua equipment

Easycvr implementation of adding preset point position function of Dahua equipment

2022-06-24 00:05:00 Tsingsee green rhino video

As we all know EasyCVR Support pan tilt control , The PTZ can be controlled remotely , Right now we're talking about EasyCVR Equipment docking for new development , If you use UOB equipment , We want to be able to pass Dahua's SDK Get all preset points .

In the development of this function , We use CLIENT_QueryRemotDevState The function is used to obtain the position of the preset point , call CLIENT_QueryRemotDevState Function time , The return value of this function is always FALSE( Acquisition failure ), The return value of the function is 7.

Find... In UOB documents 7 representative :“ Illegal user parameter ”( The figure below ).

Therefore, it has been stated in the Dahua document that the parameters are illegal ,CLIENT_QueryRemotDevState Function has 7 Parameters : Handle of the login device respectively 、 Query information type 、 Channel number 、 Output pBuf、 Cache length 、 Output parameters and waiting time ( The following figure shows the official document ).

Let's take a parameter analysis :

The first parameter is the login handle , This parameter must be correct , If there is an error, it will not return 7.

The second parameter is the type of information to query , We need to query the preset bit of the device , So I can only fill in :DH_DEVSTATE_PTZ_PRESET_LIST

The third parameter is the channel number , Because it's directly connected to the camera , So for 0;

The fourth parameter is the output parameter , And according to the second parameter , Corresponding NET_PTZ_PRESET_LIST Structure ;

The fifth parameter is the size of the fourth parameter :sizeof(NET_PTZ_PRESET_LIST) To calculate the size ;

The sixth parameter is the waiting time , The default is 3000ms;

So we know from the analysis parameters , If there is an error, it is most likely the problem of the fourth parameter ( The structure of the fourth parameter is as follows ):

Looking at this structure, we know that there are four values , Finally, the question becomes clear , Add these four values . Then the directly modified code :

Finally, one more thing to pay special attention to , Memory needs to be allocated to pstuPtzPorsetList.

原网站

版权声明
本文为[Tsingsee green rhino video]所创,转载请带上原文链接,感谢
https://yzsam.com/2021/11/20211123184357921p.html