pub struct AbrLadderConfig {
pub rungs: Vec<AbrRungConfig>,
pub strategy: LadderSelectionStrategy,
pub switch_rules: Vec<SwitchRule>,
pub segment_duration_secs: f64,
pub codec: String,
}Expand description
A complete ABR ladder with multiple quality rungs.
Fields§
§rungs: Vec<AbrRungConfig>All rungs sorted from lowest to highest quality.
strategy: LadderSelectionStrategySelection strategy.
switch_rules: Vec<SwitchRule>Switch rules between rungs.
segment_duration_secs: f64Segment duration in seconds.
codec: StringTarget codec for all rungs.
Implementations§
Source§impl AbrLadderConfig
impl AbrLadderConfig
Sourcepub fn add_rung(self, rung: AbrRungConfig) -> Self
pub fn add_rung(self, rung: AbrRungConfig) -> Self
Adds a rung to the ladder.
Sourcepub fn with_strategy(self, strategy: LadderSelectionStrategy) -> Self
pub fn with_strategy(self, strategy: LadderSelectionStrategy) -> Self
Sets the selection strategy.
Sourcepub fn with_segment_duration(self, secs: f64) -> Self
pub fn with_segment_duration(self, secs: f64) -> Self
Sets the segment duration.
Sourcepub fn standard_hls_h264() -> Self
pub fn standard_hls_h264() -> Self
Generates the standard Netflix-style HLS ladder for H.264.
Sourcepub fn select_rung(&self, available_bps: u64) -> Option<&AbrRungConfig>
pub fn select_rung(&self, available_bps: u64) -> Option<&AbrRungConfig>
Selects the best rung for the given available bandwidth.
Sourcepub fn rung_count(&self) -> usize
pub fn rung_count(&self) -> usize
Returns the number of rungs in the ladder.
Sourcepub fn lowest_rung(&self) -> Option<&AbrRungConfig>
pub fn lowest_rung(&self) -> Option<&AbrRungConfig>
Returns the lowest quality rung.
Sourcepub fn highest_rung(&self) -> Option<&AbrRungConfig>
pub fn highest_rung(&self) -> Option<&AbrRungConfig>
Returns the highest quality rung.
Sourcepub fn generate_switch_rules(&mut self)
pub fn generate_switch_rules(&mut self)
Generates switch rules for all adjacent rung pairs.
Trait Implementations§
Source§impl Clone for AbrLadderConfig
impl Clone for AbrLadderConfig
Source§fn clone(&self) -> AbrLadderConfig
fn clone(&self) -> AbrLadderConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for AbrLadderConfig
impl RefUnwindSafe for AbrLadderConfig
impl Send for AbrLadderConfig
impl Sync for AbrLadderConfig
impl Unpin for AbrLadderConfig
impl UnsafeUnpin for AbrLadderConfig
impl UnwindSafe for AbrLadderConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more