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


Public Types | |
| using | SuperClass = PESDemux |
Public Member Functions | |
| TeletextDemux (DuckContext &duck, TeletextHandlerInterface *handler=nullptr, const PIDSet &pids=NoPID()) | |
| virtual | ~TeletextDemux () override |
| virtual void | addPID (PID pid) |
| virtual void | addPIDs (const PIDSet &pids) |
| bool | allAC3 (PID pid) const |
| int | demuxId () const |
| DuckContext & | duck () |
| virtual void | feedPacket (const TSPacket &pkt) override |
| void | flushTeletext () |
| void | flushUnboundedPES () |
| void | flushUnboundedPES (PID pid) |
| int | frameCount (int page, PID pid=PID_NULL) const |
| void | getAC3Attributes (PID pid, AC3Attributes &attr) const |
| bool | getAddColors () const |
| void | getAudioAttributes (PID pid, MPEG2AudioAttributes &attr) const |
| void | getAVCAttributes (PID pid, AVCAttributes &attr) const |
| CodecType | getDefaultCodec (PID pid) const |
| void | getHEVCAttributes (PID pid, HEVCAttributes &attr) const |
| size_t | getMaxUnboundedSize () const |
| void | getVideoAttributes (PID pid, MPEG2VideoAttributes &attr) const |
| virtual bool | isFilteredPID (PID pid) const |
| virtual size_t | pidCount () const |
| cn::milliseconds | pidDuration (PID pid) const |
| PacketCounter | processedPackets () const |
| virtual void | removePID (PID pid) |
| Report & | report () |
| virtual void | reset () |
| virtual void | resetPID (PID pid) |
| void | setAddColors (bool addColors) |
| void | setDefaultCodec (CodecType codec) |
| void | setDefaultCodec (PID pid, CodecType codec) |
| void | setDemuxId (int id) |
| void | setMaxUnboundedSize (size_t size) |
| void | setPESHandler (PESHandlerInterface *h) |
| virtual void | setPIDFilter (const PIDSet &pid_filter) |
| void | setTeletextHandler (TeletextHandlerInterface *handler) |
| PacketCounter | totalPackets () const |
Static Public Attributes | |
| static constexpr size_t | DEFAULT_MAX_UNBOUNDED_PES_SIZE = 512 * 1024 |
Protected Member Functions | |
| bool | afterCallingHandler (bool execute_delayed_operations=true) |
| void | beforeCallingHandler (PID pid=PID_NULL) |
| virtual void | handlePESPacket (const PESPacket &packet) override |
| virtual void | immediateReset () override |
| virtual void | immediateResetPID (PID pid) override |
This class extracts Teletext subtitles from TS packets.
Explicit reference to superclass.
|
explicit |
Constructor
| [in,out] | duck | TSDuck execution context. The reference is kept inside the demux. |
| [in] | handler | User handler for Teletext notification. |
| [in] | pids | The set of PID's to demux. |
|
overridevirtual |
Destructor.
|
inline |
Activate or deactivate the font color tags in the output text.
| [in] | addColors | If true, font colors tags will be inserted in the output text. |
|
inline |
Check if font colors tags are inserted in the output text.
| void ts::TeletextDemux::flushTeletext | ( | ) |
Flush any pending Teletext message. Useful only after receiving the last packet in the stream. Implicitly called by destructor.
|
inline |
Replace the Teletext handler.
| [in] | handler | The Teletext handler. |
|
overrideprotectedvirtual |
Reset the demux immediately.
Reimplemented from ts::PESDemux.
|
overrideprotectedvirtual |
Reset the demuxing context for one single PID immediately.
| [in] | pid | The PID to reset. |
Reimplemented from ts::PESDemux.
|
overrideprotectedvirtual |
This hook is invoked when a complete PES packet is available. Can be overloaded by subclasses to add intermediate processing.
| [in] | packet | The PES packet. |
Reimplemented from ts::PESDemux.
|
overridevirtualinherited |
The following method feeds the demux with a TS packet.
| [in] | pkt | A TS packet. |
Reimplemented from ts::TimeTrackerDemux.
|
inherited |
Flush any unterminated unbounded PES packet on the specified PID. Unbounded PES packets have no predetermined size. They implicitely end when the next PES packet starts on the same PID. However, at end of stream, there is no next PES packet and the previous buffered data are not considered as a full unbounded packet. These data are lost. This method shall be called at end of stream when the caller is certain that the buffered data from the PID form a complete PES packet. This PES packet is then processed.
| [in] | pid | PID containing an unbounded PES packet to complete. |
|
inherited |
Flush any unterminated unbounded PES packet on all PID's.
|
inlineinherited |
Replace the PES packet handler.
| [in] | h | The object to invoke when PES packets are analyzed. |
|
inlineinherited |
Set the maximum size for unbounded PES packets. Unbounded PES packets have no predetermined size. They implicitely end when the next PES packet starts on the same PID. The demux accumulates the PES content for them on each PID as long as no new PES packet starts. To avoid saturating the memory of the demux, we limit the size of unbounded PES packets. If an unbounded PES packet exceeds the specified maximum size, the binary content which was accumulated so far for that PES packet is passed to the handler's handleInvalidPESPacket() and the PES packet is dropped. Accumulating PES data on that PID will restart at the beginning of the next PES packet.
| [in] | size | The maximum size for unbounded PES packets to use. |
|
inlineinherited |
Get the maximum size for unbounded PES packets.
|
inlineinherited |
Set the default audio or video codec for all analyzed PES PID's. The analysis of the content of a PES packet sometimes depends on the PES data format. The PES demux uses several ways to determine the data format inside a PES packet. First, when the packet is identified in a PMT, the stream type may uniquely identify the format. Second, the content itself can be identified as a specific format. Finally, in the absence of other indications, the specified codec is used.
| [in] | codec | The default codec to use. |
Set the default audio or video codec for one specific PES PID's. This is the same as setDefaultCodec(CodecType) for one specific PID. The codec of a PID is automatically determined from the characteristics of this PID in the PMT, if the PMT packets are passed to this demux.
| [in] | pid | The PID to identify. |
| [in] | codec | The default codec to use. |
Get the default codec type on a given PID.
| [in] | pid | The PID to check. |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
Check if all PES packets on the specified PID contain AC-3 audio.
| [in] | pid | The PID to check. |
|
inherited |
|
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. |
|
staticconstexprinherited |
Default maximum size for unbounded PES packets.