#[non_exhaustive]pub struct Adaptation {
pub fit_ratio: f64,
pub estimate_window: Duration,
pub loss_step_down: f64,
pub loss_emergency: f64,
pub downgrade_hold: Duration,
pub upgrade_hold: Duration,
pub post_downgrade_cooldown: Duration,
pub trial: Duration,
pub upgrade_hold_max: Duration,
pub tick: Duration,
}Expand description
The player’s adaptation thresholds and timers.
The defaults are tuned together on real and simulated links.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.fit_ratio: f64The multiple of a rung’s advertised bitrate the estimate has to cover.
The estimate reads up to 1.6 times a capped link’s rate, and encoders send about 82% of what they advertise. At 1.25, a rung fits while the estimate covers 1.5 times what it sends.
estimate_window: DurationHow long the estimate is remembered, as a sliding maximum.
The estimate refreshes ten times a second and moves with every acknowledgement. A single low reading does not mean a smaller link, so only a shortfall that lasts the whole window counts.
loss_step_down: f64Loss above which the ceiling steps down one rung.
It has to hold for downgrade_hold first.
loss_emergency: f64Loss above which the ceiling drops to the bottom rung at once.
downgrade_hold: DurationHow long a lower target has to hold before the switch.
upgrade_hold: DurationHow long a higher target has to hold before the switch.
Loss also has to stay clear this long before the loss ceiling rises a rung.
post_downgrade_cooldown: DurationHow long after a step down no step up is taken.
trial: DurationHow long a rung has to play after a step up before the step counts as held.
Each step down from a rung multiplies the hold before the next step up
to it by four, up to upgrade_hold_max. A
step up that plays this long clears the count. The estimate read on the
rung below says little about the rung above, so this lets a marginal
link settle on the rung it can carry.
upgrade_hold_max: DurationThe longest hold before a step up.
tick: DurationHow often the network is read while it can change the choice.