![]() |
TSDuck v3.46-4930
MPEG Transport Stream Toolkit
|
#include <tsBinaryTable.h>


Classes | |
| class | XMLOptions |
Public Member Functions | |
| BinaryTable ()=default | |
| BinaryTable (BinaryTable &&table) noexcept | |
| BinaryTable (const BinaryTable &table, ShareMode mode) | |
| BinaryTable (const SectionPtrVector §ions, bool replace=true, bool grow=true) | |
| template<class... Args> | |
| bool | addNewSection (Args &&... args) |
| bool | addSection (const SectionPtr §ion, bool replace=true, bool grow=true) |
| bool | addSections (const SectionPtrVector §ions, bool replace=true, bool grow=true) |
| bool | addSections (SectionPtrVector::const_iterator first, SectionPtrVector::const_iterator last, bool replace=true, bool grow=true) |
| UString | attribute () const |
| void | clear () |
| BinaryTable & | copy (const BinaryTable &table) |
| virtual Standards | definingStandards (Standards current_standards=Standards::NONE) const override |
| PacketCounter | firstTSPacketIndex () const |
| bool | fromXML (DuckContext &duck, const xml::Element *node) |
| bool | isLongSection () const |
| bool | isShortSection () const |
| bool | isValid () const |
| PacketCounter | lastTSPacketIndex () const |
| BinaryTable & | operator= (BinaryTable &&table) noexcept |
| BinaryTable & | operator= (const BinaryTable &table) |
| bool | operator== (const BinaryTable &table) const |
| PacketCounter | packetCount (bool pack=true) const |
| bool | packSections () |
| const SectionPtr | sectionAt (size_t index) const |
| size_t | sectionCount () const |
| void | setAttribute (const UString &attr) |
| void | setSourcePID (PID pid) |
| void | setTableIdExtension (uint16_t tid, bool recompute_crc=true) |
| void | setVersion (uint8_t version, bool recompute_crc=true) |
| PID | sourcePID () const |
| TID | tableId () const |
| uint16_t | tableIdExtension () const |
| size_t | totalSize () const |
| xml::Element * | toXML (DuckContext &duck, xml::Element *parent, const XMLOptions &opt=XMLOptions()) const |
| uint8_t | version () const |
Representation of MPEG PSI/SI tables in binary form (ie. list of sections).
A table is built by adding sections using addSection(). When all sections are present, the table becomes valid.
Sections are added using SectionPtr safe pointers. Only the pointers are copied. The sections are shared.
The table_id, version and number of sections is determined when the first section is added. Subsequent sections must have the same properties.
|
default |
Default constructor.
| ts::BinaryTable::BinaryTable | ( | const BinaryTable & | table, |
| ShareMode | mode ) |
Copy constructor.
| [in] | table | Another instance to copy. |
| [in] | mode | The sections are either shared (ShareMode::SHARE) between the two tables or duplicated (ShareMode::COPY). |
|
noexcept |
Move constructor.
| [in,out] | table | Another instance to move. |
| ts::BinaryTable::BinaryTable | ( | const SectionPtrVector & | sections, |
| bool | replace = true, | ||
| bool | grow = true ) |
Constructor from an array of sections.
| [in] | sections | An array of smart pointers to sections. |
| [in] | replace | If true, duplicated sections may be replaced. Otherwise, sections which are already present (based on section number) are not replaced. |
| [in] | grow | If true, the "last_section_number" of a section may be greater than the current "last_section_number" of the table. In this case, all sections which were previously added in the table are modified. |
| BinaryTable & ts::BinaryTable::operator= | ( | const BinaryTable & | table | ) |
Assignment operator. The sections are referenced, and thus shared between the two table objects.
| [in] | table | Other table to assign to this object. |
|
noexcept |
Move assignment operator. The sections are referenced, and thus shared between the two table objects.
| [in,out] | table | Other table to move into this object. |
| BinaryTable & ts::BinaryTable::copy | ( | const BinaryTable & | table | ) |
Duplication. Similar to assignment but the sections are duplicated.
| [in] | table | Other table to duplicate into this object. |
| bool ts::BinaryTable::operator== | ( | const BinaryTable & | table | ) | const |
Equality operator. The source PID's are ignored, only the table contents are compared. Invalid tables are never identical.
| [in] | table | Other table to compare. |
| bool ts::BinaryTable::addSection | ( | const SectionPtr & | section, |
| bool | replace = true, | ||
| bool | grow = true ) |
Add a section to a table.
| [in] | section | A smart pointers to section. |
| [in] | replace | If true, duplicated sections may be replaced. Otherwise, sections which are already present (based on section number) are not replaced. |
| [in] | grow | If true, the "last_section_number" of section may be greater than the current "last_section_number" of the table. In this case, all sections which were previously added in the table are modified. |
|
inline |
Create a section and add it to a table. The section is replaced if it was already present and the table grows when necessary.
| [in] | args | Arguments for the Section constructor. |
|
inline |
Add several sections to a table.
| [in] | sections | An array of smart pointers to sections. |
| [in] | replace | If true, duplicated sections may be replaced. Otherwise, sections which are already present (based on section number) are not replaced. |
| [in] | grow | If true, the "last_section_number" of a section may be greater than the current "last_section_number" of the table. In this case, all sections which were previously added in the table are modified. |
| bool ts::BinaryTable::addSections | ( | SectionPtrVector::const_iterator | first, |
| SectionPtrVector::const_iterator | last, | ||
| bool | replace = true, | ||
| bool | grow = true ) |
Add several sections to a table.
| [in] | first | First iterator to an array of smart pointers to sections. |
| [in] | last | Last iterator to an array of smart pointers to sections. |
| [in] | replace | If true, duplicated sections may be replaced. Otherwise, sections which are already present (based on section number) are not replaced. |
| [in] | grow | If true, the "last_section_number" of a section may be greater than the current "last_section_number" of the table. In this case, all sections which were previously added in the table are modified. |
| bool ts::BinaryTable::packSections | ( | ) |
Pack all sections in a table, removing references to missing sections. As an example, if a table expects 5 sections (numbered 0 to 4) but only sections numbered 1 and 3 are present, the table is packed with the two existing sections renumbered 0 and 1 and the last section number is set to 2 in the existing sections. The table becomes valid if at least one section was present.
|
inline |
Check if the table is valid.
| void ts::BinaryTable::clear | ( | ) |
Clear the content of the table. The table must be rebuilt using calls to addSection().
|
inline |
Fast access to the table id.
|
inline |
Fast access to the table id extension.
|
inline |
Fast access to the table version number.
|
inline |
| void ts::BinaryTable::setTableIdExtension | ( | uint16_t | tid, |
| bool | recompute_crc = true ) |
| void ts::BinaryTable::setVersion | ( | uint8_t | version, |
| bool | recompute_crc = true ) |
| void ts::BinaryTable::setSourcePID | ( | PID | pid | ) |
| PacketCounter ts::BinaryTable::firstTSPacketIndex | ( | ) | const |
Index of first TS packet of the table in the demultiplexed stream. Valid only if the table was extracted by a section demux.
| PacketCounter ts::BinaryTable::lastTSPacketIndex | ( | ) | const |
Index of last TS packet of the table in the demultiplexed stream. Valid only if the table was extracted by a section demux.
|
inline |
Number of sections in the table.
| size_t ts::BinaryTable::totalSize | ( | ) | const |
Total size in bytes of all sections in the table.
| PacketCounter ts::BinaryTable::packetCount | ( | bool | pack = true | ) | const |
Minimum number of TS packets required to transport the table.
| [in] | pack | If true, assume that sections are packed in TS packets. When false, assume that each section starts at the beginning of a TS packet and stuffing in applied at the end of each section. |
| const SectionPtr ts::BinaryTable::sectionAt | ( | size_t | index | ) | const |
Get a pointer to a section.
| [in] | index | Index of the section to get. |
| bool ts::BinaryTable::isShortSection | ( | ) | const |
Check if this is a table with one short section.
| bool ts::BinaryTable::isLongSection | ( | ) | const |
Check if this is a table with long sections.
| void ts::BinaryTable::setAttribute | ( | const UString & | attr | ) |
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.
Here, the attribute is set on all sections in the table. If the table contains no section, the attibute is ignored. If additional sections are added later, their attribute will not be changed.
| [in] | attr | Generic string to set as attribute. |
| UString ts::BinaryTable::attribute | ( | ) | const |
Get the generic user-defined "attribute" string of the object. This is the first non-empty attribute in the sections in the table.
| xml::Element * ts::BinaryTable::toXML | ( | DuckContext & | duck, |
| xml::Element * | parent, | ||
| const XMLOptions & | opt = XMLOptions() ) const |
This method converts the table to XML. If the table has a specialized implementation, generate a specialized XML structure. Otherwise, generate a <generic_short_table> or <generic_long_table> node.
| [in,out] | duck | TSDuck execution environment. |
| [in,out] | parent | The parent node for the XML representation. |
| [in] | opt | Conversion options. |
| bool ts::BinaryTable::fromXML | ( | DuckContext & | duck, |
| const xml::Element * | node ) |
This method converts an XML node as a binary table.
| [in,out] | duck | TSDuck execution environment. |
| [in] | node | The root of the XML descriptor. |
|
overridevirtual |
Get the list of standards which define this object.
| [in] | current_standards | Current standards in the stream so far. This is a hint which may help the object to determine to which standard it belongs. This can be used by objects with slightly different semantics depending on the standard. |
Implements ts::AbstractDefinedByStandards.