pub struct TargetBitrate {
pub peak_kbps: u32,
pub avg_kbps: u32,
pub min_kbps: u32,
}Expand description
Target bitrate specification with peak, average, and minimum limits.
Fields§
§peak_kbps: u32Peak bitrate in kbps.
avg_kbps: u32Average bitrate in kbps.
min_kbps: u32Minimum bitrate in kbps (may be 0 for unconstrained).
Implementations§
Source§impl TargetBitrate
impl TargetBitrate
Sourcepub fn with_peak(peak: u32, avg: u32) -> Self
pub fn with_peak(peak: u32, avg: u32) -> Self
Creates a VBR TargetBitrate with a peak and average; min_kbps is set
to half of avg_kbps.
Sourcepub fn cbr(kbps: u32) -> Self
pub fn cbr(kbps: u32) -> Self
Creates a CBR TargetBitrate where peak, average, and minimum are all
equal to kbps.
Sourcepub fn peak_to_avg_ratio(&self) -> f32
pub fn peak_to_avg_ratio(&self) -> f32
Returns the ratio of peak to average bitrate.
Returns 1.0 if avg_kbps is zero.
Trait Implementations§
Source§impl Clone for TargetBitrate
impl Clone for TargetBitrate
Source§fn clone(&self) -> TargetBitrate
fn clone(&self) -> TargetBitrate
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 moreSource§impl Debug for TargetBitrate
impl Debug for TargetBitrate
Source§impl PartialEq for TargetBitrate
impl PartialEq for TargetBitrate
impl Copy for TargetBitrate
impl Eq for TargetBitrate
impl StructuralPartialEq for TargetBitrate
Auto Trait Implementations§
impl Freeze for TargetBitrate
impl RefUnwindSafe for TargetBitrate
impl Send for TargetBitrate
impl Sync for TargetBitrate
impl Unpin for TargetBitrate
impl UnsafeUnpin for TargetBitrate
impl UnwindSafe for TargetBitrate
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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