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

#include <tsPSIRepository.h>

Inheritance diagram for ts::PSIRepository:
Collaboration diagram for ts::PSIRepository:

Classes

class  DescriptorClass
class  RegisterDescriptor
class  RegisterTable
class  RegisterXML
class  SignalizationClass
class  TableClass

Public Types

using DescriptorFactory = AbstractDescriptorPtr (*)()
using TableFactory = AbstractTablePtr (*)()

Public Member Functions

UString descriptorTables (const DuckContext &duck, const UString &nodeName) const
void dumpInternalState (std::ostream &out) const
DisplayCADescriptorFunction getCADescriptorDisplay (CASID cas) const
const DescriptorClass & getDescriptor (const UString &xml_name) const
const DescriptorClass & getDescriptor (EDID edid) const
const DescriptorClass & getDescriptor (std::type_index index, TID tid=TID_NULL, Standards standards=Standards::NONE) const
const DescriptorClass & getDescriptor (XDID xdid, DescriptorContext &context) const
void getRegisteredDescriptorIds (std::vector< EDID > &ids) const
void getRegisteredDescriptorNames (UStringList &names) const
void getRegisteredTableIds (std::vector< TID > &ids) const
void getRegisteredTableNames (UStringList &names) const
void getRegisteredTablesModels (UStringList &names) const
const TableClass & getTable (const UString &xml_name) const
const TableClass & getTable (TID tid, const SectionContext &context=SectionContext()) const
Standards getTableStandards (TID id, PID pid=PID_NULL, Standards current_standards=Standards::NONE) const
bool isDescriptorAllowed (const UString &xml_name, TID tid) const
void listDescriptors (std::ostream &out) const
void listTables (std::ostream &out) const

Static Public Member Functions

static PSIRepository & Instance ()
 Get the instance of the singleton of this class.
static std::type_index NullIndex ()

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.

Mixed ISDB-DVB compatibility. ISDB is based on a subset of DVB and adds other tables and descriptors. The DVB subset is compatible with ISDB. When another DID or TID is defined with two distinct semantics, one for DVB and one for ISDB, if ISDB is part of the current standards we use the ISDB semantics, otherwise we use the DVB semantics.

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()

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

Get the instance of the singleton of this class.

Returns
The instance of the singleton of this class.

◆ NullIndex()

std::type_index ts::PSIRepository::NullIndex ( )
inlinestatic

Get a value of a "null" type index. The same value is always returned and can be used as a placeholder for an unused value.

Returns
A value of a "null" type index.

◆ getTable() [1/2]

const TableClass & ts::PSIRepository::getTable ( TID tid,
const SectionContext & context = SectionContext() ) const

Get the description of a table class for a given table id and context.

Parameters
[in]tidTable id.
[in]contextOptional object to lookup the context of the table. This may help disambiguate tables with distinct standards but identical table_id.
Returns
A constant reference to the description of the class. If the class is not found, the returned description is empty (same as initial state of a TableClass).

◆ getTable() [2/2]

const TableClass & ts::PSIRepository::getTable ( const UString & xml_name) const

Get the description of a table class for a given XML node name.

Parameters
[in]xml_nameName of XML node.
Returns
A constant reference to the description of the class. If the class is not found, the returned description is empty (same as initial state of a TableClass).

◆ getTableStandards()

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

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

Parameters
[in]idTable id.
[in]pidPID on which the section is found.
[in]current_standardsCurrent standards in the stream so far. Any potential table which belongs to an incompatible standard is ignored.
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.

◆ getDescriptor() [1/4]

const DescriptorClass & ts::PSIRepository::getDescriptor ( EDID edid) const

Get the description of a descriptor class for a given EDID.

Parameters
[in]edidExtended descriptor id.
Returns
A constant reference to the description of the class. If the class is not found, the returned description is empty (same as initial state of a DescriptorClass).

◆ getDescriptor() [2/4]

const DescriptorClass & ts::PSIRepository::getDescriptor ( XDID xdid,
DescriptorContext & context ) const

Get the description of a descriptor class for a given descriptor tag and its context.

Parameters
[in]xdidExtension descriptor id. This value is extracted from the descriptor itself.
[in,out]contextObject to lookup the context of the descriptor.
Returns
A constant reference to the description of the class. If the class is not found, the returned description is empty (same as initial state of a DescriptorClass).

◆ getDescriptor() [3/4]

const DescriptorClass & ts::PSIRepository::getDescriptor ( std::type_index index,
TID tid = TID_NULL,
Standards standards = Standards::NONE ) const

Get the description of a descriptor class for a given descriptor closs RTTI index. Useful for a descriptor class to get its own description.

Parameters
[in]indexRTTI index for the descriptor class.
[in]tidOptional TID. If the descriptor class is table-specific for several tables, return the EDID for that table. If tid is TID_NULL and there are several specific tables for that descriptor, the first one is returned.
[in]standardsOptional list of standards for the table.
Returns
A constant reference to the description of the class. If the class is not found, the returned description is empty (same as initial state of a DescriptorClass).

◆ getDescriptor() [4/4]

const DescriptorClass & ts::PSIRepository::getDescriptor ( const UString & xml_name) const

Get the description of a descriptor class for a given XML node name.

Parameters
[in]xml_nameName of XML node.
Returns
A constant reference to the description of the class. If the class is not found, the returned description is empty (same as initial state of a DescriptorClass).

◆ isDescriptorAllowed()

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

Check if a descriptor is allowed in a table.

Parameters
[in]xml_nameName 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, as a descriptive string.

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.

◆ getCADescriptorDisplay()

DisplayCADescriptorFunction ts::PSIRepository::getCADescriptorDisplay ( CASID 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.

◆ listTables()

void ts::PSIRepository::listTables ( std::ostream & out) const

List all supported tables.

Parameters
[in,out]outOutput stream.

◆ listDescriptors()

void ts::PSIRepository::listDescriptors ( std::ostream & out) const

List all supported descriptors.

Parameters
[in,out]outOutput stream.

◆ dumpInternalState()

void ts::PSIRepository::dumpInternalState ( std::ostream & out) const

Dump the internal state of the PSI repository (for debug only).

Parameters
[in,out]outOutput stream.

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