TSDuck Version 3.32-2769 (TSDuck - The MPEG Transport Stream Toolkit)
ts::AbstractPacketizer Class Referenceabstract

Abstract superclass for packetizer classes (sections or PES packets). More...

Inheritance diagram for ts::AbstractPacketizer:

Public Member Functions

virtual std::ostream & display (std::ostream &strm) const
 Display the internal state of the packetizer, mainly for debug. More...
 
const DuckContextduck () const
 Get a reference to the TSDuck execution context. More...
 
virtual bool getNextPacket (TSPacket &packet)=0
 Build the next MPEG packet for the list of items (sections or PES) to pacjetize. More...
 
PID getPID () const
 Get the default PID for subsequent MPEG packets. More...
 
uint8_t nextContinuityCounter () const
 Get the continuity counter value for next MPEG packet. More...
 
PacketCounter packetCount () const
 Get the number of generated TS packets so far. More...
 
Reportreport () const
 Get a reference to the debugging report. More...
 
virtual void reset ()
 Reset the packetizer. More...
 
void setNextContinuityCounter (uint8_t cc)
 Set the continuity counter value for next MPEG packet. More...
 
void setPID (PID pid)
 Set the default PID for subsequent MPEG packets. More...
 

Protected Member Functions

 AbstractPacketizer (const DuckContext &duck, PID pid=PID_NULL)
 Constructor. More...
 
virtual ~AbstractPacketizer ()
 Destructor.
 
void configurePacket (TSPacket &pkt, bool nullify)
 Configure a TS packet with continuity and PID. More...
 

Detailed Description

Abstract superclass for packetizer classes (sections or PES packets).

Constructor & Destructor Documentation

◆ AbstractPacketizer()

ts::AbstractPacketizer::AbstractPacketizer ( const DuckContext duck,
PID  pid = PID_NULL 
)
protected

Constructor.

Parameters
[in]duckTSDuck execution context. The reference is kept inside the packetizer.
[in]pidPID for generated TS packets.

Member Function Documentation

◆ setPID()

void ts::AbstractPacketizer::setPID ( PID  pid)
inline

Set the default PID for subsequent MPEG packets.

Parameters
[in]pidPID for generated TS packets.

◆ getPID()

PID ts::AbstractPacketizer::getPID ( ) const
inline

Get the default PID for subsequent MPEG packets.

Returns
PID for generated TS packets.

◆ setNextContinuityCounter()

void ts::AbstractPacketizer::setNextContinuityCounter ( uint8_t  cc)
inline

Set the continuity counter value for next MPEG packet.

This counter is automatically incremented at each packet. It is usually never a good idea to change this, except maybe before generating the first packet if the continuity must be preserved with the previous content of the PID.

Parameters
[in]ccNext continuity counter.

◆ nextContinuityCounter()

uint8_t ts::AbstractPacketizer::nextContinuityCounter ( ) const
inline

Get the continuity counter value for next MPEG packet.

Returns
Next continuity counter.

◆ getNextPacket()

virtual bool ts::AbstractPacketizer::getNextPacket ( TSPacket packet)
pure virtual

Build the next MPEG packet for the list of items (sections or PES) to pacjetize.

If there is nothing to packetize, generate a null packet on PID_NULL.

Parameters
[out]packetThe next TS packet.
Returns
True if a real packet is returned, false if a null packet was returned.

Implemented in ts::PESPacketizer, and ts::Packetizer.

◆ packetCount()

PacketCounter ts::AbstractPacketizer::packetCount ( ) const
inline

Get the number of generated TS packets so far.

Returns
The number of generated TS packets so far.

◆ reset()

virtual void ts::AbstractPacketizer::reset ( )
virtual

Reset the packetizer.

All unfinished items (sections or PES packets) are dropped.

Reimplemented in ts::PESStreamPacketizer, ts::PESPacketizer, ts::Packetizer, and ts::CyclingPacketizer.

◆ report()

Report& ts::AbstractPacketizer::report ( ) const
inline

Get a reference to the debugging report.

Returns
A reference to the debugging report.

◆ duck()

const DuckContext& ts::AbstractPacketizer::duck ( ) const
inline

Get a reference to the TSDuck execution context.

Returns
A reference to the TSDuck execution context.

◆ display()

virtual std::ostream& ts::AbstractPacketizer::display ( std::ostream &  strm) const
virtual

Display the internal state of the packetizer, mainly for debug.

Parameters
[in,out]strmOutput text stream.
Returns
A reference to strm.

Reimplemented in ts::PESStreamPacketizer, ts::PESPacketizer, ts::Packetizer, and ts::CyclingPacketizer.

◆ configurePacket()

void ts::AbstractPacketizer::configurePacket ( TSPacket pkt,
bool  nullify 
)
protected

Configure a TS packet with continuity and PID.

Also increment the number of generated packet. So this method must be called exactly once per packet.

Parameters
[in,out]pktTS packet to configure
[in]nullifyReturn a null packet instead (no data to return for now).

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