Skip to main content

Module state

Module state 

Source
Expand description

Worker-local sessions, routing and their lifecycle transitions.

Control commands, packet processing and recovery mutate one PacketLoopState. Its sessions, media identity and source routes remain separately borrowable. RtcSessionState combines str0m with receiver delivery state so stream retirement and RTX cache changes stay within the session boundary. RouteTable owns source forwarding decisions and keyframe retry state.

Topology changes that cross these owners belong to PacketLoopState. Registration and SSRC binding maintain paired media lookups. Consumer removal repairs destination indexes before retiring its stream. Session teardown also clears scheduling and demux state while preserving surviving consumers’ indexes. Callers use these complete operations instead of coordinating cleanup steps.

schedule validates queued handles and deadlines against current sessions. Datagram lookup in demux is independent of source-to-consumer routing. RtcSnapshotState shares transport observations with readers outside the worker without exposing mutable session or route state.

Re-exportsΒ§

pub use snapshot::RtcSnapshotState;
pub use crate::engine::media_transport::TransportSessionHealth;

ModulesΒ§

bitrate πŸ”’
Worker-local RTC payload bitrate observations.
consumer_egress πŸ”’
Session operations pairing receiver egress state with str0m.
consumer_routes πŸ”’
Consumer routes coupled to session MID indexes and receiver repair state.
demux πŸ”’
Worker-local indexes for UDP ingress routing.
keyframe_tracker πŸ”’
keyframe request tracking for RTC producer sources
media_lifecycle πŸ”’
Media removal coupled to receive streams, routes, repair and session accounting.
media_registry πŸ”’
worker-local session media ownership indexes.
ownership πŸ”’
Producer and route-source ownership validation.
relay_registry πŸ”’
Source-scoped relay registrations and bounded packet mailboxes.
route_control πŸ”’
Packet gates and audio activity used by RouteTable.
route_delivery πŸ”’
Route delivery transitions coupled to session repair and producer NACK policy.
route_table πŸ”’
Source-scoped forwarding decisions and decoder-recovery state.
schedule πŸ”’
Dirty-session and deadline scheduling with generation-checked handles.
session πŸ”’
Session-local str0m state, staged negotiation and ingress accounting.
session_lifecycle πŸ”’
Session retirement across scheduling, identity, demux and route state.
slots πŸ”’
worker-local slots for packet-loop identities
snapshot πŸ”’
Read-side transport observations shared outside the worker.
source_route πŸ”’
packet-loop source route facts

StructsΒ§

PacketLoopState πŸ”’
authoritative mutable state for one RTC packet-loop worker
SharedRtcSocket πŸ”’
shared UDP socket owned by one RTC worker