zoukankan      html  css  js  c++  java
  • webrtc windows编译+vs2017

    1、 下载depot-tools

    下载depot-tools之后解压,把解压目录设置到环境变量里面 (PATH)

    2、 安装vs2017

    至少需要包含以下模块:

    安装完VS2017后,必须安装SDK调试工具。打开控制面板->程序与功能,找到刚才安装的Windows Software Development Kit,鼠标右键->change。

    image-20191211110241971

    3、源码编译

    打开cmd设置临时环境变量:

    set GYP_MSVS_VERSION=2017
    set GYP_MSVS_OVERRIDE_PATH=D:Program Files (x86)Microsoft Visual Studio2017Professional 
    set GYP_GENERATORS=msvs-ninja,ninja
    set WINDOWSSDKDIR=D:Windows Kits10 #vs不在C盘
    set DEPOT_TOOLS_WIN_TOOLCHAIN=0  也可以直接设置环境变量,告诉depot_tools使用我们本机的VS进行编译。
    

    然后执行:

    mkdir webrtc-checkout
    cd webrtc-checkout
    fetch --nohooks webrtc #获取代码,需要VPN
    gclient sync
    

    当代码获取完成后,cd到源码目录,继续输入指令来生成解决方案 (default)

    cd src
    gn gen out/Default --ide=vs2017
    ninja -C out/Default
    

    编译支持h264:

    gn gen  out/Debug_h264_ffmpeg --args="is_component_build=false rtc_use_h264=true proprietary_codecs=true is_component_ffmpeg=true ffmpeg_branding="Chrome"" --ide=vs2017
    ninja -C out/Debug_h264_ffmpeg
    
    gn gen  out/Debug_h264 --args="is_component_build=false rtc_use_h264=true proprietary_codecs=true ffmpeg_branding="Chrome"" --ide=vs2017
    ninja -C out/Debug_h264
    
    is_debug 是否是Debug版,默认true,false:表示编译Release版。
    target_os 平台类型,可以取值win、android、ios、linux等,这里取win,表示Windows平台。
    target_cpu cpu类型,Windows下可以取x86、x64
    is_component_build 是否使用动态运行期库,这里取false,使用静态运行期库,Release版本将对应MT,Debug版将对应MTd。
    proprietary_codecs 是否使用版权编码,也就是H264,这里取true。
    rtc_use_h264 是否使用H264,这里取true,注意Windows平台编码使用OpenH264,解码使用ffmpeg。
    ffmpeg_branding ffmpeg的分支名,这里采用Chrome的分支。
    rtc_build_ssl 是否编译BoringSSL,这里取false,因为后面我们要替换成OpenSSL。
    rtc_ssl_root OpenSSL的头文件路径,会被写到生成的ninja文件中。

    gn help args可以查看args的帮助文件

    gn args out/Debug_h264可以得到指定编译输出目录下的args配置文件

  • 相关阅读:
    【剑指offer】数组中重复的数字
    【剑指offer】数组中只出现一次的数字
    【linux】进程存储管理
    【linux】gdb调试
    【C/C++】快速排序的两种实现思路
    【C/C++】知识点
    【计算机网络】知识点记录
    【hadoop】mapreduce原理总结
    基于社交网络的情绪化分析IV
    Android studio 升级,不用下载完整版,完美更新到2.0
  • 原文地址:https://www.cnblogs.com/bloglearning/p/12021001.html
Copyright © 2011-2022 走看看