pub struct EgressSource { /* private fields */ }Expand description
Holds the broadcast + catalog and spawns per-rendition pump tasks.
Implementations§
Source§impl EgressSource
impl EgressSource
Sourcepub async fn new(broadcast: BroadcastConsumer) -> Result<Self>
pub async fn new(broadcast: BroadcastConsumer) -> Result<Self>
Subscribe to the broadcast’s catalog and wait for the first snapshot.
The session loop drives the pumps via the returned channel; the
caller hands EgressSource to Session::egress
which takes the receiver via Self::take_writes.
Sourcepub fn take_writes(&mut self) -> Receiver<WriteRequest>
pub fn take_writes(&mut self) -> Receiver<WriteRequest>
One-shot extractor for the write-request receiver. The session loop awaits on this to forward frames into str0m.
Sourcepub fn on_track(
&mut self,
mid: Mid,
codec: Codec,
pt: Pt,
clock_rate: Frequency,
) -> Result<()>
pub fn on_track( &mut self, mid: Mid, codec: Codec, pt: Pt, clock_rate: Frequency, ) -> Result<()>
Spawn a pump task for a newly added (sendonly) media line.
mid and pt come from str0m’s negotiated state; clock_rate is
the codec’s negotiated RTP clock. The pump subscribes to a matching
catalog rendition and forwards every frame as a WriteRequest.
Sourcepub fn catalog_codecs(&self) -> Vec<Codec>
pub fn catalog_codecs(&self) -> Vec<Codec>
Codecs present in the catalog, used by the SDP-offer side
(client publish) to declare what we have. For v1: the union of
audio + video codecs across all renditions.