Android IOS WebRTC Audio Video Development Summary (24)

Source: Internet
Author: User

This article mainly analyzes the WEBRTC audio and video point-to-point part of the code structure, the article from the blog Garden Rtc.blacker, reproduced please explain the source.

Some time ago in the problem of an occasional disconnection (this problem is the most painful, not reproducible, only by experience to do), so the next WEBRTC of the peer code structure, summarized as follows:

The first image shows the two communication paths in the actual session: Peer-to-peer or forward, 92% in the case.

Note: During the actual communication process, each client will continuously send and receive the stun packet, which is done in order to maintain the response of the connection and port.

The core component of the actual communication process is P2ptransportchannel, which represents the connection channel for local and remote computers,

A number of connection objects, such as TCP,UDP, that manage many different connection types on local and remote computers,

The Connection object contains the local port and remote address information, and when a connection fails, he seamlessly switches to the other connection, which is the internal structure of the peer data channel.

The following is the stack call procedure in the code structure:

1. The Asyncudpsocket creation process for receiving and sending data is as follows:

2, calling Party Create a connection based on Remotecandidate and perform the ping process as follows:

3. The receiver creates a connection based on Remotecandidate and performs the ping process as follows:

4. Received stun response Change the connection status call process as follows:

5, the connection successfully set up to start the process of sending and receiving data is as follows:

Android IOS WebRTC Audio Video Development Summary (24)

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.