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

Regulate execution speed based on a bitrate. More...

Public Member Functions

 BitRateRegulator (Report *report=nullptr, int log_level=Severity::Verbose)
 Constructor. More...
 
void regulate (BitRate current_bitrate, bool &flush, bool &bitrate_changed)
 Regulate the flow, to be called at each packet. More...
 
void regulate ()
 Regulate the flow, to be called at each packet. More...
 
void setBurstPacketCount (PacketCounter count)
 Set the number of packets to burst at a time. More...
 
void setFixedBitRate (BitRate bitrate)
 Set a fixed bitrate for regulation, ignore current bitrate. More...
 
void setReport (Report *report=nullptr, int log_level=Severity::Verbose)
 Set a new report. More...
 
void start ()
 Start regulation, initialize all timers.
 

Detailed Description

Regulate execution speed based on a bitrate.

See also
PCRRegulator

Constructor & Destructor Documentation

◆ BitRateRegulator()

ts::BitRateRegulator::BitRateRegulator ( 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::BitRateRegulator::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::BitRateRegulator::setBurstPacketCount ( PacketCounter  count)
inline

Set the number of packets to burst at a time.

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

◆ setFixedBitRate()

void ts::BitRateRegulator::setFixedBitRate ( BitRate  bitrate)
inline

Set a fixed bitrate for regulation, ignore current bitrate.

Parameters
[in]bitrateFixed bitrate to use. When zero, use current bitrate.

◆ regulate() [1/2]

void ts::BitRateRegulator::regulate ( BitRate  current_bitrate,
bool &  flush,
bool &  bitrate_changed 
)

Regulate the flow, to be called at each packet.

Suspend the process when necessary.

Parameters
[in]current_bitrateCurrent bitrate. Ignored if a fixed bitrate was set.
[out]flushSet to true if all previously processed and buffered packets should be flushed.
[out]bitrate_changedSet to true if the bitrate has changed.

◆ regulate() [2/2]

void ts::BitRateRegulator::regulate ( )

Regulate the flow, to be called at each packet.

Suspend the process when necessary. This version is suitable for fixed bitrate.


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