pub struct FormatSelector { /* private fields */ }Expand description
Selects the most suitable ProxyFormatConfig for a given constraint.
Implementations§
Source§impl FormatSelector
impl FormatSelector
Sourcepub fn with_configs(configs: Vec<ProxyFormatConfig>) -> Self
pub fn with_configs(configs: Vec<ProxyFormatConfig>) -> Self
Create a selector with custom configs.
Sourcepub fn select_for_budget(&self, budget_kbps: u32) -> Option<&ProxyFormatConfig>
pub fn select_for_budget(&self, budget_kbps: u32) -> Option<&ProxyFormatConfig>
Return the highest-quality preset that fits budget_kbps.
Returns None if even the lowest-quality preset exceeds the budget.
Sourcepub fn get(&self, preset: QualityPreset) -> Option<&ProxyFormatConfig>
pub fn get(&self, preset: QualityPreset) -> Option<&ProxyFormatConfig>
Return the config for preset, if present.
Sourcepub fn all_ascending(&self) -> Vec<&ProxyFormatConfig>
pub fn all_ascending(&self) -> Vec<&ProxyFormatConfig>
Return all configs sorted from lowest to highest video bitrate.
Trait Implementations§
Source§impl Default for FormatSelector
impl Default for FormatSelector
Source§fn default() -> FormatSelector
fn default() -> FormatSelector
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for FormatSelector
impl RefUnwindSafe for FormatSelector
impl Send for FormatSelector
impl Sync for FormatSelector
impl Unpin for FormatSelector
impl UnsafeUnpin for FormatSelector
impl UnwindSafe for FormatSelector
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> 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