Skip to main content

TrackSampleGroups

Struct TrackSampleGroups 

Source
pub struct TrackSampleGroups {
    pub stream_index: usize,
    pub sbgp: Vec<SampleToGroup>,
    pub sgpd: Vec<SampleGroupDescription>,
    pub csgp: Vec<CompactSampleToGroup>,
}
Expand description

Per-track sample-group emission request.

Each entry attaches an sbgp (SampleToGroupBox), csgp (CompactSampleToGroupBox) and / or sgpd (SampleGroupDescriptionBox) box into one track’s stbl. The halves share grouping_type; the writer simply serialises whatever the caller supplies — content interpretation belongs to a layer that knows the grouping-type semantics (per ISO/IEC 14496-12 §8.9).

Multiple TrackSampleGroups entries may target the same stream_index; they accumulate in encounter order. The muxer emits all sgpd boxes first, then all sbgp boxes, then all csgp boxes, after the chunk-offset table inside each track’s stbl. sbgp and csgp are alternative encodings of the same per-sample → group mapping (§8.9.5: “at most one csgp or sbgp with a given grouping_type may exist per track”); a caller picks one form per grouping_type and never both.

Fields§

§stream_index: usize

Index into the muxer’s streams slice (the stream slot that owns these groups).

§sbgp: Vec<SampleToGroup>

sbgp boxes to emit for this track. Order is preserved.

§sgpd: Vec<SampleGroupDescription>

sgpd boxes to emit for this track. Order is preserved.

§csgp: Vec<CompactSampleToGroup>

csgp (CompactSampleToGroupBox, §8.9.5) boxes to emit for this track — the compact, bit-packed alternative to sbgp for tracks whose per-sample group membership is periodic. Order is preserved and they follow any sbgp. Use csgp or sbgp for a given grouping_type, never both.

Trait Implementations§

Source§

impl Clone for TrackSampleGroups

Source§

fn clone(&self) -> TrackSampleGroups

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 TrackSampleGroups

Source§

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

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

impl Default for TrackSampleGroups

Source§

fn default() -> TrackSampleGroups

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.