Skip to main content

ProbeController

Struct ProbeController 

Source
pub struct ProbeController { /* private fields */ }
Expand description

Decides when a probe cluster is sent and at what rate.

Implementations§

Source§

impl ProbeController

Source

pub fn new(initial_bitrate: f64, max_bitrate: f64) -> Self

A controller for an estimator that starts at initial_bitrate and never goes above max_bitrate.

Source

pub fn with_probe_after_drop(self, enabled: bool) -> Self

Whether the rate the target had before a large drop is probed for, for a few seconds after it (the default), as libwebrtc’s ProbeController::RequestProbe does.

A short burst of competing traffic, or a moment of loss, makes the delay-based controller back off by a third or more; once it has passed, the climb back is the controller’s additive increase near the old operating point, half a packet per response time, and takes tens of seconds (23 s after a 2 s burst at half the capacity, in rtci-interceptor/tests/rfc8836_multi_flow.rs), against RFC 8836 section 2 (requirement 1f: the flow “regains its share quickly”). With this, a drop of the target below two thirds of its high of the last two seconds is followed, from a second on and once a second for five seconds, by a cluster at 85% of the rate before the drop while the target is still below that. A result above the target raises it (as every probe does); one below it changes nothing: the competing traffic is still there.

Source

pub fn set_max_bitrate(&mut self, max_bitrate: f64)

The ceiling of what is probed for: the estimator’s own maximum, or a limit from outside it (REMB, TMMBR, the session bit rate).

Source

pub fn poll( &mut self, now: Instant, target: f64, sending: f64, media_flowing: bool, ) -> Option<ProbeRequest>

The cluster to send now, if one is due.

target is the current target bit rate and sending the rate the application is sending at; media_flowing is whether a packet has left yet (a probe before the first one would measure nothing the receiver reports).

Source

pub fn outstanding(&self) -> Option<u32>

The number of the cluster whose result is awaited.

Source

pub fn on_result(&mut self, cluster: u32, estimate: f64) -> Option<f64>

The result of cluster: estimate bits per second. Returns the estimate when it is the outstanding cluster’s, for the estimator to take.

Source

pub fn poll_timeout(&self) -> Option<Instant>

When poll next has something to say without anything else happening.

Never an instant poll has already been called at or after: a deadline that passed with nothing to send (no media flowing, a sender that is no longer application limited, a target that recovered by itself) waits for the next write instead of asking to be woken again at once.

Trait Implementations§

Source§

impl Debug for ProbeController

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.