Skip to main content

sipx_rtp/
lib.rs

1//! RTP and RTCP (RFC 3550).
2//!
3//! Two things here earn their tests. The **sequence number is 16 bits** and wraps every
4//! twenty-odd minutes at speech packet rates, so the wrap is an ordinary event and any
5//! comparison that uses `<` is wrong. And the **jitter buffer** trades latency for order:
6//! packets arrive late, early, twice or not at all, and audio needs them evenly spaced.
7//!
8//! Packet parsing rejects rather than guesses. A decoder that reads a malformed packet
9//! optimistically plays header bytes as audio, which is heard as a loud click.
10//!
11//! # Stability
12//!
13//! sipx is pre-1.0, so **neither word below means frozen**. `1.0.0` is what freezes an API, and its
14//! predicates are in `docs/roadmap.md`. Until then:
15//!
16//! - **Supported** — meant to be depended on. Breaking changes get a `CHANGELOG.md` entry saying what
17//!   to do instead. New enum variants and new struct fields may still appear in a minor release, so a
18//!   downstream `match` should carry a `_` arm.
19//! - **Experimental** — may change shape or be removed without a migration note. Depend on it only if
20//!   you are prepared to follow it.
21//!
22//!
23//! **Supported.** RTP, RTCP, the jitter buffer, quality statistics, SRTP and RFC 4733 DTMF are all
24//! reachable from a call and exercised by it.
25
26pub mod dtmf;
27pub mod jitter;
28pub mod packet;
29pub mod quality;
30pub mod rtcp;
31pub mod srtp;
32
33pub use dtmf::{Digit, Event as DtmfEvent, Receiver as DtmfReceiver};
34pub use jitter::JitterBuffer;
35pub use packet::{HEADER_LEN, Packet, RtpError, sequence_distance, sequence_is_newer};
36pub use quality::{Quality, ntp_now, round_trip};
37pub use rtcp::{
38    ReceiverReport, ReportBlock, Rtcp, RtcpError, Sdes, SdesChunk, SdesItem, SenderReport,
39    StreamStats,
40};
41pub use srtp::{Context as SrtpContext, SrtpError};