TSDuck Version 3.15-955 (TSDuck - The MPEG Transport Stream Toolkit)
ts::PCRAnalyzer Class Reference

PCR statistics analysis. More...

Classes

struct  Status
 Structure containing the global PCR analysis results. More...
 

Public Member Functions

 PCRAnalyzer (size_t min_pid=1, size_t min_pcr=64)
 Constructor. More...
 
 ~PCRAnalyzer ()
 Destructor.
 
BitRate bitrate188 () const
 Get the evaluated TS bitrate in bits/second based on 188-byte packets. More...
 
BitRate bitrate188 (PID pid) const
 Get the evaluated PID bitrate in bits/second based on 188-byte packets. More...
 
BitRate bitrate204 () const
 Get the evaluated TS bitrate in bits/second based on 204-byte packets. More...
 
BitRate bitrate204 (PID pid) const
 Get the evaluated PID bitrate in bits/second based on 204-byte packets. More...
 
bool bitrateIsValid () const
 Check if we have collected enough packet to evaluate TS bitrate. More...
 
bool feedPacket (const TSPacket &pkt)
 The following method feeds the analyzer with a TS packet. More...
 
void getStatus (Status &status) const
 Get the global PCR analysis results. More...
 
PacketCounter packetCount (PID pid) const
 Get the number of TS packets on a PID. More...
 
void reset ()
 Reset all collected information.
 
void reset (size_t min_pid, size_t min_pcr)
 Reset all collected information and change criteria for valid bitrate analysis. More...
 
void resetAndUseDTS ()
 Reset all collected information and use DTS instead of PCR from now on. More...
 
void resetAndUseDTS (size_t min_pid, size_t min_dts)
 Reset all collected information and use DTS instead of PCR from now on. More...
 
void setIgnoreErrors (bool ignore)
 Ignore transport stream errors such as discontinuities. More...
 

Detailed Description

PCR statistics analysis.

Constructor & Destructor Documentation

◆ PCRAnalyzer()

ts::PCRAnalyzer::PCRAnalyzer ( size_t  min_pid = 1,
size_t  min_pcr = 64 
)

Constructor.

The parameters specify the criteria for valid bitrate analysis.

Parameters
[in]min_pidMinimum number of PID's with PCR's.
[in]min_pcrMinimum number of PCR's per PID.

Member Function Documentation

◆ reset()

void ts::PCRAnalyzer::reset ( size_t  min_pid,
size_t  min_pcr 
)

Reset all collected information and change criteria for valid bitrate analysis.

Parameters
[in]min_pidMinimum number of PID's with PCR's.
[in]min_pcrMinimum number of PCR's per PID.

◆ resetAndUseDTS() [1/2]

void ts::PCRAnalyzer::resetAndUseDTS ( )

Reset all collected information and use DTS instead of PCR from now on.

Using DTS (Decoding Time Stamps, typically in video PIDs) gives less accurate results than PCR (Program Clock Reference) but can save you in the absence of PCR.

◆ resetAndUseDTS() [2/2]

void ts::PCRAnalyzer::resetAndUseDTS ( size_t  min_pid,
size_t  min_dts 
)

Reset all collected information and use DTS instead of PCR from now on.

Using DTS (Decoding Time Stamps, typically in video PIDs) gives less accurate results than PCR (Program Clock Reference) but can save you in the absence of PCR. Also change criteria for valid bitrate analysis.

Parameters
[in]min_pidMinimum number of PID's with DTS's.
[in]min_dtsMinimum number of DTS's per PID.

◆ setIgnoreErrors()

void ts::PCRAnalyzer::setIgnoreErrors ( bool  ignore)

Ignore transport stream errors such as discontinuities.

By default, TS errors are not ignored. Discontinuities and other errors suspend the analysis until the stream is resynchronized. This can be summarized as follow:

  • When errors are not ignored (the default), the bitrate of the original stream (before corruptions) is evaluated.
  • When errors are ignored, the bitrate of the received stream is evaluated, "missing" packets being considered as non-existent.
    Parameters
    [in]ignoreWhen true, ignore errors.

◆ feedPacket()

bool ts::PCRAnalyzer::feedPacket ( const TSPacket pkt)

The following method feeds the analyzer with a TS packet.

Parameters
[in]pktA new transport stream packet.
Returns
True if we have collected enough packet to evaluate TS bitrate.

◆ bitrateIsValid()

bool ts::PCRAnalyzer::bitrateIsValid ( ) const
inline

Check if we have collected enough packet to evaluate TS bitrate.

Returns
True if we have collected enough packet to evaluate TS bitrate.

◆ bitrate188() [1/2]

BitRate ts::PCRAnalyzer::bitrate188 ( ) const

Get the evaluated TS bitrate in bits/second based on 188-byte packets.

Returns
The evaluated TS bitrate in bits/second based on 188-byte packets.

◆ bitrate204() [1/2]

BitRate ts::PCRAnalyzer::bitrate204 ( ) const

Get the evaluated TS bitrate in bits/second based on 204-byte packets.

Returns
The evaluated TS bitrate in bits/second based on 204-byte packets.

◆ bitrate188() [2/2]

BitRate ts::PCRAnalyzer::bitrate188 ( PID  pid) const

Get the evaluated PID bitrate in bits/second based on 188-byte packets.

Parameters
[in]pidThe PID to evaluate.
Returns
The evaluated bitrate of pid in bits/second based on 188-byte packets.

◆ bitrate204() [2/2]

BitRate ts::PCRAnalyzer::bitrate204 ( PID  pid) const

Get the evaluated PID bitrate in bits/second based on 204-byte packets.

Parameters
[in]pidThe PID to evaluate.
Returns
The evaluated bitrate of pid in bits/second based on 204-byte packets.

◆ packetCount()

PacketCounter ts::PCRAnalyzer::packetCount ( PID  pid) const

Get the number of TS packets on a PID.

Parameters
[in]pidThe PID to evaluate.
Returns
The number of TS packets on pid.

◆ getStatus()

void ts::PCRAnalyzer::getStatus ( Status status) const

Get the global PCR analysis results.

Parameters
[out]statusThe returned PCR analysis results.

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