TSDuck v3.43-4441
MPEG Transport Stream Toolkit
Loading...
Searching...
No Matches
ts::DurationAnalyzer Class Reference

Compute the duration of a stream, based on PCR or input timestamps. More...

#include <tsDurationAnalyzer.h>

Public Member Functions

 DurationAnalyzer (Report &report=(ts::NullReport::Instance()), int severity=Severity::Verbose)
 Constructor.
 
PCR duration () const
 Get the estimated playout duration in PCR units.
 
void feedPacket (const TSPacket &pkt, const TSPacketMetadata &mdata)
 The following method feeds the analyzer with a TS packet.
 
void reset ()
 Reset all collected information.
 
void useInputTimestamps (bool prefer_timestamps)
 Select the prefered method for duration evaluation.
 

Detailed Description

Compute the duration of a stream, based on PCR or input timestamps.

Constructor & Destructor Documentation

◆ DurationAnalyzer()

ts::DurationAnalyzer::DurationAnalyzer ( Report report = (ts::NullReport::Instance()),
int  severity = Severity::Verbose 
)

Constructor.

Parameters
[in,out]reportWhere to report messages when switching sources.
[in]severitySeverity of the messages when switching sources.

Member Function Documentation

◆ useInputTimestamps()

void ts::DurationAnalyzer::useInputTimestamps ( bool  prefer_timestamps)
inline

Select the prefered method for duration evaluation.

Parameters
[in]prefer_timestampsIf true, use input timestamps when possible. Fallback to PCR analysis if the input timestamps are not valid or not monotonic. If false, always use PCR analysis, ignore timestamps.

◆ feedPacket()

void ts::DurationAnalyzer::feedPacket ( const TSPacket pkt,
const TSPacketMetadata mdata 
)

The following method feeds the analyzer with a TS packet.

Parameters
[in]pktA new transport stream packet.
[in]mdataAssociated metadata, including the input timestamp.

◆ duration()

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

Get the estimated playout duration in PCR units.

Returns
The estimated playout duration in PCR units.

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