TSDuck v3.40-3968
MPEG Transport Stream Toolkit
|
General-purpose signalization demux. More...
#include <tsSignalizationDemux.h>
Public Member Functions | |
SignalizationDemux (DuckContext &duck) | |
Constructor for full services and PID's analysis. | |
SignalizationDemux (DuckContext &duck, SignalizationHandlerInterface *handler, std::initializer_list< TID > tids=std::initializer_list< TID >()) | |
Constructor with handler and selected signalization. | |
void | addFilteredService (const UString &name) |
Add a service to filter, by name or by id. | |
void | addFilteredServiceId (uint16_t sid) |
Add a service id to filter. | |
bool | addFilteredTableId (TID tid) |
Add a signalization table id to filter. | |
void | addFilteredTableIds (std::initializer_list< TID > tids) |
Add signalization table ids to filter. | |
void | addFullFilters () |
Add table filtering for full services and PID's analysis. | |
bool | atIntraFrame (PID pid) const |
Check if the past packet of a PID contained the start of a video intra-frame. | |
CodecType | codecType (PID pid, CodecType deftype=CodecType::UNDEFINED) const |
Get the codec which is used in PID in the TS. | |
void | feedPacket (const TSPacket &pkt) |
This method feeds the demux with a TS packet. | |
void | getPIDs (PIDSet &pids) const |
Get the set of PID's in the TS. | |
void | getServiceIds (PID pid, std::set< uint16_t > services) const |
Get the services of a PID. | |
void | getServiceIds (std::set< uint16_t > &services) const |
Get the list of all service ids in the TS. | |
void | getServices (ServiceList &services) const |
Get the list of all services in the TS. | |
bool | hasNIT () const |
Check if a NIT Actual has been received. | |
bool | hasPAT () const |
Check if a PAT has been received. | |
bool | inAnyService (PID pid, std::set< uint16_t > service_ids) const |
Check if a PID is a component of any service in a set of services. | |
bool | inService (PID pid, uint16_t service_id) const |
Check if a PID is a component of a service. | |
PacketCounter | intraFrameCount (PID pid) const |
Get the number of video intra-frames in a PID. | |
PacketCounter | intraFrameFirstIndex (PID pid) const |
Get the number of TS packets in a PID before its first video intra-frame. | |
PacketCounter | intraFrameLastIndex (PID pid) const |
Get the number of TS packets in a PID before its last video intra-frame. | |
bool | isFilteredServiceId (uint16_t sid) const |
Check if a service id is filtered. | |
bool | isFilteredServiceName (const UString &name) const |
Check if a service name is filtered. | |
bool | isFilteredTableId (TID tid) const |
Check if a signalization table id is filtered. | |
bool | isScrambled (PID pid) const |
Check if a PID contains scrambled packets. | |
const NIT & | lastNIT () const |
Return a constant reference to the last NIT Actual which has been received. | |
const PAT & | lastPAT () const |
Return a constant reference to the last PAT which has been received. | |
Time | lastUTC () const |
Get the last UTC time from a TOT/TDT (DVB, ISDB) or STT (ATSC). | |
uint16_t | networkId () const |
Get the actual network id (from the NIT). | |
PID | nitPID () const |
Get the NIT PID, either from last PAT or default PID. | |
uint16_t | originalNetworkId () const |
Get the original network id (from the SDT). | |
PacketCounter | packetCount (PID pid) const |
Get the number of TS packets in a PID. | |
PIDClass | pidClass (PID pid, PIDClass defclass=PIDClass::UNDEFINED) const |
Get the class of a PID in the TS. | |
PacketCounter | pusiCount (PID pid) const |
Get the number of TS packets with payload unit start indicator (PUSI) in a PID. | |
PacketCounter | pusiFirstIndex (PID pid) const |
Get the number of TS packets in a PID before its first payload unit start indicator (PUSI). | |
PacketCounter | pusiLastIndex (PID pid) const |
Get the number of TS packets in a PID before its last payload unit start indicator (PUSI). | |
void | removeAllFilteredServices () |
Remove all services to filter. | |
void | removeFilteredService (const UString &name) |
Remove a service to filter, by name or by id. | |
void | removeFilteredServiceId (uint16_t sid) |
Remove a service id to filter. | |
bool | removeFilteredTableId (TID tid) |
Remove a signalization table id to filter. | |
void | removeFilteredTableIds (std::initializer_list< TID > tids) |
Remove signalization table ids to filter. | |
void | reset () |
Reset the demux, remove all signalization filters. | |
uint16_t | serviceId (PID pid) const |
Get the service of a PID. | |
void | setHandler (SignalizationHandlerInterface *handler) |
Replace the signalization handler. | |
uint8_t | streamType (PID pid, uint8_t deftype=ST_NULL) const |
Get the stream type (from PMT) of a PID in the TS. | |
uint16_t | transportStreamId () const |
Get the transport stream id. | |
General-purpose signalization demux.
|
explicit |
Constructor for full services and PID's analysis.
All signalization is demuxed. A full map of services and PID's is internally built. This is the typical constructor to use the application only needs to query the structure of services and PID's. It is still possible to add a handler for signalization tables later.
When the demux is reset, the full filtered are restored.
[in,out] | duck | TSDuck execution context. The reference is kept inside the demux. Contextual information (such as standards) are accumulated in the context from demuxed sections. |
|
explicit |
Constructor with handler and selected signalization.
This is the typical constructor to use when the application wants to be notified of some signalization tables only. The internal map of services and PID's may be incomplete, depending on the selected signalization.
[in,out] | duck | TSDuck execution context. The reference is kept inside the demux. Contextual information (such as standards) are accumulated in the context from demuxed sections. |
[in] | handler | The object to invoke when a new complete signalization table is extracted. |
[in] | tids | The set of TID's to demux. Unsupported table ids are ignored. If TID_PMT is specified, all PMT's are filtered. To filter PMT's for selected services, use addServiceId(). |
void ts::SignalizationDemux::feedPacket | ( | const TSPacket & | pkt | ) |
This method feeds the demux with a TS packet.
[in] | pkt | A TS packet. |
|
inline |
Replace the signalization handler.
[in] | handler | The new handler. |
void ts::SignalizationDemux::reset | ( | ) |
Reset the demux, remove all signalization filters.
If this object was built using the first constructor (one parameter), full filtering is reset to its default state.
void ts::SignalizationDemux::addFullFilters | ( | ) |
Add table filtering for full services and PID's analysis.
All signalization is demuxed. A full map of services and PID's is internally built.
bool ts::SignalizationDemux::addFilteredTableId | ( | TID | tid | ) |
Add a signalization table id to filter.
[in] | tid | The table id to add. Unsupported table ids are ignored. If TID_PMT is specified, all PMT's are filtered. To filter PMT's for selected services, use addServiceId(). |
void ts::SignalizationDemux::addFilteredTableIds | ( | std::initializer_list< TID > | tids | ) |
Add signalization table ids to filter.
[in] | tids | The table ids to add. |
bool ts::SignalizationDemux::removeFilteredTableId | ( | TID | tid | ) |
Remove a signalization table id to filter.
[in] | tid | The table id to remove. Unsupported table ids are ignored. |
void ts::SignalizationDemux::removeFilteredTableIds | ( | std::initializer_list< TID > | tids | ) |
Remove signalization table ids to filter.
[in] | tids | The table ids to remove. |
|
inline |
Check if a signalization table id is filtered.
[in] | tid | The table id to check. |
void ts::SignalizationDemux::addFilteredServiceId | ( | uint16_t | sid | ) |
Add a service id to filter.
[in] | sid | The service id to add. |
void ts::SignalizationDemux::removeFilteredServiceId | ( | uint16_t | sid | ) |
Remove a service id to filter.
[in] | sid | The service id to remove. |
|
inline |
Check if a service id is filtered.
[in] | sid | The service id to check. |
void ts::SignalizationDemux::addFilteredService | ( | const UString & | name | ) |
Add a service to filter, by name or by id.
[in] | name | The service name or id to add. |
void ts::SignalizationDemux::removeFilteredService | ( | const UString & | name | ) |
Remove a service to filter, by name or by id.
[in] | name | The service name or id to remove. |
bool ts::SignalizationDemux::isFilteredServiceName | ( | const UString & | name | ) | const |
Check if a service name is filtered.
[in] | name | The service name or id to check. |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Get the transport stream id.
|
inline |
Get the original network id (from the SDT).
|
inline |
Get the actual network id (from the NIT).
PID ts::SignalizationDemux::nitPID | ( | ) | const |
|
inline |
Get the last UTC time from a TOT/TDT (DVB, ISDB) or STT (ATSC).
void ts::SignalizationDemux::getServiceIds | ( | std::set< uint16_t > & | services | ) | const |
Get the list of all service ids in the TS.
[out] | services | The set of all services ids in the TS, as found so far. |
void ts::SignalizationDemux::getServices | ( | ServiceList & | services | ) | const |
Get the list of all services in the TS.
[out] | services | The list of all services in the TS, as found so far. |
void ts::SignalizationDemux::getPIDs | ( | PIDSet & | pids | ) | const |
Get the set of PID's in the TS.
[out] | pids | The set of PID's in the TS. |
PIDClass ts::SignalizationDemux::pidClass | ( | PID | pid, |
PIDClass | defclass = PIDClass::UNDEFINED |
||
) | const |
Get the class of a PID in the TS.
[in] | pid | The PID to check. |
[in] | defclass | The default PID class to use if the actual one is unknown. |
CodecType ts::SignalizationDemux::codecType | ( | PID | pid, |
CodecType | deftype = CodecType::UNDEFINED |
||
) | const |
Get the codec which is used in PID in the TS.
[in] | pid | The PID to check. |
[in] | deftype | The default codec type to use if the actual type is unknown. |
bool ts::SignalizationDemux::isScrambled | ( | PID | pid | ) | const |
Check if a PID contains scrambled packets.
[in] | pid | The PID to check. |
PacketCounter ts::SignalizationDemux::packetCount | ( | PID | pid | ) | const |
Get the number of TS packets in a PID.
[in] | pid | The PID to check. |
PacketCounter ts::SignalizationDemux::pusiCount | ( | PID | pid | ) | const |
Get the number of TS packets with payload unit start indicator (PUSI) in a PID.
[in] | pid | The PID to check. |
PacketCounter ts::SignalizationDemux::pusiFirstIndex | ( | PID | pid | ) | const |
Get the number of TS packets in a PID before its first payload unit start indicator (PUSI).
[in] | pid | The PID to check. |
PacketCounter ts::SignalizationDemux::pusiLastIndex | ( | PID | pid | ) | const |
Get the number of TS packets in a PID before its last payload unit start indicator (PUSI).
[in] | pid | The PID to check. |
PacketCounter ts::SignalizationDemux::intraFrameCount | ( | PID | pid | ) | const |
Get the number of video intra-frames in a PID.
[in] | pid | The PID to check. |
PacketCounter ts::SignalizationDemux::intraFrameFirstIndex | ( | PID | pid | ) | const |
Get the number of TS packets in a PID before its first video intra-frame.
[in] | pid | The PID to check. |
PacketCounter ts::SignalizationDemux::intraFrameLastIndex | ( | PID | pid | ) | const |
Get the number of TS packets in a PID before its last video intra-frame.
[in] | pid | The PID to check. |
bool ts::SignalizationDemux::atIntraFrame | ( | PID | pid | ) | const |
Check if the past packet of a PID contained the start of a video intra-frame.
[in] | pid | The PID to check. |
bool ts::SignalizationDemux::inService | ( | PID | pid, |
uint16_t | service_id | ||
) | const |
Check if a PID is a component of a service.
[in] | pid | The PID to check. |
[in] | service_id | Service id. |
bool ts::SignalizationDemux::inAnyService | ( | PID | pid, |
std::set< uint16_t > | service_ids | ||
) | const |
Check if a PID is a component of any service in a set of services.
[in] | pid | The PID to check. |
[in] | service_ids | A set of service ids. |
uint16_t ts::SignalizationDemux::serviceId | ( | PID | pid | ) | const |
Get the service of a PID.
[in] | pid | The PID to check. |
void ts::SignalizationDemux::getServiceIds | ( | PID | pid, |
std::set< uint16_t > | services | ||
) | const |
Get the services of a PID.
[in] | pid | The PID to check. |
[out] | services | The set of services in which pid was found. |