Skip to main content

LowLatencyConfig

Struct LowLatencyConfig 

Source
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: f64

Part-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: f64

PART-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: PreloadHintType

TYPE 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: bool

CAN-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: bool

CAN-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

Source

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

Source§

fn clone(&self) -> LowLatencyConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for LowLatencyConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for LowLatencyConfig

Source§

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.

Source§

impl PartialEq for LowLatencyConfig

Source§

fn eq(&self, other: &LowLatencyConfig) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for LowLatencyConfig

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.