pub struct QualityController { /* private fields */ }Expand description
Tracks interaction state and determines encoding parameters each frame.
Implementations§
Source§impl QualityController
impl QualityController
pub fn new(config: QualityConfig) -> Self
Sourcepub fn on_transport_rtt(&mut self, rtt: Duration)
pub fn on_transport_rtt(&mut self, rtt: Duration)
Feed a transport RTT sample into the adaptive quality controller.
Sourcepub fn on_network_metrics(&mut self, metrics: NetworkMetrics)
pub fn on_network_metrics(&mut self, metrics: NetworkMetrics)
Feed a full network metrics sample into the adaptive quality controller.
The controller treats requested_tier as the application’s preferred
maximum quality, and network_cap_tier as the highest quality the
current transport conditions can safely sustain.
Sourcepub fn requested_tier(&self) -> QualityTier
pub fn requested_tier(&self) -> QualityTier
The currently requested application tier.
Sourcepub fn network_cap_tier(&self) -> QualityTier
pub fn network_cap_tier(&self) -> QualityTier
The highest tier currently allowed by recent network samples.
Sourcepub fn current_tier(&self) -> QualityTier
pub fn current_tier(&self) -> QualityTier
The effective encode tier after combining app preference and network cap.
Sourcepub fn last_network_metrics(&self) -> Option<NetworkMetrics>
pub fn last_network_metrics(&self) -> Option<NetworkMetrics>
The most recent network metrics sample, if one has been provided.
Sourcepub fn frame_params(&mut self) -> EncodeParams
pub fn frame_params(&mut self) -> EncodeParams
Get the encode parameters for the current frame.
Sourcepub fn set_tier(&mut self, tier: QualityTier)
pub fn set_tier(&mut self, tier: QualityTier)
Set the application’s preferred maximum tier.
Auto Trait Implementations§
impl Freeze for QualityController
impl RefUnwindSafe for QualityController
impl Send for QualityController
impl Sync for QualityController
impl Unpin for QualityController
impl UnsafeUnpin for QualityController
impl UnwindSafe for QualityController
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