编译过程参考:
https://mediasoup.org/documentation/v3/libmediasoupclient/installation/
build example部分;
goole 官方编译:
https://webrtc.github.io/webrtc-org/native-code/development/
下载代码(代码总量有10多G):
$ cd /home/foo/src
$ mkdir webrtc-checkout
$ cd webrtc-checkout
$ fetch --nohooks webrtc
$ gclient sync
切换到m79分支:
$ cd src
$ git checkout -b m79 refs/remotes/branch-heads/m79
$ gclient sync
设置编译选项:
In Linux Debian Stretch with GCC 6.3 this works:
$ gn gen out/mybuild-m79 --args='is_debug=false is_component_build=false is_clang=false rtc_include_tests=false rtc_use_h264=true rtc_enable_protobuf=false use_rtti=true use_custom_libcxx=false treat_warnings_as_errors=false use_ozone=true'
$ gn gen out/mybuild-m79 --args='is_debug=true is_component_build=false is_clang=false rtc_include_tests=false rtc_use_h264=true rtc_enable_protobuf=false use_rtti=true use_custom_libcxx=false treat_warnings_as_errors=false use_ozone=true'
编译:
$ ninja -C out/mybuild-m79
编译结果:
find out/mybuild-m79/ -name "*.a" | wc -l
132
会发现132个 .a文件, 其中包含 libwebrtc.a
gclient sync 遇到的问题:
Failed to downloadhttps://commondatastorage.googleapis.com/chrome-linux-sysroot/toolchain/bcc994cc6e5d4d6f0eec8b44e7f0a65f5a1a7b90/debian_sid_amd64_sysroot.tar.xz
解决:
这个链接需要翻墙;
问题:
urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed
解决:
https://medium.com/@moreless/how-to-fix-python-ssl-certificate-verify-failed-97772d9dd14c
export PYTHONHTTPSVERIFY=0
或者在python脚本里边加入以下语句:
import ssl
ssl._create_default_https_context = ssl._create_unverified_context
问题:
gclient sync
Warning: Running gclient on Python 3.
If you encounter any issues, please file a bug on crbug.com under the Infra>SDK component.
Syncing projects: 32% (12/37) src/buildtools/third_party/libc++/trunk
src/third_party (ERROR)
----------------------------------------
[0:00:01] Started.
[0:00:01] Finished running: git config remote.origin.url
[0:00:01] Finished running: git rev-list -n 1 HEAD
[0:00:01] Finished running: git rev-parse --abbrev-ref=strict HEAD
----------------------------------------
Error: 6>
6> ____ src/third_party at 943906bccceea25a84c1bf8bc71550bf91dd8d89
6> You have unstaged changes.
6> Please commit, stash, or reset.
解决:
原因就是你改动了,src/third_party这个文件夹下面的文件,解决方法就是到
cd src/third_party
git status
根据git status 看看那些改动
然后 git add 相应的改动即可
问题:
depot_tools\download_from_google_storage.py
这个脚本下载文件失败;
解决:
直接让该脚本的main函数 return 0 即可, 即我们不下载相关内容, 因为我们编译webrtc 不需要这些, 这些依赖可能是编译 chrome 所需要的内容;