pub enum DemuxedPacket<E: DemuxAdapter, D> {
Video(VideoTrackPacket<E, D>),
Audio(AudioTrackPacket<E, D>),
Subtitle(SubtitleTrackPacket<E, D>),
Data(DataTrackPacket<E, D>),
Attachment(AttachmentTrackPacket<E, D>),
}Expand description
One demuxed packet, with the track it came from.
Five arms — the whole delivery roster. Packets do not carry track
coordinates; this envelope does, which is what lets the same
VideoPacket type be handed straight to a decoder without
stripping a field the decoder has no use for.
A track whose kind is TrackKind::Unknown has no arm, and its
packets are therefore never delivered. The roster is closed at five
on purpose: a kind nothing can name is a kind nothing can consume.
Variants§
Video(VideoTrackPacket<E, D>)
A compressed video packet.
Audio(AudioTrackPacket<E, D>)
A compressed audio packet.
Subtitle(SubtitleTrackPacket<E, D>)
A compressed subtitle packet.
Data(DataTrackPacket<E, D>)
A timed opaque-data packet.
Attachment(AttachmentTrackPacket<E, D>)
An attachment payload.
Implementations§
Source§impl<E: DemuxAdapter, D> DemuxedPacket<E, D>
impl<E: DemuxAdapter, D> DemuxedPacket<E, D>
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
Source§impl<E: DemuxAdapter, D> DemuxedPacket<E, D>
impl<E: DemuxAdapter, D> DemuxedPacket<E, D>
Sourcepub fn unwrap_video(self) -> VideoTrackPacket<E, D>
pub fn unwrap_video(self) -> VideoTrackPacket<E, D>
Unwraps this value to the DemuxedPacket::Video variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_video_ref(&self) -> &VideoTrackPacket<E, D>
pub fn unwrap_video_ref(&self) -> &VideoTrackPacket<E, D>
Unwraps this reference to the DemuxedPacket::Video variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_video_mut(&mut self) -> &mut VideoTrackPacket<E, D>
pub fn unwrap_video_mut(&mut self) -> &mut VideoTrackPacket<E, D>
Unwraps this mutable reference to the DemuxedPacket::Video variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_audio(self) -> AudioTrackPacket<E, D>
pub fn unwrap_audio(self) -> AudioTrackPacket<E, D>
Unwraps this value to the DemuxedPacket::Audio variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_audio_ref(&self) -> &AudioTrackPacket<E, D>
pub fn unwrap_audio_ref(&self) -> &AudioTrackPacket<E, D>
Unwraps this reference to the DemuxedPacket::Audio variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_audio_mut(&mut self) -> &mut AudioTrackPacket<E, D>
pub fn unwrap_audio_mut(&mut self) -> &mut AudioTrackPacket<E, D>
Unwraps this mutable reference to the DemuxedPacket::Audio variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_subtitle(self) -> SubtitleTrackPacket<E, D>
pub fn unwrap_subtitle(self) -> SubtitleTrackPacket<E, D>
Unwraps this value to the DemuxedPacket::Subtitle variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_subtitle_ref(&self) -> &SubtitleTrackPacket<E, D>
pub fn unwrap_subtitle_ref(&self) -> &SubtitleTrackPacket<E, D>
Unwraps this reference to the DemuxedPacket::Subtitle variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_subtitle_mut(&mut self) -> &mut SubtitleTrackPacket<E, D>
pub fn unwrap_subtitle_mut(&mut self) -> &mut SubtitleTrackPacket<E, D>
Unwraps this mutable reference to the DemuxedPacket::Subtitle variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_data(self) -> DataTrackPacket<E, D>
pub fn unwrap_data(self) -> DataTrackPacket<E, D>
Unwraps this value to the DemuxedPacket::Data variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_data_ref(&self) -> &DataTrackPacket<E, D>
pub fn unwrap_data_ref(&self) -> &DataTrackPacket<E, D>
Unwraps this reference to the DemuxedPacket::Data variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_data_mut(&mut self) -> &mut DataTrackPacket<E, D>
pub fn unwrap_data_mut(&mut self) -> &mut DataTrackPacket<E, D>
Unwraps this mutable reference to the DemuxedPacket::Data variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_attachment(self) -> AttachmentTrackPacket<E, D>
pub fn unwrap_attachment(self) -> AttachmentTrackPacket<E, D>
Unwraps this value to the DemuxedPacket::Attachment variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_attachment_ref(&self) -> &AttachmentTrackPacket<E, D>
pub fn unwrap_attachment_ref(&self) -> &AttachmentTrackPacket<E, D>
Unwraps this reference to the DemuxedPacket::Attachment variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_attachment_mut(&mut self) -> &mut AttachmentTrackPacket<E, D>
pub fn unwrap_attachment_mut(&mut self) -> &mut AttachmentTrackPacket<E, D>
Unwraps this mutable reference to the DemuxedPacket::Attachment variant.
Panics if this value is of any other type.
Source§impl<E: DemuxAdapter, D> DemuxedPacket<E, D>
impl<E: DemuxAdapter, D> DemuxedPacket<E, D>
Sourcepub fn try_unwrap_video(
self,
) -> Result<VideoTrackPacket<E, D>, TryUnwrapError<Self>>
pub fn try_unwrap_video( self, ) -> Result<VideoTrackPacket<E, D>, TryUnwrapError<Self>>
Attempts to unwrap this value to the DemuxedPacket::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<&VideoTrackPacket<E, D>, TryUnwrapError<&Self>>
pub fn try_unwrap_video_ref( &self, ) -> Result<&VideoTrackPacket<E, D>, TryUnwrapError<&Self>>
Attempts to unwrap this reference to the DemuxedPacket::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 VideoTrackPacket<E, D>, TryUnwrapError<&mut Self>>
pub fn try_unwrap_video_mut( &mut self, ) -> Result<&mut VideoTrackPacket<E, D>, TryUnwrapError<&mut Self>>
Attempts to unwrap this mutable reference to the DemuxedPacket::Video variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_audio(
self,
) -> Result<AudioTrackPacket<E, D>, TryUnwrapError<Self>>
pub fn try_unwrap_audio( self, ) -> Result<AudioTrackPacket<E, D>, TryUnwrapError<Self>>
Attempts to unwrap this value to the DemuxedPacket::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<&AudioTrackPacket<E, D>, TryUnwrapError<&Self>>
pub fn try_unwrap_audio_ref( &self, ) -> Result<&AudioTrackPacket<E, D>, TryUnwrapError<&Self>>
Attempts to unwrap this reference to the DemuxedPacket::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 AudioTrackPacket<E, D>, TryUnwrapError<&mut Self>>
pub fn try_unwrap_audio_mut( &mut self, ) -> Result<&mut AudioTrackPacket<E, D>, TryUnwrapError<&mut Self>>
Attempts to unwrap this mutable reference to the DemuxedPacket::Audio variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_subtitle(
self,
) -> Result<SubtitleTrackPacket<E, D>, TryUnwrapError<Self>>
pub fn try_unwrap_subtitle( self, ) -> Result<SubtitleTrackPacket<E, D>, TryUnwrapError<Self>>
Attempts to unwrap this value to the DemuxedPacket::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<&SubtitleTrackPacket<E, D>, TryUnwrapError<&Self>>
pub fn try_unwrap_subtitle_ref( &self, ) -> Result<&SubtitleTrackPacket<E, D>, TryUnwrapError<&Self>>
Attempts to unwrap this reference to the DemuxedPacket::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 SubtitleTrackPacket<E, D>, TryUnwrapError<&mut Self>>
pub fn try_unwrap_subtitle_mut( &mut self, ) -> Result<&mut SubtitleTrackPacket<E, D>, TryUnwrapError<&mut Self>>
Attempts to unwrap this mutable reference to the DemuxedPacket::Subtitle variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_data(
self,
) -> Result<DataTrackPacket<E, D>, TryUnwrapError<Self>>
pub fn try_unwrap_data( self, ) -> Result<DataTrackPacket<E, D>, TryUnwrapError<Self>>
Attempts to unwrap this value to the DemuxedPacket::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<&DataTrackPacket<E, D>, TryUnwrapError<&Self>>
pub fn try_unwrap_data_ref( &self, ) -> Result<&DataTrackPacket<E, D>, TryUnwrapError<&Self>>
Attempts to unwrap this reference to the DemuxedPacket::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 DataTrackPacket<E, D>, TryUnwrapError<&mut Self>>
pub fn try_unwrap_data_mut( &mut self, ) -> Result<&mut DataTrackPacket<E, D>, TryUnwrapError<&mut Self>>
Attempts to unwrap this mutable reference to the DemuxedPacket::Data variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_attachment(
self,
) -> Result<AttachmentTrackPacket<E, D>, TryUnwrapError<Self>>
pub fn try_unwrap_attachment( self, ) -> Result<AttachmentTrackPacket<E, D>, TryUnwrapError<Self>>
Attempts to unwrap this value to the DemuxedPacket::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<&AttachmentTrackPacket<E, D>, TryUnwrapError<&Self>>
pub fn try_unwrap_attachment_ref( &self, ) -> Result<&AttachmentTrackPacket<E, D>, TryUnwrapError<&Self>>
Attempts to unwrap this reference to the DemuxedPacket::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 AttachmentTrackPacket<E, D>, TryUnwrapError<&mut Self>>
pub fn try_unwrap_attachment_mut( &mut self, ) -> Result<&mut AttachmentTrackPacket<E, D>, TryUnwrapError<&mut Self>>
Attempts to unwrap this mutable reference to the DemuxedPacket::Attachment variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.