TSDuck v3.40-3963
MPEG Transport Stream Toolkit
|
Representation of a MPEG PSI/SI descriptors in binary format. More...
#include <tsDescriptor.h>
Public Member Functions | |
Descriptor ()=default | |
Default constructor. | |
Descriptor (const ByteBlock &bb) | |
Constructor from full binary content. | |
Descriptor (const ByteBlockPtr &bb, ShareMode mode) | |
Constructor from full binary content. | |
Descriptor (const Descriptor &desc, ShareMode mode) | |
Copy constructor. | |
Descriptor (const void *data, size_t size) | |
Constructor from full binary content. | |
Descriptor (Descriptor &&desc) noexcept | |
Move constructor. | |
Descriptor (DID tag, const ByteBlock &data) | |
Constructor from tag and payload. | |
Descriptor (DID tag, const void *data, size_t size) | |
Constructor from tag and payload. | |
const uint8_t * | content () const |
Access to the full binary content of the descriptor. | |
Descriptor & | copy (const Descriptor &desc) |
Duplication. | |
AbstractDescriptorPtr | deserialize (DuckContext &duck, PDS pds, const AbstractTable *table) const |
Deserialize the descriptor. | |
AbstractDescriptorPtr | deserialize (DuckContext &duck, PDS pds=0, TID tid=TID_NULL) const |
Deserialize the descriptor. | |
EDID | edid (PDS pds, const AbstractTable *table) const |
Get the extended descriptor id. | |
EDID | edid (PDS pds=0, TID tid=TID_NULL) const |
Get the extended descriptor id. | |
bool | fromXML (DuckContext &duck, const xml::Element *node, TID tid=TID_NULL) |
This method converts an XML node as a binary descriptor. | |
void | invalidate () |
Invalidate descriptor content. | |
bool | isValid () const |
Check if a descriptor has valid content. | |
Descriptor & | operator= (const Descriptor &desc) |
Assignment operator. | |
Descriptor & | operator= (Descriptor &&desc) noexcept |
Move assignment operator. | |
bool | operator== (const Descriptor &desc) const |
Comparison operator. | |
uint8_t * | payload () |
Access to the payload of the descriptor. | |
const uint8_t * | payload () const |
Access to the payload of the descriptor. | |
size_t | payloadSize () const |
Size of the payload of the descriptor. | |
void | replacePayload (const ByteBlock &payload) |
Replace the payload of the descriptor. | |
void | replacePayload (const void *data, size_t size) |
Replace the payload of the descriptor. | |
void | resizePayload (size_t size) |
Resize (truncate or extend) the payload of the descriptor. | |
size_t | size () const |
Size of the binary content of the descriptor. | |
DID | tag () const |
Get the descriptor tag. | |
xml::Element * | toXML (DuckContext &duck, xml::Element *parent, PDS pds=0, TID tid=TID_NULL, bool forceGeneric=false) const |
This method converts a descriptor to XML. | |
Representation of a MPEG PSI/SI descriptors in binary format.
ts::Descriptor::Descriptor | ( | const Descriptor & | desc, |
ShareMode | mode | ||
) |
Copy constructor.
[in] | desc | Another instance to copy. |
[in] | mode | The descriptors' data are either shared (ShareMode::SHARE) between the two descriptors or duplicated (ShareMode::COPY). |
|
noexcept |
Move constructor.
[in,out] | desc | Another instance to move. |
ts::Descriptor::Descriptor | ( | DID | tag, |
const void * | data, | ||
size_t | size | ||
) |
Constructor from tag and payload.
The content is copied into the section if valid.
[in] | tag | Descriptor tag. |
[in] | data | Address of the descriptor payload. |
[in] | size | Size in bytes of the descriptor payload. |
Constructor from tag and payload.
The content is copied into the section if valid.
[in] | tag | Descriptor tag. |
[in] | data | Descriptor payload. |
ts::Descriptor::Descriptor | ( | const void * | data, |
size_t | size | ||
) |
Constructor from full binary content.
The content is copied into the section if valid.
[in] | data | Address of the descriptor data. |
[in] | size | Size in bytes of the descriptor data. |
ts::Descriptor::Descriptor | ( | const ByteBlock & | bb | ) |
Constructor from full binary content.
The content is copied into the section if valid.
[in] | bb | Descriptor binary data. |
ts::Descriptor::Descriptor | ( | const ByteBlockPtr & | bb, |
ShareMode | mode | ||
) |
Constructor from full binary content.
The content is copied into the section if valid.
[in] | bb | Descriptor binary data. |
[in] | mode | The data are either shared (ShareMode::SHARE) between the descriptor and bb or duplicated (ShareMode::COPY). |
Descriptor & ts::Descriptor::operator= | ( | const Descriptor & | desc | ) |
Assignment operator.
The content is referenced, and thus shared between the two objects.
[in] | desc | Another instance to copy. |
|
noexcept |
Move assignment operator.
[in,out] | desc | Another instance to move. |
Descriptor & ts::Descriptor::copy | ( | const Descriptor & | desc | ) |
Duplication.
Similar to assignment but the content is duplicated.
[in] | desc | Another instance to copy. |
|
inline |
Check if a descriptor has valid content.
|
inline |
Get the descriptor tag.
Get the extended descriptor id.
[in] | pds | Associated private data specifier. |
[in] | tid | Check if the descriptor is table-specific for this table-id. |
EDID ts::Descriptor::edid | ( | PDS | pds, |
const AbstractTable * | table | ||
) | const |
Get the extended descriptor id.
[in] | pds | Associated private data specifier. |
[in] | table | Check if the descriptor is table-specific for this table. |
|
inline |
Access to the full binary content of the descriptor.
|
inline |
Size of the binary content of the descriptor.
|
inline |
Access to the payload of the descriptor.
|
inline |
Access to the payload of the descriptor.
|
inline |
Size of the payload of the descriptor.
void ts::Descriptor::replacePayload | ( | const void * | data, |
size_t | size | ||
) |
Replace the payload of the descriptor.
The tag is unchanged, the size is adjusted.
[in] | data | Address of the new payload data. |
[in] | size | Size in bytes of the new payload data. |
|
inline |
Replace the payload of the descriptor.
The tag is unchanged, the size is adjusted.
[in] | payload | The new payload data. |
void ts::Descriptor::resizePayload | ( | size_t | size | ) |
Resize (truncate or extend) the payload of the descriptor.
The tag is unchanged, the size is adjusted. If the payload is extended, new bytes are zeroes.
[in] | size | New size in bytes of the payload. |
bool ts::Descriptor::operator== | ( | const Descriptor & | desc | ) | const |
Comparison operator.
[in] | desc | Another descriptor to compare. |
AbstractDescriptorPtr ts::Descriptor::deserialize | ( | DuckContext & | duck, |
PDS | pds = 0 , |
||
TID | tid = TID_NULL |
||
) | const |
Deserialize the descriptor.
[in,out] | duck | TSDuck execution context. |
[in] | pds | Associated private data specifier. |
[in] | tid | Optional table id of the table containing the descriptor. |
AbstractDescriptorPtr ts::Descriptor::deserialize | ( | DuckContext & | duck, |
PDS | pds, | ||
const AbstractTable * | table | ||
) | const |
Deserialize the descriptor.
[in,out] | duck | TSDuck execution context. |
[in] | pds | Associated private data specifier. |
[in] | table | Table containing the descriptor (can be null). |
xml::Element * ts::Descriptor::toXML | ( | DuckContext & | duck, |
xml::Element * | parent, | ||
PDS | pds = 0 , |
||
TID | tid = TID_NULL , |
||
bool | forceGeneric = false |
||
) | const |
This method converts a descriptor to XML.
If the descriptor has a specialized implementation, generate a specialized XML structure. Otherwise, generate a <generic_descriptor> node.
[in,out] | duck | TSDuck execution context. |
[in,out] | parent | The parent node for the XML descriptor. |
[in] | pds | Associated private data specifier. |
[in] | tid | Optional table id of the table containing the descriptor. |
[in] | forceGeneric | Force a <generic_descriptor> node even if the descriptor can be specialized. |
bool ts::Descriptor::fromXML | ( | DuckContext & | duck, |
const xml::Element * | node, | ||
TID | tid = TID_NULL |
||
) |
This method converts an XML node as a binary descriptor.
[in,out] | duck | TSDuck execution context. |
[in] | node | The root of the XML descriptor. |
[in] | tid | Optional table id of the table containing the descriptor. |