TSDuck v3.38-3675
MPEG Transport Stream Toolkit
Loading...
Searching...
No Matches
ts::PCRRegulator Class Reference

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

#include <tsPCRRegulator.h>

Public Member Functions

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

Static Public Attributes

static constexpr cn::milliseconds DEFAULT_MIN_WAIT = cn::milliseconds(50)
 Default minimum wait interval.
 

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()

template<class Rep , class Period >
void ts::PCRRegulator::setMinimimWait ( const cn::duration< Rep, Period > &  d)

Set the minimum wait interval.

Parameters
[in]dMinimum duration interval.

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