How to Use the streaming media data proxy function?

Source: Internet
Author: User

In the "anychat platform core SDK v2.8" SDK, the "user streaming media data proxy function" is added ", this function allows a specified user to use streaming media data (audio and video) of other users as their own data and forward it to the user who requests the specified user data.

 

Application Scenario: Set the specified user (p) as the proxy for other user (a) data (audio and video data). When a third-party user (c) sends) when requesting data, a third-party user (c) will receive data (audio and video) from other users ().

 

This function can be used to implement some special applications. For example, in a live conference application, you can set multiple proxy users (p) to represent the streaming media data of the main venue (, when other users (c) request streaming media data from the proxy user, the streaming media data of the main venue (a) will be obtained, so that the data can be diverted to avoid the main venue () network Congestion is caused by too many user requests.

 

When the Conference scale is large, the ideal deployment solution is to deploy multiple proxy users. The data of the main venue is only sent to the proxy users (only requests from the proxy users ), A common user requests only the data of the proxy user, so that the multi-level data transmission function is realized, saving the bandwidth pressure on the network where the main venue is located.

 

The sample code of the typical streaming media data proxy function is as follows:

 

  01. // Specifies the video and voice data of a user whose ID is 11. 02. DWORD  dwUserId = 11; 03. BRAC_SetSDKOption(BRAC_SO_PROXY_VIDEOCTRL,( const  char *)&dwUserId, sizeof ( DWORD )); 04. BRAC_SetSDKOption(BRAC_SO_PROXY_AUDIOCTRL,( const  char *)&dwUserId, sizeof ( DWORD )); 05. // Start proxy Mode 06. BOOL  bStartProxy = TRUE; 07. BRAC_SetSDKOption(BRAC_SO_PROXY_FUNCTIONCTRL,( const  char *)&bStartProxy, sizeof ( DWORD )); 08. // Request the voice and video data of a user numbered 11 09. BRAC_UserCameraControl(dwUserId,TRUE); 10. BRAC_UserSpeakControl(dwUserId,TRUE);

 

 

Note: The proxy user (p) must actively request the relevant data of the proxy user (a). Other users (c) can obtain the proxy user (a) from the proxy user (P) other users (c) directly request the data of the proxy user (P), instead of the data of the proxy user (.

Related Article

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.