pub struct LowLatencyConfig {Show 14 fields
pub part_target: f64,
pub part_hold_back: f64,
pub preload_hint_part: Option<String>,
pub preload_hint_type: PreloadHintType,
pub preload_hint_byte_range_start: Option<u64>,
pub preload_hint_byte_range_length: Option<u64>,
pub can_skip_until: Option<f64>,
pub can_block_reload: bool,
pub extra_attrs: Vec<(String, String)>,
pub sc_extra_attrs: Vec<(String, String)>,
pub pi_extra_attrs: Vec<(String, String)>,
pub ph_extra_attrs: Vec<(String, String)>,
pub hold_back: Option<f64>,
pub can_skip_dateranges: bool,
}Expand description
Low-Latency HLS playlist configuration — RFC 8216bis.
Presence of this config on a MediaPlaylist switches on the LL-HLS
directives (#EXT-X-SERVER-CONTROL, #EXT-X-PART-INF, #EXT-X-PART,
#EXT-X-PRELOAD-HINT); see the module docs for each tag’s spec section.
Fields§
§part_target: f64Part-target duration in seconds — the PART-TARGET of #EXT-X-PART-INF
(RFC 8216bis §4.4.3.7). Typically 0.2–0.5 s.
part_hold_back: f64PART-HOLD-BACK in seconds — the #EXT-X-SERVER-CONTROL attribute
(RFC 8216bis §4.4.3.8). MUST be at least 3 × part_target; the renderer
raises it to that floor if a smaller value is supplied.
preload_hint_part: Option<String>URI of the next, not-yet-available part or map — rendered as
#EXT-X-PRELOAD-HINT:TYPE=<...>,URI="<uri>" (RFC 8216bis §4.4.5.3). When
None, no preload hint is emitted (e.g. an ended playlist).
preload_hint_type: PreloadHintTypeTYPE of Self::preload_hint_part’s hinted resource (RFC 8216bis
§4.4.5.3): PART (a Partial Segment) or MAP (a Media
Initialization Section). Only meaningful when preload_hint_part is
Some; defaults to PreloadHintType::Part (the overwhelmingly
common case).
preload_hint_byte_range_start: Option<u64>BYTERANGE-START of the #EXT-X-PRELOAD-HINT tag (RFC 8216bis
§4.4.5.3) — byte offset of the hinted resource. None implies 0.
preload_hint_byte_range_length: Option<u64>BYTERANGE-LENGTH of the #EXT-X-PRELOAD-HINT tag (RFC 8216bis
§4.4.5.3) — length in bytes. None means “to the end of the
resource”.
can_skip_until: Option<f64>CAN-SKIP-UNTIL attribute of #EXT-X-SERVER-CONTROL (RFC 8216bis
§4.4.3.8) — the Skip Boundary in seconds, advertising support for
Playlist Delta Updates (#EXT-X-SKIP). None omits the attribute.
can_block_reload: boolCAN-BLOCK-RELOAD attribute of #EXT-X-SERVER-CONTROL (RFC 8216bis
§4.4.3.8) — whether the server supports Blocking Playlist Reload
(RFC 8216bis §6.2.5.2). to_m3u8 renders the actual value
(YES/NO) rather than assuming YES; MediaPlaylist::parse
derives it from the attribute’s real wire value, defaulting to
false (per RFC 8216bis) when the attribute — or the whole
#EXT-X-SERVER-CONTROL tag — is absent. A client MUST NOT infer
blocking-reload support merely from MediaPlaylist::low_latency
being Some; it must check this field (issue #717 slice 1 gap).
extra_attrs: Vec<(String, String)>Unmodeled attributes from #EXT-X-SERVER-CONTROL,
#EXT-X-PART-INF, and #EXT-X-PRELOAD-HINT, retained so REQ-
prefixed names can fire RFC 8216bis §8 row 12. Sorted by name on parse (deterministic).
sc_extra_attrs: Vec<(String, String)>Unmodeled attributes from #EXT-X-SERVER-CONTROL only.
pi_extra_attrs: Vec<(String, String)>Unmodeled attributes from #EXT-X-PART-INF only.
ph_extra_attrs: Vec<(String, String)>Unmodeled attributes from #EXT-X-PRELOAD-HINT only.
hold_back: Option<f64>HOLD-BACK attribute of #EXT-X-SERVER-CONTROL (RFC 8216bis
§4.4.3.8) — the server-recommended minimum distance from the live
edge for clients NOT playing in Low-Latency Mode. None means the
attribute is absent (the spec default: three times the Target
Duration). When Some, the value MUST be at least three times the
Target Duration per the spec. Only meaningful when
LowLatencyConfig is present; for a non-LL-HLS playlist with a
custom hold-back, set this on a playlist that also carries the
#EXT-X-PART-INF and #EXT-X-SERVER-CONTROL tags.
can_skip_dateranges: boolCAN-SKIP-DATERANGES attribute of #EXT-X-SERVER-CONTROL
(RFC 8216bis §4.4.3.8) — enumerated-string YES if the server can
produce Playlist Delta Updates (§6.2.5.1) that skip older
#EXT-X-DATERANGE tags in addition to Media Segments. REQUIRES the
presence of Self::can_skip_until; the renderer suppresses this
attribute when that field is None regardless of this value.
Implementations§
Source§impl LowLatencyConfig
impl LowLatencyConfig
Sourcepub fn effective_part_hold_back(&self) -> f64
pub fn effective_part_hold_back(&self) -> f64
The PART-HOLD-BACK value actually rendered: at least 3 × part_target
per RFC 8216bis §4.4.3.8, even if Self::part_hold_back is smaller.
Trait Implementations§
Source§impl Clone for LowLatencyConfig
impl Clone for LowLatencyConfig
Source§fn clone(&self) -> LowLatencyConfig
fn clone(&self) -> LowLatencyConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for LowLatencyConfig
impl Debug for LowLatencyConfig
Source§impl Default for LowLatencyConfig
impl Default for LowLatencyConfig
Source§fn default() -> Self
fn default() -> Self
Defaults can_block_reload to true — this crate’s own LL-HLS
origin (and every in-repo test/fixture that builds a
LowLatencyConfig from scratch via ..Default::default()) always
supports blocking reload, matching to_m3u8()’s historical
CAN-BLOCK-RELOAD=YES output. This default is never consulted for a
parsed playlist: MediaPlaylist::parse always derives
can_block_reload from the wire attribute (RFC 8216bis default:
false/absent-means-NO), independent of this Default impl.