pub struct AbrLadder {
pub renditions: Vec<ResolutionBitrate>,
}Expand description
An adaptive bitrate ladder containing multiple renditions.
Fields§
§renditions: Vec<ResolutionBitrate>Renditions sorted by bitrate descending.
Implementations§
Source§impl AbrLadder
impl AbrLadder
Sourcepub fn new(renditions: Vec<ResolutionBitrate>) -> Self
pub fn new(renditions: Vec<ResolutionBitrate>) -> Self
Creates a new ABR ladder.
Sourcepub fn optimal_bitrate_kbps(
&self,
bandwidth_kbps: u32,
) -> Option<&ResolutionBitrate>
pub fn optimal_bitrate_kbps( &self, bandwidth_kbps: u32, ) -> Option<&ResolutionBitrate>
Selects the optimal rendition for a given available bandwidth.
Returns the highest-bitrate rendition whose bitrate is ≤ 80% of available bandwidth.
Sourcepub fn highest_quality(&self) -> Option<&ResolutionBitrate>
pub fn highest_quality(&self) -> Option<&ResolutionBitrate>
Returns the highest-quality rendition.
Sourcepub fn lowest_quality(&self) -> Option<&ResolutionBitrate>
pub fn lowest_quality(&self) -> Option<&ResolutionBitrate>
Returns the lowest-quality rendition.
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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