TSDuck Version 3.24-2000 (TSDuck - The MPEG Transport Stream Toolkit)
ts::PCRRegulator Class Reference

Regulate execution speed based on PCR's in one reference PID. More...

Public Member Functions

 PCRRegulator (Report *report=nullptr, int log_level=Severity::Verbose)
 Constructor. More...
 
PID getReferencePID () const
 Get the current PCR reference PID. More...
 
bool regulate (const TSPacket &pkt)
 Regulate the flow, to be called at each packet. More...
 
void reset ()
 Re-initialize state.
 
void setBurstPacketCount (PacketCounter count)
 Set the number of packets to burst at a time. More...
 
void setMinimimWait (NanoSecond ns=DEFAULT_MIN_WAIT_NS)
 Set the minimum wait interval. More...
 
void setReferencePID (PID pid)
 Set the PCR reference PID. More...
 
void setReport (Report *report=nullptr, int log_level=Severity::Verbose)
 Set a new report. More...
 

Static Public Attributes

static const NanoSecond DEFAULT_MIN_WAIT_NS = 50 * NanoSecPerMilliSec
 Default minimum wait interval in nano-seconds.
 

Detailed Description

Regulate execution speed based on PCR's in one reference PID.

See also
BitRateRegulator

Constructor & Destructor Documentation

◆ PCRRegulator()

ts::PCRRegulator::PCRRegulator ( Report report = nullptr,
int  log_level = Severity::Verbose 
)

Constructor.

Parameters
[in,out]reportWhere to report errors.
[in]log_levelSeverity level for information messages.

Member Function Documentation

◆ setReport()

void ts::PCRRegulator::setReport ( Report report = nullptr,
int  log_level = Severity::Verbose 
)

Set a new report.

Parameters
[in,out]reportWhere to report errors.
[in]log_levelSeverity level for information messages.

◆ setBurstPacketCount()

void ts::PCRRegulator::setBurstPacketCount ( PacketCounter  count)
inline

Set the number of packets to burst at a time.

Parameters
[in]countNumber of packets to burst at a time.

◆ setReferencePID()

void ts::PCRRegulator::setReferencePID ( PID  pid)

Set the PCR reference PID.

Parameters
[in]pidReference PID. If PID_NULL, use the first PID containing PCR's.

◆ getReferencePID()

PID ts::PCRRegulator::getReferencePID ( ) const
inline

Get the current PCR reference PID.

Returns
Current reference PID or PID_NULL if none was set or found.

◆ setMinimimWait()

void ts::PCRRegulator::setMinimimWait ( NanoSecond  ns = DEFAULT_MIN_WAIT_NS)

Set the minimum wait interval.

Parameters
[in]nsMinimum duration interval in nano-seconds.

◆ regulate()

bool ts::PCRRegulator::regulate ( const TSPacket pkt)

Regulate the flow, to be called at each packet.

Suspend the process when necessary.

Parameters
[in]pktTS packet from the stream.
Returns
True if all previously processed and buffered packets should be flushed.

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