Webrtc 探究(一): Android编写翻译

作者:杏彩
  1. 直接想看webrtc的源码,苦于FQ工玉环易且全数编写翻译进程耗费时间巨大,故求助于网络。在网络搜索许久编译好的Webrtc源码,相当多本子下载下来总是报各样不当,十分颓唐。
  2. 只要武术深铁杵磨成针,终于寻得一版可用的Web凯雷德tc源码。具体从哪些网址找的早已记不起来了,可是照旧感激分享者。
  3. 分享给大家: 链接: 密码: u37i
  4. 轻巧易行说一下:分享文件中七个文本,第二个depot_tools解压缩,然后增加随地境变量。然后解压缩伊始编写翻译webrtc代码
  5. 说下本人的编译情状:vs2015
  6. 图片 1
  7. 图片 2
  8. 嗯 时间不早了,下一步要起来商讨源码了。初步布署从PeerConnectionClient和server demo跑起。

Release版本

鉴于webrtc是不停在master分支开拓的,所以大家三遍开拓webrtc最棒基于牢固的release版本。
查找库上的release版本

git branch -r

接下来checkout到相应的release版本

git checkout -b my_branch branch-heads/66  #切换到M66版本
gclient sync  #同步对应版本的代码

问题1:
假使寻找不到对应的release版本,那只怕是本地源码历史太久远了(二〇一五-3-24从前的本子)
亟待实施

gclient sync --with_branch_heads
git fetch origin

下一场查看 .git/config

fetch = +refs/branch-heads/*:refs/remotes/branch-heads/*

则消除难题。

问题2:
一经checkout了比较早的本子,比方branch-heads/5* 版本
试行 gclient sync 会报联手错误
是因为 depot_tools 的源码太新,导致与webrtc源码不相配,能够将 depot_tools 工程复苏到与 webrtc指标release版本附前段时间期的工程源码来张开共同编写翻译。

编写翻译最新版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编写翻译好的全体项目自个儿传到百度云了: (注:由Yu Gang压缩还好上传中,有10多G,请稍等,等上传完毕后再下载)

 

------------------------ 二〇一五-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说明-----------------------------------------

本子编写翻译

一、编写翻译参数钦定

gn gen out/build --args='target_os="android" target_cpu="arm" is_debug=false'

out/build : 编写翻译生成文件的目录,随便钦赐
target_os : 编写翻译目的平台 android ios 等
target_cpu : CPU架构平台 arm arm64 x86 x64等
is_debug : Release形式恐怕Debug情势

二、试行编写翻译
由于是全量编写翻译,所以时间有个别有一些长,看机器品质。

ninja -C out/build

生成Gradle项目文件

build/android/gradle/generate_gradle.py --output-directory $PWD/out/build 
--target "//examples:AppRTCMobile" --use-gradle-process-resources 
--split-projects --canary

实施达成,可以在out/build/目录下会转换三个gradle的公文夹,使用Android studio该gradle目录就可以运营demo工程。

本文由杏彩发布,转载请注明来源

关键词: