Representation of a DSM-CC Stream Descriptors table.
More...
#include <tsDSMCCStreamDescriptorsTable.h>
|
| DSMCCStreamDescriptorsTable (const DSMCCStreamDescriptorsTable &other) |
| Copy constructor.
|
|
| DSMCCStreamDescriptorsTable (DuckContext &duck, const BinaryTable &table) |
| Constructor from a binary table.
|
|
| DSMCCStreamDescriptorsTable (uint8_t vers=0, bool cur=true, uint16_t tid_ext=0) |
| Default constructor.
|
|
const UString & | attribute () const |
| Get the generic user-defined "attribute" string of the table.
|
|
virtual void | clear () override final |
| This method clears the content of the table or descriptor.
|
|
template<typename INT , typename std::enable_if< std::is_integral< INT >::value, int >::type = 0> |
UString | dataName (const UChar *section, INT value, NamesFlags flags=NamesFlags::NAME, INT alternate=0, size_t bits=0) |
| Get a name from a specified section in the DVB names file for that signalization structure.
|
|
virtual Standards | definingStandards () const override |
| Get the list of standards which define this object.
|
|
bool | deserialize (DuckContext &duck, const BinaryTable &bin) |
| This method deserializes a binary table.
|
|
virtual void | fromXML (DuckContext &duck, const xml::Element *element) override final |
| This method converts an XML structure to a table or descriptor in this object.
|
|
void | invalidate () |
| Invalidate this object.
|
|
virtual bool | isPrivate () const override |
| Check if the table is a private one (ie.
|
|
bool | isValid () const |
| Check if this object is valid.
|
|
DSMCCStreamDescriptorsTable & | operator= (const DSMCCStreamDescriptorsTable &other) |
| Assignment operator.
|
|
bool | serialize (DuckContext &duck, BinaryTable &bin) const |
| This method serializes a table.
|
|
void | setAttribute (const UString &attr) |
| Set a generic user-defined string as "attribute" of the table.
|
|
TID | tableId () const |
| Get the table_id.
|
|
virtual uint16_t | tableIdExtension () const override |
| Get the table id extension.
|
|
virtual xml::Element * | toXML (DuckContext &duck, xml::Element *parent) const override final |
| This method converts this object to XML.
|
|
UString | xmlName () const |
| Get the XMl node name representing this table or descriptor.
|
|
|
template<typename INT , typename std::enable_if< std::is_integral< INT >::value, int >::type = 0> |
static UString | DataName (const UChar *xml_name, const UChar *section, INT value, NamesFlags flags=NamesFlags::NAME, INT alternate=0, size_t bits=0) |
| Get a name from a specified section in the DVB names file.
|
|
static void | DisplaySection (ts::TablesDisplay &display, const ts::Section §ion, ts::PSIBuffer &payload, const ts::UString &margin) |
| A static method to display a section.
|
|
static xml::Element * | GetOrCreateMetadata (xml::Element *element) |
| Get the <metadata> structure inside a XML element representing a table.
|
|
|
DescriptorList | descs |
| List of descriptors.
|
|
bool | is_current = true |
| True if table is current, false if table is next.
|
|
uint16_t & | table_id_extension |
| User-defined in the case of DSM-CC Stream Descriptors table.
|
|
uint8_t | version = 0 |
| Table version number.
|
|
|
static const UChar *const | XML_GENERIC_DESCRIPTOR |
| XML tag name for generic descriptors.
|
|
static const UChar *const | XML_GENERIC_LONG_TABLE |
| XML tag name for generic tables with long sections.
|
|
static const UChar *const | XML_GENERIC_SHORT_TABLE |
| XML tag name for generic short sections.
|
|
|
TID | _table_id = TID_NULL |
| The table id can be modified by subclasses only.
|
|
uint16_t | _tid_ext = 0xFFFF |
| Table_id extension.
|
|
Representation of a DSM-CC Stream Descriptors table.
- See also
- ISO/IEC 13818-6, 9.2.2 and 9.2.7
◆ DSMCCStreamDescriptorsTable() [1/3]
ts::DSMCCStreamDescriptorsTable::DSMCCStreamDescriptorsTable |
( |
uint8_t |
vers = 0 , |
|
|
bool |
cur = true , |
|
|
uint16_t |
tid_ext = 0 |
|
) |
| |
Default constructor.
- Parameters
-
[in] | vers | Table version number. |
[in] | cur | True if table is current, false if table is next. |
[in] | tid_ext | User-defined table id extension. |
◆ DSMCCStreamDescriptorsTable() [2/3]
ts::DSMCCStreamDescriptorsTable::DSMCCStreamDescriptorsTable |
( |
DuckContext & |
duck, |
|
|
const BinaryTable & |
table |
|
) |
| |
Constructor from a binary table.
- Parameters
-
[in,out] | duck | TSDuck execution context. |
[in] | table | Binary table to deserialize. |
◆ DSMCCStreamDescriptorsTable() [3/3]
Copy constructor.
- Parameters
-
[in] | other | Other instance to copy. |
◆ operator=()
Assignment operator.
- Parameters
-
[in] | other | Other instance to copy. |
- Returns
- A reference to this object.
◆ isPrivate()
virtual bool ts::DSMCCStreamDescriptorsTable::isPrivate |
( |
| ) |
const |
|
overridevirtual |
Check if the table is a private one (ie.
not MPEG-defined). The default implementation returns true. MPEG-defined tables should override this method to return false.
- Returns
- True if the table is a private one (ie. not MPEG-defined).
Reimplemented from ts::AbstractTable.
◆ DisplaySection()
A static method to display a section.
- Parameters
-
[in,out] | display | Display engine.
|
[in] | section | The section to display.
|
[in,out] | payload | A PSIBuffer over the payload. |
[in] | margin | Left margin content.
|
◆ buildXML()
Helper method to convert this object to XML.
It is called by toXML() only when the object is valid. The root element is already built with the appropriate XML node name. In buildXML(), the subclass shall simply populate the XML node.
- Parameters
-
[in,out] | root | The root node for the new XML tree. |
[in,out] | duck | TSDuck execution context. |
Reimplemented from ts::AbstractDescriptorsTable.
◆ analyzeXML()
Helper method to convert this object from XML.
It is called by fromXML() after checking the validity of the XML node name. In analyzeXML(), the subclass shall populate the C++ object from the content of the XML node. If analyzeXML() returns false, this table or descriptor object is then invalidated and cleared.
- Parameters
-
[in,out] | duck | TSDuck execution context. |
[in] | element | XML element to convert. |
- Returns
- True if the analysis is correct, false otherwise.
Reimplemented from ts::AbstractDescriptorsTable.
◆ tableIdExtension()
virtual uint16_t ts::AbstractDescriptorsTable::tableIdExtension |
( |
| ) |
const |
|
overridevirtualinherited |
Get the table id extension.
The table id extension is a 16-bit field which usually contains one of the table fields (service id, transport stream id, etc.) For each subclass, the table id extension is usually directly available in the corresponding public field. This virtual method is a generic way to access the table id extension.
- Returns
- The table id extension.
Implements ts::AbstractLongTable.
◆ topLevelDescriptorList() [1/2]
virtual DescriptorList * ts::AbstractDescriptorsTable::topLevelDescriptorList |
( |
| ) |
|
|
overrideprotectedvirtualinherited |
Get the address of the "top-level descriptor list" of the table.
Some tables have descriptor lists, and sometimes two levels of descriptor lists. This is the case of the PMT, NIT, BAT, etc. The "top-level descriptor list" is present once in the table. It describes the service (PMT), the network (NIT) or the operator (BAT). At the second level, there is one descriptor list per component (PMT), or per transport stream (NIT, BAT). Sometimes, when exploring a second-level descriptor list, it is useful to also explore the top-level descriptor list. This virtual method returns a pointer to the top-level descriptor list. Thus, when exploring a second-level descriptor list, using the table pointer in that list, we can get a reference to the higher-level list.
The default implementation returns the null pointer.
- Returns
- The address of the "top-level descriptor list" of the table, if there is one. Return the null pointer if there is no such descriptor list.
Reimplemented from ts::AbstractTable.
◆ topLevelDescriptorList() [2/2]
virtual const DescriptorList * ts::AbstractDescriptorsTable::topLevelDescriptorList |
( |
| ) |
const |
|
overrideprotectedvirtualinherited |
Get the address of the "top-level descriptor list" of the table (constant).
- Returns
- The address of the "top-level descriptor list" of the table, if there is one. Return the null pointer if there is no such descriptor list.
- See also
- DescriptorList* topLevelDescriptorList()
Reimplemented from ts::AbstractTable.
◆ clearContent()
virtual void ts::AbstractDescriptorsTable::clearContent |
( |
| ) |
|
|
overrideprotectedvirtualinherited |
Helper method to clear the content of the table or descriptor.
It is called by clear(). In clearContent(), the subclass shall simply revert the value of all fields to their original values in the default constructor.
Implements ts::AbstractSignalization.
◆ serializePayload()
virtual void ts::AbstractDescriptorsTable::serializePayload |
( |
BinaryTable & |
table, |
|
|
PSIBuffer & |
buf |
|
) |
| const |
|
overrideprotectedvirtualinherited |
This abstract method serializes the payload of all sections in the table.
When serialize() is called, the output binary table is cleared and serializePayload() is called. A subclass shall implement serializePayload() which adds all required sections in the binary table.
Note that it is not necessary to explicitly add the last (or only) section. Upon return from serializePayload(), serialize() checks the state of the payload buffer. If the output binary table is still empty or if the payload buffer is not empty (or not empty after the last saved write position), then addOneSection() is automatically called.
- Parameters
-
Implements ts::AbstractTable.
◆ deserializePayload()
virtual void ts::AbstractDescriptorsTable::deserializePayload |
( |
PSIBuffer & |
buf, |
|
|
const Section & |
section |
|
) |
| |
|
overrideprotectedvirtualinherited |
This abstract method deserializes the payload of one section.
When deserialize() is called, this object is cleared and validated. Then, deserializePayload() is invoked for each section in the binary table. A subclass shall implement deserializePayload() which adds the content of the binary section to the C++ object. Do not reset the object in deserializePayload() since it is repeatedly called for each section of a single binary table.
- Parameters
-
[in,out] | buf | Deserialization buffer. The subclass shall read the descriptor payload from buf. The end of read is the end of the binary payload. If any kind of error is reported in the buffer or if the payload is not completely read, the deserialization is considered as invalid. |
[in] | section | A reference to the section. Can be used to access values in the section header (typically for long sections). |
Implements ts::AbstractTable.
◆ clear()
virtual void ts::AbstractLongTable::clear |
( |
| ) |
|
|
finaloverridevirtualinherited |
This method clears the content of the table or descriptor.
Upon return, the object is valid and in the same empty state as after a default constructor.
Reimplemented from ts::AbstractTable.
◆ maxPayloadSize()
virtual size_t ts::AbstractLongTable::maxPayloadSize |
( |
| ) |
const |
|
overrideprotectedvirtualinherited |
◆ useTrailingCRC32()
virtual bool ts::AbstractLongTable::useTrailingCRC32 |
( |
| ) |
const |
|
overrideprotectedvirtualinherited |
Check if the sections of this table have a trailing CRC32.
This is usually false for short sections but some short sections such as DVB-TOT use a CRC32.
- Returns
- True if the sections of this table have a trailing CRC32.
Reimplemented from ts::AbstractTable.
◆ deserializePayloadWrapper()
virtual void ts::AbstractLongTable::deserializePayloadWrapper |
( |
PSIBuffer & |
buf, |
|
|
const Section & |
section |
|
) |
| |
|
overrideprotectedvirtualinherited |
Wrapper for deserializePayload().
This is a method to overload in intermediate classes to avoid using "call superclass" to all tables.
- Parameters
-
[in,out] | buf | Deserialization buffer. |
[in] | section | A reference to the section. |
Reimplemented from ts::AbstractTable.
◆ addOneSectionImpl()
virtual void ts::AbstractLongTable::addOneSectionImpl |
( |
BinaryTable & |
table, |
|
|
PSIBuffer & |
payload |
|
) |
| const |
|
overrideprotectedvirtualinherited |
Actual implementation of adding one section in a binary table.
Do not call directly, it is only called by addOneSection() and is overridden in AbstractLongTable.
- Parameters
-
[in,out] | table | The binary table into which the new section shall be added. |
[in,out] | payload | A PSIBuffer containing the section payload between the read and the write pointer. |
Reimplemented from ts::AbstractTable.
◆ tableId()
TID ts::AbstractTable::tableId |
( |
| ) |
const |
|
inlineinherited |
Get the table_id.
- Returns
- The table_id.
◆ serialize()
This method serializes a table.
- Parameters
-
[in,out] | duck | TSDuck execution context. |
[out] | bin | A binary table object. Its content is replaced with a binary representation of this object. |
- Returns
- True in case of success, false if the table is invalid.
◆ deserialize()
This method deserializes a binary table.
In case of success, this object is replaced with the interpreted content of bin. In case of error, this object is invalidated.
- Parameters
-
[in,out] | duck | TSDuck execution context. |
[in] | bin | A binary table to interpret according to the table subclass. |
- Returns
- True in case of success, false if the table is invalid.
◆ setAttribute()
void ts::AbstractTable::setAttribute |
( |
const UString & |
attr | ) |
|
|
inlineinherited |
Set a generic user-defined string as "attribute" of the table.
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 the table.
- Parameters
-
[in] | attr | Generic string to set as attribute. |
◆ attribute()
const UString & ts::AbstractTable::attribute |
( |
| ) |
const |
|
inlineinherited |
Get the generic user-defined "attribute" string of the table.
- Returns
- A constant reference to the attribute string in the object.
- See also
- setAttribute()
◆ toXML()
|
finaloverridevirtualinherited |
This method converts this object to XML.
When this object is valid, this method creates a root node with the default XML name and then invokes buildXML() in the subclass to populate the XML node.
Important: Implementers of signalization classes shall not override this class. Implement the protected method buildXML() instead.
- Parameters
-
[in,out] | duck | TSDuck execution context. |
[in,out] | parent | The parent node for the new XML tree. |
- Returns
- The new XML element.
Reimplemented from ts::AbstractSignalization.
◆ fromXML()
|
finaloverridevirtualinherited |
This method converts an XML structure to a table or descriptor in this object.
In case of success, this object is replaced with the interpreted content of the XML structure. In case of error, this object is invalidated.
This method checks the name of the XML node and then invokes analyzeXML() in the subclass. Depending on the returned values of analyzeXML(), this object is either validated or invalidated.
Important: Implementers of signalization classes shall not override this class. Implement the protected method analyzeXML() instead.
- Parameters
-
[in,out] | duck | TSDuck execution context. |
[in] | element | XML element to convert. |
Reimplemented from ts::AbstractSignalization.
◆ GetOrCreateMetadata()
Get the <metadata> structure inside a XML element representing a table.
If the <metadata> structure does not exist, it is created.
- Parameters
-
[in,out] | element | The XML element representing a table. |
- Returns
- The <metadata> structure inside element. Never null, unless element is null.
◆ isValidTableId()
virtual bool ts::AbstractTable::isValidTableId |
( |
TID |
tid | ) |
const |
|
protectedvirtualinherited |
This method checks if a table id is valid for this object.
- Parameters
-
[in] | tid | A table id to check. |
- Returns
- True if tid is a valid table id for this object, false otherwise. The default implementation checks that tid is identical to the table id of this object.
Reimplemented in ts::EIT, ts::NIT, ts::SDT, and ts::NBIT.
◆ addOneSection()
Helper method for serializePayload(): add a section in a binary table.
For long tables, the section number is always one more than the current last section in the table.
If the payload buffer has a pushed read/write state, this state is restored and immediately pushed again. The typical use case is the following:
- A table may create more than one section.
- The payload of all sections starts with the same fixed data.
- In the subclass, the method serializePayload() builds the initial fixed data once.
- The method serializePayload() immediately pushes the read/write state of the buffer.
- The method serializePayload() builds payloads and call addOneSection().
- Upon return from addOneSection(), the buffer is back right after the initial fixed data.
- Parameters
-
[in,out] | table | The binary table into which the new section shall be added. |
[in,out] | payload | A PSIBuffer containing the section payload between the read and the write pointer. |
◆ isValid()
bool ts::AbstractSignalization::isValid |
( |
| ) |
const |
|
inlineinherited |
Check if this object is valid.
- Returns
- True if this object is valid.
◆ invalidate()
void ts::AbstractSignalization::invalidate |
( |
| ) |
|
|
inlineinherited |
Invalidate this object.
This object must be rebuilt.
◆ xmlName()
UString ts::AbstractSignalization::xmlName |
( |
| ) |
const |
|
inherited |
Get the XMl node name representing this table or descriptor.
- Returns
- The XML node name.
◆ definingStandards()
virtual Standards ts::AbstractSignalization::definingStandards |
( |
| ) |
const |
|
overridevirtualinherited |
◆ DataName()
template<typename
INT , typename std::enable_if< std::is_integral<
INT >::value, int >::type = 0>
Get a name from a specified section in the DVB names file.
- Template Parameters
-
- Parameters
-
[in] | xml_name | Table or descriptor name, as used in XML structures. |
[in] | section | Name of section to search. Not case-sensitive. The actual section in the names file is prefixed by the XML name, followed by a dot. |
[in] | value | Value to get the name for. |
[in] | flags | Presentation flags. |
[in] | alternate | Display this integer value if flags ALTERNATE is set. |
[in] | bits | Optional size in bits of the displayed data. Used in replacement of the "Bits=XX" directive in the .names file. |
- Returns
- The corresponding name.
◆ dataName()
template<typename
INT , typename std::enable_if< std::is_integral<
INT >::value, int >::type = 0>
Get a name from a specified section in the DVB names file for that signalization structure.
- Template Parameters
-
- Parameters
-
[in] | section | Name of section to search. Not case-sensitive. The actual section in the names file is prefixed by the XML name of the structure, followed by a dot. |
[in] | value | Value to get the name for. |
[in] | flags | Presentation flags. |
[in] | alternate | Display this integer value if flags ALTERNATE is set. |
[in] | bits | Optional size in bits of the displayed data. Used in replacement of the "Bits=XX" directive in the .names file. |
- Returns
- The corresponding name.
◆ _tid_ext
uint16_t ts::AbstractDescriptorsTable::_tid_ext = 0xFFFF |
|
protectedinherited |
Table_id extension.
When unused (CAT, TSDT), it must be left to the default value 0xFFFF.
The documentation for this class was generated from the following file: