pub struct CbrController { /* private fields */ }Expand description
Constant Bitrate rate controller.
Uses a leaky bucket model to maintain constant bitrate output.
Implementations§
Source§impl CbrController
impl CbrController
Sourcepub fn set_qp_gain(&mut self, gain: f32)
pub fn set_qp_gain(&mut self, gain: f32)
Set the QP adjustment gain factor.
Sourcepub fn set_allow_frame_drop(&mut self, allow: bool)
pub fn set_allow_frame_drop(&mut self, allow: bool)
Enable or disable frame dropping.
Sourcepub fn get_rc(&mut self, frame_type: FrameType) -> RcOutput
pub fn get_rc(&mut self, frame_type: FrameType) -> RcOutput
Get rate control output for a frame.
Sourcepub fn update(&mut self, stats: &FrameStats)
pub fn update(&mut self, stats: &FrameStats)
Update controller with frame statistics.
Sourcepub fn buffer_fullness(&self) -> f32
pub fn buffer_fullness(&self) -> f32
Get current buffer fullness (0.0 - 1.0).
Sourcepub fn buffer_level(&self) -> u64
pub fn buffer_level(&self) -> u64
Get current buffer level in bits.
Sourcepub fn average_bitrate(&self, elapsed_seconds: f64) -> f64
pub fn average_bitrate(&self, elapsed_seconds: f64) -> f64
Get average bitrate achieved.
Sourcepub fn short_term_bitrate(&self, fps: f64) -> f64
pub fn short_term_bitrate(&self, fps: f64) -> f64
Get short-term bitrate (over recent frames).
Sourcepub fn target_bitrate(&self) -> u64
pub fn target_bitrate(&self) -> u64
Get target bitrate.
Sourcepub fn frame_count(&self) -> u64
pub fn frame_count(&self) -> u64
Get frame count.
Sourcepub fn frames_dropped(&self) -> u64
pub fn frames_dropped(&self) -> u64
Get frames dropped.
Sourcepub fn current_qp(&self) -> f32
pub fn current_qp(&self) -> f32
Get current QP.
Sourcepub fn is_overflow_risk(&self) -> bool
pub fn is_overflow_risk(&self) -> bool
Check if buffer is in overflow danger zone.
Sourcepub fn is_underflow_risk(&self) -> bool
pub fn is_underflow_risk(&self) -> bool
Check if buffer is in underflow danger zone.
Trait Implementations§
Source§impl Clone for CbrController
impl Clone for CbrController
Source§fn clone(&self) -> CbrController
fn clone(&self) -> CbrController
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 CbrController
impl Debug for CbrController
Source§impl Default for CbrController
impl Default for CbrController
Source§impl RateController for CbrController
impl RateController for CbrController
Source§fn get_output(&mut self, frame_type: FrameType, _complexity: f32) -> RcOutput
fn get_output(&mut self, frame_type: FrameType, _complexity: f32) -> RcOutput
Get rate control output for a frame.
Source§fn update_stats(&mut self, stats: &FrameStats)
fn update_stats(&mut self, stats: &FrameStats)
Update controller with frame encoding results.
Source§fn current_qp(&self) -> f32
fn current_qp(&self) -> f32
Get the current QP value.
Source§fn frame_count(&self) -> u64
fn frame_count(&self) -> u64
Get total frames processed.
Source§fn total_bits(&self) -> u64
fn total_bits(&self) -> u64
Get total bits produced.
Auto Trait Implementations§
impl Freeze for CbrController
impl RefUnwindSafe for CbrController
impl Send for CbrController
impl Sync for CbrController
impl Unpin for CbrController
impl UnsafeUnpin for CbrController
impl UnwindSafe for CbrController
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