WebRTC 源码概览

Abstract

WebRTC Source

Authors

Walter Fan

Status

WIP

Updated

2024-08-21

Overview

WebRTC release notes are posted to the discuss-webrtc mailing list before the release: https://webrtc.googlesource.com/src/+/refs/heads/main/docs/release-notes.md

Domain object

Call

A Call represents a two-way connection carrying zero or more outgoing and incoming media streams, transported over one or more RTP transports.

A Call instance can contain several send and/or receive streams.

All streams are assumed to have the same remote endpoint and will share bitrate estimates etc.

When using the PeerConnection API, there is an one to one relationship between the PeerConnection and the Call.

Stream

  • AudioSendStream

  • AudioReceiveStream

  • VideoSendStream

  • VideoReceiveStream

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

Import Interfaces

  • LossNotificationSender,

  • RecoveredPacketReceiver,

  • KeyFrameRequestSender,

  • NackSender,

  • OnDecryptedFrameCallback,

  • OnDecryptionStatusChangeCallback,

  • RtpVideoFrameReceiver

  • RtpPacketSinkInterface,

void OnRtpPacket(const RtpPacketReceived& packet) override;
class PacketReceiver {
public:
    enum DeliveryStatus {
      DELIVERY_OK,
      DELIVERY_UNKNOWN_SSRC,
      DELIVERY_PACKET_ERROR,
    };

    virtual DeliveryStatus DeliverPacket(MediaType media_type,
                                        rtc::CopyOnWriteBuffer packet,
                                        int64_t packet_time_us) = 0;

protected:
    virtual ~PacketReceiver() {}
};

Treasure in code

Contribution

The detailed stpes refer to https://webrtc.org/support/contributing There is an example: https://webrtc-review.googlesource.com/c/src/+/278682

preparation

  1. Check out and build the code

  2. Fill in the Contributor agreement

3) If you’ve never submitted code before, you must add your name and contact info to the AUTHORS file Go to https://webrtc.googlesource.com/new-password and login with your email account. This should be the same account as returned by git config user.email

  1. Then, run: git cl creds-check. If you get any errors, ask for help on discuss-webrtc

You will not have to repeat the above. After all that, you’re ready to upload:

upload patch

  • Assuming you’re on the main branch:

git checkout -b my-work-branch
  • Make changes, build locally, run tests locally

git commit -am "Changed x, and it is working"
git cl upload

Reference