TSDuck v3.40-3963
MPEG Transport Stream Toolkit
|
Base class for all kinds of demuxed data. More...
#include <tsDemuxedData.h>
Public Member Functions | |
DemuxedData (const ByteBlock &content, PID source_pid=PID_NULL) | |
Constructor from full binary content. | |
DemuxedData (const ByteBlockPtr &content_ptr, PID source_pid=PID_NULL) | |
Constructor from full binary content. | |
DemuxedData (const DemuxedData &other, ShareMode mode) | |
Copy constructor. | |
DemuxedData (const void *content, size_t content_size, PID source_pid=PID_NULL) | |
Constructor from full binary content. | |
DemuxedData (DemuxedData &&other) noexcept | |
Move constructor. | |
DemuxedData (PID source_pid=PID_NULL) | |
Default constructor. | |
virtual | ~DemuxedData () |
Virtual destructor. | |
const UString & | attribute () const |
Get the generic user-defined "attribute" string of the object. | |
virtual void | clear () |
Clear data content. | |
virtual const uint8_t * | content () const |
Access to the full binary content of the data. | |
DemuxedData & | copy (const DemuxedData &other) |
Duplication. | |
PacketCounter | firstTSPacketIndex () const |
Index of first TS packet of the data in the demultiplexed stream. | |
PacketCounter | lastTSPacketIndex () const |
Index of last TS packet of the data in the demultiplexed stream. | |
bool | matchContent (const ByteBlock &pattern, const ByteBlock &mask=ByteBlock()) const |
Check if the start of the data matches a given pattern. | |
DemuxedData & | operator= (const DemuxedData &other) |
Assignment operator. | |
DemuxedData & | operator= (DemuxedData &&other) noexcept |
Move assignment operator. | |
bool | operator== (const DemuxedData &other) const |
Equality operator. | |
size_t | rawDataSize () const |
Size of the complete binary raw data containing the logical structure. | |
virtual void | reload (const ByteBlock &content, PID source_pid=PID_NULL) |
Reload from full binary content. | |
virtual void | reload (const ByteBlockPtr &content_ptr, PID source_pid=PID_NULL) |
Reload from full binary content. | |
virtual void | reload (const void *content, size_t content_size, PID source_pid=PID_NULL) |
Reload from full binary content. | |
void | setAttribute (const UString &attr) |
Set a generic user-defined string as "attribute" of the object. | |
void | setFirstTSPacketIndex (PacketCounter i) |
Set the first TS packet of the data in the demultiplexed stream. | |
void | setLastTSPacketIndex (PacketCounter i) |
Set the last TS packet of the data in the demultiplexed stream. | |
void | setSourcePID (PID pid) |
Set the source PID. | |
virtual size_t | size () const |
Size of the logical binary content of the data. | |
PID | sourcePID () const |
Get the source PID. | |
Protected Member Functions | |
void | rwAppend (const void *data, size_t dsize) |
Append raw data to the full binary content of the data for subclasses. | |
uint8_t * | rwContent () |
Read/write access to the full binary content of the data for subclasses. | |
void | rwResize (size_t s) |
Resize the full binary content of the data for subclasses. | |
Base class for all kinds of demuxed data.
Default constructor.
[in] | source_pid | PID from which the packet was read. |
ts::DemuxedData::DemuxedData | ( | const DemuxedData & | other, |
ShareMode | mode | ||
) |
Copy constructor.
[in] | other | Another instance to copy. |
[in] | mode | The data are either shared (ShareMode::SHARE) between the two instances or duplicated (ShareMode::COPY). |
|
noexcept |
Move constructor.
[in,out] | other | Another instance to move. |
ts::DemuxedData::DemuxedData | ( | const void * | content, |
size_t | content_size, | ||
PID | source_pid = PID_NULL |
||
) |
Constructor from full binary content.
[in] | content | Address of the binary data. |
[in] | content_size | Size in bytes of the data. |
[in] | source_pid | PID from which the data was read. |
Constructor from full binary content.
[in] | content | Binary packet data. |
[in] | source_pid | PID from which the packet was read. |
ts::DemuxedData::DemuxedData | ( | const ByteBlockPtr & | content_ptr, |
PID | source_pid = PID_NULL |
||
) |
Constructor from full binary content.
[in] | content_ptr | Safe pointer to the binary data. The content is referenced, and thus shared. Do not modify the referenced ByteBlock from outside the DemuxedData. |
[in] | source_pid | PID from which the data were read. |
|
virtual |
Reload from full binary content.
[in] | content | Address of the binary packet data. |
[in] | content_size | Size in bytes of the packet. |
[in] | source_pid | PID from which the data were read. |
Reimplemented in ts::PESPacket, ts::Section, and ts::T2MIPacket.
|
virtual |
Reload from full binary content.
[in] | content | Binary packet data. |
[in] | source_pid | PID from which the data were read. |
Reimplemented in ts::PESPacket, ts::Section, and ts::T2MIPacket.
|
virtual |
Reload from full binary content.
[in] | content_ptr | Safe pointer to the binary packet data. The content is referenced, and thus shared. Do not modify the referenced ByteBlock from outside the DemuxedData. |
[in] | source_pid | PID from which the data were read. |
Reimplemented in ts::PESPacket, ts::Section, and ts::T2MIPacket.
|
virtual |
Clear data content.
Reimplemented in ts::PESPacket, ts::Section, and ts::T2MIPacket.
DemuxedData & ts::DemuxedData::operator= | ( | const DemuxedData & | other | ) |
Assignment operator.
The packets are referenced, and thus shared between the two packet objects.
[in] | other | Other packet to assign to this object. |
|
noexcept |
Move assignment operator.
[in,out] | other | Other packet to assign to this object. |
DemuxedData & ts::DemuxedData::copy | ( | const DemuxedData & | other | ) |
Duplication.
Similar to assignment but the data are duplicated.
[in] | other | Other data to duplicate into this object. |
bool ts::DemuxedData::operator== | ( | const DemuxedData & | other | ) | const |
Equality operator.
The source PID's are ignored, only the data contents are compared.
[in] | other | Other packet to compare. |
|
inline |
Get the source PID.
|
inline |
Set the source PID.
[in] | pid | The source PID. |
|
inline |
Index of first TS packet of the data in the demultiplexed stream.
Usually valid only if the data were extracted by a demux.
|
inline |
Index of last TS packet of the data in the demultiplexed stream.
Usually valid only if the data were extracted by a demux.
|
inline |
Set the first TS packet of the data in the demultiplexed stream.
[in] | i | The first TS packet of the data in the demultiplexed stream. |
|
inline |
Set the last TS packet of the data in the demultiplexed stream.
[in] | i | The last TS packet of the data in the demultiplexed stream. |
|
inline |
Set a generic user-defined string as "attribute" of the object.
The semantics of this attribute string is not defined. It is used by the application. The attribute string can be found in the <metadata>
structure of the XML representation of a table.
[in] | attr | Generic string to set as attribute. |
|
inline |
Get the generic user-defined "attribute" string of the object.
|
virtual |
Access to the full binary content of the data.
Do not modify content.
|
virtual |
Size of the logical binary content of the data.
For subclasses of DemuxedData, this is the logical size of the data structure inside the DemuxedData blob.
Reimplemented in ts::PESPacket.
size_t ts::DemuxedData::rawDataSize | ( | ) | const |
Size of the complete binary raw data containing the logical structure.
bool ts::DemuxedData::matchContent | ( | const ByteBlock & | pattern, |
const ByteBlock & | mask = ByteBlock() |
||
) | const |
Check if the start of the data matches a given pattern.
[in] | pattern | A byte block to compare with the start of the data. |
[in] | mask | Optional mask to select meaningful bits in pattern. |
|
inlineprotected |
Read/write access to the full binary content of the data for subclasses.
|
protected |
Resize the full binary content of the data for subclasses.
[in] | s | New size in bytes of the full binary content of the data. |
|
protected |
Append raw data to the full binary content of the data for subclasses.
[in] | data | Address of the new area to append. |
[in] | dsize | Size of the area to append. |