#[non_exhaustive]pub struct VideoHint {Show 14 fields
pub codec: Option<VideoCodec>,
pub coded_width: Option<u32>,
pub coded_height: Option<u32>,
pub display_aspect_width: Option<u32>,
pub display_aspect_height: Option<u32>,
pub color: Option<Color>,
pub bitrate: Option<u64>,
pub framerate: Option<f64>,
pub reorder: Option<u8>,
pub optimize_for_latency: Option<bool>,
pub jitter: Option<Duration>,
pub delay: Option<Duration>,
pub container: Container,
pub preference: i32,
/* private fields */
}Expand description
Caller-provided catalog fields for a video track: a starting point for what the importer detects.
Every field is optional and fills only a gap the stream leaves; a value the stream reveals (the
dimensions from an SPS, …) always wins, so a detected change just updates the catalog. A
codec alone is enough to publish the catalog before the first keyframe (the
decoder config then arrives in band). Use it for fields the stream can’t reveal (bitrate) or to
skip that wait. The MSF catalog declares only hinted estimates (bitrate, framerate, jitter,
delay), never measured ones, so an MSF track carries only those set here.
Video importers take one because they build the VideoConfig
themselves, out of the bitstream, so the caller never holds the config to set these on. An audio
importer publishes a complete config from its init bytes, so the field those bytes can’t carry
(bitrate) rides on AudioInit instead.
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.codec: Option<VideoCodec>The video codec.
coded_width: Option<u32>The encoded width in pixels.
coded_height: Option<u32>The encoded height in pixels.
display_aspect_width: Option<u32>The width of the aspect ratio the whole picture is displayed at, not the sample aspect.
display_aspect_height: Option<u32>The height of the aspect ratio the whole picture is displayed at.
color: Option<Color>The colour the pixels carry. Each field the stream signals outranks the hint’s.
bitrate: Option<u64>The maximum bitrate in bits per second.
framerate: Option<f64>The frame rate in frames per second.
reorder: Option<u8>The rendition’s reorder depth.
optimize_for_latency: Option<bool>If true, the decoder optimizes for latency.
jitter: Option<Duration>The maximum jitter before the next frame is emitted.
delay: Option<Duration>How far this rendition trails the broadcast’s earliest rendition.
container: ContainerThe container wrapping each frame on the wire.
Unlike the other fields this is a choice, not a hint: the bitstream never reveals a container, so it is applied to every config the importer publishes rather than filling a gap.
preference: i32The rendition’s preference.
A choice like the container: the bitstream never reveals it, so every config gets it.
Implementations§
Source§impl VideoHint
impl VideoHint
Sourcepub fn apply(&self, config: &mut VideoConfig)
pub fn apply(&self, config: &mut VideoConfig)
Fill a detected video config’s absent optional fields from these hints.
Only the gaps: a value the stream detects (e.g. the dimensions from an SPS) is left untouched,
so a resolution change updates the catalog instead of conflicting with the hint. An importer
calls this on every config it publishes, before handing it to
container::Producer::set, so a hinted field counts as
supplied and is never overwritten by detection.
Trait Implementations§
Source§impl From<VideoConfig> for VideoHint
impl From<VideoConfig> for VideoHint
Source§fn from(config: VideoConfig) -> Self
fn from(config: VideoConfig) -> Self
Carry a whole rendition across as hints, for a caller that already knows what its encoder emits (moq-video probes its encoder for exactly this).
Total by construction: every field the hint can hold is taken from the config, so there is no
per-field copy for a caller to forget. Fields with no hint slot (broadcast, description,
enabled) are set through the catalog directly.