Webrtc 探究(一): Android编译

  1. 直接想看webrtc的源码,苦于FQ能力有限且一切编译进程耗时巨大,故求助于互连网。在互联网搜寻许久编译好的Webrtc源码,好多版本下载下来总是报种种不当,相当优伤。
  2. 百二秦关终属楚,终于寻得一版可用的Web路虎极光tc源码。具体从哪个网站找的早已记不起来了,不过依然感激分享者。
  3. 共享给我们: 链接:
    密码: u37i
  4. 总结说一下:共享文件中三个文本,第三个depot_tools解压缩,然后添加到环境变量。然后解压缩开端编译webrtc代码
  5. 说下自家的编译环境:vs2016
  6. 图片 1
  7. 图片 2

  8. 时间不早了,下一步要从头探究源码了。开始安顿从PeerConnectionClient和server
    demo跑起。

前言

webrtc是谷歌(Google)收购并开源的壹个支撑实时音录制对话的技巧。
官网是:https://webrtc.org

OK,介绍就那样多。

编译最新版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

上图哈:

图片 3

注:
1.depot_tools的应用参考:
2.webrtc官方源码小编copy到github上了:
3.webrtc编译好的整整项目自身传到百度云了: (注:由于刚(yú gāng )压缩幸而上传中,有10多G,请稍等,等上传完结后再下载)

 

———————— 2014-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:\path\to\depot_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 源码编译需求自备梯子.

有备无患干活

即使不打算修改webrtc相关源码,指出不要去折腾编译这几个源码工程。
直白引用已经编译好的中心库(Maven或然Gradle):

认准官方渠道:(只示例Gradle方式的)

compile 'org.webrtc:google-webrtc:1.0.+'   // + 可以换成对应版本号

有关版本可以在
https://bintray.com/google/webrtc/google-webrtc
那里询问,这些相应会频频更新。
PS:+替换的本子号一定要去地点网址里面查询是还是不是存在该版本。

有历史的民间渠道:

compile 'io.pristine:libjingle:11139@aar'

相关版本可以在
http://mvnrepository.com/artifact/io.pristine/libjingle
举办询问,当初革新挺频仍,近期两三年没更新了,权当个驰念吧。

收获源码

源码下载

若果想修改源码,恭喜您,你需要协调编译源码。
webrtc编译说起来,编译既费力又简便;困难在源码规模太大,国内同步代码频繁出题目,简单在于谷歌(Google)早已将混乱的编译进程整合成简单明了的编译脚本命令。
强调一点:下边的编译操作是基于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

贰 、下载项目源码

壹 、准备干活
钦命多少个职分存放webrtc源码,越发必要注意的是现阶段硬盘存储空间须求不少于20GB。

mkdir webrtc
cd webrtc

② 、代码同步

fetch --nohooks webrtc_android
gclient sync

本条几乎会15-20GB的文件须要下载(版本持续迭代),同步速度取决于你的VPN给不给力。
三 、正视环境布署(编译环境只必要进行四回)

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

当源码下载完备后,执行环境布署脚本,会帮您检测并设置编译所急需的正视库和工具。

安装 depot_tools

depot_tools是个工具包,里面富含gclient、gcl、gn和ninja等工具。其中gclient是代码获取工具,它实际上是运用了svn和Git.

//todo install
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
修改 ~/.zshrc
export PATH=$PATH:~/work/depot_tools/depot_tools

发表评论

电子邮件地址不会被公开。 必填项已用*标注