Audinate Browse Device Browsing API Small analysis

Source: Internet
Author: User

      • Objective
      • Call
      • Software Run architecture
      • Initializing the configuration phase
      • Dynamically Refresh monitoring device information
      • Get device-related information
      • Note

Objective

After installing the Audinate SDK, the official offers a number of demos for learning to use. For the C-series API, honestly, without a detailed tutorial or demo, Getting started is really not that easy. Summarize the blog over the course of the learning process for reflection.

Call

Audiate's development mechanism is based on Apple's MDNS protocol, and the operating mechanism is outlined below
Application Layer--API Layer--system service layer (MDNS)
Therefore, in order to run the software properly, to obtain information about the device, the precondition is that you must install the Audinate SDK service, and ensure that the service has been started, or call the relevant function, will automatically error interrupt program run.

PS: How to determine that the service has been started?
It's really simple, just start the official Dante Controller and see if it works.
If you are prompted not to find the service, through: My Computer - right mouse: Management -- services to the application -- services , to find the relevant Dante service started on the line

While the Dante SDK needs to be called through a static connection library , the SDK relies on the Win32 Network communication library (select call), so you must also add:

    • Ws2_32.lib
    • Iphlpapi.lib

Two libraries to get the software to compile properly. Because the official library uses a large number of C-language usage, the VS platform will give a large number of warning messages, if it is not pleasing to the eye, directly in the property bar debug close the line.

Software Run architecture
  • Initializing configuration information
  • Dynamic refresh of connected device information in monitoring network
  • Get device-related information
Initializing the configuration phase

There are three main aspects of software initialization

  • Initializing the Environment
  • Create a Browser object
  • Start browsing Configuration
    The period involves three core parameters: type , config , * browser structure. Configuration parameters *

Dynamically Refresh monitoring device information

The initialization process requires the configuration of two callback functions, the socket change notification function, and the network change notification function.

  • Db_browse_set_network_changed_callback (Test.browse, db_test_network_changed);
  • Db_browse_set_sockets_changed_callback (Test.browse, db_test_sockets_changed);


Each time the polling is refreshed, it automatically refreshes once the network or socket has been detected.
The official idea is designed to be monitored by a while loop, once the monitor has a data write (select) or time-out ( Determine if time-outs are timed by the next refresh time provided during each recording of the land and the data obtained

    if (next_resolve_timeout.tv_sec || next_resolve_timeout.tv_usec)    {        now;        aud_utime_get(&now);        if (aud_utime_compare(&next_resolve_timeout, &now0)        {            processing_needed = AUD_TRUE;        }    }
    result = db_browse_process(test->browse,&curr_sockets,&next_resolve_timeout);
Get device-related information
        Constdb_browse_network_t * Network = db_browse_get_network (Test->browse); for(i =0; I < db_browse_network_get_num_devices (network); i++) {db_browse_device_t * device = db_browse_network_device_at_index (network, i);Const Char* Name = Db_browse_device_get_name (device); result = Db_browse_device_reconfirm (device,0, Aud_false);if(Result! = aud_success) {printf("Error reconfirming device '%s ':%s\n", name, Aud_error_message (result, test->errbuf));//return result;}printf("reconfirming device '%s ' \ n", name); }

After extracting the db_browse_device_t * device object from the network object, the next thing to do is to harvest the information. As soon as you get the device handle , get and configure information about the devices, like wolves into the flock, the tiger into the pigsty, love how to complete the whole. Since the official API is very detailed and convenient to call, this is not a good place to repeat

Note

In the actual commissioning of the development process, the official dynamic refresh mechanism is actually problematic, due to the second
The next_resolve_timeout value extracted by db_browse_process is automatically set to 0, resulting in the inability to periodically refresh device changes in the network.
The cause of this problem may be from the official API function call, unable to get the normal next_resolve_timeout time, this time is the local time in the device, it may be no synchronization clock for the sake of it.
However, since the actual development process does not need to rely on the official design architecture, you can configure a timer to complete the non-data write the timing of the monitoring refresh

    result = db_browse_process(test->browse,&curr_sockets,&next_resolve_timeout);

Audinate Browse Device Browsing API Small analysis

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.