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

A class to lookup the context of MPEG PSI/SI descriptors. More...

#include <tsDescriptorContext.h>

Public Member Functions

 DescriptorContext (const DuckContext &duck, const DescriptorList &dlist, size_t index, CASID casid=CASID_NULL)
 Constructor, using a descriptor list.
 
 DescriptorContext (const DuckContext &duck, TID tid=TID_NULL, Standards standards=Standards::NONE, CASID casid=CASID_NULL, const REGIDVector &regids=REGIDVector(), PDS pds=PDS_NULL)
 Constructor, using default values.
 
const DuckContextduck ()
 Get a reference to the TSDuck execution context.
 
CASID getCAS () const
 Get the Conditional Access System id in the context where the descriptor is located.
 
PDS getPDS ()
 Get the private data specifier in the context where the descriptor is located.
 
REGIDVector getREGIDs ()
 Get the list of registration ids in the context where the descriptor is located.
 
void getREGIDs (REGIDVector &regids)
 Get the list of registration ids in the context where the descriptor is located.
 
Standards getStandards () const
 Get the standards where the descriptor is located.
 
TID getTableId () const
 Get the table id of the table where the descriptor is located.
 
void moveRawDescriptorListToTop ()
 Move the current raw descriptor list as top-level descriptor list.
 
void setCurrentDescriptorList (const DescriptorList *dlist, size_t index=NPOS)
 Set the current descriptor list where to search for private identifiers, PDS or REGID.
 
void setCurrentRawDescriptorList (const void *data, size_t size)
 Set the current descriptor list where to search for private identifiers, PDS or REGID.
 
void setTopLevelRawDescriptorList (const void *data, size_t size)
 Set the top-level descriptor list where to search for private identifiers, PDS or REGID.
 

Detailed Description

A class to lookup the context of MPEG PSI/SI descriptors.

The interface of the base class is used to understand the context of a descriptor. When getting a binary descriptor, for instance, it is not always easy to determine the true nature of the descriptor, because the 8-bit descriptor tag can be used by different types of descriptors. The DescriptorContext provides the table id, the standards, CAS id, private specifier, or registration id which disambiguate the resolution.

Constructor & Destructor Documentation

◆ DescriptorContext() [1/2]

ts::DescriptorContext::DescriptorContext ( const DuckContext duck,
TID  tid = TID_NULL,
Standards  standards = Standards::NONE,
CASID  casid = CASID_NULL,
const REGIDVector regids = REGIDVector(),
PDS  pds = PDS_NULL 
)

Constructor, using default values.

Parameters
[in,out]duckA reference to the TSDuck execution context. The DuckContext must be valid until the destruction of the DescriptorContext object.
[in]tidOptional table id. This value is returned by getTableId().
[in]standardsOptional set of standards. This value is returned by getStandards().
[in]casidOptional Conditional Access System id. This value is returned by getCAS().
[in]regidsOptional list of registration ids. This value is returned by getREGIDs().
[in]pdsOptional DVB private data specifier. This value is returned by getPDS().

◆ DescriptorContext() [2/2]

ts::DescriptorContext::DescriptorContext ( const DuckContext duck,
const DescriptorList dlist,
size_t  index,
CASID  casid = CASID_NULL 
)

Constructor, using a descriptor list.

Parameters
[in,out]duckA reference to the TSDuck execution context. The DuckContext must be valid until the destruction of the DescriptorContext object.
[in]dlistA reference to the descriptor list to search. The referenced object must remain valid as long as the context object references it.
[in]indexIndex of the last descriptor to search in the list. If greater than than the list size, stop at the last descriptor in the list.
[in]casidOptional Conditional Access System id. This value is returned by getCAS().

Member Function Documentation

◆ duck()

const DuckContext & ts::DescriptorContext::duck ( )
inline

Get a reference to the TSDuck execution context.

Returns
A reference to the TSDuck execution context.

◆ getTableId()

TID ts::DescriptorContext::getTableId ( ) const

Get the table id of the table where the descriptor is located.

Returns
The parent table id or TID_NULL if unknown.

◆ getStandards()

Standards ts::DescriptorContext::getStandards ( ) const

Get the standards where the descriptor is located.

Returns
The standards where the descriptor is located.

◆ getCAS()

CASID ts::DescriptorContext::getCAS ( ) const

Get the Conditional Access System id in the context where the descriptor is located.

Returns
The contextual CAS id or CASID_NULL if unknown.

◆ getPDS()

PDS ts::DescriptorContext::getPDS ( )

Get the private data specifier in the context where the descriptor is located.

Returns
The contextual PDS or PDS_NULL if unknown.

◆ getREGIDs() [1/2]

void ts::DescriptorContext::getREGIDs ( REGIDVector regids)

Get the list of registration ids in the context where the descriptor is located.

Parameters
[out]regidsReceive the list of applicable MPEG registration ids.

◆ getREGIDs() [2/2]

REGIDVector ts::DescriptorContext::getREGIDs ( )

Get the list of registration ids in the context where the descriptor is located.

Returns
The list of applicable MPEG registration ids.

◆ setCurrentDescriptorList()

void ts::DescriptorContext::setCurrentDescriptorList ( const DescriptorList dlist,
size_t  index = NPOS 
)

Set the current descriptor list where to search for private identifiers, PDS or REGID.

When the descriptor list is a second-level one (eg. component-level in a PMT), the top-level descriptor list of the same table (eg. program-level in a PMT) is automatically retrieved to look for registration ids.

Parameters
[in]dlistAddress of the descriptor list to search. The pointed object must remain valid as long as the context object references it. If null, reset the descriptor list and revert to the default values which were passed to the constructor.
[in]indexIndex of the last descriptor to search in the list. If greater than than the list size, stop at the last descriptor in the list.

◆ setCurrentRawDescriptorList()

void ts::DescriptorContext::setCurrentRawDescriptorList ( const void *  data,
size_t  size 
)

Set the current descriptor list where to search for private identifiers, PDS or REGID.

Unlike setCurrentDescriptorList(), the descriptor list is unstructured, this is just a memory area. Furthermore, when the descriptor list is a second-level one (eg. component-level in a PMT), the top-level descriptor list of the same table (eg. program-level in a PMT) cannot be automatically retrieved. In that case, the application needs to call setTopLevelRawDescriptorList() to establish where to search for higher-level registration ids.

Parameters
[in]dataAddress of the descriptor list to search. The pointed memory must remain valid as long as the context object references it. If null, reset the descriptor list and revert to the default values which were passed to the constructor.
[in]sizeSize in bytes of the memory area. This is usually not the complete size of the descriptor list. The size shall end at the descriptor for which we need to establish a context (see parameter index in setCurrentDescriptorList()).
See also
setTopLevelRawDescriptorList()

◆ setTopLevelRawDescriptorList()

void ts::DescriptorContext::setTopLevelRawDescriptorList ( const void *  data,
size_t  size 
)

Set the top-level descriptor list where to search for private identifiers, PDS or REGID.

Parameters
[in]dataAddress of the descriptor list to search. The pointed memory must remain valid as long as the context object references it. If null, reset the descriptor list and revert to the default values which were passed to the constructor.
[in]sizeSize in bytes of the memory area. Unlike setCurrentRawDescriptorList(), this must be the total size of the top-level descriptor list.
See also
setCurrentRawDescriptorList()

◆ moveRawDescriptorListToTop()

void ts::DescriptorContext::moveRawDescriptorListToTop ( )

Move the current raw descriptor list as top-level descriptor list.

The REGID analysis is preserved and moved to the top list.

See also
setCurrentRawDescriptorList()
setTopLevelRawDescriptorList()

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