Files
DomiStream/crates/domistream/src/lib.rs
T
mnovak 30a7b90034 [domistream] Implementation: HTTP, pairing, RTSP/SDP, ENet, control, input, RTP, FEC, video and audio receivers
Per PROTOCOL.md and the Wolf docs; interop with a real host is unverified. Strict, capped parsers throughout,
shared helpers in util.rs. Where PROTOCOL.md says UNKNOWN the Wolf-documented behaviour is used. The audio
receiver waits for the jitter budget before rebuilding a missing packet, so a late packet beats a rebuilt one.
2026-11-25 14:10:24 +01:00

57 lines
2.2 KiB
Rust

//! DomiStream: a sans-I/O GameStream client (the protocol Sunshine hosts and Moonlight clients speak), for
//! Arena Domi TV and the other Play remotely clients.
//!
//! Interop with real hosts is unverified: the blocking UNKNOWNs of `docs/PROTOCOL.md` are settled live on Day 1.
//! Where the protocol is UNKNOWN, the Wolf-documented behaviour is implemented and kept easy to change.
//!
//! # Shape
//!
//! Nothing here opens a socket, reads a clock, spawns a thread or touches a file. The caller:
//! - feeds received bytes in (`handle_*` / `push` / `parse_*`, always `&[u8]`),
//! - passes the current time in as [`Instant`] and randomness as a [`RandomSource`],
//! - sends the bytes the state machines hand out (`poll_transmit`, [`http::HttpRequest`]),
//! - reacts to events (`poll_event`) and wakes the machine at its deadline (`poll_timeout` / `handle_timeout`).
//!
//! Every parser has a `MAX_*` constant and refuses larger input before it allocates.
//!
//! # Modules, in session order
//!
//! | Module | Protocol (see `docs/PROTOCOL.md`) |
//! | :-- | :-- |
//! | [`http`] | serverinfo, applist, launch/resume/cancel (section 1) |
//! | [`pairing`] | the PIN handshake and the client certificate (section 1.5) |
//! | [`rtsp`] | OPTIONS, DESCRIBE, SETUP, ANNOUNCE, PLAY and SDP (section 2) |
//! | [`enet`] | the ENet-compatible reliable UDP layer under the control stream (section 3.1) |
//! | [`control`] | AES-GCM framing and control messages (sections 3.2, 3.3) |
//! | [`input`] | input and gamepad packets (section 4) |
//! | [`rtp`] | the RTP header shared by video and audio |
//! | [`fec`] | Reed-Solomon erasure coding over GF(2^8) |
//! | [`video`] | video depacketizer with FEC recovery and decryption (section 5) |
//! | [`audio`] | audio depacketizer with FEC recovery and decryption (section 6) |
//!
//! Opus and video decoding are not here: they belong to the platform layer (ArenaTV).
#![forbid(unsafe_code)]
#![deny(missing_docs)]
pub mod audio;
pub mod control;
pub mod enet;
pub mod entropy;
pub mod error;
pub mod fec;
pub mod http;
pub mod input;
pub mod keys;
pub mod pairing;
pub mod rtp;
pub mod rtsp;
pub mod time;
mod util;
pub mod video;
pub use entropy::RandomSource;
pub use error::{Error, Result};
pub use keys::SessionKeys;
pub use time::Instant;