sipx_media/lib.rs
1//! Media sessions: RTP over UDP, paced sending, buffered receiving.
2//!
3//! Two decisions shape this crate.
4//!
5//! **Symmetric RTP.** Media goes back to where it arrives from, not to the address the SDP
6//! advertised. Behind a NAT the advertised address is private and the only path back is the
7//! pinhole the far end opened by sending.
8//!
9//! **The clock lives in one place.** Audio is paced by one interval timer at the packetisation
10//! interval. Sending on channel readiness instead makes the packet rate depend on how fast the
11//! application produces samples, which is how a call sends 200 packets per second to a jitter
12//! buffer expecting 50.
13//!
14//! # Stability
15//!
16//! sipx is pre-1.0, so **neither word below means frozen**. `1.0.0` is what freezes an API, and its
17//! predicates are in `docs/roadmap.md`. Until then:
18//!
19//! - **Supported** — meant to be depended on. Breaking changes get a `CHANGELOG.md` entry saying what
20//! to do instead. New enum variants and new struct fields may still appear in a minor release, so a
21//! downstream `match` should carry a `_` arm.
22//! - **Experimental** — may change shape or be removed without a migration note. Depend on it only if
23//! you are prepared to follow it.
24//!
25//!
26//! **Supported**: `MediaSession` and the RTP/RTCP plumbing under it — binding, symmetric RTP, the
27//! pacing clock, SRTP keyed from SDES, quality statistics — plus [`ice`], whose gathering and
28//! selected-pair driver are consumed by `sipx-call`, and [`dtls`]'s protocol, key-derivation and
29//! handshake surface, which `sipx-call` selects for explicit DTLS-SRTP policy (`M-28`).
30//!
31//! **Experimental**:
32//!
33//! - `dtls::openssl` — the optional OpenSSL implementation behind the off-by-default `dtls`
34//! feature. No shipped application enables it by default; the feature never changes a session or
35//! call without explicit DTLS-SRTP policy.
36//! - [`Bridge`] and [`Conference`] — real and tested over sessions **you** own; a `Call` does not hand
37//! out its `MediaSession`, so two calls cannot be bridged yet (`C-6`).
38
39pub mod bridge;
40pub mod browser;
41pub mod conference;
42mod counters;
43pub mod dtls;
44pub mod ice;
45pub mod session;
46
47pub use bridge::Bridge;
48pub use conference::{Conference, ConferenceError};
49pub use counters::MediaDiscardCounts;
50pub use dtls::{Arriving, Handshake, Profile, Role};
51pub use ice::IcePath;
52#[cfg(feature = "dtls")]
53pub use session::DtlsStartError;
54pub use session::{
55 Codec, CodecDirection, Config, Encoded, Interrupt, MediaPort, MediaSession, PcmCapture,
56 Playback, PlaybackEnd, PlaybackId, RtcpQualityHook, RtcpQualitySample, SetupError, SrtpKeys,
57 StartError,
58};
59pub use sipx_audio::{Pcm, PcmEncoding, PcmError, PcmFormat, PcmSamples};