moq_lite/lib.rs
1//! # moq-lite: Media over QUIC Transport
2//!
3//! `moq-lite` is designed for real-time live media delivery with sub-second latency at massive scale.
4//! This is a simplified subset of the *official* Media over QUIC (MoQ) transport, focusing on the practical features.
5//!
6//! **NOTE**: While compatible with a subset of the IETF MoQ specification (see [ietf::Version]), many features are not supported on purpose.
7//! Additionally, the IETF standard is immature and up to interpretation, so many implementations are not compatible anyway.
8//! I highly highly highly recommend using `moq-lite` instead of the IETF standard until at least draft-30.
9//!
10//! ## API
11//!
12//! The API is built around Producer/Consumer pairs, with the hierarchy:
13//! - [Origin]: A collection of [Broadcast]s, produced by one or more [Session]s.
14//! - [Broadcast]: A collection of [Track]s, produced by a single publisher.
15//! - [Track]: A collection of [Group]s, delivered out-of-order until expired.
16//! - [Group]: A collection of [Frame]s, delivered in order until cancelled.
17//!
18//! To publish media, create:
19//! - [Origin::produce] to get an [OriginProducer] and [OriginConsumer] pair.
20//! - [OriginProducer::create_broadcast] to create a [BroadcastProducer].
21//! - [BroadcastProducer::create_track] to create a [TrackProducer] for each track.
22//! - [TrackProducer::append_group] for each Group of Pictures (GOP) or audio frames.
23//! - [GroupProducer::write_frame] to write each encoded frame in the group.
24//!
25//! To consume media, create:
26//! - [Origin::produce] to get an [OriginProducer] and [OriginConsumer] pair.
27//! - [OriginConsumer::announced] to discover new [BroadcastConsumer]s as they're announced.
28//! - [BroadcastConsumer::subscribe_track] to get a [TrackConsumer] for a specific track.
29//! - [TrackConsumer::next_group] to receive the next available group.
30//! - [GroupConsumer::read_frame] to read each frame in the group.
31//!
32//! ## Advanced Usage
33//!
34//! - Use [FrameProducer] and [FrameConsumer] for chunked frame writes/reads without allocating entire frames (useful for relaying).
35//! - Use [TrackProducer::create_group] instead of [TrackProducer::append_group] to produce groups out-of-order.
36
37mod client;
38mod error;
39mod model;
40mod path;
41mod server;
42mod session;
43mod setup;
44
45pub mod coding;
46pub mod ietf;
47pub mod lite;
48
49pub use client::*;
50pub use error::*;
51pub use model::*;
52pub use path::*;
53pub use server::*;
54pub use session::*;