您现在的位置是:首页 >其他 >【webrtc】编译webrtc网站首页其他
【webrtc】编译webrtc
目录
编译webRTC
1.visual studio2019 commity安装
怎么表现出下面的东西来
右键更改,
2.安装depot_tools
3.安装ninja
https://blog.csdn.net/qq_36651243/article/details/115689930
4.设置一下网络
原文链接:https://blog.csdn.net/weixin_40425640/article/details/121945060
git config --global http.proxy 127.0.0.1:10809
git config --global https.proxy 127.0.0.1:10809
netsh winhttp set proxy 127.0.0.1:10809
set HTTP_PROXY=127.0.0.1:10809
set HTTPS_PROXY=127.0.0.1:10809
9不行设置8
如何取消,不取消后期拉公司代码拉不下来了
git config --global --unset https.proxy
git config --global --unset http.proxy
netsh winhttp reset proxy
5.glicent
6.拉代码
mkdir webrtc-source
cd webrtc-source
fetch --nohooks webrtc
gclient sync
set vs2019_install=D:Program Files (x86)Microsoft Visual Studio2019Community
# 如果是VS2017或者VS2022也是类似格式
# set vs2017_install=D:Program Files (x86)Microsoft Visual Studio2017Community
# set vs2022_install=D:Program Files (x86)Microsoft Visual Studio2022Community
set GYP_GENERATORS=msvs-ninja,ninja
set WINDOWSSDKDIR=D:Program Files (x86)Windows Kits10
# 告诉depot_tools使用我们本机的VS进行编译
set DEPOT_TOOLS_WIN_TOOLCHAIN=0
7.切到我们要的分支上
git checkout branch-heads/4606
//同步代码
gclient sync
8.编译
cd src
gn gen --ide=vs2019 out/DefaultEx --args="is_debug=false use_custom_libcxx=false proprietary_codecs=true rtc_use_h264=true ffmpeg_branding="Chrome""
ninja -C out/DefaultEx
一定要和上面一样的
如果报错NOMINMAX啥的,就找到那一行,把define NOMINMAX删掉
取消编译就是
gn clean out/Default
编译mediasoup
1.安装cmake
https://cmake.org/
安装方法:https://blog.csdn.net/GenuineMonster/article/details/120261628
2.编译libmediasoupclient
https://mediasoup.org/documentation/v3/libmediasoupclient/installation/
set GYP_MSVS_OVERRIDE_PATH=C:Program Files (x86)Microsoft Visual Studio2019Community
set GYP_MSVS_PATH=C:Program Files (x86)Microsoft Visual Studio2019CommunityMSBuildCurrentBin
set GYP_MSVS_VERSION=2019
cd F:05_projectrtn-sdk-windowslibmediasoupclient
//
cmake . -Bbuild -DLIBWEBRTC_INCLUDE_PATH:PATH=F:05_projectwebrtc-sourcesrc -DLIBWEBRTC_BINARY_PATH:PATH=F:05_projectwebrtc-sourcesrcoutDefaultExobj
注意不能在vsstudio自带的powershell下面执行cmake,要在cmd上执行
3.生成mediasoup
右键,生成。
F:05_projectrtn-sdk-windowslibmediasoupclientinclude
F:05_projectrtn-sdk-windowslibmediasoupclientdepslibsdptransforminclude
F:05_projectwebrtc-sourcesrc
F:05_projectwebrtc-sourcesrcthird_partyabseil-cpp
%(AdditionalIncludeDirectories)
%(PreprocessorDefinitions)
NDEBUG
WEBRTC_WIN
CMAKE_INTDIR="RelWithDebInfo"
3.1一些报错
1.catch (std::exception& e) 警告 C4101 “e”: 未引用的局部变量 ,删掉& e
2.非法标记
这些要挨个改,把std::max括起来(std::max)就可以了只括这些
3.
忽略掉就可以了
3.5 生成socketIO
要先下载openssl https://www.cnblogs.com/dingshaohua/p/12271280.html
用下面的方法
..include
E:downloadOpenSSL-Win64include
%(AdditionalIncludeDirectories)
..libsboost
..libssocket.io-client
E:downloadOpenSSL-Win64lib
%(AdditionalLibraryDirectories)
把编译好的结果给rtn-windos替换一下
RNMGlobalDefine.h Rtn-SocketIO-Module.h改动了这两个文件就需要替换,没改动就不需要替换
lib复制到RTN-SDK-WindowslibsRtn-SocketIO-Module
替换到RTN-SDK-WindowsincludeRtn-SocketIO-Module
3.6 生成sdptransform
F:05_projectrtn-sdk-windowslibmediasoupclientdepslibsdptransforminclude
%(AdditionalIncludeDirectories)
4.生成rtn-windows
..include
F:05_projectwebrtc-sourcesrc
F:05_projectwebrtc-sourcesrcthird_partyabseil-cpp
F:05_projectrtn-sdk-windowslibmediasoupclientinclude
F:05_projectrtn-sdk-windowslibmediasoupclientdepslibsdptransforminclude
F:05_projectwebrtc-sourcesrcthird_partylibyuvinclude
%(AdditionalIncludeDirectories)
F:05_projectrtn-sdk-windowslibmediasoupclientbuildRelWithDebInfo
F:05_projectwebrtc-sourcesrcoutDefaultExobj
..libsRtn-SocketIO-Module
F:05_projectrtn-sdk-windowslibmediasoupclientbuildlibsdptransformRelWithDebInfo
%(AdditionalLibraryDirectories)
crypt32.lib
secur32.lib
ws2_32.lib
dmoguids.lib
msdmo.lib
wmcodecdspuuid.lib
amstrmid.lib
strmiids.lib
mfuuid.lib
mf.lib
mfplat.lib
winmm.lib
d3d9.lib
d3d11.lib
dxgi.lib
dxva2.lib
Iphlpapi.lib
urlmon.lib
Rtn-SocketIO-Module.lib
webrtc.lib
sdptransform.lib
mediasoupclient.lib
version.lib
要下载一下clang-cl,直接在vstudio上搜索,然后把他下载好
然后生成
报错
这里的clang有问题要看后面输出的报错
都改成MT的
5.生成rtn-windows-demo
先安装qt.exe
安装qt-vsaddin-2019.vsix
https://blog.csdn.net/WindSunLike/article/details/103945051
配置qt-vsaddin-2019.vsix
https://blog.csdn.net/c_general/article/details/120385519
会出现QTDIR改不了的情况,找到对应的.user