QtlMovie 1.12 (A specialized FFmpeg front-end)
QtsTable Class Reference

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 &section, bool replace=true, bool grow=true)
 Add a section to a table. More...
 
bool addSection (const QtsSectionPtr &section, 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 QtsTableoperator= (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< QtsSectionPtrSectionVector
 < 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...
 

Detailed Description

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.

Member Typedef Documentation

◆ SectionVector

typedef QVector<QtsSectionPtr> QtsTable::SectionVector
private

< Vector of smart pointers to sections.

Constructor & Destructor Documentation

◆ QtsTable() [1/2]

QtsTable::QtsTable ( )

Default constructor.

◆ QtsTable() [2/2]

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.

Parameters
[in]otherOther instance to copy.

Member Function Documentation

◆ operator=()

const QtsTable & QtsTable::operator= ( const QtsTable other)

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.

Parameters
[in]otherOther instance to copy.

◆ operator==()

bool QtsTable::operator== ( const QtsTable other) const

Comparison operator.

Parameters
[in]otherOther instance to compare.
Returns
True if the tables are identical, false otherwise. The source PID's are ignored, only the sections contents are compared. Note: Invalid tables are never identical.

◆ operator!=()

bool QtsTable::operator!= ( const QtsTable other) const
inline

Difference operator.

Parameters
[in]otherOther instance to compare.
Returns
True if the tables are different, false otherwise. The source PID's are ignored, only the sections contents are compared. Note: Invalid tables are never identical.

◆ addSection() [1/2]

bool QtsTable::addSection ( const QtsSection section,
bool  replace = true,
bool  grow = true 
)
inline

Add a section to a table.

Parameters
[in]sectionThe section to add.
[in]replaceIf true, an existing section may be replaced. Otherwise, replacing an existing section is an error.
[in]growIf 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.
Returns
True on success, false if the section could not be added (inconsistent property).

◆ addSection() [2/2]

bool QtsTable::addSection ( const QtsSectionPtr section,
bool  replace = true,
bool  grow = true 
)

Add a section to a table.

Parameters
[in]sectionA 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]replaceIf true, an existing section may be replaced. Otherwise, replacing an existing section is an error.
[in]growIf 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.
Returns
True on success, false if the section could not be added (inconsistent property).

◆ isValid()

bool QtsTable::isValid ( ) const
inline

Check if the table is valid.

Returns
True if the table is valid, false otherwise;

◆ clear()

void QtsTable::clear ( )

Clear the content of the table.

The table must be rebuilt using calls to addSection().

◆ tableId()

QtsTableId QtsTable::tableId ( ) const
inline

Get the table id.

Returns
The table id.

◆ tableIdExtension()

quint16 QtsTable::tableIdExtension ( ) const
inline

Get the table id extension (long sections only).

Returns
The table id extension (zero for short sections).

◆ version()

quint8 QtsTable::version ( ) const
inline

Get the table version (long sections only).

Returns
The table version (zero for short sections).

◆ sourcePid()

QtsPid QtsTable::sourcePid ( ) const
inline

Get the PID from which the section was collected.

Returns
The PID from which the section was collected.

◆ setTableIdExtension()

void QtsTable::setTableIdExtension ( quint16  tidExt,
bool  recomputeCrc = true 
)

Modify the table id extension.

Parameters
[in]tidExtNew table id extension.
[in]recomputeCrcIf true, recompute the CRC32 of the section.

◆ setVersion()

void QtsTable::setVersion ( quint8  version,
bool  recomputeCrc = true 
)

Modify the table version.

Parameters
[in]versionNew table version.
[in]recomputeCrcIf true, recompute the CRC32 of the section.

◆ setSourcePid()

void QtsTable::setSourcePid ( QtsPid  pid)

Set the PID from which the table was collected (informational only).

Parameters
[in]pidThe PID from which the table was collected.

◆ getFirstTsPacketIndex()

QtsPacketCounter QtsTable::getFirstTsPacketIndex ( ) const

Get the index of first TS packet of the table in the demultiplexed stream.

Returns
The index of first TS packet of the table.

◆ getLastTsPacketIndex()

QtsPacketCounter QtsTable::getLastTsPacketIndex ( ) const

Get the index of last TS packet of the table in the demultiplexed stream.

Returns
The index of last TS packet of the table.

◆ sectionCount()

int QtsTable::sectionCount ( ) const
inline

Get the number of sections in the table.

Returns
The number of sections in the table.

◆ totalSize()

int QtsTable::totalSize ( ) const

Get the total size in bytes of all sections in the table.

Returns
The total size in bytes of all sections in the table.

◆ sectionAt()

QtsSectionPtr QtsTable::sectionAt ( int  index) const

Get a smart pointer to a section in the table.

Parameters
[in]indexSection number.
Returns
A pointer to the section in the table or zero if not present. The pointed object shall not be modified.

Member Data Documentation

◆ _isValid

bool QtsTable::_isValid
private

Content of _data is a valid section.

◆ _tid

QtsTableId QtsTable::_tid
private

Table id.

◆ _tidExt

quint16 QtsTable::_tidExt
private

Table id extension.

◆ _version

quint8 QtsTable::_version
private

Table version.

◆ _sourcePid

QtsPid QtsTable::_sourcePid
private

Source PID (informational).

◆ _missingCount

int QtsTable::_missingCount
private

Number of missing sections.

◆ _sections

SectionVector QtsTable::_sections
private

Vector of sections.


The documentation for this class was generated from the following files: