TSDuck v3.46-4930
MPEG Transport Stream Toolkit
Loading...
Searching...
No Matches

#include <tsMPEDemux.h>

Inheritance diagram for ts::MPEDemux:
Collaboration diagram for ts::MPEDemux:

Public Types

using SuperClass = AbstractDemux

Public Member Functions

 MPEDemux (DuckContext &duck, MPEHandlerInterface *mpe_handler=nullptr, const PIDSet &pid_filter=NoPID())
virtual ~MPEDemux () override
virtual void addPID (PID pid) override
virtual void addPIDs (const PIDSet &pids) override
int demuxId () const
DuckContext & duck ()
virtual void feedPacket (const TSPacket &pkt) override
virtual bool isFilteredPID (PID pid) const
virtual size_t pidCount () const
PacketCounter processedPackets () const
virtual void removePID (PID pid) override
Report & report ()
virtual void reset ()
virtual void resetPID (PID pid)
void setDemuxId (int id)
void setHandler (MPEHandlerInterface *h)
virtual void setPIDFilter (const PIDSet &pid_filter)
PacketCounter totalPackets () const

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)

Detailed Description

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.

Member Typedef Documentation

◆ SuperClass

Explicit reference to superclass.

Constructor & Destructor Documentation

◆ MPEDemux()

ts::MPEDemux::MPEDemux ( DuckContext & duck,
MPEHandlerInterface * mpe_handler = nullptr,
const PIDSet & pid_filter = NoPID() )
explicit

Constructor.

Parameters
[in,out]duckTSDuck execution context. The reference is kept inside the demux.
[in]mpe_handlerThe object to invoke when MPE information is found.
[in]pid_filterThe set of MPE PID's to demux.

◆ ~MPEDemux()

virtual ts::MPEDemux::~MPEDemux ( )
overridevirtual

Destructor.

Member Function Documentation

◆ feedPacket()

virtual void ts::MPEDemux::feedPacket ( const TSPacket & pkt)
overridevirtual

The following method feeds the demux with a TS packet.

Parameters
[in]pktA TS packet.

Reimplemented from ts::AbstractDemux.

◆ addPID()

virtual void ts::MPEDemux::addPID ( PID pid)
overridevirtual

Add one PID to filter.

Parameters
[in]pidThe new PID to filter.

Reimplemented from ts::AbstractDemux.

◆ addPIDs()

virtual void ts::MPEDemux::addPIDs ( const PIDSet & pids)
overridevirtual

Add several PID's to filter.

Parameters
[in]pidsThe list of new PID's to filter.

Reimplemented from ts::AbstractDemux.

◆ removePID()

virtual void ts::MPEDemux::removePID ( PID pid)
overridevirtual

Remove one PID to filter. The method resetPID() is invoked on pid.

Parameters
[in]pidThe PID to no longer filter.

Reimplemented from ts::AbstractDemux.

◆ setHandler()

void ts::MPEDemux::setHandler ( MPEHandlerInterface * h)
inline

Replace the MPE handler.

Parameters
[in]hThe new handler.

◆ immediateReset()

virtual void ts::MPEDemux::immediateReset ( )
overrideprotectedvirtual

Reset the demux immediately.

Reimplemented from ts::AbstractDemux.

◆ report()

Report & ts::AbstractDemux::report ( )
inlineinherited

Get the associated Report.

Returns
A reference to the associated Report.

◆ duck()

DuckContext & ts::AbstractDemux::duck ( )
inlineinherited

Get the associated TSDuck execution context.

Returns
A reference to the associated DuckContext.

◆ 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_filterThe list of PID's to filter.

◆ pidCount()

virtual size_t ts::AbstractDemux::pidCount ( ) const
inlinevirtualinherited

Get the current number of PID's being filtered.

Returns
The current number of PID's being filtered.

◆ totalPackets()

PacketCounter ts::AbstractDemux::totalPackets ( ) const
inlineinherited

Get the current total number of TS packets which were processed by the demux.

Returns
The current number of TS packets which were processed by the demux.

◆ processedPackets()

PacketCounter ts::AbstractDemux::processedPackets ( ) const
inlineinherited

Get the number of processed TS packets in filtered PIDs.

Returns
The number of processed TS packets.

◆ isFilteredPID()

virtual bool ts::AbstractDemux::isFilteredPID ( PID pid) const
inlinevirtualinherited

Check if a PID is filtered.

Parameters
[in]pidThe PID to test.
Returns
Tue if pid is filtered.

◆ reset()

virtual void ts::AbstractDemux::reset ( )
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.

◆ resetPID()

virtual void ts::AbstractDemux::resetPID ( PID pid)
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().

Parameters
[in]pidThe PID to reset.

Reimplemented in ts::StandaloneTableDemux.

◆ 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]idApplication-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 execute_delayed_operations=true)
void beforeCallingHandler(PID pid=PID_NULL)
Parameters
[in]pidThe 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 execute_delayed_operations = true)
protectedinherited

Helper for subclass, after invoking an application-defined handler.

Parameters
[in]execute_delayed_operationsWhen true (the default), execute all pending reset operations.
Returns
True if a delayed reset was executed.
See also
beforeCallingHandler()

◆ immediateResetPID()

virtual void ts::AbstractDemux::immediateResetPID ( PID pid)
protectedvirtualinherited

Reset the demuxing context for one single PID immediately.

Parameters
[in]pidThe PID to reset.

Reimplemented in ts::ContinuityAnalyzer, ts::PESDemux, ts::SectionDemux, ts::T2MIDemux, ts::TeletextDemux, and ts::TimeTrackerDemux.


The documentation for this class was generated from the following file: