pub struct LayerSelector { /* private fields */ }Expand description
Stateful chooser over a fixed set of layers.
Selection and the ABR form a closed loop: relaying a higher rung puts more bytes on the wire, so on a constrained link the controller cuts, which demotes the rung, which frees the link and lets the target recover — and the cycle repeats. Measured on the demo camera under 12 % loss it ran every 10-40 s indefinitely. Neither a hold nor a backoff damps it on its own, because the cycle is caused by the switch, so the selector remembers the target at which each rung failed and refuses to climb back for less.
Implementations§
Source§impl LayerSelector
impl LayerSelector
Sourcepub fn new(layers: Vec<VideoLayer>, target_kbps: u32) -> Option<Self>
pub fn new(layers: Vec<VideoLayer>, target_kbps: u32) -> Option<Self>
Build a selector over layers, settled at whichever layer target_kbps
affords. Starting where the link already is avoids a gratuitous switch in
the first seconds of a session.
Returns None if no layer was declared; a single layer is fine and makes
step a no-op forever.
pub fn current(&self) -> u8
pub fn current_name(&self) -> &str
pub fn layers(&self) -> &[VideoLayer]
Trait Implementations§
Source§impl Clone for LayerSelector
impl Clone for LayerSelector
Source§fn clone(&self) -> LayerSelector
fn clone(&self) -> LayerSelector
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more