Skip to main content

Module rtc

Module rtc 

Source
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:

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 ForwardedPacket is that shape it keeps the source session, RTP header view and Arc payload 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 Rtc session
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 RtcWorker creates 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ยง

RtcWorkerConfig ๐Ÿ”’