citadel_sdk/media/mod.rs
1//! Real-time audio/video transport over a Citadel connection.
2//!
3//! Binds the I/O-free [`citadel_media`] primitives (packetizer, reassembler,
4//! jitter buffer, send-queue policy, control messages) to a live connection:
5//!
6//! * **Unreliable** mode: media fragments travel over the session's UDP
7//! channel (`UdpMode::Enabled`), control messages over the ordered-reliable
8//! channel.
9//! * **Reliable** mode (no UDP channel arrived within `udp_wait`): everything
10//! travels over the ordered-reliable channel; the receiver demuxes by wire
11//! message type.
12//!
13//! Entry point: [`MediaEndpoint::from_peer_connection`](crate::media::MediaEndpoint::from_peer_connection) /
14//! [`MediaEndpoint::from_c2s`](crate::media::MediaEndpoint::from_c2s), then
15//! [`MediaEndpoint::split`](crate::media::MediaEndpoint::split).
16//!
17//! Dropping a [`MediaReceiver`](crate::media::MediaReceiver) drops the UDP receive half it owns, which
18//! signals `PeerSignal::DisconnectUDP` to the peer — keep it alive for the
19//! lifetime of the call.
20
21mod config;
22mod endpoint;
23mod eos;
24pub mod error;
25mod receiver;
26mod sender;
27mod transport;
28
29#[cfg(test)]
30mod tests;
31
32pub use config::{
33 MediaTransportConfig, RECOMMENDED_FRAGMENT_PAYLOAD, RECOMMENDED_UDP_PAYLOAD_BUDGET,
34};
35pub use endpoint::{MediaEndpoint, MediaEndpointParts};
36pub use receiver::{MediaEvent, MediaReceiver};
37pub use sender::MediaSender;
38pub use transport::{MediaDatagramSink, MediaDatagramSource, MediaTransportKind, ReliableSink};