Expand description
Private WebRTC backend below MediaTransport.
Each RtcWorker runs one packet loop for its assigned str0m sessions,
one UDP socket shared by those sessions and command plus relay mailboxes.
MediaTransport routes sessions to the workers
named by their transport keys and coordinates relay routes between workers.
Main boundaries:
worker,commandsandstatecover worker startup, mailbox control and packet-loop state.bootstrapcreates worker sockets and session-localstr0mstate.codeccentralizes RTP profiles, negotiated capabilities, negotiated RID handling and codec-specific packet inspection plus rewriting.packet_loopowns UDP routing andstr0mpolling.demuxprovides recovery indexes androuting_missbounds repeated fallback work whileRtc::accepts()remains the session authority.route_table,source_route,route_controlandkeyframe_trackerkeep forwarding routes, packet gates, activity ranking and keyframe retry state.forwarded_packet,forwarding_planner,forwarding_destination,local_forwardingandlocal_send_rewriteshare payloads across sinks, relays and local RTC destinations. Local RTC egress projects receiver RTP identity.media_registry,relay_registryandbitratekeep media handles, relay targets and bitrate observations.
Re-exportsยง
pub use commands::RtcWorkerCommand;pub use commands::RtcWorkerResponse;pub use commands::WorkerMediaControlBatch;pub use commands::WorkerMediaControlBatchOutcome;pub use worker::RtcWorker;
Modulesยง
- bitrate ๐
- Worker-local RTC payload bitrate observations.
- bootstrap ๐
- cold-path rtc socket and session bootstrap
- codec ๐
- RTC codec policy, negotiation and packet behavior.
- commands ๐
- mailbox command contract for the RTC worker engine
- demux ๐
- Worker-local indexes for UDP ingress routing.
- forwarded_
packet ๐ - the packet loop needs one packet shape that can cross four local concerns:
observation, fanout planning, local browser egress and relay egress
ForwardedPacketis that shape it keeps the source session, RTP header view andArcpayload together while letting each concern borrow only the state it owns - forwarding_
destination ๐ - executable forwarding destinations for one packet-loop flush
- forwarding_
planner ๐ - Packet forwarding planner for the RTC engine hot path.
- keyframe_
tracker ๐ - keyframe request tracking for RTC producer sources
- local_
forwarding ๐ - local RTP egress into a browser consumer
Rtcsession - local_
send_ ๐rewrite - destination RTP identity projection for local egress
- media_
registry ๐ - worker-local session media ownership indexes.
- packet_
loop ๐ - Worker-local media packet loop.
- relay_
registry ๐ - route_
control ๐ - Transport-native route control for source packet forwarding.
- route_
table ๐ - Worker-local RTC source routing and decoder recovery.
- routing_
miss ๐ - Negative routing memory for packet-loop UDP demux fallback.
- slots ๐
- worker-local slots for packet-loop identities
- source_
route ๐ - packet-loop source route facts
- state ๐
- worker-local state for the RTC engine transport layer
- worker ๐
- Each
RtcWorkercreates a private current-thread executor inside a dedicated OS thread. UDP ingress, relay packets and command APIs therefore mutate RTC state in the same packet-loop task instead of entering the process-wide work-stealing runtime.
Structsยง
- RtcWorker
Config ๐