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>
impl<E: DemuxAdapter> TrackParams<E>
Sourcepub const fn is_video(&self) -> bool
pub const fn is_video(&self) -> bool
Returns true if this value is of type Video. Returns false otherwise
Sourcepub const fn is_audio(&self) -> bool
pub const fn is_audio(&self) -> bool
Returns true if this value is of type Audio. Returns false otherwise
Sourcepub const fn is_subtitle(&self) -> bool
pub const fn is_subtitle(&self) -> bool
Returns true if this value is of type Subtitle. Returns false otherwise
Sourcepub const fn is_data(&self) -> bool
pub const fn is_data(&self) -> bool
Returns true if this value is of type Data. Returns false otherwise
Sourcepub const fn is_attachment(&self) -> bool
pub const fn is_attachment(&self) -> bool
Returns true if this value is of type Attachment. Returns false otherwise
Sourcepub const fn is_unknown(&self) -> bool
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>
impl<E: DemuxAdapter> TrackParams<E>
Sourcepub fn unwrap_video(self) -> VideoTrackParams<E>
pub fn unwrap_video(self) -> VideoTrackParams<E>
Unwraps this value to the TrackParams::Video variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_video_ref(&self) -> &VideoTrackParams<E>
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.
Sourcepub fn unwrap_video_mut(&mut self) -> &mut VideoTrackParams<E>
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.
Sourcepub fn unwrap_audio(self) -> AudioTrackParams<E>
pub fn unwrap_audio(self) -> AudioTrackParams<E>
Unwraps this value to the TrackParams::Audio variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_audio_ref(&self) -> &AudioTrackParams<E>
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.
Sourcepub fn unwrap_audio_mut(&mut self) -> &mut AudioTrackParams<E>
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.
Sourcepub fn unwrap_subtitle(self) -> SubtitleTrackParams<E>
pub fn unwrap_subtitle(self) -> SubtitleTrackParams<E>
Unwraps this value to the TrackParams::Subtitle variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_subtitle_ref(&self) -> &SubtitleTrackParams<E>
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.
Sourcepub fn unwrap_subtitle_mut(&mut self) -> &mut SubtitleTrackParams<E>
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.
Sourcepub fn unwrap_data(self) -> DataTrackParams<E>
pub fn unwrap_data(self) -> DataTrackParams<E>
Unwraps this value to the TrackParams::Data variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_data_ref(&self) -> &DataTrackParams<E>
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.
Sourcepub fn unwrap_data_mut(&mut self) -> &mut DataTrackParams<E>
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.
Sourcepub fn unwrap_attachment(self) -> AttachmentTrackParams<E>
pub fn unwrap_attachment(self) -> AttachmentTrackParams<E>
Unwraps this value to the TrackParams::Attachment variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_attachment_ref(&self) -> &AttachmentTrackParams<E>
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.
Sourcepub fn unwrap_attachment_mut(&mut self) -> &mut AttachmentTrackParams<E>
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.
Sourcepub fn unwrap_unknown(self) -> UnknownTrackParams<E>
pub fn unwrap_unknown(self) -> UnknownTrackParams<E>
Unwraps this value to the TrackParams::Unknown variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_unknown_ref(&self) -> &UnknownTrackParams<E>
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.
Sourcepub fn unwrap_unknown_mut(&mut self) -> &mut UnknownTrackParams<E>
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>
impl<E: DemuxAdapter> TrackParams<E>
Sourcepub fn try_unwrap_video(
self,
) -> Result<VideoTrackParams<E>, TryUnwrapError<Self>>
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.
Sourcepub fn try_unwrap_video_ref(
&self,
) -> Result<&VideoTrackParams<E>, TryUnwrapError<&Self>>
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.
Sourcepub fn try_unwrap_video_mut(
&mut self,
) -> Result<&mut VideoTrackParams<E>, TryUnwrapError<&mut Self>>
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.
Sourcepub fn try_unwrap_audio(
self,
) -> Result<AudioTrackParams<E>, TryUnwrapError<Self>>
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.
Sourcepub fn try_unwrap_audio_ref(
&self,
) -> Result<&AudioTrackParams<E>, TryUnwrapError<&Self>>
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.
Sourcepub fn try_unwrap_audio_mut(
&mut self,
) -> Result<&mut AudioTrackParams<E>, TryUnwrapError<&mut Self>>
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.
Sourcepub fn try_unwrap_subtitle(
self,
) -> Result<SubtitleTrackParams<E>, TryUnwrapError<Self>>
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.
Sourcepub fn try_unwrap_subtitle_ref(
&self,
) -> Result<&SubtitleTrackParams<E>, TryUnwrapError<&Self>>
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.
Sourcepub fn try_unwrap_subtitle_mut(
&mut self,
) -> Result<&mut SubtitleTrackParams<E>, TryUnwrapError<&mut Self>>
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.
Sourcepub fn try_unwrap_data(self) -> Result<DataTrackParams<E>, TryUnwrapError<Self>>
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.
Sourcepub fn try_unwrap_data_ref(
&self,
) -> Result<&DataTrackParams<E>, TryUnwrapError<&Self>>
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.
Sourcepub fn try_unwrap_data_mut(
&mut self,
) -> Result<&mut DataTrackParams<E>, TryUnwrapError<&mut Self>>
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.
Sourcepub fn try_unwrap_attachment(
self,
) -> Result<AttachmentTrackParams<E>, TryUnwrapError<Self>>
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.
Sourcepub fn try_unwrap_attachment_ref(
&self,
) -> Result<&AttachmentTrackParams<E>, TryUnwrapError<&Self>>
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.
Sourcepub fn try_unwrap_attachment_mut(
&mut self,
) -> Result<&mut AttachmentTrackParams<E>, TryUnwrapError<&mut Self>>
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.
Sourcepub fn try_unwrap_unknown(
self,
) -> Result<UnknownTrackParams<E>, TryUnwrapError<Self>>
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.
Sourcepub fn try_unwrap_unknown_ref(
&self,
) -> Result<&UnknownTrackParams<E>, TryUnwrapError<&Self>>
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.
Sourcepub fn try_unwrap_unknown_mut(
&mut self,
) -> Result<&mut UnknownTrackParams<E>, TryUnwrapError<&mut Self>>
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.