#[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
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
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
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
impl MaxBwConfig
Sourcepub fn max_bw_bytes_per_sec(&self) -> Option<u64>
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
impl Clone for MaxBwConfig
Source§fn clone(&self) -> MaxBwConfig
fn clone(&self) -> MaxBwConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for MaxBwConfig
Source§impl Debug for MaxBwConfig
impl Debug for MaxBwConfig
Source§impl Default for MaxBwConfig
impl Default for MaxBwConfig
Source§fn default() -> Self
fn default() -> Self
Default: MaxBwConfig::Set at 1 Gbps (specs/rules/srt-livecc.md
§5.1.1, L3122-3123).