Expand description
The demux tier — the track table, the five-arm packet envelope, and
the Demuxer session face.
A container file is a bundle of tracks; reading it produces a
single interleaved stream of packets, each belonging to one track.
This module names both halves: TrackInfo describes a track,
DemuxedPacket delivers one packet with its track coordinate
attached, and Demuxer is the pull session that hands them out.
§The session is pull-style
The caller owns the loop. Demuxer::next_packet returns the next
packet in interleaved file order and Ok(None) at end of file. One
packet is in hand at a time, whatever the file’s length, and the
caller pulls only when it is ready to consume — backpressure with no
machinery. This is the same rhythm the decoder faces already keep
(the caller schedules; see crate::decoder).
§Construction is not on the trait
Demuxer covers the opened session only: tracks,
next_packet, seek. Opening is each backend’s own business
and each backend’s is different — FFmpeg opens from a path or from a
Read + Seek reader, a WebAssembly container parser opens from a
byte slice. Putting a constructor on the trait would force one of
those spellings onto all of them, which is exactly what the decoder
traits already decline to do.
§Not every backend is a demuxer
R3D and BRAW are clip-oriented SDKs: they expose frames by index,
never packets, so there is nothing for them to demux. They
deliberately do not implement this trait and join a pipeline one
tier up, through crate::decoder::VideoFrameSource and
crate::decoder::AudioFrameSource. A graph that wants both shapes
unifies them at the frame tier, not here.
Structs§
- Attachment
Packet - An attachment packet — a whole file carried inside the container.
- Attachment
Track Packet - Payload for
DemuxedPacket::Attachment. - Attachment
Track Params - Payload for
TrackParams::Attachment. - Audio
Track Packet - Payload for
DemuxedPacket::Audio. - Audio
Track Params - Payload for
TrackParams::Audio. - Data
Packet - A timed opaque-data packet — timecode, KLV, timed ID3.
- Data
Track Packet - Payload for
DemuxedPacket::Data. - Data
Track Params - Payload for
TrackParams::Data. - Subtitle
Track Packet - Payload for
DemuxedPacket::Subtitle. - Subtitle
Track Params - Payload for
TrackParams::Subtitle. - Track
Index - A track’s position in the table
Demuxer::tracksreturns. - Track
Info - One row of the track table
Demuxer::tracksreturns. - Unknown
Track Params - Payload for
TrackParams::Unknown. - Video
Track Packet - Payload for
DemuxedPacket::Video. - Video
Track Params - Payload for
TrackParams::Video.
Enums§
- Demuxed
Packet - One demuxed packet, with the track it came from.
- Track
Kind - What a track carries.
- Track
Params - A track’s codec and per-kind parameters.
Traits§
- Demux
Adapter - Backend vocabulary for the demux tier.
- Demuxer
- An opened container session: the track table, a pull loop, and a seek.
Type Aliases§
- Demux
Attachment Packet - The
AttachmentPacketaDemuxAdapterdelivers over bufferD. - Demux
Audio Packet - The
AudioPacketaDemuxAdapterdelivers over bufferD. - Demux
Data Packet - The
DataPacketaDemuxAdapterdelivers over bufferD. - Demux
Subtitle Packet - The
SubtitlePacketaDemuxAdapterdelivers over bufferD. - Demux
Video Packet - The
VideoPacketaDemuxAdapterdelivers over bufferD.