Data transmission in secondary development of audio and video communication

Source: Internet
Author: User
Data transmission in secondary development of audio and video communication

Nowadays, most people communicate with each other through instant messaging tools, which have the basic functions of file transmission. This function is used after self-development through instant messaging tools. the following uses AnyChat interactive development platform, which is a leading audio and video technology in China, as an example to implement the file transmission function.

AnyChat SDK V4.1.0.1 and later versions support file transmission speed limiting. By default, AnyChat's file transmission and buffer transmission automatically detect available network bandwidth and perform network transmission based on the principle of "transmission at the shortest time and speed, this principle can adapt to most applications. However, in some applications, some bandwidth needs to be reserved for other modules, and AnyChat file transmission does not require all network bandwidth, in this case, the speed limit function can be used.

The speed limit function of AnyChat file transmission is to set the upload speed of local files and control the total upload speed. if the speed limit is set to 500 kbps, when one file is transmitted simultaneously, the maximum upload speed is 500 kbps. if two files are uploaded simultaneously, the maximum upload speed of each file is 250 kbps.

BRAC_TransFile,BRAC_TransBufferExBoth APIs are subject to the transmission speed limit function.

The transmission speed limit interface is defined as follows:

1. // transmission buffer, maximum file bit rate control (the parameter is int type, 0 is not limited, transmission at the fastest speed [default], otherwise it indicates the maximum bit rate, unit: bps)

2. # defineBRAC_SO_NETWORK_TRANSBUFMAXBITRATE 46

By default, the transmission speed limit function is disabled on the AnyChat platform. to enable the function, refer to the following code (the call is valid after SDK initialization is successful and can be called as needed and dynamically adjusted ):

1. // Set the upload speed to 500 kbps (62 kBps)

2. DWORD dwMaxUpRate = 500*1000;

3. BRAC_SetSDKOption (BRAC_SO_NETWORK_TRANSBUFMAXBITRATE, (constchar *) & dwMaxUpRate, sizeof (DWORD ));

To cancel the transmission speed limit function, refer to the following code:

1. // cancel the speed limit function

2. DWORD dwMaxUpRate = 0;

3. BRAC_SetSDKOption (BRAC_SO_NETWORK_TRANSBUFMAXBITRATE, (constchar *) & dwMaxUpRate, sizeof (DWORD ));



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.