【bob体育app】WebRtc编译好的vs2015源码

2019-12-04 18:59栏目:bob体育app
TAG:

  1. 一直想看webrtc的源码,苦于FQ能力有限且整个编译过程耗时巨大,故求助于互联网。在互联网寻找许久编译好的Webrtc源码,好多版本下载下来总是报各种错误,很是失落。
  2. 皇天不负有心人,终于寻得一版可用的WebRtc源码。具体从哪个网站找的已经记不起来了,不过还是感谢分享者。
  3. 共享给大家: 链接: 密码: u37i
  4. 简单说一下:共享文件中两个文件,第一个depot_tools解压缩,然后添加到环境变量。然后解压缩开始编译webrtc代码
  5. 说下我的编译环境:vs2015
  6. bob体育app 1
  7. bob体育app 2
  8. 嗯 时间不早了,下一步要开始研究源码了。初步计划从PeerConnectionClient和server demo跑起。

项目结构

由于生成的gradle工程的源码并不是放在一个位置,而且分散在webrtc各个文件夹中,可以将各个对应文件夹下的源码文件整合到一起。
java源码目录如下:

#android端demo工程源码
examples/androidapp/src  
#lib源码
modules/audio_device/android/java/src  
base/android/java/src  
rtc_base/java/src  
sdk/android/api 
sdk/android/src/java 
#so库,位于编译目录下
libjingle_peerconnection_so.so

PS:可以自己通过gradle文件的依赖分析查看源码文件夹的引用路径。

编译最新版webrtc源码和编译好的整个项目10多个G【分享】

 

参考编译最新版webrtc源码:

Git clone 

gclient config  --name=src

set DEPOT_TOOLS_WIN_TOOLCHAIN=0
set GYP_MSVS_VERSION=2015
set GYP_GENERATORS=ninja,msvs-ninja
gclient sync
cd src
Python webrtc/build/gyp_webrtc.py

上图哈:

bob体育app 3

注:
1.depot_tools的使用参考:
2.webrtc官方源码我copy到github上了:
3.webrtc编译好的整个项目我传到百度云了: (注:由于刚压缩好在上传中,有10多G,请稍等,等上传完成后再下载)

 

------------------------ 2016-9-29加入安装depot_tools说明(红色字体:python和其他工具会在运行gclinet时自己下载安装) -----------------------------------------

Install depot_tools

Chromium and Chromium OS use a package of scripts called depot_tools to manage checkouts and code reviews.  
The depot_tools package includes gclientgclgit-clrepo, and others.

Installing on Linux and Mac

  1. Confirm git and python are installed. git 2.2.1+ recommended. python 2.7+ recommended.

  2. Fetch depot_tools: 
    $ git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
  3. Add depot_tools to your PATH:
    $ export PATH=`pwd`/depot_tools:"$PATH"

    • Yes, you want to put depot_tools ahead of everything else, otherwise gcl will refer to the GNU Common Lisp compiler.
    • You may want to add this to your .bashrc file or your shell's equivalent so that you don’t need to reset your $PATH manually each time you open a new shell.

Installing on Windows

Preamble

Chromium is mostly designed to be run using the native Windows tools and the Msys (Git for Windows) toolchain. Cygwin is not recommended, and likely things will fail in cryptic ways.

Instructions

  1. Download depot_tools.zip and decompress it.
  • Do not use drag-n-drop or copy-n-paste extract from Explorer, this will not extract the hidden ".git" folder which is necessary for depot_tools to autoupdate itself. You can use "Extract all..." from the context menu though.
  • Do not extract to a path containing spaces. If you do, gclient will produce the error "update_depot_tools.bat was not expected at this time" or similar.
Add depot_tools to the start (not end!) of your PATH: With Administrator access:
  • Control Panel > System and Security > System > Advanced system settings
  • Modify the PATH system variable to include depot_tools
Without Administrator access:
  • Control Panel > User Accounts > User Accounts > Change my environment variables
  • Add a PATH user variable: C:pathtodepot_tools;%PATH%
Run gclient from the cmd shell. The first time it is run, it will install its own copy of various tools. If you run gclient from a non-cmd shell, it may appear to run properly, but python, and other tools may not get installed correctly (while it should work fine from a msys bash shell, you may still trip over bugs from time to time).
  • If you see strange errors with the file system on the first run of gclient, you may want to disable Windows Indexing.
  • If you see errors like "The system cannot execute the specified program", try installing "Microsoft Visual C++ 2008 Redistributable Package".
  • If it complains that it can't find python, make sure you don't already have a .gclient file in the same directory.
  • After running gclient open a command prompt and type where python and confirm that the depot_tools python.bat comes ahead of any copies of python.exe. Failing to ensure this can lead to overbuilding when using gn - see crbug.com/611087

See also Howto: depot tools

------------------------2016-9-29加入安装depot_tools说明-----------------------------------------

源码下载

如果想修改源码,恭喜你,你需要自己编译源码。
webrtc编译说起来,编译既困难又简单;困难在源码规模太大,国内同步代码频繁出问题,简单在于谷歌已经将繁杂的编译过程整合成简单明了的编译脚本命令。
强调一点:下面的编译操作是基于Linux环境。

一、安装编译依赖环境
webrtc的编译环境依赖于谷歌的编译环境,也就是 depot_tools。
很简单,就一个clone源码到本地

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

这里需要设置环境变量

export PATH=$PATH:/path/depot_tools  #在当前环境变量追加路径

注意:path是你depot_tools文件夹所在的地址,需要替换为正确的路径。

测试环境变量是否配置成功:

which gn 或者 which gclient  #which指令会在环境变量设置的目录里查找执行文件

如果输出了前面配置的depot_tools文件夹地址,则是配置成功!

官网参考:http://commondatastorage.googleapis.com/chrome-infra-docs/flat/depot_tools/docs/html/depot_tools_tutorial.html#_setting_up

二、下载项目源码

1、准备工作
指定一个位置存放webrtc源码,特别需要注意的是当前硬盘存储空间需要不少于20GB。

mkdir webrtc
cd webrtc

2、代码同步

fetch --nohooks webrtc_android
gclient sync

这个大概会15-20GB的文件需要下载(版本持续迭代),同步速度取决于你的VPN给不给力。
3、依赖环境配置(编译环境只需要执行一次)

cd src
./build/install-build-deps.sh

当源码下载完备后,执行环境配置脚本,会帮你检测并安装编译所需要的依赖库和工具。

版权声明:本文由bob体育app发布于bob体育app,转载请注明出处:【bob体育app】WebRtc编译好的vs2015源码