TSDuck v3.46-4930
MPEG Transport Stream Toolkit
Loading...
Searching...
No Matches

#include <tsPCRAnalyzer.h>

Classes

struct  Status

Public Member Functions

 PCRAnalyzer (size_t min_pid=1, size_t min_pcr=64)
BitRate bitrate188 () const
BitRate bitrate188 (PID pid) const
BitRate bitrate204 () const
BitRate bitrate204 (PID pid) const
bool bitrateIsValid () const
PCR duration () const
PCR duration (PID pid) const
bool feedPacket (const TSPacket &pkt)
void getStatus (Status &status) const
BitRate instantaneousBitrate188 () const
BitRate instantaneousBitrate204 () const
PacketCounter packetCount (PID pid) const
void reset ()
void reset (size_t min_pid, size_t min_pcr)
void resetAndUseDTS ()
void resetAndUseDTS (size_t min_pid, size_t min_dts)
void setIgnoreErrors (bool ignore)

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() [1/2]

void ts::PCRAnalyzer::reset ( )

Reset all collected information.

◆ reset() [2/2]

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.

◆ instantaneousBitrate188()

BitRate ts::PCRAnalyzer::instantaneousBitrate188 ( ) const
inline

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

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

◆ instantaneousBitrate204()

BitRate ts::PCRAnalyzer::instantaneousBitrate204 ( ) const
inline

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

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

◆ duration() [1/2]

PCR ts::PCRAnalyzer::duration ( ) const
inline

Get the estimated playout duration in PCR units.

Returns
The estimated playout duration in PCR units.

◆ duration() [2/2]

PCR ts::PCRAnalyzer::duration ( PID pid) const

Get the estimated playout duration in PCR units, based on the clock of a given PID.

Parameters
[in]pidThe PID to evaluate.
Returns
The estimated playout duration in PCR units.

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