在AR云渲染服务中,尝试玩转webrtc的编译

1、depot_tools下载

下载depot_tools.zip并解压,将解压后的depot_tools文件夹路径加入到系统环境变量

        git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git

管理员方式运行cmd运行

2、cmd中设置代理的方法为:

set http_proxy=http://10.34.192.82:808

set https_proxy=http://10.34.192.82:808

git config --global http.proxy http://10.34.192.82:808

git config --global https.proxy http://10.34.192.82:808

但是,我设置之后,依然在下载cpid的时候报错,看起来是访问这个地址chrome-infra-packages.appspot.com的时候没有走代理

,撸一下代码, 有一个脚本cipd_impl.ps1,找到下载cpid的代码,在$wc = (New-Object System.Net.WebClient)前面增加上设置代理的代码

  $proxy = (New-Object System.Net.WebProxy)

  $proxy.Address = "http://10.34.192.82:808"

  $proxy.useDefaultCredentials = $true

  $wc = (New-Object System.Net.WebClient)

  $wc.proxy = $proxy

  $wc.Headers.Add("User-Agent", $UserAgent)

3、拉取代码

set WINDOWSSDKDIR=C:\Program Files (x86)\Windows Kits\10

set DEPOT_TOOLS_WIN_TOOLCHAIN=0

set DEPOT_TOOLS_UPDATE=0

set GYP_MSVS_VERSION=2019

set GYP_MSVS_OVERRIDE_PATH=C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise

set GYP_GENERATORS=msvs-ninja,ninja

fetch --nohooks webrtc

gclient sync

剩下就是漫长的等待

4、编译

生成VS2019工程文件:

cd src

gn gen --ide=vs out/Default

可以在src\out\Default\ 下得到 all.sln解决方案文件。

如果不想使用默认编译参数,可以使用gn args out/Default --list查看当前编译参数,通过类似如下方式设置:

gn gen --ide=vs out/h264Debug --args="proprietary_codecs=true rtc_use_h264=true ffmpeg_branding=\"Chrome\" is_debug=true rtc_include_tests=false"

ninja -C out/h264Debug

5、FAQ:

[P5948 10:03:46.035 fs.go:531 W] fs: giving up trying to rename("D:\\depot_tools\\bootstrap-3_8_0_chromium_8_bin\\.cipd\\pkgs\\0\\F_E3fZLLqQZJ", "D:\\depot_tools\\bootstrap-3_8_0_chromium_8_bin\\.cipd\\pkgs\\0\\FT1KzTGakKWeUreqsiJRsxZtcTcPC7PUVSIIOPm08VgC") - Access is denied.

[P5948 10:03:46.035 fs.go:449 W] fs: failed to rename directory "D:\\depot_tools\\bootstrap-3_8_0_chromium_8_bin\\.cipd\\pkgs\\0\\F_E3fZLLqQZJ" - Access is denied.

[P5948 10:03:46.047 client.go:1711 E] Failed to install infra/3pp/tools/git/windows-amd64:FT1KzTGakKWeUreqsiJRsxZtcTcPC7PUVSIIOPm08VgC - Access is denied.

 

解决方法:

进入depot_tools\bootstrap-3_8_0_chromium_8_bin目录,找到.cipd文件夹,右键选中—>属性—>安全,选中你当前的登陆用户,然后点击编辑,把修改权限勾选上。

6、参考文献:

https://blog.csdn.net/gupar/article/details/78565677

https://webrtc.org.cn/mirror/

https://blog.csdn.net/freeabc/article/details/106451174

https://webrtc.org/native-code/development/

https://chromium.googlesource.com/chromium/src/+/master/docs/windows_build_instructions.md

https://blog.jianchihu.net/windows-webrtc-build.html

 

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

XR风云

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值