write on the front
A: The purpose of writing a blog
1. Self-study of the hard self-evident.
2. All kinds of information on the Internet is a mixed bag, many are outdated.
3. Based on the latest WEBRTC source to share some experience in their work.
4. If you write a good people clap, write bad don't spray. Money to hold a field, no money ...
Two: Compile compile or compile
1. It is best to prepare a VPN, do not think of someone to copy the code to upload to the domestic server.
2. Download the depot_tools and add to path:
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
export path= ' pwd '/depot_tools: "$PATH" (recommended to configure in/etc/profile, so that each time you re-open the terminal to reset it again)
3. Install the dependent libraries. (These libraries are not only required at compile time, but are also used when downloading, so install them before downloading the code)
Python (>= 2.4)
Libnss3-dev >= 3.12
Libasound2-dev
Libpulse-dev
Libjpeg62-dev
Libxv-dev
Libgtk2.0-dev
Libexpat1-dev
g++ (>= 4.2)
32-bit dependent libraries, this is mainly used when compiling Apprtcdemo
lib32asound2-dev
lib32z1
lib32ncurses5
lib32bz2-1.0
above these straight- connect sudo apt-get install installs on the can.
The above is not enough to ensure that the compilation smoothly through, according to my ubuntu14.04 compilation experience, but also need other libraries, when the error, go directly to the location of the error, to install the required library on it.
The library's dependencies are shown in log.
You will also need to download the Openjdk-7-dev and configure the java_home=/usr/lib/jvm/java* configuration to the environment.
4. Get the code (this step is annoying, I took 2 days to download the completed)
1. Create a directory mkdir Webrtc_dir
2. CD Webrtc_dir
3. Fectch WEBRTC
If Android is needed
Export gyp_defines= "Os=android"
Fetch Webrtc_android
If there is a disconnect in the middle, direct CD to truck or src directory to perform gclient sync. This is the same command when synchronizing the code later.
5. Compilation:ninja-c out/debug
6. Compile Apprtcdemo:
1. Set environment variables, such as NDK environment. Here we need to say that the NDK used here is the source of the NDK, do not need us to download and configure the NDK environment. Otherwise, there are various problems and many brain cells have to die.
Direct CD to src directory execution. Build/android/evnsetup.sh on the line.
2. Setting GYP Environment variables
export Gyp_defines = "build _with_libjingle=1 build_with_chromium=0 libjingle_java=1 os=android $GYP _defines " |
|
|
3. Compiling
Ninja-C out/Debug Apprtcdemo
In fact, it is so simple, if there are problems in the compilation process, just leave a comment in the comments.
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
WEBRTC study One