Skip to main content

Module packet

Module packet 

Source
Expand description

Compressed access units.

A Packet is what a demuxer yields and a decoder takes, and what an encoder yields and a muxer takes. It is never a picture: a decoder may produce zero, one or several frames per packet, and may produce them later (reordering, hidden frames, show-existing).

The payload is a PacketPayload: an owned Vec, or a range of a shared buffer, so a demuxer can hand out slices of one read without copying and a backend can take an owned Vec without copying either. A consumer that accepts a packet takes its payload (Packet::take); one that pushes back leaves it in place for the retry.

Structs§

Discard
Decoded media to drop from one packet’s output: padding the encoder added (WebM DiscardPadding, the end of an Opus or AAC stream).
Packet
A compressed access unit and what the container recorded about it.
PacketAddition
Side data carried with one packet: a WebM BlockAdditional, an alpha plane coded separately. How additions pair with the main payload is the codec’s business, not the packet’s.

Enums§

PacketError
Invalid packet construction.
PacketPayload
Where a packet’s bytes live.
RandomAccess
What the container says about random access at a packet.