TSDuck v3.40-4033
MPEG Transport Stream Toolkit
|
This class extracts MPE (Multi-Protocol Encapsulation) datagrams from TS packets. More...
#include <tsMPEDemux.h>
Public Types | |
using | SuperClass = AbstractDemux |
Explicit reference to superclass. | |
Public Member Functions | |
MPEDemux (DuckContext &duck, MPEHandlerInterface *mpe_handler=nullptr, const PIDSet &pid_filter=NoPID) | |
Constructor. | |
virtual | ~MPEDemux () override |
Destructor. | |
virtual void | addPID (PID pid) override |
Add one PID to filter. | |
virtual void | addPIDs (const PIDSet &pids) override |
Add several PID's to filter. | |
int | demuxId () const |
Get the "demux id" value, as previously stored by the application. | |
virtual void | feedPacket (const TSPacket &pkt) override |
The following method feeds the demux with a TS packet. | |
virtual bool | hasPID (PID pid) const |
Check if a PID is filtered. | |
virtual size_t | pidCount () const |
Get the current number of PID's being filtered. | |
virtual void | removePID (PID pid) override |
Remove one PID to filter. | |
virtual void | reset () |
Reset the demux. | |
virtual void | resetPID (PID pid) |
Reset the demuxing context for one single PID. | |
void | setDemuxId (int id) |
Set some arbitrary "demux id" value. | |
void | setHandler (MPEHandlerInterface *h) |
Replace the MPE handler. | |
virtual void | setPIDFilter (const PIDSet &pid_filter) |
Replace the list of PID's to filter. | |
Protected Member Functions | |
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) |
Reset the demuxing context for one single PID immediately. | |
Protected Attributes | |
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. | |
This class extracts MPE (Multi-Protocol Encapsulation) datagrams from TS packets.
The signalization is analyzed. MPE components in services are signaled to a handler. The application decides which MPE PID's should be demuxed. These PID's can be selected from the beginning or in response to the discovery of MPE PID's.
|
explicit |
Constructor.
[in,out] | duck | TSDuck execution context. The reference is kept inside the demux. |
[in] | mpe_handler | The object to invoke when MPE information is found. |
[in] | pid_filter | The set of MPE PID's to demux. |
|
overridevirtual |
The following method feeds the demux with a TS packet.
[in] | pkt | A TS packet. |
Reimplemented from ts::AbstractDemux.
|
overridevirtual |
Add one PID to filter.
[in] | pid | The new PID to filter. |
Reimplemented from ts::AbstractDemux.
|
overridevirtual |
Add several PID's to filter.
[in] | pids | The list of new PID's to filter. |
Reimplemented from ts::AbstractDemux.
|
overridevirtual |
Remove one PID to filter.
The method resetPID() is invoked on pid.
[in] | pid | The PID to no longer filter. |
Reimplemented from ts::AbstractDemux.
|
inline |
Replace the MPE handler.
[in] | h | The new handler. |
|
overrideprotectedvirtual |
Reset the demux immediately.
Reimplemented from ts::AbstractDemux.
|
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. |
|
virtualinherited |
Get the current number of PID's being filtered.
|
virtualinherited |
Check if a PID is filtered.
[in] | pid | The PID to test. |
|
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] | executeDelayedOperations | When true (the default), execute all pending reset operations. |
|
protectedvirtualinherited |
Reset the demuxing context for one single PID immediately.
[in] | pid | The PID to reset. |
Reimplemented in ts::SectionDemux, ts::TimeTrackerDemux, ts::PESDemux, ts::T2MIDemux, and ts::TeletextDemux.