ubuntu18.04编译webrtc源码

Geeny 2019-07-01

梯子搭好了,一切好说
1.搭建shadowsock客户端

2.安装polipo服务
apt install polipo

/etc/polipo/config文件修改为:
logSyslog = true
logFile = /var/log/polipo/polipo.log

socksParentProxy = "127.0.0.1:1080" #这是socks代理的地址和端口
socksProxyType = socks5

chunkHighMark = 50331648
objectHighMark = 16384

serverMaxSlots = 64
serverSlots = 16
serverSlots1 = 32

proxyAddress = "127.0.0.1" #这是本代理的地址端口
proxyPort = 8123

然后重启polipo服务
service polipo restart

3.把相关代理变量设置到/etc/profile
export http_proxy="http://127.0.0.1:8123"
export https_proxy="http://127.0.0.1:8123"
export PATH=$PATH:/work/av/tools/depot_tools
export NO_AUTH_BOTO_CONFIG=/work/av/tools/depot_tools/http_proxy.boto

然后执行source /etc/profile

创建文件/work/av/tools/depot_tools/http_proxy.boto
[Boto]
proxy= 127.0.0.1
proxy_port= 1080

设置git代理
git config --global http.proxy http://127.0.0.1:8123
git config --global https.proxy http://127.0.0.1:8123

如果要取消git代理

git config --global --unset http.proxy
git config --global --unset https.proxy

4.测试翻墙效果
git clone https://chromium.googlesource...
curl https://www.google.com

5.下载depot_tools
git clone https://chromium.googlesource...
export PATH=$PATH:/work/av/tools/depot_tools

6.下载源码
fetch --nohooks webrtc
或者fetch --nohook webrtc_android
下载中途挂了就输入gclient sync

7.下载编译依赖
如果使用root用户,先修改这个:
vim depot_tools/update_depot_tools
注释掉第11行的exit
然后gclient runhooks

8.生成gn编译文件
gn gen out/Debug --args="rtc_use_h264=true is_component_ffmpeg=true"
gn gen out/Release --args='is_debug=false'
如果要编译安卓平台
gn gen out/Debug --args='target_os="android" target_cpu="arm64" rtc_use_h264=true ffmpeg_branding="Chrome" proprietary_codecs=true'

9.编译
ninja -C out/Debug
ninja -C out/Release

相关推荐