Expand description
Real-time audio/video transport bound to a connection (see [citadel_media])
Real-time audio/video transport over a Citadel connection.
Binds the I/O-free [citadel_media] primitives (packetizer, reassembler,
jitter buffer, send-queue policy, control messages) to a live connection:
- Unreliable mode: media fragments travel over the session’s UDP
channel (
UdpMode::Enabled), control messages over the ordered-reliable channel. - Reliable mode (no UDP channel arrived within
udp_wait): everything travels over the ordered-reliable channel; the receiver demuxes by wire message type.
Entry point: MediaEndpoint::from_peer_connection /
MediaEndpoint::from_c2s, then
MediaEndpoint::split.
Dropping a MediaReceiver drops the UDP receive half it owns, which
signals PeerSignal::DisconnectUDP to the peer — keep it alive for the
lifetime of the call.
Modules§
- error
MediaError→NetworkErrormapping. AFromimpl is impossible here (orphan rule: both types are foreign), so the conversion is a function plus a result-extension trait.
Structs§
- Media
Endpoint - A media session bound to one connection. Build with
MediaEndpoint::from_peer_connectionorMediaEndpoint::from_c2s, thenMediaEndpoint::split. - Media
Endpoint Parts - The two halves of a
MediaEndpoint. - Media
Receiver - Inbound half of a media endpoint.
- Media
Sender - Outbound half of a media endpoint.
send_frameis synchronous and never blocks; control messages (announce,end_of_stream) are async. - Media
Transport Config - Transport tunables for a
super::MediaEndpoint. Every field is mandatory (noDefault); callMediaTransportConfig::validatebefore use. - Reliable
Sink - Sync façade over the ordered-reliable channel: datagrams are queued on an
unbounded channel and a pump task forwards them through
PeerChannelSendHalf::into_sink. Cloning shares the same pump.
Enums§
- Media
Event - What
MediaReceiver::next_eventyields. - Media
Transport Kind - Which path media fragments take.
Constants§
- RECOMMENDED_
FRAGMENT_ PAYLOAD - Recommended [
MediaConfig::max_fragment_payload]:RECOMMENDED_UDP_PAYLOAD_BUDGET - FRAGMENT_HEADER_LEN= 1004, rounded down. - RECOMMENDED_
UDP_ PAYLOAD_ BUDGET - Recommended upper bound on the plaintext bytes handed to the UDP channel per
datagram across every transport. Measured floors: the P2P QUIC connection
reports a 1162-byte datagram ceiling at spawn (=> 1066 B payload after the
64-byte HDP header + 32-byte AEAD at
SecurityLevel::Standard); the raw hole-punched socket allows 1232 B datagrams (=> 1136 B). 1024 fits both with headroom for one extra AEAD layer.
Traits§
- Media
Datagram Sink - Synchronous, never-blocking datagram sink. Mirrors
OutboundUdpSender::unbounded_send: a failure is terminal for that datagram. - Media
Datagram Source - Stream of inbound datagrams (one
SecBufferper wire message).