#[non_exhaustive]pub struct Options {
pub track: Option<String>,
pub config: Config,
pub bandwidth: Allocator,
pub lower: Option<Rung>,
}Expand description
Encode and publication policy for Producer.
#[non_exhaustive]: construct via Options::new and set fields, so new knobs can be added
without breaking callers.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.track: Option<String>Track name to publish under. None derives a unique one from the codec (0.avc3, then
1.avc3, …). Subscribers find it through the catalog either way.
config: ConfigThe encoder: the geometry every written frame has, the codec, the backend, and the
bitrate, which is the ceiling the grant never raises it past.
bandwidth: AllocatorThe connection’s bandwidth, as an allocator over
Session::send_bandwidth (or
moq_tokio::Connection::send_bandwidth, which survives reconnects).
The track reserves its ceiling against it and, while someone watches, retunes the encoder
to its share between frames, per the default rate::Policy, so a closing uplink gets a
softer picture instead of a stalled one. Pass the same allocator to every sender on the
connection, audio included, so their bitrates sum to the uplink instead of each matching it.
Defaults to Allocator::unlimited, which holds
the ceiling regardless of congestion.
lower: Option<Rung>The next lower rendition of the same source, when this one is encoded beside it.
Makes this rendition a simulcast rung: while the grant can no longer fund it, it stops
encoding, drops what is written to it, and advertises itself disabled, so the lower
renditions keep their share, and it resumes on a keyframe once the grant recovers. It takes
the track priority one below the lower rendition’s, so the allocator fills that one first.
Needs a bandwidth to follow, and a ceiling above the lower one’s.