Webrtcソースの取得とコンパイル
11973 ワード
1、svnをインストールせずに実行可能なバージョンをインストールする
2、depot_をダウンロードして構成するtools
保存depot_を作成toolsのディレクトリ、commandがそのディレクトリに入ります
svn co http://src.chromium.org/svn/trunk/tools/depot_tools
ダウンロードしてdepot_toolsディレクトリ
システム環境変数PATHに手動で追加
3、webrtcディレクトリeg.d:webrtcを作成する
4、cmdを開き、d:webrtcに入る
d:\webrtc> gclient
git,svn,pythonのようなツールのインストールを求めると、バックグラウンドでダウンロードし、最後に自動的に構成され、それぞれのネットワークによって時間が異なります.
d:\webrtc> gclient
インストールのヒントがなければいいのですが、gclientのパラメータの説明が表示されます.
5、作成.gclientファイル
d:\webrtc> gclient config http://webrtc.googlecode.com/svn/trunk
このときd:webrtcの下に1つのファイルが追加されました
6、webrtcコードと作業環境をダウンロードする
d:\webrtc>gclient sync
d:webrtctrunkフォルダを生成してファイルをゆっくりダウンロードすると、途中で切れてしまう可能性がありますので、何度も繰り返してください
7、生成
d:\webrtc>gclient runhooks
NOTE: The gclient sync command fetches dependencies and generates native build files for your environment using gyp (Windows: ninja/Visual Studio, OS X: ninja/XCode, Linux: ninja/make, Android: ninja). Ninja is the default build system for all platforms.
Select build system
You can directly specify which build system to use. This can be done if you don't want to use ninja. Set the GYP_GENERATORS environment variable to the string:
make for Makefiles
msvs for Visual Studio
xcode for Xcode
8、WindowsでVisual Studioエンジニアリングを生成したい場合は、システム環境変数にGYP_を加えるGENERATORS値がmsvs for Visual Studioの場合は、再度gclient runhooksでOKです.
これでVisual Studioエンジニアリングが生成されます.
Webrtcの原文:
http://www.webrtc.org/reference/getting-started
Before you start
First, be sure to install the prerequisite software.
The currently supported platforms are Windows, Mac OS X, Linux and Android.
Getting the code and building
Create a working directory, enter it, and run:
$ gclient config
http://webrtc.googlecode.com/svn/trunk
Android specific steps. *
Select build system (optional for all OSs except Android where ninja is mandatory). *
Starred (*) items are described in their own section below and should be performed, if at all, in place.
Notes
If you're a committer, substitute https for http.
On Windows, use gclient.bat instead (or prefix the commands by invoking python).
Android requires that you build on a Linux machine.
The gclient sync command fetches dependencies and generates native build files for your environment using gyp
(
Windows:
ninja/
Visual Studio,
OS X: ninja/XCode,
Linux: ninja/
make
, Android: ninja). Ninja
is the default build system for all platforms. It is possible to just generate new build files by calling:
Android Specific Steps
If building for Android these steps should be inlined above.
$
echo "target_os = ['android', 'unix']">> .gclient
$
gclient sync --nohooks
$
source ./build/android/envsetup.sh
$
JAVA_HOME=
Select build system
You can directly specify which build system to use. This can be done if you don't want to use ninja. Set the GYP_GENERATORS environment variable to the string:
make for Makefiles
msvs for Visual Studio
xcode for Xcode
Note, when the build environment is set to generate Visual Studio project files, gyp will by default, generate a project for the
latest version of Visual Studio installed on your computer. It is possible to
specify the desired Visual Studio version as described below:
Set environment variable
run the following gyp command from
the trunk/directory (this replaces
gclient runhooks
):
$ build/gyp_chromium --depth=. -G msvs_version= all.gyp
is on the form
YYYY
.
Building
Binaries are by default (i.e. when building with ninja) generated in
for debug and release builds respectively.
With ninja
Debug:
2、depot_をダウンロードして構成するtools
保存depot_を作成toolsのディレクトリ、commandがそのディレクトリに入ります
svn co http://src.chromium.org/svn/trunk/tools/depot_tools
ダウンロードしてdepot_toolsディレクトリ
システム環境変数PATHに手動で追加
3、webrtcディレクトリeg.d:webrtcを作成する
4、cmdを開き、d:webrtcに入る
d:\webrtc> gclient
git,svn,pythonのようなツールのインストールを求めると、バックグラウンドでダウンロードし、最後に自動的に構成され、それぞれのネットワークによって時間が異なります.
d:\webrtc> gclient
インストールのヒントがなければいいのですが、gclientのパラメータの説明が表示されます.
5、作成.gclientファイル
d:\webrtc> gclient config http://webrtc.googlecode.com/svn/trunk
このときd:webrtcの下に1つのファイルが追加されました
6、webrtcコードと作業環境をダウンロードする
d:\webrtc>gclient sync
d:webrtctrunkフォルダを生成してファイルをゆっくりダウンロードすると、途中で切れてしまう可能性がありますので、何度も繰り返してください
7、生成
d:\webrtc>gclient runhooks
NOTE: The gclient sync command fetches dependencies and generates native build files for your environment using gyp (Windows: ninja/Visual Studio, OS X: ninja/XCode, Linux: ninja/make, Android: ninja). Ninja is the default build system for all platforms.
Select build system
You can directly specify which build system to use. This can be done if you don't want to use ninja. Set the GYP_GENERATORS environment variable to the string:
make for Makefiles
msvs for Visual Studio
xcode for Xcode
8、WindowsでVisual Studioエンジニアリングを生成したい場合は、システム環境変数にGYP_を加えるGENERATORS値がmsvs for Visual Studioの場合は、再度gclient runhooksでOKです.
これでVisual Studioエンジニアリングが生成されます.
Webrtcの原文:
http://www.webrtc.org/reference/getting-started
Before you start
First, be sure to install the prerequisite software.
The currently supported platforms are Windows, Mac OS X, Linux and Android.
Getting the code and building
Create a working directory, enter it, and run:
$ gclient config
http://webrtc.googlecode.com/svn/trunk
Android specific steps. *
Select build system (optional for all OSs except Android where ninja is mandatory). *
$ gclient sync --force
Starred (*) items are described in their own section below and should be performed, if at all, in place.
Notes
If you're a committer, substitute https for http.
On Windows, use gclient.bat instead (or prefix the commands by invoking python).
Android requires that you build on a Linux machine.
The gclient sync command fetches dependencies and generates native build files for your environment using gyp
(
Windows:
ninja/
Visual Studio,
OS X: ninja/XCode,
Linux: ninja/
make
, Android: ninja). Ninja
is the default build system for all platforms. It is possible to just generate new build files by calling:
$ gclient runhooks --force
Android Specific Steps
If building for Android these steps should be inlined above.
$
echo "target_os = ['android', 'unix']">> .gclient
$
gclient sync --nohooks
$
source ./build/android/envsetup.sh
$
JAVA_HOME=
Select build system
You can directly specify which build system to use. This can be done if you don't want to use ninja. Set the GYP_GENERATORS environment variable to the string:
make for Makefiles
msvs for Visual Studio
xcode for Xcode
Note, when the build environment is set to generate Visual Studio project files, gyp will by default, generate a project for the
latest version of Visual Studio installed on your computer. It is possible to
specify the desired Visual Studio version as described below:
Set environment variable
GYP_MSVS_VERSION=<version>
before runhooks or manually run the following gyp command from
the trunk/directory (this replaces
gclient runhooks
):
$ build/gyp_chromium --depth=. -G msvs_version=
YYYY
.
Building
Binaries are by default (i.e. when building with ninja) generated in
out/Debug/ and out/Release
for debug and release builds respectively.
With ninja
$ cd trunk
Debug:
$ ninja -C out/Debug
Release:
$ ninja -C out/Release
With Visual Studio
Use Visual Studio to open and build the trunk/all.sln solution file.
Example Applications
WebRTC contains several example applications which can be found under trunk/webrtc/examples and trunk/talk/examples. Higher level applications are listed first.
AppRTCDemo (Android application using WebRTC Native APIs via JNI)
The JNI wrapper is documented here. AppRTCDemo is documented here.
Peerconnection (Application using WebRTC Native APIs)
Peerconnection consist of two applications. A server application,
peerconnection_server
, and a client application,
peerconnection_client
.
Note that we currently don't support peerconnection_client for Mac and Android.
The client application has simple voice and video capabilities. The server enables client applications to initiate a call between clients by managing signaling messages generated by the clients.
Setting up P2P calls between peerconnection_clients
Start
peerconnection_server
. You should see the following message indicating that it is running:
Server listening on port 8888
Start any number of
peerconnection_client
s and connect them to the server. The client UI consists of a few parts:
Connecting to a server: when the application is started you must specify which machine (IP-address) the server application is running on. Once that is done you can press "Connect" or the return button.
Select a peer: once successfully connected to a server
you can connect to a peer by
double clicking or select+press return on a peer's name.
Video chat: when a peer has been successfully connected to, a Video chat will be displayed in full window.
Ending chat session: press Esc. You will now be back to selecting a peer.
Ending connection: press Esc and you will now be able to select which server to connect to.
Testing peerconnection_server
Start an instance of peerconnection_server application.
Open
trunk/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 (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.
Further, y
ou can specify input and output RTP dump for voice and video. It
provides two samples of input RTP dump: voice.rtpdump which contains a stream of single channel, 16Khz
voice encoded with G722, and video.rtpdump which contains a 320x240 video encoded with H264
AVC at 30 frames per second. The provided samples will inter-operate with
Google Talk Video. If you use other input RTP dump, you may need to change the
codecs in call_main.cc (lines 215 - 222).
WebRTCDemo (Android application using media engines)
This app does not use WebRTC native APIs. It can send and receive media streams if manually connected to another WebRTCDemo that is directly accessible (e.g. firewalls might prevent you from establishing a connection). Further it allows setting, enabling and disabling audio and video processing functionality (e.g. echo cancellation, NACK, audio codec and video codec).
Relay server (specialized server application that can be used with Call)
Target name
relayserver
. Relays traffic when a direct peer-to-peer connection can't
be established.
Stun server
Target name
stunserver
.
Implements the STUN protocol for Session Traversal
Utilities for NAT as documented in rfc5389.
Turn server
Target name
turnserver
. In active development to reach compatibility with rfc5766.