Skip to main content

TrackInfo

Struct TrackInfo 

Source
pub struct TrackInfo { /* private fields */ }
Expand description

One track of a container: its codec, clock, configuration and what the container declares about it. Built with TrackInfo::video, TrackInfo::audio or TrackInfo::other.

Delays and edit offsets are carried untouched, so a stream copy preserves them. They are applied exactly once, by the decoder adapter configured from this track; the session never trims.

Implementations§

Source§

impl TrackInfo

Source

pub fn video( index: u32, codec: CodecId, time_base: TimeBase, video: VideoTrackInfo, ) -> TrackInfoBuilder

A video track.

Source

pub fn audio( index: u32, codec: CodecId, time_base: TimeBase, audio: AudioTrackInfo, ) -> TrackInfoBuilder

An audio track.

Source

pub fn other( index: u32, kind: TrackKind, codec: CodecId, time_base: TimeBase, ) -> TrackInfoBuilder

A subtitle or data track.

Source

pub fn index(&self) -> u32

The track’s index in its container’s track list.

Source

pub fn kind(&self) -> TrackKind

What the track carries.

Source

pub fn codec(&self) -> &CodecId

The codec.

Source

pub fn time_base(&self) -> TimeBase

The clock its timestamps use.

Source

pub fn codec_private(&self) -> Option<&Arc<[u8]>>

Codec configuration bytes from the container (av1C, avcC, OpusHead), as stored.

Source

pub fn config_epoch(&self) -> u32

The configuration epoch the current codec_private belongs to.

Source

pub fn video_info(&self) -> Option<&VideoTrackInfo>

Video declarations, for a video track.

Source

pub fn audio_info(&self) -> Option<&AudioTrackInfo>

Audio declarations, for an audio track.

Source

pub fn codec_delay(&self) -> Option<FrameDuration>

Decoder delay the container records (Opus pre-skip, AAC priming).

Source

pub fn seek_preroll(&self) -> Option<FrameDuration>

How much must be decoded before a seek target to output it correctly (Opus in WebM: 80 ms).

Source

pub fn edit_delay_ticks(&self) -> Option<i64>

The edit-list offset of the first presentation, in track ticks.

Source

pub fn declared_packets(&self) -> Option<u64>

How many packets the container says the track has.

Source

pub fn declared_duration_ticks(&self) -> Option<u64>

The track length the container declares, in track ticks.

Trait Implementations§

Source§

impl Clone for TrackInfo

Source§

fn clone(&self) -> TrackInfo

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 TrackInfo

Source§

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

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

impl From<&TrackInfo> for CodecConfig

Source§

fn from(t: &TrackInfo) -> Self

Converts to this type from the input type.

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> 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 = Infallible

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.