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

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

#include <tsBitRateRegulator.h>

Public Member Functions

 BitRateRegulator (Report *report=nullptr, int log_level=Severity::Verbose)
 Constructor.
 
void regulate ()
 Regulate the flow, to be called at each packet.
 
void regulate (const BitRate &current_bitrate, bool &flush, bool &bitrate_changed)
 Regulate the flow, to be called at each packet.
 
void setBurstPacketCount (PacketCounter count)
 Set the number of packets to burst at a time.
 
void setFixedBitRate (BitRate bitrate)
 Set a fixed bitrate for regulation, ignore current bitrate.
 
void setReport (Report *report=nullptr, int log_level=Severity::Verbose)
 Set a new report.
 
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 ( const 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: