Skip to main content

MaxBwConfig

Enum MaxBwConfig 

Source
#[non_exhaustive]
pub enum MaxBwConfig { Set(u64), InputBased { input_bw: u64, overhead: u64, }, Estimated { est_input_bw: u64, overhead: u64, }, Infinite, }
Expand description

Maximum bandwidth configuration mode (specs/rules/srt-livecc.md §5.1.1, lines L3116-L3202).

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Set(u64)

MAXBW_SET (§5.1.1, L3120-3128): MAX_BW set explicitly (bytes/sec). Default: 1 Gbps = 125_000_000 bytes/sec.

§

InputBased

INPUTBW_SET (§5.1.1, L3130-3146): input rate (bytes/sec) + overhead percentage. MAX_BW = input_bw * (1 + overhead / 100) (L3143).

Fields

§input_bw: u64

The sender’s input rate, in bytes per second.

§overhead: u64

Overhead percentage (e.g. 25 means 25%).

§

Estimated

INPUTBW_ESTIMATED (§5.1.1, L3148-3184): measured input rate + overhead. MAX_BW = est_input_bw * (1 + overhead / 100) (L3154).

Unlike MaxBwConfig::InputBased, est_input_bw is updated externally (e.g. the encoder’s measured bitrate). The formula is identical.

Fields

§est_input_bw: u64

The estimated sender input rate, in bytes per second.

§overhead: u64

Overhead percentage (e.g. 25 means 25%).

§

Infinite

Unbounded — infinite bandwidth. No packet pacing is applied.

Not a named mode in §5.1.1’s table (L3197-3201), but is the implicit effect when MAX_BW is not set or is unlimited. Represented by a PKT_SND_PERIOD of 0 (send as fast as possible).

Implementations§

Source§

impl MaxBwConfig

Source

pub fn name(&self) -> &'static str

The §5.1.1 mode name.

Source

pub fn max_bw_bytes_per_sec(&self) -> Option<u64>

Resolve the current MAX_BW value in bytes per second, or None for unbounded (infinite bandwidth).

Per specs/rules/srt-livecc.md §5.1.1:

  • MAXBW_SET: returns the explicit value (L3120-3128).
  • INPUTBW_SET: returns input_bw * (1 + overhead / 100) (L3143).
  • INPUTBW_ESTIMATED: returns est_input_bw * (1 + overhead / 100) (L3154).
  • Infinite: returns None.

Trait Implementations§

Source§

impl Clone for MaxBwConfig

Source§

fn clone(&self) -> MaxBwConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for MaxBwConfig

Source§

impl Debug for MaxBwConfig

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for MaxBwConfig

Source§

fn default() -> Self

Default: MaxBwConfig::Set at 1 Gbps (specs/rules/srt-livecc.md §5.1.1, L3122-3123).

Source§

impl Display for MaxBwConfig

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Eq for MaxBwConfig

Source§

impl PartialEq for MaxBwConfig

Source§

fn eq(&self, other: &MaxBwConfig) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for MaxBwConfig

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.