TSDuck v3.40-3968
MPEG Transport Stream Toolkit
Loading...
Searching...
No Matches
ts::PSIRepository Class Reference

A repository for known PSI/SI tables and descriptors. More...

#include <tsPSIRepository.h>

Classes

class  RegisterDescriptor
 A class to register fully implemented descriptors. More...
 
class  RegisterTable
 A class to register fully implemented tables. More...
 
class  RegisterXML
 A class to register additional XML model files to merge with the main model for tables and descriptors. More...
 

Public Types

using DescriptorFactory = AbstractDescriptorPtr(*)()
 Profile of a function which creates a descriptor.
 
using TableFactory = AbstractTablePtr(*)()
 Profile of a function which creates a table.
 

Public Member Functions

UString descriptorTables (const DuckContext &duck, const UString &nodeName) const
 Get the list of tables where a descriptor is allowed.
 
DisplayCADescriptorFunction getCADescriptorDisplay (uint16_t cas) const
 Get the display function of the CA_descriptor for a given CA_system_id.
 
DisplayDescriptorFunction getDescriptorDisplay (const EDID &edid, TID tid=TID_NULL) const
 Get the display function for a given extended descriptor id.
 
DescriptorFactory getDescriptorFactory (const EDID &edid, TID tid=TID_NULL) const
 Get the descriptor factory for a given descriptor tag.
 
DescriptorFactory getDescriptorFactory (const UString &nodeName) const
 Get the descriptor factory for a given XML node name.
 
void getRegisteredDescriptorIds (std::vector< EDID > &ids) const
 Get the list of all registered descriptor tags.
 
void getRegisteredDescriptorNames (UStringList &names) const
 Get the list of all registered XML names for descriptors.
 
void getRegisteredTableIds (std::vector< TID > &ids) const
 Get the list of all registered table ids.
 
void getRegisteredTableNames (UStringList &names) const
 Get the list of all registered XML names for tables.
 
void getRegisteredTablesModels (UStringList &names) const
 Get the list of all registered additional XML model file names for tables and descriptors.
 
DisplaySectionFunction getSectionDisplay (TID id, Standards standards, PID pid=PID_NULL, uint16_t cas=CASID_NULL) const
 Get the display function for a given table id.
 
LogSectionFunction getSectionLog (TID id, Standards standards, PID pid=PID_NULL, uint16_t cas=CASID_NULL) const
 Get the log function for a given table id.
 
TableFactory getTableFactory (const UString &nodeName) const
 Get the table factory for a given XML node name.
 
TableFactory getTableFactory (TID id, Standards standards, PID pid=PID_NULL, uint16_t cas=CASID_NULL) const
 Get the table factory for a given table id.
 
Standards getTableStandards (TID id, PID pid=PID_NULL) const
 Get the list of standards which are defined for a given table id.
 
bool isDescriptorAllowed (const UString &nodeName, TID tid) const
 Check if a descriptor is allowed in a table.
 

Static Public Member Functions

static PSIRepositoryInstance ()
 Get the instance of the singleton of this class.
 

Detailed Description

A repository for known PSI/SI tables and descriptors.

This class is a singleton. Use static Instance() method to access the single instance.

Multi-threading considerations: The singleton is built and modified using static registration instances during the initialization of the application (ie. in one single thread). Then, the singleton is only read during the execution of the application. So, no explicit synchronization is required.

Member Typedef Documentation

◆ TableFactory

Profile of a function which creates a table.

Returns
A safe pointer to an instance of a concrete subclass of AbstractTable.

◆ DescriptorFactory

Profile of a function which creates a descriptor.

Returns
A safe pointer to an instance of a concrete subclass of AbstractDescriptor.

Member Function Documentation

◆ Instance()

static PSIRepository & ts::PSIRepository::Instance ( )
inlinestatic

Get the instance of the singleton of this class.

Returns
The instance of the singleton of this class.

◆ getTableFactory() [1/2]

TableFactory ts::PSIRepository::getTableFactory ( TID  id,
Standards  standards,
PID  pid = PID_NULL,
uint16_t  cas = CASID_NULL 
) const

Get the table factory for a given table id.

Parameters
[in]idTable id.
[in]standardsList of current active standards in the application. If there are several factories for this table id, return only a factory for which the standard is active. For instance, if the same table id is used by ATSC and ISDB but the application runs in an ISDB context, return the factory for the ISDB version of this table id.
[in]pidPID on which the section is found.
[in]casCurrent CAS id.
Returns
Corresponding factory or zero if there is none.

◆ getTableStandards()

Standards ts::PSIRepository::getTableStandards ( TID  id,
PID  pid = PID_NULL 
) const

Get the list of standards which are defined for a given table id.

Parameters
[in]idTable id.
Returns
Corresponding list of standards. If multiple definitions exist for this table id, return the common subset of all definitions. This means that only standards which are used in all cases are returned.
Parameters
[in]pidPID on which the section is found.

◆ getDescriptorFactory() [1/2]

DescriptorFactory ts::PSIRepository::getDescriptorFactory ( const EDID edid,
TID  tid = TID_NULL 
) const

