Skip to main content

VideoHint

Struct VideoHint 

Source
#[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
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional 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: Container

The 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: i32

The rendition’s preference.

A choice like the container: the bitstream never reveals it, so every config gets it.

Implementations§

Source§

impl VideoHint

Source

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 Clone for VideoHint

Source§

fn clone(&self) -> Self

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 Debug for VideoHint

Source§

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

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

impl Default for VideoHint

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl From<VideoConfig> for VideoHint

Source§

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.

Source§

impl PartialEq for VideoHint

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for VideoHint

Source§

impl TryFrom<&VideoHint> for Wire

Source§

type Error = Error

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

fn try_from(hint: &VideoHint) -> Result<Self>

Performs the conversion.

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more