pub struct ProbeController { /* private fields */ }Expand description
Decides when a probe cluster is sent and at what rate.
Implementations§
Source§impl ProbeController
impl ProbeController
Sourcepub fn new(initial_bitrate: f64, max_bitrate: f64) -> Self
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.
Sourcepub fn with_probe_after_drop(self, enabled: bool) -> Self
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.
Sourcepub fn set_max_bitrate(&mut self, max_bitrate: f64)
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).
Sourcepub fn poll(
&mut self,
now: Instant,
target: f64,
sending: f64,
media_flowing: bool,
) -> Option<ProbeRequest>
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).
Sourcepub fn outstanding(&self) -> Option<u32>
pub fn outstanding(&self) -> Option<u32>
The number of the cluster whose result is awaited.
Sourcepub fn on_result(&mut self, cluster: u32, estimate: f64) -> Option<f64>
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.
Sourcepub fn poll_timeout(&self) -> Option<Instant>
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.