Get the descriptor factory for a given descriptor tag.

Parameters
[in]edidExtended descriptor id.
[in]tidOptional table id of the table containing the descriptor. If edid is a standard descriptor and tid is specified, try first a table-specific descriptor for this table. Fallback to the standard descriptor.
Returns
Corresponding factory or zero if there is none.

◆ getTableFactory() [2/2]

TableFactory ts::PSIRepository::getTableFactory ( const UString nodeName) const

Get the table factory for a given XML node name.

Parameters
[in]nodeNameName of XML node.
Returns
Corresponding factory or zero if there is none.

◆ getDescriptorFactory() [2/2]

DescriptorFactory ts::PSIRepository::getDescriptorFactory ( const UString nodeName) const

Get the descriptor factory for a given XML node name.

Parameters
[in]nodeNameName of XML node.
Returns
Corresponding factory or zero if there is none.

◆ isDescriptorAllowed()

bool ts::PSIRepository::isDescriptorAllowed ( const UString nodeName,
TID  tid 
) const

Check if a descriptor is allowed in a table.

Parameters
[in]nodeNameName of the XML node for the descriptor.
[in]tidTable id of the table to check.
Returns
True if the descriptor is allowed, false otherwise. Non-table-specific descriptors are allowed everywhere. Table-specific descriptors are allowed only in a set of specific tables.

◆ descriptorTables()

UString ts::PSIRepository::descriptorTables ( const DuckContext duck,
const UString nodeName 
) const

Get the list of tables where a descriptor is allowed.

Parameters
[in]duckTSDuck execution context to interpret table names.
[in]nodeNameName of the XML node for the descriptor.
Returns
Human-readable list of tables where the descriptor is allowed. Empty string for non-table-specific descriptors.

◆ getSectionDisplay()

DisplaySectionFunction ts::PSIRepository::getSectionDisplay ( TID  id,
Standards  standards,
PID  pid = PID_NULL,
uint16_t  cas = CASID_NULL 
) const

Get the display function for a given table id.

Parameters
[in]idTable id.
[in]standardsList of current active standards in the application. If there are several display functions for this table id, return only a function for which the standard is active. For instance, if the same table id is used by ATSC and ISDB but the application runs in an ISDB context, return the display function for the ISDB version of this table id.
[in]pidPID on which the section is found.
[in]casCurrent CAS id.
Returns
Corresponding display function or zero if there is none.

◆ getSectionLog()

LogSectionFunction ts::PSIRepository::getSectionLog ( TID  id,
Standards  standards,
PID  pid = PID_NULL,
uint16_t  cas = CASID_NULL 
) const

Get the log function for a given table id.

Parameters
[in]idTable id.
[in]standardsList of current active standards in the application. If there are several log functions for this table id, return only a function for which the standard is active. For instance, if the same table id is used by ATSC and ISDB but the application runs in an ISDB context, return the log function for the ISDB version of this table id.
[in]pidPID on which the section is found.
[in]casCurrent CAS id.
Returns
Corresponding log function or zero if there is none.

◆ getDescriptorDisplay()

DisplayDescriptorFunction ts::PSIRepository::getDescriptorDisplay ( const EDID edid,
TID  tid = TID_NULL 
) const

Get the display function for a given extended descriptor id.

Parameters
[in]edidExtended descriptor id.
[in]tidOptional table id of the table containing the descriptor. If edid is a standard descriptor and tid is specified, try first a table-specific descriptor for this table. Fallback to the standard descriptor.
Returns
Corresponding display function or zero if there is none.

◆ getCADescriptorDisplay()

DisplayCADescriptorFunction ts::PSIRepository::getCADescriptorDisplay ( uint16_t  cas) const

Get the display function of the CA_descriptor for a given CA_system_id.

Parameters
[in]casCA_system_id.
Returns
Corresponding display function or zero if there is none.

◆ getRegisteredTableIds()

void ts::PSIRepository::getRegisteredTableIds ( std::vector< TID > &  ids) const

Get the list of all registered table ids.

Parameters
[out]idsList of all registered table ids.

◆ getRegisteredDescriptorIds()

void ts::PSIRepository::getRegisteredDescriptorIds ( std::vector< EDID > &  ids) const

Get the list of all registered descriptor tags.

Parameters
[out]idsList of all registered descriptor tags.

◆ getRegisteredTableNames()

void ts::PSIRepository::getRegisteredTableNames ( UStringList names) const

Get the list of all registered XML names for tables.

Parameters
[out]namesList of all registered XML names for tables.

◆ getRegisteredDescriptorNames()

void ts::PSIRepository::getRegisteredDescriptorNames ( UStringList names) const

Get the list of all registered XML names for descriptors.

Parameters
[out]namesList of all registered XML names for descriptors.

◆ getRegisteredTablesModels()

void ts::PSIRepository::getRegisteredTablesModels ( UStringList names) const

Get the list of all registered additional XML model file names for tables and descriptors.

Parameters
[out]namesList of all registered additional XML model file names.

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