TSDuck v3.40-4025
MPEG Transport Stream Toolkit
|
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 ®ids=REGIDVector(), PDS pds=PDS_NULL) | |
Constructor, using default values. | |
const DuckContext & | duck () |
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 ®ids) |
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. | |
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.
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.
[in,out] | duck | A reference to the TSDuck execution context. The DuckContext must be valid until the destruction of the DescriptorContext object. |
[in] | tid | Optional table id. This value is returned by getTableId(). |
[in] | standards | Optional set of standards. This value is returned by getStandards(). |
[in] | casid | Optional Conditional Access System id. This value is returned by getCAS(). |
[in] | regids | Optional list of registration ids. This value is returned by getREGIDs(). |
[in] | pds | Optional DVB private data specifier. This value is returned by getPDS(). |
ts::DescriptorContext::DescriptorContext | ( | const DuckContext & | duck, |
const DescriptorList & | dlist, | ||
size_t | index, | ||
CASID | casid = CASID_NULL |
||
) |
Constructor, using a descriptor list.
[in,out] | duck | A reference to the TSDuck execution context. The DuckContext must be valid until the destruction of the DescriptorContext object. |
[in] | dlist | A reference to the descriptor list to search. The referenced object must remain valid as long as the context object references it. |
[in] | index | Index 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] | casid | Optional Conditional Access System id. This value is returned by getCAS(). |
|
inline |
Get a reference to the TSDuck execution context.
TID ts::DescriptorContext::getTableId | ( | ) | const |
Get the table id of the table where the descriptor is located.
Standards ts::DescriptorContext::getStandards | ( | ) | const |
Get the standards where the descriptor is located.
CASID ts::DescriptorContext::getCAS | ( | ) | const |
Get the Conditional Access System id in the context where the descriptor is located.
PDS ts::DescriptorContext::getPDS | ( | ) |
Get the private data specifier in the context where the descriptor is located.
void ts::DescriptorContext::getREGIDs | ( | REGIDVector & | regids | ) |
Get the list of registration ids in the context where the descriptor is located.
[out] | regids | Receive the list of applicable MPEG registration ids. |
REGIDVector ts::DescriptorContext::getREGIDs | ( | ) |
Get the list of registration ids in the context where the descriptor is located.
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.
[in] | dlist | Address 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] | index | Index of the last descriptor to search in the list. If greater than than the list size, stop at the last descriptor in the list. |
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.
[in] | data | Address 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] | size | Size 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()). |
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.
[in] | data | Address 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] | size | Size in bytes of the memory area. Unlike setCurrentRawDescriptorList(), this must be the total size of the top-level descriptor list. |
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.