TSDuck v3.43-4462
MPEG Transport Stream Toolkit
Loading...
Searching...
No Matches
ts::tr101290::Analyzer Class Reference

A class which analyzes a transport stream according to ETSI TR 101 290. More...

#include <tstr101290Analyzer.h>

Inheritance diagram for ts::tr101290::Analyzer:
Collaboration diagram for ts::tr101290::Analyzer:

Public Member Functions

 Analyzer (DuckContext &duck, ErrorHandlerInterface *handler=nullptr)
 Constructor.
 
void feedPacket (const PCR &timestamp, const TSPacket &pkt)
 The following method feeds the analyzer with a TS packet.
 
void getCounters (Counters &counters)
 Get the global error counters since start or the last getCountersRestart().
 
void getCounters (Counters &global, CountersByPID &by_pid)
 Get the global and detailed error counters since start or the last getCountersRestart().
 
void getCountersRestart (Counters &counters)
 Get and restart the global error counters since start or the last getCountersRestart().
 
void getCountersRestart (Counters &global, CountersByPID &by_pid)
 Get and restart the global and detailed error counters since start or the last getCountersRestart().
 
void reset ()
 Reset the analyzer.
 
void setCollectByPID (bool on)
 Enable or disable the detailed collection of error counters by PID.
 
void setErrorHandler (ErrorHandlerInterface *handler)
 Set a new error handler.
 
template<class Rep , class Period >
void setMaxPIDInterval (cn::duration< Rep, Period > interval)
 Set the maximum packet interval in "user PID's" before declaring PID_error.
 
void setTSSyncLostCount (size_t count)
 Set the number of consecutive invalid TS sync bytes before declaring TS sync loss.
 

Detailed Description

A class which analyzes a transport stream according to ETSI TR 101 290.

See also
ETSI TR 101 290 V1.4.1 (2020-06): Digital Video Broadcasting(DVB); Measurement guidelines for DVB systems.

Limitations

Although this is not clearly explained that way, ETSI TR 101 290 defines two distinct classes of measurements: physical transport errors and transport stream logical errors. As a software tool, TSDuck can only detect transport stream logical errors. As an example, section 4 of ETSI TR 101 290 says: "Most of the parameters can be measured with standard equipment such as spectrum analysers or constellation analysers. Other parameters are defined in a new way as a request to test and measurement equipment manufacturers to integrate this functionality in their products." It is obvious that TSDuck cannot detect physical transport errors that require "spectrum analysers or constellation analysers". Therefore, this class implements only a subset of ETSI TR 101 290.

The "TS_sync_loss" and "Sync_byte_error" indicators are inaccessible in most cases. It depends on the input plugin. Many plugins, such as "dvb" or all IP-based plugins ("ip", "srt", "rist", etc.) use the 0x47 sync byte to resynchronize in the data stream or to locate TS packets in datagrams. Therefore, with these input plugins, corrupted sync bytes are filtered upstream and never reach the analyzer classes.

Constructor & Destructor Documentation

◆ Analyzer()

ts::tr101290::Analyzer::Analyzer ( DuckContext duck,
ErrorHandlerInterface handler = nullptr 
)
explicit

Constructor.

Parameters
[in,out]duckTSDuck execution context. The reference is kept inside this instance.
[in]handlerOptional error handler.

Member Function Documentation

◆ setErrorHandler()

void ts::tr101290::Analyzer::setErrorHandler ( ErrorHandlerInterface handler)
inline

Set a new error handler.

Parameters
[in]handlerNew error handler. Can be null (no handler).

◆ setCollectByPID()

void ts::tr101290::Analyzer::setCollectByPID ( bool  on)
inline

Enable or disable the detailed collection of error counters by PID.

By default, error counters are collected at global TS level. Enabling the detailed collection of error counters by PID uses more resources. Use only when necessary.

Parameters
[in]onIf true, detailed counters are collected by PID. If false, only collect the global counters.

◆ feedPacket()

void ts::tr101290::Analyzer::feedPacket ( const PCR timestamp,
const TSPacket pkt 
)

The following method feeds the analyzer with a TS packet.

Parameters
[in]timestampA timestamp for the packet, in PCR units. There is no specific relation with the PCR values in the stream. This must be a monotonic clock which never wraps (unlike 33-bits PCR value which wrap after 26 hours).
[in]pktA TS packet.

◆ getCounters() [1/2]

void ts::tr101290::Analyzer::getCounters ( Counters counters)

Get the global error counters since start or the last getCountersRestart().

This is just a snapshot. Counters will continue to increment.

Parameters
[out]countersReturned error counters.

◆ getCounters() [2/2]

void ts::tr101290::Analyzer::getCounters ( Counters global,
CountersByPID by_pid 
)

Get the global and detailed error counters since start or the last getCountersRestart().

This is just a snapshot. Counters will continue to increment.

Parameters
[out]globalReturned global error counters, at TS level.
[out]by_pidReturned error counters. If setCollectByPID() was not called, the error counters are empty.

◆ getCountersRestart() [1/2]

void ts::tr101290::Analyzer::getCountersRestart ( Counters counters)

Get and restart the global error counters since start or the last getCountersRestart().

Error counters are reset and a new measurement period starts.

Parameters
[out]countersReturned error counters.

◆ getCountersRestart() [2/2]

void ts::tr101290::Analyzer::getCountersRestart ( Counters global,
CountersByPID by_pid 
)

Get and restart the global and detailed error counters since start or the last getCountersRestart().

Error counters are reset and a new measurement period starts.

Parameters
[out]globalReturned global error counters, at TS level.
[out]by_pidReturned error counters. If setCollectByPID() was not called, the error counters are empty.

◆ setMaxPIDInterval()

template<class Rep , class Period >
void ts::tr101290::Analyzer::setMaxPIDInterval ( cn::duration< Rep, Period >  interval)
inline

Set the maximum packet interval in "user PID's" before declaring PID_error.

This value currently applies to video and audio PID's only.

Parameters
[in]intervalThe maximum interval as a duration value.

◆ setTSSyncLostCount()

void ts::tr101290::Analyzer::setTSSyncLostCount ( size_t  count)
inline

Set the number of consecutive invalid TS sync bytes before declaring TS sync loss.

Parameters
[in]countWhen that number of consecutive TS packets have a corrupted sync byte (the initial 0x47 value), we declare a TS synchronization loss.

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