The road of WebRTC audio and video development

Source: Internet
Author: User

As early as 2014 through the WebRTC realized the PC client real-time video voice, then the establishment of peer-to WEBRTC with the Libjingle library, using the Peerconnection API implementation. Later in the Remote Desktop, file transfer requires point-to-point connection, the Libjingle library for a period of time, found a few problems:

The 1.libjingle library is built using the XMPP protocol, but our clients do not support the XMPP protocol;

2.libjingle Library is huge, making rewriting difficult.

3. Stability issues.

Then, based on the UDT library to achieve a set of peer-to transfer library, use is also very convenient as long as the two sides agreed to the name of the simultaneous connection to the server can be a successful hole, and later use this library to replace the WEBRTC Libjingle library for transmission.

The implementation details are as follows:

Using WebRTC's voice_engine and video_engine to achieve video voice (because the Voice_engine and Video_engine APIs are simple and easy to maintain), the docking section is as follows:

1 classWebrtc_dllexport voenetwork2 {3  Public:4     //Factory for the voenetwork Sub-api. Increases an internal5     //Reference counter if successful. Returns NULL If the API is not6     //supported or if construction fails.7     Staticvoenetwork* GetInterface (voiceengine*voiceengine);8 9     //releases the Voenetwork Sub-api and decreases an internalTen     //reference counter. Returns the new reference count. This value should One     //Be zero for all sub-api:s before the Voiceengine object can be safely A     //deleted. -     Virtual intRelease () =0; -  the     //installs and enables a user-defined external transport protocol for a -     //specified |channel|. -     Virtual intRegisterexternaltransport ( -         intChannel, transport& Transport) =0; +  -     //removes and disables a user-defined external transport protocol for a +     //specified |channel|. A     Virtual intDeregisterexternaltransport (intChannel) =0; at  -     //The packets received from the network should is passed to this -     //function When external transport is enabled. Note that the data -     //including the Rtp-header must also is given to the voiceengine. -     Virtual intReceivedrtppacket ( -         intChannelConst void* Data, unsignedintLength) =0; in  -     //The packets received from the network should is passed to this to     //function When external transport is enabled. Note that the data +     //including the Rtcp-header must also is given to the voiceengine. -     Virtual intReceivedrtcppacket ( the         intChannelConst void* Data, unsignedintLength) =0; *  $ protected:Panax Notoginseng voenetwork () {} -     Virtual~voenetwork () {} the};

Implement the interface of the transport class sendpacket,sendrtcppacket to send RTP and RTCP packets, call Voenetwork::registerexternaltransport () to register to Voice_ Engine, and then the received packets to voenetwork::receivedrtppacket and Voenetwork::receivedrtcppacket to deal with, the video is similar processing.

The road of WebRTC audio and video development

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.