QtlMovie 1.12 (A specialized FFmpeg front-end)
QtsTimeStamper Class Reference

Time stamp management per PID. More...

Public Member Functions

 QtsTimeStamper (const QtsDemux *demux=0)
 Constructor. More...
 
QtsPid getPid () const
 Get the reference PID. More...
 
quint64 lastTimeStamp ()
 Get the last timestamp in milliseconds, starting with zero. More...
 
void processPesPacket (const QtsPesPacket &packet)
 Process one PES packet from the reference PID. More...
 
void reset ()
 Reset the stamper, back to constructor state. More...
 
void setDemux (const QtsDemux *demux=0)
 Set a new demux. More...
 

Private Types

enum  TimeSource {
  PTS,
  PCR,
  UNDEFINED
}
 Our source of time reference. More...
 

Private Member Functions

void processClock (qint64 clock)
 Process a new clock value in millisecond. More...
 

Private Attributes

qint64 _delta
 Adjustment value between time clock and time stamps. More...
 
const QtsDemux_demux
 Demux providing the PCR. More...
 
quint64 _lastTimeStamp
 Last known timestamp. More...
 
QtsPid _pid
 Reference PID for timestamps. More...
 
qint64 _previousClock
 Previous time clock value. More...
 
TimeSource _source
 Where do we get the time reference from. More...
 

Detailed Description

Time stamp management per PID.

Return a current time reference in millisecond for a given PID. The first time reference found is zero. Use the PTS from the PID if some are found. Otherwise, use the global PCR from the TS.

Member Enumeration Documentation

◆ TimeSource

Our source of time reference.

Enumerator
PTS 
PCR 
UNDEFINED 

Constructor & Destructor Documentation

◆ QtsTimeStamper()

QtsTimeStamper::QtsTimeStamper ( const QtsDemux demux = 0)

Constructor.

Parameters
[in]demuxOptional demux which will be used to collect PCR. If zero, no PCR will be used, only PTS from the PES packets in the PID.

Member Function Documentation

◆ setDemux()

void QtsTimeStamper::setDemux ( const QtsDemux demux = 0)

Set a new demux.

Parameters
[in]demuxNew demux. Ignored if the time source is already PTS on the PID.

◆ lastTimeStamp()

quint64 QtsTimeStamper::lastTimeStamp ( )

Get the last timestamp in milliseconds, starting with zero.

Returns
The last timestamp in milliseconds.

◆ processPesPacket()

void QtsTimeStamper::processPesPacket ( const QtsPesPacket packet)

Process one PES packet from the reference PID.

Parameters
[in]packetThe PES packet. The first packet defines the PID. All subsequent packets must belong to the same PID.

◆ reset()

void QtsTimeStamper::reset ( )

Reset the stamper, back to constructor state.

◆ getPid()

QtsPid QtsTimeStamper::getPid ( ) const
inline

Get the reference PID.

Returns
The reference PID or QTS_PID_NULL if unknown.

◆ processClock()

void QtsTimeStamper::processClock ( qint64  clock)
private

Process a new clock value in millisecond.

Parameters
[in]clockNew clock value in millisecond.

Member Data Documentation

◆ _demux

const QtsDemux* QtsTimeStamper::_demux
private

Demux providing the PCR.

◆ _pid

QtsPid QtsTimeStamper::_pid
private

Reference PID for timestamps.

◆ _source

TimeSource QtsTimeStamper::_source
private

Where do we get the time reference from.

◆ _lastTimeStamp

quint64 QtsTimeStamper::_lastTimeStamp
private

Last known timestamp.

◆ _previousClock

qint64 QtsTimeStamper::_previousClock
private

Previous time clock value.

◆ _delta

qint64 QtsTimeStamper::_delta
private

Adjustment value between time clock and time stamps.


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