Compute a clock, based real time, TS time, PCR or input timestamps.
More...
#include <tsTSClock.h>
Compute a clock, based real time, TS time, PCR or input timestamps.
Depending on parameters, the clock can be:
- Real time (system clock)
- Time from the first TDT, TOT ot ATSC STT.
- Explicit start time from parameters. The progression of the clock is based on TS packets in the last two cases. By default, the clock is based on real UTC time and TS packets are unused.
◆ TSClock()
Constructor.
- Parameters
-
| [in,out] | duck | TSDuck execution context. A reference is kept inside this object. |
| [in] | severity | Severity of the messages when switching sources. |
◆ reset()
Reset all collected information.
- Parameters
-
| [in] | args | Clock parameters. |
◆ feedPacket()
The following method feeds the analyzer with a TS packet.
- Parameters
-
| [in] | pkt | A new transport stream packet. |
| [in] | mdata | Associated metadata, including the input timestamp. |
◆ isValid()
| bool ts::TSClock::isValid |
( |
| ) |
const |
|
inline |
Check if the clock is valid.
The clock is invalid when based on the TS clock, before the first TDT, TOT or STT.
- Returns
- True if the clock is valid, false otherwise.
◆ initialClockUTC()
| Time ts::TSClock::initialClockUTC |
( |
| ) |
const |
|
inline |
Get the clock in UTC time of the first packet.
- Returns
- The clock of the first packet in UTC time or Time::Epoch if the clock is not yet valid.
◆ initialClock()
| Time ts::TSClock::initialClock |
( |
| ) |
const |
Get the clock of the first packet, in UTC or local time, depending on TSClockArgs.
- Returns
- The clock of the first packet or Time::Epoch if the clock is not yet valid.
◆ clockUTC()
| Time ts::TSClock::clockUTC |
( |
| ) |
const |
Get the current clock in UTC time.
- Returns
- The computed clock in UTC or Time::Epoch if the clock is not yet valid.
◆ clock()
| Time ts::TSClock::clock |
( |
| ) |
const |
Get the current clock, in UTC or local time, depending on TSClockArgs.
- Returns
- The computed clock or Time::Epoch if the clock is not yet valid.
◆ durationMS()
| cn::milliseconds ts::TSClock::durationMS |
( |
| ) |
const |
Get the estimated playout duration since first packets in milliseconds.
The returned duration depends on the TSClockArgs. If real time is used, this is the number of actual milliseconds since the first packet. Otherwise, this is the same as durationPCR(), converted in milliseconds.
- Returns
- The estimated playout duration in milliseconds.
◆ durationPCR()
| PCR ts::TSClock::durationPCR |
( |
| ) |
const |
|
inline |
Get the estimated playout duration since first packets in PCR units.
The returned duration is always based on the timestamps from the stream, never on real time.
- Returns
- The estimated playout duration in PCR units.
The documentation for this class was generated from the following file: