Template Struct Packets¶
Defined in File packets.h
Struct Documentation¶
-
template<MediaType media>
struct Packets¶ Media packets template forward declaration.
Compressed media packets with metadata.
Packets structure carries compressed packets from demuxer to decoder, along with codec information and timing metadata. Similar to Frames, AVPacket pointers are managed for bulk resource release.
- Template Parameters:
media – Media type (Audio, Video, or Image).
Public Functions
-
Packets() = default¶
Default constructor.
-
Packets(const std::string &src, int index, Codec<media> &&codec, const std::optional<TimeWindow> ×tamp = {})¶
Construct packets from demuxer for one-time decoding.
Includes codec information needed to initialize the decoder.
- Parameters:
src – Source URI.
index – Stream index.
codec – Codec information.
timestamp – Optional time window user specified.
-
Packets(const std::string &src, int index, const Rational &time_base, const std::optional<TimeWindow> ×tamp = {})¶
Construct packets from demuxer for streaming.
Decoder is initialized separately, so codec is not needed here.
- Parameters:
src – Source URI.
index – Stream index.
time_base – Time base for timestamps.
timestamp – Optional time window user specified.
-
Packets(uintptr_t id, int stream_index, Rational time_base)¶
Construct packets from encoder for muxing.
- Parameters:
id – Trace ID.
stream_index – Output stream index.
time_base – Time base for timestamps.
-
~Packets() = default¶
Destructor.
Public Members
-
uintptr_t id = {}¶
Trace ID for debugging.
-
std::string src¶
Source URI or identifier.
-
int stream_index¶
Stream index in the source.
-
PacketSeries pkts¶
Series of compressed packets.
-
std::optional<TimeWindow> timestamp¶
Optional time window specified by user.