![]() |
TSDuck v3.46-4930
MPEG Transport Stream Toolkit
|
#include <tsSectionDemux.h>


Classes | |
| struct | Status |
Public Types | |
| using | SuperClass = AbstractDemux |
Public Member Functions | |
| SectionDemux (DuckContext &duck, TableHandlerInterface *table_handler=nullptr, SectionHandlerInterface *section_handler=nullptr, const PIDSet &pid_filter=NoPID()) | |
| virtual void | addPID (PID pid) |
| virtual void | addPIDs (const PIDSet &pids) |
| int | demuxId () const |
| DuckContext & | duck () |
| virtual void | feedPacket (const TSPacket &pkt) override |
| void | fillAndFlushEITs () |
| void | getStatus (Status &status) const |
| bool | hasErrors () const |
| virtual bool | isFilteredPID (PID pid) const |
| void | packAndFlushSections () |
| virtual size_t | pidCount () const |
| PacketCounter | processedPackets () const |
| virtual void | removePID (PID pid) |
| Report & | report () |
| virtual void | reset () |
| virtual void | resetPID (PID pid) |
| void | setCurrentNext (bool current, bool next) |
| void | setDemuxId (int id) |
| void | setInvalidSectionHandler (InvalidSectionHandlerInterface *h) |
| virtual void | setPIDFilter (const PIDSet &pid_filter) |
| void | setSectionHandler (SectionHandlerInterface *h) |
| void | setTableHandler (TableHandlerInterface *h) |
| void | setTransportErrorLogLevel (int level) |
| PacketCounter | totalPackets () const |
| void | trackInvalidSectionVersions (bool on) |
Protected Member Functions | |
| bool | afterCallingHandler (bool execute_delayed_operations=true) |
| void | beforeCallingHandler (PID pid=PID_NULL) |
| virtual void | immediateReset () override |
| virtual void | immediateResetPID (PID pid) override |
This class rebuilds MPEG tables and sections from TS packets.
Long sections are validated with CRC. Corrupted sections are not reported.
Sections with the next indicator are ignored. Only sections with the current indicator are reported.
Explicit reference to superclass.
|
explicit |
Constructor.
| [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] | table_handler | The object to invoke when a new complete table is extracted. |
| [in] | section_handler | The object to invoke when any valid section is extracted. |
| [in] | pid_filter | The set of PID's to demux. |
|
overridevirtual |
The following method feeds the demux with a TS packet.
| [in] | pkt | A TS packet. |
Reimplemented from ts::AbstractDemux.
|
inline |
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.
|
inline |
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.
|
inline |
Replace the table handler.
| [in] | h | The new handler. |
|
inline |
Replace the section handler.
| [in] | h | The new handler. |
|
inline |
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.
| [in] | h | The new handler. |
|
inline |
Filter sections based on current/next indicator.
| [in] | current | Get "current" tables. This is true by default. |
| [in] | next | Get "next" tables. This is false by default. |
|
inline |
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.
| [in] | on | Track invalid section versions. This is false by default. |
|
inline |
Set the log level for messages reporting transport stream errors in demux. By default, the log level is Severity::Debug.
| [in] | level | The new log level for messages reporting transport stream errors. |
|
inline |
Get the current status of the demux.
| [out] | status | The returned status. |
|
inline |
Check if the demux has errors.
|
overrideprotectedvirtual |
Reset the demux immediately.
Reimplemented from ts::AbstractDemux.
|
overrideprotectedvirtual |
Reset the demuxing context for one single PID immediately.
| [in] | pid | The PID to reset. |
Reimplemented from ts::AbstractDemux.
|
inlineinherited |
|
inlineinherited |
Get the associated TSDuck execution context.
|
virtualinherited |
Replace the list of PID's to filter. The method resetPID() is invoked on each removed PID.
| [in] | pid_filter | The list of PID's to filter. |
|
inlinevirtualinherited |
|
inlinevirtualinherited |
Add several PID's to filter.
| [in] | pids | The list of new PID's to filter. |
Reimplemented in ts::MPEDemux.
|
virtualinherited |
Remove one PID to filter. The method resetPID() is invoked on pid.
| [in] | pid | The PID to no longer filter. |
Reimplemented in ts::MPEDemux.
|
inlinevirtualinherited |
|
inlineinherited |
Get the current total number of TS packets which were processed by the demux.
|
inlineinherited |
Get the number of processed TS packets in filtered PIDs.
|
inlinevirtualinherited |
|
virtualinherited |
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 in ts::StandaloneTableDemux.
|
virtualinherited |
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().
| [in] | pid | The PID to reset. |
Reimplemented in ts::StandaloneTableDemux.
|
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.
| [in] | id | Application-defined demux id to assign. |
|
inlineinherited |
Get the "demux id" value, as previously stored by the application.
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:
| [in] | pid | The PID for which the handler will be called. All reset operations on this PID will be delayed until afterCallingHandler(). |
|
protectedinherited |
Helper for subclass, after invoking an application-defined handler.
| [in] | execute_delayed_operations | When true (the default), execute all pending reset operations. |