pub struct Consumer { /* private fields */ }Expand description
A cursor over one rendition’s segments, in timeline order.
Obtained from Rendition::segments. Each
next awaits the next segment, then FETCHes and transmuxes it through the
path the HTTP serve path uses. The cursor also holds a live subscription to the media
track, so each group reaches the cache as it is published and that FETCH is a hit. A
cursor reads every group anyway, so this costs no extra traffic, and a source without
FETCH (moq-lite before 05) can serve a group no other way.
Implementations§
Source§impl Consumer
impl Consumer
Sourcepub async fn init(&self) -> Result<Option<Bytes>>
pub async fn init(&self) -> Result<Option<Bytes>>
The rendition’s CMAF init segment, built once and cached; None until it can be built
(an inline-parameter-set codec needs the first segment first).
Sourcepub async fn next(&mut self) -> Result<Option<Segment>>
pub async fn next(&mut self) -> Result<Option<Segment>>
The next segment, with its media; None once the rendition ends.
Waits for the next segment, then FETCHes and transmuxes its groups. A segment whose groups already left the relay cache (or that is a gap for this rendition) is skipped, resuming at the next one, rather than surfaced as an error; a real fetch/transmux failure is returned, leaving the cursor to retry it on the next call.