Skip to main content

SampleToGroup

Struct SampleToGroup 

Source
pub struct SampleToGroup {
    pub grouping_type: [u8; 4],
    pub grouping_type_parameter: Option<u32>,
    pub entries: Vec<(u32, u32)>,
}
Expand description

One sbgp (SampleToGroupBox) to emit on a track.

grouping_type is the four-byte selector that pairs this box with an sgpd of the same type. The common types in ISO/IEC 14496-12 are roll (audio roll-back distance), rap (random-access points), sync (sync samples), alst (alternate startup sequence), prol (audio preroll); other groupings are defined in codec-binding specs.

grouping_type_parameter selects an alternative grouping of the same type when Some(_) (version 1 of sbgp); None emits version 0.

entries is the run-length table — each pair (sample_count, group_description_index) says “the next sample_count samples belong to group group_description_index”. group_description_index = 0 means “no group of this type” for the run; an index ≥ 0x10001 is a movie-fragment-local reference and is written verbatim (the muxer does not resolve fragment-local groups). The cumulative sum(sample_count) should match the track’s total sample count per §8.9.2.1 — the builder does not validate this.

Fields§

§grouping_type: [u8; 4]

Four-byte grouping type (e.g. *b"roll", *b"rap ").

§grouping_type_parameter: Option<u32>

grouping_type_parameter — selects an alternative grouping of the same type. Some(_) emits version 1; None emits version 0.

§entries: Vec<(u32, u32)>

Run-length entries (sample_count, group_description_index). Empty is a legal “zero-entry” sbgp.

Trait Implementations§

Source§

impl Clone for SampleToGroup

Source§

fn clone(&self) -> SampleToGroup

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 SampleToGroup

Source§

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

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

impl Default for SampleToGroup

Source§

fn default() -> SampleToGroup

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.