1, 下载TortoiseSVN工具
http://sourceforge.net/projects/tortoisesvn/
2,下载msysgit 选择一个版本安装
http://code.google.com/p/msysgit/downloads/list
把msysgit的bin目录手动添加到系统环境变量PATH中
3,下载Tortoisegit
http://code.google.com/p/tortoisegit/downloads/list
4,下载安装python,根据实际需求选择实际的Python版本。
如果下载的是绿色版Python,需要把Python的执行目录添加到系统环境变量PATH中。
5,下载并配置depot_tools
linux系统需要使用 “svn co http://src.chromium.org/svn/trunk/tools/depot_tools ”命令;
windows可以直接使用svn checkout到一个相应的目录。
下载完成后,然后把depot_tools的目录添加到系统环境变量PATH中去
6,下载webrtc源码
找个比较大的系统盘,新建一个目录,右键目录选择 Git Bash命令会弹出一个dos命令框
6.1 ,下载webrtc源码, 输入 svn checkout http://webrtc.googlecode.com/svn/trunk (这个很快会下完)
6.2,下载webrtc会调用到的第三方库源码 gclient config https://webrtc.googlecode.com/svn/trunk (这个会下很久,搞不好还下不下来,建议翻墙或者vpn下载)
6.3,同步google项目文件,获取最新工程 gclient sync --force
需要生成vs工程的,可以先设置GYP_MSVS_VERSION=2010 值为VS版本 我是用的VS2010 如果不设置 会自动检测。
6.4,下载安装SDK 7.1和directx
SDK 7.1:
http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=8279
DirectX SDK:
http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=6812
6.5,生成各平台相关的项目文件 gclient runhooks --force
基本上大功告成了,祝你好运!
参考: http://www.webrtcbbs.com/forum.php?mod=viewthread&tid=115&extra=page%3D1
http://blog.csdn.net/temotemo/article/details/7056581
附webrtc官网原话:
Before you start
Depot Tools
Linux (Ubuntu/Debian)
This, and more, is described on the Chromium site:
A script is provided for Ubuntu, which is available after your first gclient sync:
./build/install-build-deps.sh
Pulse Audio is missing from the script. On Ubuntu, this is provided by the libpulse-dev package.
Although the install-build-deps.sh script is the recommended method, it will install much more than you need. Here is a (hopefully complete) minimal list of packages to install (sudo apt-get install...): g++ (>= 4.2)
python (>= 2.4)
libnss3-dev >= 3.12
libasound2-dev
libpulse-dev
libjpeg62-dev
libxv-dev
libgtk2.0-dev
libexpat1-dev
To create 32-bit builds for Linux on a 64-bit system (not needed or Android builds):
lib32asound2-dev
lib32z1
lib32ncurses5
lib32bz2-1.0
Tips for other distributions are available on the Chromium page.
Windows
Follow Chromium's build instructions at:
http://www.chromium.org/developers/how-tos/build-instructions-windows.
OS X
XCode 3.0 or higher
|
Getting the code
- If you're on Linux and have OpenJDK 7 installed in another location than Ubuntu's default:
export
JAVA_HOME=<location of OpenJDK 7>
- On Windows: launch a command prompt as Administrator.
- Create a working directory, enter it, and run
fetch webrtc
:
mkdir webrtc-checkout
cd webrtc-checkout
gclient sync
f
etch --nohooks webrtc
This will take a long time because it downloads the whole Chromium repository and dependencies which are several gigabytes. Do not interrupt this step or you may need to start all over agan (a newgclient sync
may be enough but you might also need to start over cleanly). - Optionally you can specify how new branches should be tracked:
git config branch.autosetupmerge always
git config branch.autosetuprebase always
- Alternatively, you can create new local branches like this (recommended):
cd src
git checkout master
git new-branch your-branch-name
Updating the code
git pull
git pull
won't work, and you'll need to use
git fetch
instead.
gclient sync
gclient runhooks
). Ninja is the default build system for all platforms. It is possible to just generate new build files by calling:
python webrtc/build/gyp_webrtc
gclient runhooks
step.
Building
out/Debug andout/Release
for debug and release builds respectively.
See
Android
and
iOS
for build instructions specific to those platforms
.
With Ninja
out
folder), run
python webrtc/build/gyp_webrtc
Then compile with (standing in
src/
):
ninja -C out/Debug
Release:
ninja -C out/Release
Using another build system
Other build systems are not fully supported (and may fail), such as Visual Studio on Win or Xcode on OSX. GYP supports a hybrid approach of using ninja for building, but VS/Xcode for editing and driving compilation. Set the GYP_GENERATORS environment variable to the string:
ninja,msvs-ninja
for Visual Studio project building with ninjaninja,xcode-ninja
for Xcode
GYP_MSVS_VERSION=<version>
before runhooks or manually
run the following gyp command from
the src/ directory (this replaces
gclient runhooks
):
python webrtc/build/gyp_webrtc -G msvs_version=<version>
src/all.sln
solution file
Working with Release Branches
git branch -r
cd /path/to/webrtc/src
gclient sync --with_branch_heads
git fetch origin
[remote "origin"]
in.git/config
:
fetch = +refs/branch-heads/*:refs/remotes/branch-heads/*
git checkout -b my_branch refs/remotes/branch-heads/43
Contributing Patches
Committing Code
From March 24, 2015, the source of truth is the Git repository at https://chromium.googlesource.com/external/webrtc. To be able to push commits to it, you need to perform the steps below.
- Go to https://chromium.googlesource.com/new-password and login with your webrtc.org account.
- Follow the instructions on how to store the credentials in the .gitcookies file in your home directory.
- Go to https://chromium-review.googlesource.com and login with your webrtc.org account. This will create the user in the Gerrit permission system so it can be added to the right committers group.
- Make sure you have set the
user.name
anduser.email
Git config settings as specified at thedepot tools setup page. If you're also a Chromium committer: also read the next section.
git cl land
--bypass-hooks
flag.
Chromium committers
Many WebRTC committers are also Chromium committers. To make sure to use the right account for pushing commits to WebRTC, use theuser.email
Git config setting. The recommended way is to have the chromium.org account set globally as described at the
depot tools setup page and then set
user.email
locally for the WebRTC repos using (change to your webrtc.org address):
cd /path/to/webrtc/src
git config user.email yourname@webrtc.org
Example Applications
- A server application, with target name peerconnection_server
- A client application, with target name peerconnection_client(not currently supported on Mac/Android)
Setting up P2P calls between peerconnection_clients
Testing peerconnection_server
Open
src/talk/examples/peerconnection/server/server_test.html
in your browser. Click connect. Observe that the peerconnection_server announces your connection. Open one more tab using the same page. Connect it too (with a different name). It is now possible to exchange messages between the connected peers.
Call app
call
(currently disabled). A
n application that establishes a call using libjingle.
Call uses xmpp (as opposed to SDP used by WebRTC) to allow you to
login using your gmail account
and make audio/video calls with your gmail friends
. It is built on top of libjingle to provide this functionality.
Relay server
relayserver
. Relays traffic when a direct peer-to-peer connection can't
be established. Can be used with thecall
application above.
Stun server
stunserver
.
Implements the STUN protocol for Session Traversal
Utilities for NAT as documented in rfc5389.
Turn server
turnserver
. In active development to reach compatibility with rfc5766.