Skip to main content

TrackParams

Enum TrackParams 

Source
pub enum TrackParams<E: DemuxAdapter> {
    Video(VideoTrackParams<E>),
    Audio(AudioTrackParams<E>),
    Subtitle(SubtitleTrackParams<E>),
    Data(DataTrackParams<E>),
    Attachment(AttachmentTrackParams<E>),
    Unknown(UnknownTrackParams<E>),
}
Expand description

A track’s codec and per-kind parameters.

The arm is the kind: TrackInfo::kind reads it off this enum rather than storing a second copy that could disagree with the payload beside it.

No Clone — see TrackInfo’s own doc for the message-carrier law that keeps it off this type too.

Variants§

§

Video(VideoTrackParams<E>)

Motion video.

§

Audio(AudioTrackParams<E>)

Audio.

§

Subtitle(SubtitleTrackParams<E>)

Subtitles / captions.

§

Data(DataTrackParams<E>)

Timed opaque data.

§

Attachment(AttachmentTrackParams<E>)

An attached file — a font, cover art.

§

Unknown(UnknownTrackParams<E>)

A track the backend could not classify.

Implementations§

Source§

impl<E: DemuxAdapter> TrackParams<E>

Source

pub const fn is_video(&self) -> bool

Returns true if this value is of type Video. Returns false otherwise

Source

pub const fn is_audio(&self) -> bool

Returns true if this value is of type Audio. Returns false otherwise

Source

pub const fn is_subtitle(&self) -> bool

Returns true if this value is of type Subtitle. Returns false otherwise

Source

pub const fn is_data(&self) -> bool

Returns true if this value is of type Data. Returns false otherwise

Source

pub const fn is_attachment(&self) -> bool

Returns true if this value is of type Attachment. Returns false otherwise

Source

pub const fn is_unknown(&self) -> bool

Returns true if this value is of type Unknown. Returns false otherwise

Source§

impl<E: DemuxAdapter> TrackParams<E>

Source

pub fn unwrap_video(self) -> VideoTrackParams<E>

Unwraps this value to the TrackParams::Video variant. Panics if this value is of any other type.

Source

pub fn unwrap_video_ref(&self) -> &VideoTrackParams<E>

Unwraps this reference to the TrackParams::Video variant. Panics if this value is of any other type.

Source

pub fn unwrap_video_mut(&mut self) -> &mut VideoTrackParams<E>

Unwraps this mutable reference to the TrackParams::Video variant. Panics if this value is of any other type.

Source

pub fn unwrap_audio(self) -> AudioTrackParams<E>

Unwraps this value to the TrackParams::Audio variant. Panics if this value is of any other type.

Source

pub fn unwrap_audio_ref(&self) -> &AudioTrackParams<E>

Unwraps this reference to the TrackParams::Audio variant. Panics if this value is of any other type.

Source

pub fn unwrap_audio_mut(&mut self) -> &mut AudioTrackParams<E>

Unwraps this mutable reference to the TrackParams::Audio variant. Panics if this value is of any other type.

Source

pub fn unwrap_subtitle(self) -> SubtitleTrackParams<E>

Unwraps this value to the TrackParams::Subtitle variant. Panics if this value is of any other type.

Source

pub fn unwrap_subtitle_ref(&self) -> &SubtitleTrackParams<E>

Unwraps this reference to the TrackParams::Subtitle variant. Panics if this value is of any other type.

Source

pub fn unwrap_subtitle_mut(&mut self) -> &mut SubtitleTrackParams<E>

Unwraps this mutable reference to the TrackParams::Subtitle variant. Panics if this value is of any other type.

Source

pub fn unwrap_data(self) -> DataTrackParams<E>

Unwraps this value to the TrackParams::Data variant. Panics if this value is of any other type.

Source

pub fn unwrap_data_ref(&self) -> &DataTrackParams<E>

Unwraps this reference to the TrackParams::Data variant. Panics if this value is of any other type.

Source

pub fn unwrap_data_mut(&mut self) -> &mut DataTrackParams<E>

Unwraps this mutable reference to the TrackParams::Data variant. Panics if this value is of any other type.

Source

pub fn unwrap_attachment(self) -> AttachmentTrackParams<E>

Unwraps this value to the TrackParams::Attachment variant. Panics if this value is of any other type.

Source

pub fn unwrap_attachment_ref(&self) -> &AttachmentTrackParams<E>

Unwraps this reference to the TrackParams::Attachment variant. Panics if this value is of any other type.

Source

pub fn unwrap_attachment_mut(&mut self) -> &mut AttachmentTrackParams<E>

Unwraps this mutable reference to the TrackParams::Attachment variant. Panics if this value is of any other type.

Source

pub fn unwrap_unknown(self) -> UnknownTrackParams<E>

Unwraps this value to the TrackParams::Unknown variant. Panics if this value is of any other type.

Source

pub fn unwrap_unknown_ref(&self) -> &UnknownTrackParams<E>

Unwraps this reference to the TrackParams::Unknown variant. Panics if this value is of any other type.

Source

pub fn unwrap_unknown_mut(&mut self) -> &mut UnknownTrackParams<E>

Unwraps this mutable reference to the TrackParams::Unknown variant. Panics if this value is of any other type.

Source§

impl<E: DemuxAdapter> TrackParams<E>

Source

pub fn try_unwrap_video( self, ) -> Result<VideoTrackParams<E>, TryUnwrapError<Self>>

Attempts to unwrap this value to the TrackParams::Video variant. Returns a [TryUnwrapError] with the original value if this value is of any other type.

Source

