API Reference webrtc v#0.1.0
View SourceModules
WebRTC peer connections in pure Erlang.
Congestion control of one media session, as a sans-IO engine: transport-wide sequence numbers and feedback (webrtc_twcc_sender, webrtc_twcc_receiver), the bandwidth estimate (webrtc_gcc), the pacer (webrtc_pacer) and the RTP circuit breakers (webrtc_circuit_breaker). webrtc_media drives it.
Bandwidth probing, without I/O: probe clusters sent ahead of the estimate and the bitrate they show, as libwebrtc's probe controller and probe bitrate estimator do.
Bit rate over a sliding time window, in one-millisecond buckets.
Receiver side of RTP Control Protocol feedback for congestion control (RFC 8888), as a sans-IO engine.
RTP media circuit breakers (RFC 8083 §4), as a sans-IO engine.
WebRTC data channels: the Data Channel Establishment Protocol (RFC 8832) and the data channel rules of RFC 8831 on top of webrtc_sctp_assoc.
Classify a datagram received on a WebRTC transport by its first byte (RFC 7983 §7 as updated by RFC 9443 §3).
DSCP values for WebRTC flows (RFC 8837 §5, Table 1), as RFC 8835 §4.2 asks implementations to mark their packets.
DTLS endpoint for WebRTC (RFC 9147 DTLS 1.3 and RFC 6347 DTLS 1.2, RFC 5764, RFC 8842), as a sans-IO engine (see docs/ARCHITECTURE.md). Both versions are offered by default; the server picks DTLS 1.3 when the client offers it.
DTLS 1.3 key schedule (RFC 8446 §7, RFC 9147 §5.9): HKDF (RFC 5869), HKDF-Expand-Label with the "dtls13" label prefix, handshake and application traffic secrets, traffic keys including the record number encryption key (RFC 9147 §4.2.3), Finished, KeyUpdate and the exporter (RFC 8446 §7.5), and the TLS 1.3 cipher suite table.
DTLS 1.3 handshake message and extension codec (RFC 8446 §4, RFC 9147 §5). ClientHello and ServerHello share the DTLS 1.2 layout and are handled by webrtc_dtls_msg; this module covers the messages and extensions that only exist in (D)TLS 1.3.
DTLS 1.3 record layer (RFC 9147 §4): demultiplexing of DTLSPlaintext and DTLSCiphertext records (§4.1), the unified header, AEAD protection with the TLS 1.3 nonce and inner plaintext (RFC 8446 §5.2, §5.3), record number encryption (§4.2.3), record number reconstruction (§4.2.2) and the ACK message (§7).
Certificates for DTLS in WebRTC.
Cryptographic building blocks for DTLS 1.2: cipher suite table, TLS 1.2 PRF (RFC 5246 §5), master secret including the extended master secret (RFC 7627), key block, Finished, exporters (RFC 5705), ECDHE and handshake signatures.
DTLS 1.2 handshake message codec (RFC 6347 §4.2.2, RFC 5246 §7.4) with the extensions WebRTC needs: supported_groups and ec_point_formats (RFC 8422), signature_algorithms, use_srtp (RFC 5764 §4.1.1), extended_master_secret (RFC 7627) and renegotiation_info (RFC 5746).
DTLS 1.2 record layer (RFC 6347 §4.1): record framing, AEAD protection and the anti-replay window (§4.1.2.6).
FlexFEC (RFC 8627): parity FEC repair packets on their own RTP stream, protecting the packets of a source stream named in the repair packet's CSRC list (§4.2.1).
Frame assembly and jitter buffer for one received RTP stream. No I/O: packets go in with push/4, frames come out as actions, and the caller runs timeout/2 at next_timeout/1.
Google Congestion Control (draft-ietf-rmcat-gcc-02), sender side, as a sans-IO engine.
AIMD rate controller of the delay-based part of Google Congestion Control (draft-ietf-rmcat-gcc-02 §5.5).
Delay-based over-use detection of Google Congestion Control (draft-ietf-rmcat-gcc-02 §5.1 to §5.4).
Sans-IO ICE agent (RFC 8445), full or lite, with trickle ICE (RFC 8838), the RFC 8863 failure rule, consent freshness (RFC 7675) and relayed candidates through TURN (RFC 8656).
ICE candidates: priorities, foundations, pair priorities, redundancy elimination and the RFC 8839 candidate-attribute syntax.
Resolve STUN and TURN servers given by URI (webrtc_ice_uri) to the addresses the ICE agent uses.
STUN and TURN server URIs (RFC 7064, RFC 7065) and the W3C RTCIceServer list that carries them.
JSEP (RFC 9429) negotiation on structured SDP.
Media capabilities and their negotiation for JSEP (RFC 9429 §5.2.1, §5.3.1, RFC 3264 §6.1).
Name resolution for ICE candidates whose address is a host name, and an optional mDNS responder for our own host candidates (draft-ietf-mmusic-mdns-ice-candidates).
Sans-IO DNS message codec for multicast DNS (RFC 1035 §4, RFC 6762).
Sans-IO one-shot multicast DNS resolver (RFC 6762 §5.1) for the A and AAAA records of .local host names, with a small TTL cache.
Sans-IO multicast DNS responder for the <uuid>.local names of our own host candidates (draft-ietf-mmusic-mdns-ice-candidates §3.1).
Media session of one BUNDLE transport, as a sans-IO engine: SRTP/SRTCP protection, RTP demultiplexing to transceivers, RTCP reports, NACK-based retransmission (RFC 4585, RFC 4588) and keyframe requests (RFC 4585 PLI, RFC 5104 FIR).
A codec plugin decodes the frames a transceiver receives and encodes what the application sends on it, and reports the W3C decoder and encoder statistics. This library stays pure Erlang; a plugin is where native code (FFmpeg, libvpx, Opus) comes in, in a separate package.
Slice loss (SLI) and reference picture selection (RPSI) indications, RFC 4585 §6.3.2 and §6.3.3, used as RFC 8834 §5.1.3 and §5.1.4 ask once nack sli or nack rpsi is negotiated.
TMMBR and TMMBN in the media engine (RFC 5104 §4.2, required by RFC 8834 §5.1.6), when ccm tmmbr is negotiated.
Statistics a codec plugin or the application reports (webrtc:report_media_stats/4): the W3C members each kind of object takes, and how a report merges into what is kept. Counters add up, the other members replace the previous value; an unknown member or a value of the wrong type is dropped.
Receive side of RTP stream identifiers (RFC 8852) for webrtc_media: which simulcast layer (rid) an incoming SSRC carries.
Rapid synchronisation of RTP streams (RFC 6051, RECOMMENDED by RFC 8834 §5.2.1).
Receiver-side NACK generator (sans-IO).
Sender-side retransmission buffer for NACK (RFC 4585 §6.2.1, RFC 4588).
Leaky bucket pacer for outgoing media, as a sans-IO engine.
Token bucket that holds one media stream to a bit rate, as a sans-IO engine: the limit a peer set with TMMBR (RFC 5104 §4.2.1.2, RFC 8834 §5.1.6).
RTP payload for redundant data (RFC 2198).
RTCP compound packet codec (RFC 3550 §6).
RTP Control Protocol feedback for congestion control (RFC 8888), RTPFB FMT 11.
RTCP feedback messages (RFC 4585 §6): transport layer (RTPFB, PT 205) and payload specific (PSFB, PT 206).
RTCP transmission interval (RFC 3550 §6.2, §6.3 and Appendix A.7) with the RTP/AVPF rules of RFC 4585 §3.4 and §3.5 and the reduced minimum interval required by RFC 8834 §5.1.
RTCP transmission scheduler of a media session: when regular reports go out (RFC 3550 §6.3 and Appendix A.7 with the RTP/AVPF rules of RFC 4585 §3.5) and whether feedback can be sent now under the RTCP bandwidth (RFC 4585 §3.5.2, RFC 8834 §5.1).
Transport-wide congestion control feedback, RTPFB FMT 15 (draft-holmer-rmcat-transport-wide-cc-extensions-01 §3.1).
RTCP extended reports (RFC 3611), PT 207.
RTP packet codec (RFC 3550 §5.1).
AV1 RTP payload format (AOMedia "RTP Payload Format for AV1" v1.0.0 §4.4 to §4.5): aggregation header, key frame detection, depacketization, packetization and the frame size of a sequence header.
RTP header extensions (RFC 8285) and the typed values carried in them.
H.264 RTP payload format (RFC 6184): packetization-mode 1 (non-interleaved: single NAL unit packets, STAP-A and FU-A) and packetization-mode 2 (interleaved: STAP-B, MTAP16, MTAP24, FU-A and FU-B with decoding order numbers).
Opus RTP payload format (RFC 7587).
RTP stream pause and resume (RFC 7728), without I/O.
Wrapping arithmetic for RTP sequence numbers (16 bits) and timestamps (32 bits), RFC 3550 §5.1 and Appendix A.1.
RTP receiver and sender statistics (RFC 3550 §6.4, Appendix A).
VP8 RTP payload descriptor (RFC 7741 §4.2) without decoding media.
VP9 RTP payload format (RFC 9628): payload descriptor, key frame detection, frame size and packetization.
RTP retransmission payload format (RFC 4588 §4).
SCTP acknowledgement processing, congestion control and retransmission timer (RFC 9260 §6.2.1, §6.3, §7.2, RFC 3758 §3.5).
Sans-IO SCTP association (RFC 9260) for SCTP over DTLS (RFC 8261), with partial reliability (RFC 3758, RFC 7496), stream reconfiguration (RFC 6525), message interleaving (RFC 8260) and zero checksum (RFC 9653).
SCTP packet and chunk codec (RFC 9260 §3, RFC 3758, RFC 4820, RFC 6525, RFC 8260, RFC 9653).
SCTP State Cookie (RFC 9260 §5.1.3, §5.1.5).
CRC32c (Castagnoli) checksum used by SCTP (RFC 9260 Appendix A).
SCTP association setup (RFC 9260 §5, §8.4, §8.5.1).
SCTP output: actions, control chunk queue and packet bundling (RFC 9260 §6.10, RFC 9653 §5.2).
SCTP TLV codec: INIT / INIT ACK parameters (RFC 9260 §3.3.2.1, RFC 3758, RFC 4820, RFC 5061, RFC 9653), RE-CONFIG parameters (RFC 6525 §4) and error causes (RFC 9260 §3.3.10).
Packetization layer path MTU discovery for SCTP over DTLS (RFC 8899 §4, §5 and §6.2, RFC 8261 §5, RFC 8831 §5).
SCTP partial reliability on the send side (RFC 3758 §3.5, RFC 8260 §2.3.1): abandoning messages, the Advanced.Peer.Ack.Point and FORWARD TSN / I-FORWARD-TSN generation.
SCTP stream reconfiguration (RFC 6525).
SCTP receive side: TSN tracking, SACK generation, reassembly and ordered delivery (RFC 9260 §6.2, §6.6, §6.7, §6.9, RFC 3758 §3.6, RFC 8260 §2.2.3, RFC 6525 §5.2.2).
SCTP send side: per stream queues, scheduler, fragmentation and transmission (RFC 9260 §6.1, §6.9, RFC 8260 §2.2.2 and §3.2).
SDP codec (RFC 8866) with the attributes used by WebRTC.
SDP attribute codec: maps a= lines to typed terms and back.
ICE candidate attribute codec (RFC 8839 §5.1, RFC 6544 §4.5).
Lexical helpers shared by the SDP codec modules.
Queries and updates on parsed SDP for JSEP.
RTP stream identifier (a=rid, RFC 8851) and simulcast (a=simulcast, RFC 8853) attribute values, used through webrtc_sdp_rtp.
RTP related SDP attribute values: rtpmap and fmtp (RFC 8866 §6), rtcp-fb (RFC 4585 §4.2), extmap (RFC 8285 §8), msid (RFC 8830), legacy msid-semantic, ssrc and ssrc-group (RFC 5576). rid and simulcast values are handled by webrtc_sdp_rid.
SRTP and SRTCP crypto contexts (RFC 3711, RFC 7714), keyed from DTLS-SRTP (RFC 5764).
SRTP and SRTCP packet transforms: AES-CM with HMAC-SHA1 (RFC 3711 §4.1.1, §4.2.1) and AES-GCM (RFC 7714 §8, §9).
SRTP key derivation (RFC 3711 §4.3) with the AES-CM PRF (RFC 3711 §4.3.3, RFC 6188 §7 for AES-256 master keys).
SRTP protection profiles for DTLS-SRTP (RFC 5764 §4.1.2, RFC 7714 §14.2) and the layout of the exported keying material (RFC 5764 §4.2).
Sliding window replay list (RFC 3711 §3.3.2, RFC 2401 style bitmap).
The W3C WebRTC statistics (https://www.w3.org/TR/webrtc-stats/) of a peer connection, built from the engines' own statistics.
STUN message codec (RFC 8489), with the ICE (RFC 8445 §16.1) and TURN (RFC 8656 §18) attributes.
Sans-IO STUN client transaction table for UDP (RFC 8489 §6.2.1).
Temporary maximum media stream bit rate limits of one media stream we send (RFC 5104 §3.5.4, §4.2), as a sans-IO state.
TURN ChannelData framing (RFC 8656 §12.4).
Sans-IO TURN client for UDP (RFC 8656), one allocation per client state.
Framing of TURN over a stream transport (TCP, TLS over TCP, RFC 8656 §3.1, §12.5): the messages on the stream are STUN messages and ChannelData, each self-delimiting, ChannelData padded to a multiple of four bytes.
Receiver side of transport-wide congestion control (draft-holmer-rmcat-transport-wide-cc-extensions-01 §3), as a sans-IO engine.
Sender side of transport-wide congestion control (draft-holmer-rmcat-transport-wide-cc-extensions-01).
ULPFEC (RFC 5109): generic forward error correction of RTP packets by XOR, as WebRTC sends it inside video RED (RFC 8854 §5.2).