Expand description
The sans-IO DASH client for static (VOD) presentations
(docs/dash-runtime/DESIGN.md sections 1, 5 and 7).
Spec: ISO/IEC 23009-1:2022 5.3.2 (Periods, continuity 5.3.2.4), 5.3.9
(segment addressing, sidx 5.3.9.5.4), 5.6 (BaseURL), Annex A.9 (playback
across Periods); ISO/IEC 14496-12 8.8.4 / 8.16.3 (moof/mdat, sidx).
Verbatim text: private/specs-verified/dash/23009-1/.
DashClient is the hls_runtime::client::HlsClient analogue. The caller
drains Actions, performs the I/O, feeds the answers back and drains
Outputs: one Manifest per Period, then the
Tracks and ordered Samples demuxed
with transmux::Fmp4Demux. All selected AdaptationSets play on one
timeline (design decision D7); Periods play back to back.
What it does, and does not:
- Static and dynamic MPDs. A dynamic one needs a UTC clock
(
DashClient::set_wall_clock,UTCTimingthroughAction::FetchUtcTiming, or the responseDateinResponseMeta), gates every request on the segment’s availability, refreshes the MPD and reportsOutput::ClockSynced; seenext_wakefor timers. - fMP4/CMAF segments only; encrypted, MPEG-2 TS, WebM, subtitle and
trick-mode sets are reported as
Output::TrackDropped, never misplayed. - Retry policy is the caller’s.
DashClient::on_failureclassifies a failure (FailureClass); the caller owns the backoff arithmetic and callsDashClient::retry. A resource that failsDashConfig::max_segment_failurestimes in a row ends the presentation withOutput::Fatal(thebroadcast-clientper-segment contract for a VOD playlist). - Init segments are fetched concurrently per Representation and shared by
identical URL and range;
sidxindexes are fetched before their Representation’s segments are planned; every request is a typed byte range when the MPD says so. - With
DashConfig::cross_origin_urls = falseevery URL the MPD makes the client request must have the MPD’s origin.
No clock is read; the now_us arguments are the caller’s monotonic clock.
use dash_runtime::client::{Action, DashClient, DashConfig, PullLimits};
let mut client = DashClient::new("https://origin.example/vod/manifest.mpd", DashConfig::default(), PullLimits::default());
let Some(Action::FetchMpd { url, .. }) = client.poll(0) else { unreachable!() };
assert_eq!(url, "https://origin.example/vod/manifest.mpd");
// The MPD is requested once until the caller reports a failure and retries.
assert!(client.poll(0).is_none());Re-exports§
pub use config::DashClockPolicy;pub use config::DashConfig;pub use config::DashConfigError;pub use config::PullLimits;pub use config::PullLimitsError;
Modules§
- config
DashConfig: the DASH-specific knobs of a client session.
Structs§
- Audio
Rendition - One selectable audio AdaptationSet.
- Dash
Client - The sans-IO DASH client for static and dynamic presentations.
- Manifest
Selection - The selection made for one Period.
- MpdValidators
- The validators of the MPD the client holds; send them as
If-None-MatchandIf-Modified-Sinceso an unchanged MPD answers304(IOP 4.4.4). - RepId
- Client-assigned identity of one Representation in one Period. Stable for the life of the client.
- Response
Meta - An MPD response as the caller observed it.
- State
Size - The sizes of a
DashClient’s bookkeeping, seeDashClient::state_size. - UtcId
- Identity of one
UTCTimingrequest; correlates anAction::FetchUtcTimingwith theon_utc_*call that answers it. - UtcResponse
- A
UTCTimingresponse as the caller observed it. - Variant
Info - One Representation of a selectable video AdaptationSet, in the shape a host’s variant list wants (DESIGN D11).
Enums§
- Action
- One unit of I/O the caller performs.
- Drop
Cause - Why a set or Representation is not played.
- Error
- Errors returned by the client’s
on_*andselect_*calls. - Failure
- How a fetch failed, as the caller observed it.
- Failure
Class - What the caller does after a failure.
- Failure
Kind - The cause the core attributes to a counted failure.
- Fatal
Kind - Why the presentation cannot continue.
- Notice
- A non-fatal, once-per-session observation.
- Output
- One unit of output.
- Rejection
- Why a delivered body was rejected.
- Resource
Id - One fetchable resource; correlates an
Actionwith theon_*call that delivers it. - UtcMethod
- The HTTP method of a
UTCTimingrequest.
Type Aliases§
- Result
- Result alias.