#[non_exhaustive]pub struct PolicyConfig {
pub min: Duration,
pub initial: Duration,
pub max: Duration,
pub k1_q8: u16,
pub margin: Duration,
pub k2_q8: u16,
pub after_rebuffer_q8: u16,
pub max_step_down_per_s: Duration,
pub reprime_floor: Duration,
pub reprime_hold: Duration,
}Expand description
Target-buffer policy configuration.
max is a hard cap: neither the target, nor the start threshold, nor
the resume threshold ever exceeds it, so a caller can size its compressed
queue from it.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.min: DurationFloor of every target (300 ms).
initial: DurationCold-start target without stall memory (1.8 s, owner-approved 2026-10-17).
max: DurationHard ceiling of every target and threshold (3 s).
k1_q8: u16Baseline multiplier, Q8 (2.0 => 512).
margin: DurationAdditive margin (100 ms).
k2_q8: u16Stall-peak multiplier, Q8 (1.2 => 307).
after_rebuffer_q8: u16Resume target after a stall = max(target, x * stall_peak), Q8 (1.25 => 320).
max_step_down_per_s: DurationTarget decrease rate per second of clock (100 ms per second).
reprime_floor: DurationVoluntary re-prime below this lead while playing (0 = disabled).
reprime_hold: DurationHow long below the floor before re-priming (2 s).
Implementations§
Trait Implementations§
Source§impl Clone for PolicyConfig
impl Clone for PolicyConfig
impl Copy for PolicyConfig
Source§impl Debug for PolicyConfig
impl Debug for PolicyConfig
Source§impl Default for PolicyConfig
impl Default for PolicyConfig
Source§impl<'de> Deserialize<'de> for PolicyConfig
impl<'de> Deserialize<'de> for PolicyConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for PolicyConfig
Source§impl PartialEq for PolicyConfig
impl PartialEq for PolicyConfig
Source§impl Serialize for PolicyConfig
impl Serialize for PolicyConfig
impl StructuralPartialEq for PolicyConfig
Auto Trait Implementations§
impl Forget for PolicyConfig
impl Freeze for PolicyConfig
impl Move for PolicyConfig
impl RefUnwindSafe for PolicyConfig
impl Send for PolicyConfig
impl Sync for PolicyConfig
impl Unpin for PolicyConfig
impl UnsafeUnpin for PolicyConfig
impl UnwindSafe for PolicyConfig
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