Expand description
str0m session driver shared by every HTTP role / media direction.
str0m is sans-IO, so we drive the str0m::Rtc instance from a tokio
task that owns a UDP socket. Session::run alternates between
Rtc::poll_output (drain pending transmits / events) and
Rtc::handle_input (feed UDP packets or timeouts).
The session itself doesn’t care whether the Rtc was populated by
accepting an SDP offer (server side) or by minting one and posting it
to a remote URL (client side), or whether the media flow is RTP-in
(MediaSink) or RTP-out (crate::egress::EgressSource).
Structs§
Enums§
- Media
Role - What the session does with the negotiated media stream.
Traits§
- Media
Sink - Receives
MediaDataevents from str0m and dispatches to the right codecBridge. Used as the per-session sink inSession::runfor any flow where RTP arrives from the peer (server publish/ WHIP server,client subscribe/ WHEP client).
Functions§
- bind_
udp - Bind an ephemeral UDP socket for a single client session and return it (shared with its reader task) plus the ICE candidates to advertise.
- rtc_
config_ with_ codecs - Build a
RtcwithCodecConfigrestricted to the supplied codecs. - rtc_
with_ codecs - Build a codec-restricted
Rtcfor the client egress path (which lets str0m mint its own ICE credentials). The server egress path usesrtc_config_with_codecsdirectly so it can inject the mux’s known credentials before building. - spawn_
socket_ reader - Spawn a 1:1 reader pumping every datagram from
socketinto a channel, for the client paths (one socket per session, so no demux is needed). Mirrors the inbound side ofcrate::server::muxfor a single session.