Representation of a binary MPEG PSI/SI table. More...
Public Member Functions | |
QtsTable () | |
Default constructor. More... | |
QtsTable (const QtsTable &other) | |
Copy constructor. More... | |
bool | addSection (const QtsSection §ion, bool replace=true, bool grow=true) |
Add a section to a table. More... | |
bool | addSection (const QtsSectionPtr §ion, bool replace=true, bool grow=true) |
Add a section to a table. More... | |
void | clear () |
Clear the content of the table. More... | |
QtsPacketCounter | getFirstTsPacketIndex () const |
Get the index of first TS packet of the table in the demultiplexed stream. More... | |
QtsPacketCounter | getLastTsPacketIndex () const |
Get the index of last TS packet of the table in the demultiplexed stream. More... | |
bool | isValid () const |
Check if the table is valid. More... | |
bool | operator!= (const QtsTable &other) const |
Difference operator. More... | |
const QtsTable & | operator= (const QtsTable &other) |
Assignment operator. More... | |
bool | operator== (const QtsTable &other) const |
Comparison operator. More... | |
QtsSectionPtr | sectionAt (int index) const |
Get a smart pointer to a section in the table. More... | |
int | sectionCount () const |
Get the number of sections in the table. More... | |
void | setSourcePid (QtsPid pid) |
Set the PID from which the table was collected (informational only). More... | |
void | setTableIdExtension (quint16 tidExt, bool recomputeCrc=true) |
Modify the table id extension. More... | |
void | setVersion (quint8 version, bool recomputeCrc=true) |
Modify the table version. More... | |
QtsPid | sourcePid () const |
Get the PID from which the section was collected. More... | |
QtsTableId | tableId () const |
Get the table id. More... | |
quint16 | tableIdExtension () const |
Get the table id extension (long sections only). More... | |
int | totalSize () const |
Get the total size in bytes of all sections in the table. More... | |
quint8 | version () const |
Get the table version (long sections only). More... | |
Private Types | |
typedef QVector< QtsSectionPtr > | SectionVector |
< Vector of smart pointers to sections. More... | |
Private Attributes | |
bool | _isValid |
Content of _data is a valid section. More... | |
int | _missingCount |
Number of missing sections. More... | |
SectionVector | _sections |
Vector of sections. More... | |
QtsPid | _sourcePid |
Source PID (informational). More... | |
QtsTableId | _tid |
Table id. More... | |
quint16 | _tidExt |
Table id extension. More... | |
quint8 | _version |
Table version. More... | |
Representation of a binary MPEG PSI/SI table.
A table is built by adding sections using addSection(). When all sections are present, the table becomes valid.
Data from sections are not deeply copied thanks to the implicit sharing mechanism of the Qt containers. Whenever a section is modified, then a copy-on-write occurs.
The table_id, version and number of sections is determined when the first section is added. Subsequent sections must have the same properties.
|
private |
< Vector of smart pointers to sections.
QtsTable::QtsTable | ( | ) |
Default constructor.
QtsTable::QtsTable | ( | const QtsTable & | other | ) |
Copy constructor.
Data from sections are not deeply copied thanks to the implicit sharing mechanism of the Qt containers. Whenever a section is modified, then a copy-on-write occurs.
[in] | other | Other instance to copy. |
Assignment operator.
Data from sections are not deeply copied thanks to the implicit sharing mechanism of the Qt containers. Whenever a section is modified, then a copy-on-write occurs.
[in] | other | Other instance to copy. |
bool QtsTable::operator== | ( | const QtsTable & | other | ) | const |
Comparison operator.
[in] | other | Other instance to compare. |
|
inline |
Difference operator.
[in] | other | Other instance to compare. |
|
inline |
Add a section to a table.
[in] | section | The section to add. |
[in] | replace | If true, an existing section may be replaced. Otherwise, replacing an existing section is an error. |
[in] | grow | If true, the "last_section_number" of the section may be greater than the "last_section_number" in the table. In this case, all sections which were previously added in the table are modified. |
bool QtsTable::addSection | ( | const QtsSectionPtr & | section, |
bool | replace = true , |
||
bool | grow = true |
||
) |
Add a section to a table.
[in] | section | A smart pointer to the section to add. The section is not copied, only the smart pointer is used. Do not modify the section object from outside after invoking this method. |
[in] | replace | If true, an existing section may be replaced. Otherwise, replacing an existing section is an error. |
[in] | grow | If true, the "last_section_number" of the section may be greater than the "last_section_number" in the table. In this case, all sections which were previously added in the table are modified. |
|
inline |
Check if the table is valid.
void QtsTable::clear | ( | ) |
Clear the content of the table.
The table must be rebuilt using calls to addSection().
|
inline |
Get the table id.
|
inline |
Get the table id extension (long sections only).
|
inline |
Get the table version (long sections only).
|
inline |
Get the PID from which the section was collected.
void QtsTable::setTableIdExtension | ( | quint16 | tidExt, |
bool | recomputeCrc = true |
||
) |
Modify the table id extension.
[in] | tidExt | New table id extension. |
[in] | recomputeCrc | If true, recompute the CRC32 of the section. |
void QtsTable::setVersion | ( | quint8 | version, |
bool | recomputeCrc = true |
||
) |
Modify the table version.
[in] | version | New table version. |
[in] | recomputeCrc | If true, recompute the CRC32 of the section. |
void QtsTable::setSourcePid | ( | QtsPid | pid | ) |
Set the PID from which the table was collected (informational only).
[in] | pid | The PID from which the table was collected. |
QtsPacketCounter QtsTable::getFirstTsPacketIndex | ( | ) | const |
Get the index of first TS packet of the table in the demultiplexed stream.
QtsPacketCounter QtsTable::getLastTsPacketIndex | ( | ) | const |
Get the index of last TS packet of the table in the demultiplexed stream.
|
inline |
Get the number of sections in the table.
int QtsTable::totalSize | ( | ) | const |
Get the total size in bytes of all sections in the table.
QtsSectionPtr QtsTable::sectionAt | ( | int | index | ) | const |
Get a smart pointer to a section in the table.
[in] | index | Section number. |
|
private |
Content of _data is a valid section.
|
private |
Table id.
|
private |
Table id extension.
|
private |
Table version.
|
private |
Source PID (informational).
|
private |
Number of missing sections.
|
private |
Vector of sections.