WebRTC Videoengine Ultra-Detailed tutorial (i)--the basic process of video Call

Source: Internet
Author: User
Tags printf

Transferred from: http://blog.csdn.net/nonmarking/article/details/47375849

This series is currently a total of three articles, follow up will also update

WebRTC Videoengine Ultra-Detailed tutorial (i)--the basic process of video Call

WebRTC Videoengine Ultra-Detailed tutorial (ii)--integrated OPENH264 codec

WebRTC Videoengine Ultra-Detailed tutorial (iii)--integrated X264 encoding and FFmpeg decoding

The advent of WEBRTC technology has changed the status of traditional instant messaging, a set of open source technologies designed to build browser-side-to-end communication standards, support browser platforms, and use peer-to architecture. WEBRTC's technology is the current VoIP advanced technology, such as the internal use of the audio engine is Google's acquisition of well-known gips companies to obtain the core technology: Video codec uses the VP8.

Everyone said WebRTC good, is the trend of the future, but have to say that the open source project is very unfriendly to novice learning, just under the Windows platform of the compilation can be spent a whole day of energy, and may not be successful, about this issue in my previous article described. After the successful compilation of a look, the whole solution inside there are 215 items, absolutely let people at that time, and most importantly, Google does not seem to give any useful documents for reference, the network of relevant information is also more about web-side development, and native API development related to less and less, so I decided to take their two days to learn videoengine the results of sharing, for your reference, what problems are also welcome to point out, together learn to progress together.

The first thing to note is that there is a vie_auto_test project under the All.sln of the WEBRTC project, which contains a number of test procedures for Videoengine, and my demo here is based on this modification.


Let's take a look at the core API of Videoengine, which is basically in the following header files.


Specifically,

Viebase for

-Create and Destroy Videoengine instances

-Create and destroy channels
-Connect the video channel with the corresponding voice channel and synchronize
-Start and stop of sending and receiving

viecapture for

-Assign capture devices.
-Connect capture device to one or more channels.
-Start or stop capture devices.
-Get the availability of capture device.

Viecodec for

-Set up the codec to send and receive.

-Set codec properties.

-Key frame signaling.

-Stream management settings.

Vieerror is a few predefined error messages

Vieexternalcodec for registering codecs other than VP8

vieimageprocess provides the following features

-Effect Filters
-Anti-flicker
-Color Enhancement

Vienetwork for

-Configure send and receive addresses.
-External transport support.
-Port and address filtering.
-Windows GQoS functions and ToS functions.
-Packet Timeout notification.
-Dead‐or‐alive connection observations.

Vierender for

-Specify render targets for input video streams, capture device, and files.
-Configure render streams.

viertp_rtcp for

-Callbacks for RTP and RTCP events such as modified SSRC or CSRC.

-SSRC handling.
-Transmission of RTCP reports.
-Obtaining RTCP data from incoming RTCP sender reports.
-RTP and RTCP statistics (jitter, packet loss, RTT etc).
-Forward Error Correction (FEC).
-Writing RTP and RTCP packets to binary files for off‐line analysis of the "Call quality".
-Inserting extra RTP packets into active audio stream.


The following will be implemented as a video Call function for example details of the use of Videoengine, in the text at the weekend to attach the corresponding source of the download address

The first step is to create a Videoengine instance, as follows

[CPP]View plain copy webrtc::videoengine* Ptrvie = NULL;       Ptrvie = Webrtc::videoengine::create ();           if (Ptrvie = = NULL) {printf ("ERROR in videoengine::create\n");       return-1; Then initialize the Videoengine and create a channel
[CPP]  View plain copy webrtc::viebase* ptrviebase = webrtc::viebase::getinterface (Ptrvie);        if  (ptrviebase == null)        {            printf ("error in viebase::getinterface\n ");           return -1;        }          error = ptrviebase->init ();// The init here is actually for Videoengine        if  (error == -1)        {           printf ("Error in  viebase::init\n ");           return -1;        }          webrtc::ViERTP_RTCP*  ptrviertprtcp =           webrtc::viertp_rtcp::getinterface (PtrViE);        if  (ptrviertprtcp == null)        {           printf ("error in viertp_rtcp::getinterface\n");            return -1;        }          int videoChannel = -1;        error = ptrviebase->createchannel (videochannel);        if  (error == -1)        {            printf ("error in viebase::createchannel\n");            return -1;       }   List of available capture Devices waiting for users to choose, then allocate and connect, and finally start the selected capture device
[CPP]View plain copy webrtc::viecapture* ptrviecapture = Webrtc::viecapture::getinterface (Ptrvie);

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.