Home
AV module

MediaPacket

Timestamped media packet carrying raw audio or video data.

MediaPacket

#include <icy/av/packet.h>
struct MediaPacket

Defined in src/av/include/icy/av/packet.h:28

Inherits: RawPacket Subclassed by: AudioPacket, VideoPacket

Timestamped media packet carrying raw audio or video data.

List of all members

NameKindOwner
timevariableDeclared here
MediaPacketfunctionDeclared here
MediaPacketfunctionDeclared here
MediaPacketfunctionDeclared here
~MediaPacketfunctionDeclared here
clonefunctionDeclared here
classNamefunctionDeclared here
RawPacketfunctionInherited from RawPacket
RawPacketfunctionInherited from RawPacket
RawPacketfunctionInherited from RawPacket
~RawPacketfunctionInherited from RawPacket
clonefunctionInherited from RawPacket
copyDatafunctionInherited from RawPacket
readfunctionInherited from RawPacket
writefunctionInherited from RawPacket
datafunctionInherited from RawPacket
sizefunctionInherited from RawPacket
classNamefunctionInherited from RawPacket
ownsBufferfunctionInherited from RawPacket
_datavariableInherited from RawPacket
_sizevariableInherited from RawPacket
_ownedvariableInherited from RawPacket
operator<<friendInherited from IPacket
opaquevariableInherited from IPacket
infovariableInherited from IPacket
flagsvariableInherited from IPacket
IPacketfunctionInherited from IPacket
IPacketfunctionInherited from IPacket
operator=functionInherited from IPacket
clonefunctionInherited from IPacket
~IPacketfunctionInherited from IPacket
readfunctionInherited from IPacket
writefunctionInherited from IPacket
sizefunctionInherited from IPacket
hasDatafunctionInherited from IPacket
datafunctionInherited from IPacket
constDatafunctionInherited from IPacket
classNamefunctionInherited from IPacket
printfunctionInherited from IPacket

Inherited from RawPacket

KindNameDescription
functionRawPacket inlineConstruct with borrowed (non-owning) buffer.
functionRawPacket inlineConstruct with const data (copied, owning).
functionRawPacket inlineCopy constructor (always copies data).
function~RawPacket virtualDefaulted destructor.
functionclone virtual const inline override
functioncopyData virtual inlineCopies data into an internally owned buffer, replacing any prior content.
functionread virtual inline overrideReads from the buffer by copying its contents into an owned buffer.
functionwrite virtual const inline overrideAppends the packet data to the given output buffer.
functiondata virtual const inline override
functionsize virtual const inline override
functionclassName virtual const inline overrideReturns the class name of this packet type for logging and diagnostics.
functionownsBuffer const inline
variable_data
variable_size
variable_owned

Inherited from IPacket

KindNameDescription
friendoperator<< inlineStream insertion operator; delegates to print().
variableopaqueOptional type-safe context data. Use std::any_cast to retrieve. Lifetime of the stored value is tied to the packet's lifetime.
variableinfoOptional extra information about the packet.
variableflagsProvides basic information about the packet.
functionIPacket inline
functionIPacket inlineCopy constructor; clones the info object if present.
functionoperator= inlineCopy assignment; clones the info object if present.
functionclone virtual constReturns a heap-allocated deep copy of this packet.
function~IPacket virtualDefaulted destructor.
functionread virtualRead/parse to the packet from the given input buffer. The number of bytes read is returned.
functionwrite virtual constCopy/generate to the packet given output buffer. The number of bytes written can be obtained from the buffer.
functionsize virtual const inlineThe size of the packet in bytes.
functionhasData virtual const inlineReturns true if the packet has a non-null data pointer.
functiondata virtual const inlineThe packet data pointer for buffered packets.
functionconstData virtual const inlineThe const packet data pointer for buffered packets.
functionclassName virtual constReturns the class name of this packet type for logging and diagnostics.
functionprint virtual const inlinePrints a human-readable representation to the given stream.

Public Attributes

ReturnNameDescription
int64_ttimePresentation timestamp in microseconds.

time

int64_t time

Defined in src/av/include/icy/av/packet.h:30

Presentation timestamp in microseconds.

Public Methods

ReturnNameDescription
MediaPacket inlineConstruct with a non-owning or owning mutable buffer.
MediaPacket inlineConstruct with const data (copied, owning).
MediaPacket inlineCopy constructor.
std::unique_ptr< IPacket >clone virtual const inline override
const char *className virtual const inline overrideReturns the class name of this packet type for logging and diagnostics.

MediaPacket

inline

inline MediaPacket(uint8_t * data = nullptr, size_t size = 0, int64_t time = 0)

Defined in src/av/include/icy/av/packet.h:36

Construct with a non-owning or owning mutable buffer.

Parameters

  • data Pointer to the raw data buffer (may be null).

  • size Size of the buffer in bytes.

  • time Presentation timestamp in microseconds.


MediaPacket

inline

inline MediaPacket(const uint8_t * data, size_t size, int64_t time = 0)

Defined in src/av/include/icy/av/packet.h:46

Construct with const data (copied, owning).

Parameters

  • data Pointer to the const raw data buffer (data is copied).

  • size Size of the buffer in bytes.

  • time Presentation timestamp in microseconds.


MediaPacket

inline

inline MediaPacket(const MediaPacket & r)

Defined in src/av/include/icy/av/packet.h:53

Copy constructor.


clone

virtual const inline override

virtual inline std::unique_ptr< IPacket > clone() const override

Defined in src/av/include/icy/av/packet.h:62

Returns

A heap-allocated copy of this packet.

Reimplements
Reimplemented by

className

virtual const inline override

virtual inline const char * className() const override

Defined in src/av/include/icy/av/packet.h:64

Returns the class name of this packet type for logging and diagnostics.

Reimplements
Reimplemented by