WebRTC

Development


The currently supported platforms are Windows, Mac OS X, Linux, Android and iOS. See the Android and iOS pages for build instructions and example applications specific to these mobile platforms.

Get the code

源代码地址: https://webrtc.googlesource.com/src.git

获取代码与chromium类似,都要设置代理,配置git,depot_tools等,下面只标识不一样的地方。

有关代理,depot_tools等前置设置请参考获取和编译chromium代码

$ mkdir webrtc
$ cd webrtc
$ fetch --nohooks webrtc

# git
$ git config branch.autosetupmerge always
$ git config branch.autosetuprebase always

$ cd src
# Chromium 103.0.5060.134
$ git checkout -b M103 refs/remotes/branch-heads/5060
$ gclient sync

$ gn gen out/Default
$ gn gen out/Default --args='is_debug=false'
$ gn clean out/Default
$ ninja -C out/Default
$ ninja all -C out/Default

Check out and the build code

Release notes

从 2019 年 12 月 2 日开始,WebRTC 从M80版本开始,不再以M80命令分支名称,而是与 Chromium 的分支名称匹配。比如 WebRTC M80 匹配 Chromium 80.0.3987.xxx,所在分支为 refs/branch-heads/3987

Chromium Active Branches

Peerconnection

使用 WebRTC Native API 的应用程序。客户端peerconnection_client应用程序具有简单的语音和视频功能。服务端peerconnection_server通过管理客户端生成的信令消息,使客户端应用程序能够发起客户端之间的呼叫。

Call

目标名称 call(当前禁用)。使用 libjingle 建立的调用应用程序。Call 使用 xmpp(与 WebRTC 使用的 SDP 不同)允许您使用您的 gmail 帐户登录并与您的 gmail 朋友进行音频/视频通话。它建立在 libjingle 之上以提供此功能。

此外,您可以为语音和视频指定输入和输出 RTP 转储。它提供了两个输入 RTP 转储样本:包含单通道、使用 G722 编码的 16Khz 语音流的voice.rtpdump,以及包含使用 H264 AVC 以每秒 30 帧编码的 320x240 视频流 video.rtpdump。提供的示例将与 Google Talk Video 互操作。如果您使用其他输入 RTP 转储,您可能需要在call_main.cc(第 215-222 行)中更改编解码器。

Relay Server

目标名称 relayserver。在无法建立直接对等连接时中继流量。可以与上面的通话应用程序一起使用。

STUN Server

目标名称 stunserver。为RFC 5389中记录的 NAT 会话遍历实用程序实现 STUN 协议。

TURN Server

目标名称 turnserver。用于单元测试。

参考资料