Skip to main content

Module bandwidth

Module bandwidth 

Source
Expand description

Rate estimation, split into a Producer and Consumer handle.

A Producer is used to set the current estimated bitrate, notifying consumers. A Consumer can read the current estimate and wait for changes. A Demand watches whether anyone reads it, so a producer estimates only on demand.

One estimate covers a whole connection, so senders sharing one divide it with an Allocator rather than each targeting the whole thing. How a sender then follows its share is shared media policy: see moq_mux::rate.

The same reservations set the connection’s probe target: their ceilings summed, which the session hands to its transport’s Probe so the estimate can rise to fund them.

The receive direction mirrors it: Viewers divides the receive estimate among the broadcasts watched over one connection, and their ceilings summed are the PROBE target the session asks its peer to probe up to.

A Limit is the other side: a live Cap an embedder puts on one session’s media, which a gateway enforces however its protocol allows.

Structs§

Allocator
Divides one connection’s bandwidth estimate among the tracks sharing it.
Cap
A rate cap: the sustained rate media may arrive or leave at, and the burst above it.
Consumer
Consumes bandwidth estimates, allowing reads and async change notifications.
Demand
A cloneable, watch-only handle to whether anyone reads a bandwidth estimate.
Limit
A live cap for one session, uncapped while it holds None.
Producer
Produces bandwidth estimates, notifying consumers when the value changes.
Rate
A rate, in bits per second.
Reservation
One track’s standing claim on an Allocator, held for as long as the sender that took it is publishing.
Viewer
One watched broadcast’s standing claim on Viewers, held for as long as it is watched.
Viewers
Divides one connection’s receive estimate among the broadcasts watched over it.
Weak
Mints Consumers on demand without counting as one, nor keeping the channel open.