編譯過程參考:
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
設(shè)置編譯選項:
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
編譯結(jié)果:
find out/mybuild-m79/? -name "*.a" | wc -l
132
會發(fā)現(xiàn)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
根據(jù)git status 看看那些改動
然后 git add 相應(yīng)的改動即可
問題:
depot_tools\download_from_google_storage.py
這個腳本下載文件失敗;
解決:
直接讓該腳本的main函數(shù) return? 0 即可,? 即我們不下載相關(guān)內(nèi)容,? 因為我們編譯webrtc 不需要這些, 這些依賴可能是編譯 chrome 所需要的內(nèi)容;