Skip to main content

CompactSampleToGroup

Struct CompactSampleToGroup 

Source
pub struct CompactSampleToGroup {
    pub grouping_type: [u8; 4],
    pub grouping_type_parameter: Option<u32>,
    pub index_msb_indicates_fragment_local_description: bool,
    pub patterns: Vec<CompactSampleToGroupPattern>,
}
Expand description

One csgp (CompactSampleToGroupBox, ISO/IEC 14496-12:2020 §8.9.5) to emit on a track — the compact alternative to SampleToGroup.

Where sbgp emits one (sample_count, group_description_index) pair per run, csgp groups samples into a small set of patterns that are each replicated across the track: pattern i replays its indices for sample_count[i] consecutive groups. A track whose per-sample group membership is periodic (the common reason to pick the compact form) shrinks dramatically — the index run is bit-packed at the narrowest width that fits.

Pairs with an sgpd of the same grouping_type exactly like sbgp.

Fields§

§grouping_type: [u8; 4]

Four-byte grouping type matching the paired sgpd.

§grouping_type_parameter: Option<u32>

grouping_type_parameter — selects an alternative grouping of the same type. Some(_) sets the flag-layout presence bit and emits the optional u32 field; None omits it.

§index_msb_indicates_fragment_local_description: bool

index_msb_indicates_fragment_local_description — flag-layout bit 7 (§8.9.5). Set it (only legal when emitting into a traf) to declare that the most-significant bit of each index is a fragment-local-vs-global sgpd source selector. The builder writes each index value verbatim; it does not synthesise the selector bit, so a caller that sets this must pre-set the high bit on indices that should reference the fragment-local sgpd. Defaults to false (stbl form / no MSB special-casing).

§patterns: Vec<CompactSampleToGroupPattern>

The repeating index patterns, in emit order.

Trait Implementations§

Source§

impl Clone for CompactSampleToGroup

Source§

fn clone(&self) -> CompactSampleToGroup

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 CompactSampleToGroup

Source§

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

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

impl Default for CompactSampleToGroup

Source§

fn default() -> CompactSampleToGroup

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

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, 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> Same for T

Source§

type Output = T

Should always be Self
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, <T as TryFrom<U>>::Error>

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.