A SectionDemux which extracts MPEG tables without external handler.
More...
#include <tsStandaloneTableDemux.h>
|
using | SuperClass = AbstractDemux |
| Explicit reference to superclass.
|
|
|
bool | afterCallingHandler (bool executeDelayedOperations=true) |
| Helper for subclass, after invoking an application-defined handler.
|
|
void | beforeCallingHandler (PID pid=PID_NULL) |
| Helper for subclass, before invoking an application-defined handler.
|
|
virtual void | immediateReset () override |
| Reset the demux immediately.
|
|
virtual void | immediateResetPID (PID pid) override |
| Reset the demuxing context for one single PID immediately.
|
|
|
DuckContext & | _duck |
| The TSDuck execution context is accessible to all subclasses.
|
|
PacketCounter | _packet_count = 0 |
| Number of TS packets in the demultiplexed stream.
|
|
PIDSet | _pid_filter {} |
| Current set of filtered PID's.
|
|
A SectionDemux which extracts MPEG tables without external handler.
◆ StandaloneTableDemux()
Constructor.
- Parameters
-
[in,out] | duck | TSDuck execution context. The reference is kept inside the demux. |
[in] | pid_filter | The set of PID's to demux. |
◆ tableCount()
size_t ts::StandaloneTableDemux::tableCount |
( |
| ) |
const |
|
inline |
Get the number of demuxed tables so far.
- Returns
- The number of demuxed tables so far.
◆ tableAt()
const BinaryTablePtr & ts::StandaloneTableDemux::tableAt |
( |
size_t |
index | ) |
const |
Get a pointer to a demuxed table.
- Parameters
-
[in] | index | Index of a demuxed table, from 0 to tableCount()-1. |
- Returns
- A safe pointer to the corresponding table.
◆ reset()
virtual void ts::StandaloneTableDemux::reset |
( |
| ) |
|
|
overridevirtual |
Reset the demux.
Useful when the transport stream changes. The PID filter and the handlers are not modified.
If invoked in an application-handler, the operation is delayed until the handler terminates. For subclass implementers, see beforeCallingHandler() and override immediateReset() instead of reset().
Reimplemented from ts::AbstractDemux.
◆ resetPID()
virtual void ts::StandaloneTableDemux::resetPID |
( |
PID |
pid | ) |
|
|
overridevirtual |
Reset the demuxing context for one single PID.
Forget all previous partially demuxed data on this PID.
If invoked in an application-handler, the operation is delayed until the handler terminates. For subclass implementers, see beforeCallingHandler() and override immediateResetPID() instead of resetPID().
- Parameters
-
Reimplemented from ts::AbstractDemux.
◆ feedPacket()
virtual void ts::SectionDemux::feedPacket |
( |
const TSPacket & |
pkt | ) |
|
|
overridevirtualinherited |
The following method feeds the demux with a TS packet.
- Parameters
-
Reimplemented from ts::AbstractDemux.
◆ packAndFlushSections()
void ts::SectionDemux::packAndFlushSections |
( |
| ) |
|
|
inlineinherited |
Pack sections in all incomplete tables and notify these rebuilt tables.
All incomplete tables which have not yet been notified are packed. This means that missing sections are ignored and the tables are built from existing sections only, as if they were contiguous. Then, the table handler is invoked for each table.
This may create inconsistent tables since sections are missing. But this may me useful at the end of a table collecting sessions to grab incomplete tables.
- See also
- BinaryTable::packSections()
◆ fillAndFlushEITs()
void ts::SectionDemux::fillAndFlushEITs |
( |
| ) |
|
|
inlineinherited |
Add missing sections in all incomplete EIT's and notify these rebuilt tables.
All DVB Event Information Tables (EIT) which have not yet been notified are completed. Missing sections are added with sections without events. Then, the table handler is invoked for each table.
This is typically useful at the end of processing when segmented EIT's are collected but no empty section was collected at end of segments.
◆ setTableHandler()
Replace the table handler.
- Parameters
-
◆ setSectionHandler()
Replace the section handler.
- Parameters
-
◆ setInvalidSectionHandler()
Replace the invalid section handler.
This object is invoked each time an invalid section is extracted from the stream, maybe due to invalid section length, invalid CRC32, etc. This type of data block is not a valid section and is never used in the standard table or section handler.
- Parameters
-
◆ setCurrentNext()
void ts::SectionDemux::setCurrentNext |
( |
bool |
current, |
|
|
bool |
next |
|
) |
| |
|
inlineinherited |
Filter sections based on current/next indicator.
- Parameters
-
[in] | current | Get "current" tables. This is true by default. |
[in] | next | Get "next" tables. This is false by default. |
◆ trackInvalidSectionVersions()
void ts::SectionDemux::trackInvalidSectionVersions |
( |
bool |
on | ) |
|
|
inlineinherited |
Track / untrack invalid section version numbers.
By default, if a section version does not change, the section is ignored. When this tracking is enabled, the content of the sections are tracked and a table is demuxed when a section version does not change but the content changes. This is considered as an error according to MPEG rules.
- Parameters
-
[in] | on | Track invalid section versions. This is false by default. |
◆ setTransportErrorLogLevel()
void ts::SectionDemux::setTransportErrorLogLevel |
( |
int |
level | ) |
|
|
inlineinherited |
Set the log level for messages reporting transport stream errors in demux.
By default, the log level is Severity::Debug.
- Parameters
-
[in] | level | The new log level for messages reporting transport stream errors. |
◆ getStatus()
void ts::SectionDemux::getStatus |
( |
Status & |
status | ) |
const |
|
inlineinherited |
Get the current status of the demux.
- Parameters
-
[out] | status | The returned status. |
◆ hasErrors()
bool ts::SectionDemux::hasErrors |
( |
| ) |
const |
|
inlineinherited |
Check if the demux has errors.
- Returns
- True if any error counter is not zero.
◆ immediateReset()
virtual void ts::SectionDemux::immediateReset |
( |
| ) |
|
|
overrideprotectedvirtualinherited |
◆ immediateResetPID()
virtual void ts::SectionDemux::immediateResetPID |
( |
PID |
pid | ) |
|
|
overrideprotectedvirtualinherited |
Reset the demuxing context for one single PID immediately.
- Parameters
-
Reimplemented from ts::AbstractDemux.
◆ setPIDFilter()
virtual void ts::AbstractDemux::setPIDFilter |
( |
const PIDSet & |
pid_filter | ) |
|
|
virtualinherited |
Replace the list of PID's to filter.
The method resetPID() is invoked on each removed PID.
- Parameters
-
[in] | pid_filter | The list of PID's to filter. |
◆ addPID()
virtual void ts::AbstractDemux::addPID |
( |
PID |
pid | ) |
|
|
virtualinherited |
Add one PID to filter.
- Parameters
-
[in] | pid | The new PID to filter. |
Reimplemented in ts::MPEDemux.
◆ addPIDs()
virtual void ts::AbstractDemux::addPIDs |
( |
const PIDSet & |
pids | ) |
|
|
virtualinherited |
Add several PID's to filter.
- Parameters
-
[in] | pids | The list of new PID's to filter. |
Reimplemented in ts::MPEDemux.
◆ removePID()
virtual void ts::AbstractDemux::removePID |
( |
PID |
pid | ) |
|
|
virtualinherited |
Remove one PID to filter.
The method resetPID() is invoked on pid.
- Parameters
-
[in] | pid | The PID to no longer filter. |
Reimplemented in ts::MPEDemux.
◆ pidCount()
virtual size_t ts::AbstractDemux::pidCount |
( |
| ) |
const |
|
virtualinherited |
Get the current number of PID's being filtered.
- Returns
- The current number of PID's being filtered.
◆ hasPID()
virtual bool ts::AbstractDemux::hasPID |
( |
PID |
pid | ) |
const |
|
virtualinherited |
Check if a PID is filtered.
- Parameters
-
- Returns
- Tue if pid is filtered.
◆ setDemuxId()
void ts::AbstractDemux::setDemuxId |
( |
int |
id | ) |
|
|
inlineinherited |
Set some arbitrary "demux id" value.
This value is chosen and set by the application. It can be retrieved later if a table or section handler is used by several demux. The demux id is not interpreted by the demux, it is only stored for the application. The initial value of a demux id is zero.
- Parameters
-
[in] | id | Application-defined demux id to assign. |
◆ demuxId()
int ts::AbstractDemux::demuxId |
( |
| ) |
const |
|
inlineinherited |
Get the "demux id" value, as previously stored by the application.
- Returns
- The application-defined demux id.
◆ beforeCallingHandler()
void ts::AbstractDemux::beforeCallingHandler |
( |
PID |
pid = PID_NULL | ) |
|
|
protectedinherited |
Helper for subclass, before invoking an application-defined handler.
The idea is to protect the integrity of the demux during the execution of an application-defined handler. The handler is invoked in the middle of an operation but the handler may call reset() or resetPID(). Executing the reset in the middle of an operation may be problematic. By using beforeCallingHandler() and afterCallingHandler(), all reset operations in between are delayed after the execution of the handler.
Example:
try {
_handler->handleEvent(*this, pid, ...);
}
catch (...) {
throw;
}
bool afterCallingHandler(bool executeDelayedOperations=true)
Helper for subclass, after invoking an application-defined handler.
void beforeCallingHandler(PID pid=PID_NULL)
Helper for subclass, before invoking an application-defined handler.
- Parameters
-
[in] | pid | The PID for which the handler will be called. All reset operations on this PID will be delayed until afterCallingHandler(). |
◆ afterCallingHandler()
bool ts::AbstractDemux::afterCallingHandler |
( |
bool |
executeDelayedOperations = true | ) |
|
|
protectedinherited |
Helper for subclass, after invoking an application-defined handler.
- Parameters
-
[in] | executeDelayedOperations | When true (the default), execute all pending reset operations. |
- Returns
- True if a delayed reset was executed.
- See also
- beforeCallingHandler()
The documentation for this class was generated from the following file: