std only.Expand description
Smooth Streaming live origin engine (issue #2453): the client Manifest and
fragment decision logic, driven from a shared media_plane::Trunk — the
same shape as hls-runtime’s server module.
Nothing here ever .awaits or opens a socket. SmoothOrigin::manifest
renders the current live Manifest and the ServedEgress implementation
answers one parsed SmoothRequest with an
EgressResponse (Ready, Await,
BadRequest, NotFound) — never blocking the caller. The manifest is
built as a broadcast-smooth model and rendered by its own to_xml; no
XML is written here. Each track’s codec parameters come from transmux’s
resolve_codec, the same resolver the packager
uses, so the manifest advertises exactly what the fragments carry.
§The host’s bookkeeping, not the origin’s
Which segments and tracks a program presents is the host’s own
bookkeeping (the set its DASH window and HLS origin already render from),
so the origin asks for both through SegmentProvider and
TrackProvider rather than caching the media itself. The Trunk stays
the single copy.
§The caller-driven wait loop
A Manifest cannot be rendered before the trunk has an init segment, a
track set and at least one published segment. The origin answers
EgressResponse::Await until then; an adapter registers Trunk::listen
before retrying so no publish is missed:
loop {
let listener = trunk.listen();
match origin.resolve(request, now, await_policy) {
EgressResponse::Await { .. } => { /* bounded wait on `listener` */ }
answer => return answer,
}
}§std-only
Like media_plane::Trunk itself, this module needs std::sync::Mutex, so
it is compiled only when this crate’s std feature is enabled (the
default). A --no-default-features build gets crate::client alone.
Structs§
- Fragment
Location - One fragment a manifest advertises: its stream, absolute start time and
duration in
SMOOTH_TIMESCALEticks. - Smooth
Origin - The live Smooth origin over one
Trunk. - Smooth
Origin Config - What a
SmoothOriginis built from: every part is required, soSmoothOriginConfig::newtakes all three. - Stream
Key - What identifies one advertised stream: its media kind and the 1-based
ordinal of that kind,
(kind, ordinal), exactly the pair the manifest’sStreamIndex@Name/@Urland the request grammar name. Two tracks of one kind are therefore distinct.
Enums§
- Smooth
Body - The body of a
SmoothOriginanswer. - Smooth
Origin Error - Why a
SmoothOrigincannot describe the trunk’s media. - Smooth
Request - What a caller asks a
SmoothOriginfor: the client Manifest, or one fragment of it.
Traits§
- Segment
Provider - The segments the origin should describe, given the
Trunkit reads. - Track
Provider - The tracks the origin should describe, given the
Trunkit reads.