TSDuck v3.40-4033
MPEG Transport Stream Toolkit
Loading...
Searching...
No Matches
ts::AbstractPacketizer Class Referenceabstract

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

#include <tsAbstractPacketizer.h>

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.
 
const DuckContextduck () const
 Get a reference to the TSDuck execution context.
 
virtual bool getNextPacket (TSPacket &packet)=0
 Build the next MPEG packet for the list of items (sections or PES) to pacjetize.
 
PID getPID () const
 Get the default PID for subsequent MPEG packets.
 
uint8_t nextContinuityCounter () const
 Get the continuity counter value for next MPEG packet.
 
PacketCounter packetCount () const
 Get the number of generated TS packets so far.
 
Reportreport () const
 Get a reference to the debugging report.
 
virtual void reset ()
 Reset the packetizer.
 
void setNextContinuityCounter (uint8_t cc)
 Set the continuity counter value for next MPEG packet.
 
void setPID (PID pid)
 Set the default PID for subsequent MPEG packets.
 

Protected Member Functions

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

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::Packetizer, and ts::PESPacketizer.

◆ 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::CyclingPacketizer, ts::Packetizer, ts::PESPacketizer, and ts::PESStreamPacketizer.

◆ 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::CyclingPacketizer, ts::Packetizer, ts::PESPacketizer, and ts::PESStreamPacketizer.

◆ 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: