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 (.