Skip to main content

Module rtc

Module rtc 

Source
Expand description

Private WebRTC backend below MediaTransport.

Each RtcWorker drives its sessions through one shared UDP socket and bounded mailboxes. control and packet_loop share recovery:

worker
  +-- commands ------> control ------+
  |                                  +--> recovery
  `-- media packets -> packet_loop --+
                           |
                           `--> consumer_egress

state::PacketLoopState holds the sessions, media identity, routes and scheduling indexes used by these operations. Its lifecycle methods keep dependent indexes and stream retirement together. state::RtcSnapshotState exposes observations without granting access to that mutable state.

worker::loop_driver governs turn ordering. consumer_egress provides receiver RTP writes. egress dispatches encoded transmits to network adapters after the worker releases mutable RTC state. Packet processing and recovery do not call command handlers.

commands defines shared mailbox contracts, codec provides codec rules and bootstrap initializes sockets and sessions.

Re-exportsยง

pub use commands::RtcWorkerCommand;
pub use commands::RtcWorkerResponse;
pub use commands::WorkerMediaControlBatch;
pub use commands::WorkerMediaControlBatchOutcome;
pub use worker::RtcWorker;

Modulesยง

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
consumer_egress ๐Ÿ”’
Receiver RTP projection and repair bookkeeping for local RTC destinations.
control ๐Ÿ”’
RTC command workflows for one worker.
egress ๐Ÿ”’
Complete RTC output dispatched to worker-local network adapters.
packet_loop ๐Ÿ”’
Datagram admission, packet observation and forwarding execution.
recovery ๐Ÿ”’
Decoder readiness effects and keyframe dispatch across RTC workers.
state ๐Ÿ”’
Worker-local sessions, routing and their lifecycle transitions.
worker ๐Ÿ”’
Thread lifecycle and turn scheduling for one RtcWorker.

Structsยง

RtcWorkerConfig ๐Ÿ”’