WebRTC 源码分析

Abstract

WebRTC Source

Authors

Walter Fan

Status

WIP

Updated

2021-12-29

Source code

  1. 安装 Chromium 软件库工具.

    参见 * WebRTC 开发依赖软件 * 安装 WebRTC 开发工具

  2. 下载 WebRTC 源码

$ mkdir webrtc-checkout
$ cd webrtc-checkout
$ fetch --nohooks webrtc
$ gclient sync
  1. 更新源码到你自己的分支

$ git checkout main
$ git pull origin main
$ gclient sync
$ git checkout my-branch
$ git merge main
  1. 构建

先要安装 ninja 构建工具 这一构建工具, 通过它来生成构建脚本

cd src
# generate project files using the defaults (Debug build)
$ gn gen out/Default
# clean all build artifacts in a directory but leave the current GN configuration untouched
$ gn clean out/Default
  1. 编译

$ ninja -C out/Default

Modules

  • async_audio_processing

  • audio_coding

  • audio_device

  • audio_mixer

  • audio_processing

  • congestion_controller

  • desktop_capture

  • include

  • pacing

  • remote_bitrate_estimator

  • rtp_rtcp

  • third_party - fft - g711 - g722 - portaudio

  • utility

  • video_capture

  • video_coding

  • video_processing

Treasure in code

  • overuse_frame_detector - webrtc/video/adaptation

  • congestion control - webrtc/modules/congestion_controller/

  • remote_bitrate_estimator - webrtc/modules/remote_bitrate_estimator/