pub fn try_unwrap_video_ref( &self, ) -> Result<&VideoTrackParams<E>, TryUnwrapError<&Self>>

Attempts to unwrap this reference to the TrackParams::Video variant. Returns a [TryUnwrapError] with the original value if this value is of any other type.

Source

pub fn try_unwrap_video_mut( &mut self, ) -> Result<&mut VideoTrackParams<E>, TryUnwrapError<&mut Self>>

Attempts to unwrap this mutable reference to the TrackParams::Video variant. Returns a [TryUnwrapError] with the original value if this value is of any other type.

Source

pub fn try_unwrap_audio( self, ) -> Result<AudioTrackParams<E>, TryUnwrapError<Self>>

Attempts to unwrap this value to the TrackParams::Audio variant. Returns a [TryUnwrapError] with the original value if this value is of any other type.

Source

pub fn try_unwrap_audio_ref( &self, ) -> Result<&AudioTrackParams<E>, TryUnwrapError<&Self>>

Attempts to unwrap this reference to the TrackParams::Audio variant. Returns a [TryUnwrapError] with the original value if this value is of any other type.

Source

pub fn try_unwrap_audio_mut( &mut self, ) -> Result<&mut AudioTrackParams<E>, TryUnwrapError<&mut Self>>

Attempts to unwrap this mutable reference to the TrackParams::Audio variant. Returns a [TryUnwrapError] with the original value if this value is of any other type.

Source

pub fn try_unwrap_subtitle( self, ) -> Result<SubtitleTrackParams<E>, TryUnwrapError<Self>>

Attempts to unwrap this value to the TrackParams::Subtitle variant. Returns a [TryUnwrapError] with the original value if this value is of any other type.

Source

pub fn try_unwrap_subtitle_ref( &self, ) -> Result<&SubtitleTrackParams<E>, TryUnwrapError<&Self>>

Attempts to unwrap this reference to the TrackParams::Subtitle variant. Returns a [TryUnwrapError] with the original value if this value is of any other type.

Source

pub fn try_unwrap_subtitle_mut( &mut self, ) -> Result<&mut SubtitleTrackParams<E>, TryUnwrapError<&mut Self>>

Attempts to unwrap this mutable reference to the TrackParams::Subtitle variant. Returns a [TryUnwrapError] with the original value if this value is of any other type.

Source

pub fn try_unwrap_data(self) -> Result<DataTrackParams<E>, TryUnwrapError<Self>>

Attempts to unwrap this value to the TrackParams::Data variant. Returns a [TryUnwrapError] with the original value if this value is of any other type.

Source

pub fn try_unwrap_data_ref( &self, ) -> Result<&DataTrackParams<E>, TryUnwrapError<&Self>>

Attempts to unwrap this reference to the TrackParams::Data variant. Returns a [TryUnwrapError] with the original value if this value is of any other type.

Source

pub fn try_unwrap_data_mut( &mut self, ) -> Result<&mut DataTrackParams<E>, TryUnwrapError<&mut Self>>

Attempts to unwrap this mutable reference to the TrackParams::Data variant. Returns a [TryUnwrapError] with the original value if this value is of any other type.

Source

pub fn try_unwrap_attachment( self, ) -> Result<AttachmentTrackParams<E>, TryUnwrapError<Self>>

Attempts to unwrap this value to the TrackParams::Attachment variant. Returns a [TryUnwrapError] with the original value if this value is of any other type.

Source

pub fn try_unwrap_attachment_ref( &self, ) -> Result<&AttachmentTrackParams<E>, TryUnwrapError<&Self>>

Attempts to unwrap this reference to the TrackParams::Attachment variant. Returns a [TryUnwrapError] with the original value if this value is of any other type.

Source

pub fn try_unwrap_attachment_mut( &mut self, ) -> Result<&mut AttachmentTrackParams<E>, TryUnwrapError<&mut Self>>

Attempts to unwrap this mutable reference to the TrackParams::Attachment variant. Returns a [TryUnwrapError] with the original value if this value is of any other type.

Source

pub fn try_unwrap_unknown( self, ) -> Result<UnknownTrackParams<E>, TryUnwrapError<Self>>

Attempts to unwrap this value to the TrackParams::Unknown variant. Returns a [TryUnwrapError] with the original value if this value is of any other type.

Source

pub fn try_unwrap_unknown_ref( &self, ) -> Result<&UnknownTrackParams<E>, TryUnwrapError<&Self>>

Attempts to unwrap this reference to the TrackParams::Unknown variant. Returns a [TryUnwrapError] with the original value if this value is of any other type.

Source

pub fn try_unwrap_unknown_mut( &mut self, ) -> Result<&mut UnknownTrackParams<E>, TryUnwrapError<&mut Self>>

Attempts to unwrap this mutable reference to the TrackParams::Unknown variant. Returns a [TryUnwrapError] with the original value if this value is of any other type.

Source§

impl<E: DemuxAdapter> TrackParams<E>

Source

pub const fn kind(&self) -> TrackKind

Returns the kind this arm describes.

Source

pub const fn codec(&self) -> E::CodecId

Returns the codec identifier, whichever arm this is.

Trait Implementations§

Source§

impl<E: DemuxAdapter> Debug for TrackParams<E>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<E> Freeze for TrackParams<E>

§

impl<E> RefUnwindSafe for TrackParams<E>

§

impl<E> Send for TrackParams<E>

§

impl<E> Sync for TrackParams<E>

§

impl<E> Unpin for TrackParams<E>

§

impl<E> UnsafeUnpin for TrackParams<E>

§

impl<E> UnwindSafe for TrackParams<E>

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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.