WEBRTC First Knowledge

Source: Internet
Author: User

Recently, due to the needs of the project, I began to touch the WEBRTC thing. Unexpectedly the threshold of this thing is still pretty high, next share I stepped on the pit, hoping for the first contact with this thing in the future to help people.

WEBRTC official website

The first step of course is to see the official homepage (www.webrtc.org), first the content of the homepage was roughly swept over, probably a little bit of understanding of this thing, and then follow the steps of the development page to start. According to the official version of the installation of dependent Tools,java environment etc ... This, of course, includes the necessary steps for FQ.

Code Download:

When you have finished configuring the environment, to run the command gclient sync, found that waiting for a long time, is still keep working state, a little anxious. Then look at the Chinese BBS (http://chinawebrtc.org/), found that I was wrong, the original code has more than 10 g, the code size depends on the corresponding platform code you download. In fact, after 24 hours of downloading, I gave up my idea of downloading on the website. In the Chinese forum found that good people have been on the network to share the code on different platforms, with a thunderbolt less than 3 hours to take care of the code download.

Code Compilation:

The next step is to prepare the compilation. However, I found that the compilation is still so troublesome, because I am the source of the download of others, but WEBRTC use their own compilation System Ninja, the compilation system needs the. Ninja file (in fact, corresponding to the makefile file) is dependent on the code to download the local environment has been set. After all, but finally escaped gclient sync this step, but fortunately, less than 1 hours this process has ended smoothly, the local compilation script is also normal. According to the official instructions to execute ninja-c out/debug several times is not very smooth, can not find the specific reason, the feeling is still the problem of the code. Later on GitHub found someone else to write the compilation script (Https://github.com/pristineio/webrtc-build-scripts), with the attitude of trying to put down the script first, and then copy their own code to the directory webrtc-build-scripts/android/below, the final code directory is WEBRTC-BUILD-SCRIPTS/ANDROID/WEBRTC/SRC, Next follow the webrtc-build-scripts of the readme steps, the process is very smooth, after the completion of the compilation, will be in the opposite target platform directory under the corresponding libjingle_peerconnection.so and Libjingle_ Peerconnection.jar.

Static libraries:

The dynamic library of ARM platform is compiled, but for the sake of demand, we need to make a static library. Looked for a long time did not find a way to compile a static library. So can only do their own, through the analysis of the Libjingle_peerconnection_so.ninjia file, found that the dynamic library is only a static library of other modules compiled a simple merger. I would like to use the same idea to write a script to extract the static library of all the compiled submodule, and then merge into a static library (of course, prior to the understanding of the static library is limited to simple targets. o file merging). When I try to write this method, I find that I can't, when the static library is extracted from the static library can not be used, it feels like the location of the target file is bound. Later, after a variety of attempts to successfully compile the Android platform Static Library, thinking about the following, using AR-M This command to merge the static library. The specific MRI script I have placed on GitHub (Https://github.com/xiaopeifeng/apprtc/tree/master/webrtc_static_library_build_script).

The echomri.sh script is first placed in the Webrtc/src/debug directory and executed, and a Libjingle_peerconnection.mri script file is generated after the end.

Then execute AR-M < Libjingle_peerconnection.mri

You will eventually see the generated Libjingle_peerconnection.a static library file in your directory.

APPRTC Android Project:

Since there was no prior contact with Android development, so the establishment of the Android project still took some time, in fact, the process is quite simple, the directory Example/androidapp directory code directly into Eclipse (company main), the WebSocket jar package, Libjingle _peerconnection.jar and Armebi's libjingle_peerconnection.so are placed in the Libs directory. I have made available works put in (Https://github.com/xiaopeifeng/apprtc.git), Welcome to download using.

APPRTC Code Modification:

Although this code is available, and the demo can run, but the signaling server outside the wall, all the need to make their own server, the official demo code to read through, according to the WEBRTC peerconnection layer of the running process, to do their own server, And now it's easy to run. After the stability of the public bar.

WebRTC Road still has a long, unknown pit still have many, slowly tread, slowly share.

WEBRTC First Knowledge

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.