pub struct AbrLadder {
pub rungs: Vec<AbrRung>,
pub strategy: AbrStrategy,
pub max_resolution: (u32, u32),
pub min_resolution: (u32, u32),
}Expand description
ABR ladder configuration.
Fields§
§rungs: Vec<AbrRung>The rungs in the ladder, sorted by bitrate (lowest to highest).
strategy: AbrStrategyStrategy used to generate the ladder.
max_resolution: (u32, u32)Maximum resolution to include.
min_resolution: (u32, u32)Minimum resolution to include.
Implementations§
Source§impl AbrLadder
impl AbrLadder
Sourcepub fn new(strategy: AbrStrategy) -> Self
pub fn new(strategy: AbrStrategy) -> Self
Creates a new empty ABR ladder.
Sourcepub fn with_max_resolution(self, width: u32, height: u32) -> Self
pub fn with_max_resolution(self, width: u32, height: u32) -> Self
Sets the maximum resolution.
Sourcepub fn with_min_resolution(self, width: u32, height: u32) -> Self
pub fn with_min_resolution(self, width: u32, height: u32) -> Self
Sets the minimum resolution.
Sourcepub fn hls_standard() -> Self
pub fn hls_standard() -> Self
Generates a standard HLS ladder based on Apple recommendations.
Sourcepub fn youtube_standard() -> Self
pub fn youtube_standard() -> Self
Generates a YouTube-style ABR ladder.
Sourcepub fn conservative() -> Self
pub fn conservative() -> Self
Generates a conservative ladder (fewer rungs for bandwidth savings).
Sourcepub fn aggressive() -> Self
pub fn aggressive() -> Self
Generates an aggressive ladder (more rungs for quality).
Sourcepub fn filter_by_source(self, source_width: u32, source_height: u32) -> Self
pub fn filter_by_source(self, source_width: u32, source_height: u32) -> Self
Filters rungs based on source resolution.
Only includes rungs at or below the source resolution.
Sourcepub fn rung_count(&self) -> usize
pub fn rung_count(&self) -> usize
Gets the number of rungs in the ladder.
Sourcepub fn highest_quality(&self) -> Option<&AbrRung>
pub fn highest_quality(&self) -> Option<&AbrRung>
Gets the highest quality rung.
Sourcepub fn lowest_quality(&self) -> Option<&AbrRung>
pub fn lowest_quality(&self) -> Option<&AbrRung>
Gets the lowest quality rung.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AbrLadder
impl RefUnwindSafe for AbrLadder
impl Send for AbrLadder
impl Sync for AbrLadder
impl Unpin for AbrLadder
impl UnsafeUnpin for AbrLadder
impl UnwindSafe for AbrLadder
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