Objective:
On an article "Hai Kang Wei video monitoring Equipment Web View System (i): Summary of the general introduction of the sea and Kang video transfer scheme of ideas, this article will be step-by-step implementation of the scheme in the video relay server. The article will involve some. NET socket processing and the underlying multithreaded operation. I am using the SDK version is sdk_win32_v4.2.8.1. Everyone according to their actual situation want in the corresponding SDK, the description of the page has a detailed list of equipment models.
Analysis of the Official SDK Demo:
First look at the official SDK in the C # version of the demo, the official demo is divided into two versions, namely, "Live Preview sample Code One" and "Live Preview sample code Two", because there is a ready-made C # version, so we use the content of sample code one. First focus on the class named Chcnetsdk, this class seals all the unmanaged method interfaces in the SDK, we need to introduce this class and the DLL file in the SDK into our project, if there are friends who don't know about C # calling C + + class library, please Google yourself, the information is very much, There are many writers in the blog park who have written this kind of article, this article does not do in-depth discussion on this content.
Call SDK no problem, next look at the use of the SDK, according to the SDK using the document, the SDK interface calls need to pass a standard process, the flowchart is as follows:
In this process, our first step is to initialize the SDK, then there are three optional callback function settings, and then to do the user registration device is the device login, followed by the core part, according to the idea in the previous article, in addition to the preview module of several other modules of the call is not the scope of the problem we want to solve, It is therefore not considered. The final step is to unregister the device and release the SDK resources. So, finally, according to our requirements, the process is simplified as follows:
This column more highlights: http://www.bianceng.cnhttp://www.bianceng.cn/Programming/net/