Skip to main content

DemuxAdapter

Trait DemuxAdapter 

Source
pub trait DemuxAdapter {
    type CodecId: Copy + Eq + Debug;
    type Video: VideoAdapter<CodecId = Self::CodecId>;
    type Audio: AudioAdapter<CodecId = Self::CodecId>;
    type Subtitle: SubtitleAdapter<CodecId = Self::CodecId>;
    type DataExtra;
    type AttachmentExtra;
    type TrackExtra;
    type Text: AsRef<str> + Debug;
}
Expand description

Backend vocabulary for the demux tier.

Bundles the three decoding families (VideoAdapter, AudioAdapter, SubtitleAdapter) that already exist and adds the seats only a demuxer needs: extras for the two packet kinds that have no decoder face, extras for a track-table row, and the text carrier for a track’s identity metadata.

The three families are bound to share this adapter’s CodecId. A demuxer reads one container, and a container’s track table has one codec-identifier column — the same namespace names its video, its audio, its subtitles, and its cover art. Keeping them one type is what lets a consumer take the codec identifier off an Attachment track carrying cover art and hand it to a video decoder.

Required Associated Types§

Source

type CodecId: Copy + Eq + Debug

Codec identifier for every track in the table, whatever its kind (e.g. a newtype around FFmpeg’s AVCodecID, a WebCodecs codec string, a container fourcc).

Source

type Video: VideoAdapter<CodecId = Self::CodecId>

Vocabulary for the container’s video tracks.

Source

type Audio: AudioAdapter<CodecId = Self::CodecId>

Vocabulary for the container’s audio tracks.

Source

type Subtitle: SubtitleAdapter<CodecId = Self::CodecId>

Vocabulary for the container’s subtitle tracks.

Source

type DataExtra

Backend-specific extras carried on every DataPacket.

Source

type AttachmentExtra

Backend-specific extras carried on every AttachmentPacket.

Source

type TrackExtra

Backend-specific extras carried on every TrackInfo — the place a backend keeps what the portable row has no seat for (a native stream index, disposition bits, the container’s metadata bag).

Source

type Text: AsRef<str> + Debug

Text carrier for a track’s identity metadata — the attachment filename and MIME type on TrackInfo.

A seat rather than a fixed string type so the core stays allocator-free: a backend with compile-time names can bind &'static str, one that reads them out of a container binds an owned inline string.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§