参考:
http://www.webrtc.org/ webrtc官网
问题和解决:
bcb@bcb-Lenovo:~/webrtc-nntv-work$ gclient sync
Updating projects from gyp files...
Package glib-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `glib-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'glib-2.0' found
Package gobject-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gobject-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gobject-2.0' found
Package gthread-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gthread-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gthread-2.0' found
Package gtk+-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gtk+-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gtk+-2.0' found
gyp: Call to 'pkg-config --libs-only-l glib-2.0 gobject-2.0 gthread-2.0 gtk+-2.0' returned exit status 1.
Package gobject-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gobject-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gobject-2.0' found
Package gthread-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gthread-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gthread-2.0' found
Package gtk+-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gtk+-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gtk+-2.0' found
gyp: Call to 'pkg-config --libs-only-l gobject-2.0 gthread-2.0 gtk+-2.0' returned exit status 1.
Error: Command /usr/bin/python src/webrtc/build/gyp_webrtc -Dextra_gyp_flag=0 returned non-zero exit status 1 in /home/bcb/webrtc-nntv-work
没有安装必须的库,使用src/build/install-build-deps-android.sh来安装依赖的库
bcb@bcb-Lenovo:~$ sudo apt-get install libnss3-dev libasound2-dev libpulse-dev libjpeg62-dev libxv-dev libgtk2.0-dev libexpat1-dev
bcb@bcb-Lenovo:~/webrtc-nntv-work$ . src/build/install-build-deps-android.sh
......
Installing Archives:
Preparing to install archives
Downloading Google Play services, revision 23
Installing Google Play services, revision 23
Installed Google Play services, revision 2397%)
Done. 1 package installed.
install-android-sdks.sh complete.
install-build-deps-android.sh complete.
Package xtst was not found in the pkg-config search path.
Perhaps you should add the directory containing `xtst.pc'
to the PKG_CONFIG_PATH environment variable
No package 'xtst' found
gyp: Call to 'pkg-config --cflags xtst' returned exit status 1.
Error: Command /usr/bin/python src/webrtc/build/gyp_webrtc -Dextra_gyp_flag=0 returned non-zero exit status 1 in /home/bcb/webrtc-nntv-work
bcb@bcb-Lenovo:~/webrtc-nntv-work$ export GYP_DEFINES="OS=android"
编译:
bcb@bcb-Lenovo:~/webrtc-nntv-work$ cd src/
bcb@bcb-Lenovo:~/webrtc-nntv-work/src$ ninja -C out/Debug AppRTCDemo
ninja: Entering directory `out/Debug'
[2591/2616] ACTION Compiling libjingle_peerconnection_java java sources
注: 某些输入文件使用或覆盖了已过时的 API。
注: 有关详细信息, 请使用 -Xlint:deprecation 重新编译。
[2616/2616] STAMP obj/talk/AppRTCDemo.actions_rules_copies.stamp
bcb@bcb-Lenovo:~/webrtc-nntv-work/src$ ls out/Debug/apks/
AppRTCDemo.apk