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... | |
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.
|
private |
| QtsTimeStamper::QtsTimeStamper | ( | const QtsDemux * | demux = 0 | ) |
Constructor.
| [in] | demux | Optional demux which will be used to collect PCR. If zero, no PCR will be used, only PTS from the PES packets in the PID. |
| void QtsTimeStamper::setDemux | ( | const QtsDemux * | demux = 0 | ) |
Set a new demux.
| [in] | demux | New demux. Ignored if the time source is already PTS on the PID. |
| quint64 QtsTimeStamper::lastTimeStamp | ( | ) |
Get the last timestamp in milliseconds, starting with zero.
| void QtsTimeStamper::processPesPacket | ( | const QtsPesPacket & | packet | ) |
Process one PES packet from the reference PID.
| [in] | packet | The PES packet. The first packet defines the PID. All subsequent packets must belong to the same PID. |
| void QtsTimeStamper::reset | ( | ) |
Reset the stamper, back to constructor state.
|
inline |
Get the reference PID.
|
private |
Process a new clock value in millisecond.
| [in] | clock | New clock value in millisecond. |
|
private |
Demux providing the PCR.
|
private |
Reference PID for timestamps.
|
private |
Where do we get the time reference from.
|
private |
Last known timestamp.
|
private |
Previous time clock value.
|
private |
Adjustment value between time clock and time stamps.