Basic definition of an MPEG-2 transport packet. More...
Public Member Functions | |
void | clearPriority () |
Clear the transport_priority - 1 bit. More... | |
void | clearPusi () |
Clear the payload_unit_start_indicator (PUSI) - 1 bit. More... | |
void | clearTei () |
Clear the transport_error_indicator (TEI) - 1 bit. More... | |
int | getAdaptationFieldSize () const |
Compute the adaptation_field (AF) size in bytes. More... | |
quint8 | getCc () const |
Extract the continuity_counter (CC) - 4 bits. More... | |
bool | getDiscontinuityIndicator () const |
Check if packet has a discontinuity_indicator set - 1 bit. More... | |
quint64 | getDts () const |
Get the DTS - 33 bits. More... | |
bool | getEspi () const |
Check if packet has a elementary_stream_priority_indicator (ESPI) set - 1 bit. More... | |
int | getHeaderSize () const |
Compute the size of the TS header (ie. More... | |
quint64 | getOpcr () const |
Get the Original Program Clock Reference (OPCR) - 42 bits. More... | |
const quint8 * | getPayload () const |
Get payload start address inside this object. More... | |
quint8 * | getPayload () |
Get payload start address inside this object. More... | |
int | getPayloadSize () const |
Compute the payload size. More... | |
quint64 | getPcr () const |
Get the Program Clock Reference (PCR) - 42 bits. More... | |
QtsPid | getPid () const |
Extract the PID - 13 bits. More... | |
bool | getPriority () const |
Extract the transport_priority - 1 bit. More... | |
quint64 | getPts () const |
Get the PTS - 33 bits. More... | |
bool | getPusi () const |
Extract the payload_unit_start_indicator (PUSI) - 1 bit. More... | |
bool | getRandomAccessIndicator () const |
Check if packet has a random_access_indicator set - 1 bit. More... | |
quint8 | getScrambling () const |
Extract the transport_scrambling_control - 2 bits. More... | |
bool | getTei () const |
Extract the transport_error_indicator (TEI) - 1 bit. More... | |
bool | hasAdaptationField () const |
Check if the packet has an adaptation_field (AF). More... | |
bool | hasDTS () const |
Check if the TS packet contains a Decoding Time Stamp (DTS). More... | |
bool | hasOpcr () const |
Check if packet has an Original Program Clock Reference (OPCR). More... | |
bool | hasPayload () const |
Check if the packet has a payload. More... | |
bool | hasPcr () const |
Check if packet has a Program Clock Reference (PCR). More... | |
bool | hasPts () const |
Check if the TS packet contains a Presentation Time Stamp (PTS). More... | |
bool | hasValidSync () const |
Check if the sync byte is valid in the packet. More... | |
bool | isClear () const |
Check if the packet is clear. More... | |
bool | isScrambled () const |
Check if the packet is scrambled. More... | |
bool | operator!= (const QtsTsPacket &p) const |
Difference operator. More... | |
const QtsTsPacket & | operator= (const QtsTsPacket &p) |
Assigment operator. More... | |
bool | operator== (const QtsTsPacket &p) const |
Comparison operator. More... | |
void | setCc (quint8 cc) |
Set the continuity_counter (CC) - 4 bits. More... | |
void | setOpcr (const quint64 &opcr) |
Replace the Original Program Clock Reference (OPCR) value - 42 bits. More... | |
void | setPcr (const quint64 &pcr) |
Replace the Program Clock Reference (PCR) value - 42 bits. More... | |
void | setPid (QtsPid pid) |
Set the PID - 13 bits. More... | |
void | setPriority () |
Set the transport_priority - 1 bit. More... | |
void | setPusi () |
Set the payload_unit_start_indicator (PUSI) - 1 bit. More... | |
void | setScrambling (quint8 sc) |
Set the transport_scrambling_control - 2 bits. More... | |
void | setTei () |
Set the transport_error_indicator (TEI) - 1 bit. More... | |
bool | startPes () const |
Check if the packet contains the start of a clear PES header. More... | |
Static Public Member Functions | |
static void | sanityCheck () |
Sanity check routine. More... | |
Public Attributes | |
quint8 | b [QTS_PKT_SIZE] |
Public content is a byte array. More... | |
Private Member Functions | |
int | dtsOffset () const |
Compute the offset of DTS. More... | |
quint64 | getPdts (int offset) const |
Get the PTS or DTS at specified offset. More... | |
int | opcrOffset () const |
Compute the offset of OPCR. More... | |
int | pcrOffset () const |
Compute the offset of PCR. More... | |
int | ptsOffset () const |
Compute the offset of PTS. More... | |
Basic definition of an MPEG-2 transport packet.
The binary representation of this object is exactly 188 bytes. Arrays of QtsTsPacket can be mapped on transport stream data buffers.
|
inline |
Assigment operator.
p | Other instance to assign. |
|
inline |
Comparison operator.
p | Other instance to compare with. |
|
inline |
Difference operator.
p | Other instance to compare with. |
|
inline |
Check if the sync byte is valid in the packet.
|
inline |
Extract the PID - 13 bits.
|
inline |
Set the PID - 13 bits.
[in] | pid | The PID of the packet. |
|
inline |
Extract the payload_unit_start_indicator (PUSI) - 1 bit.
|
inline |
Clear the payload_unit_start_indicator (PUSI) - 1 bit.
|
inline |
Set the payload_unit_start_indicator (PUSI) - 1 bit.
|
inline |
Extract the transport_error_indicator (TEI) - 1 bit.
|
inline |
Clear the transport_error_indicator (TEI) - 1 bit.
|
inline |
Set the transport_error_indicator (TEI) - 1 bit.
|
inline |
Extract the transport_priority - 1 bit.
|
inline |
Clear the transport_priority - 1 bit.
|
inline |
Set the transport_priority - 1 bit.
|
inline |
Extract the transport_scrambling_control - 2 bits.
|
inline |
Check if the packet is clear.
|
inline |
Check if the packet is scrambled.
|
inline |
Set the transport_scrambling_control - 2 bits.
[in] | sc | The transport_scrambling_control value. |
|
inline |
Extract the continuity_counter (CC) - 4 bits.
|
inline |
Set the continuity_counter (CC) - 4 bits.
[in] | cc | The continuity_counter value. |
|
inline |
Check if the packet has an adaptation_field (AF).
|
inline |
Compute the adaptation_field (AF) size in bytes.
|
inline |
Compute the size of the TS header (ie.
index to TS payload).
|
inline |
Check if the packet has a payload.
|
inline |
Get payload start address inside this object.
|
inline |
Get payload start address inside this object.
|
inline |
Compute the payload size.
|
inline |
Check if packet has a discontinuity_indicator set - 1 bit.
|
inline |
Check if packet has a random_access_indicator set - 1 bit.
|
inline |
Check if packet has a elementary_stream_priority_indicator (ESPI) set - 1 bit.
|
inline |
Check if packet has a Program Clock Reference (PCR).
|
inline |
Check if packet has an Original Program Clock Reference (OPCR).
quint64 QtsTsPacket::getPcr | ( | ) | const |
Get the Program Clock Reference (PCR) - 42 bits.
quint64 QtsTsPacket::getOpcr | ( | ) | const |
Get the Original Program Clock Reference (OPCR) - 42 bits.
void QtsTsPacket::setPcr | ( | const quint64 & | pcr | ) |
Replace the Program Clock Reference (PCR) value - 42 bits.
Do nothing if the packet has not PCR.
pcr | PCR value to replace. |
void QtsTsPacket::setOpcr | ( | const quint64 & | opcr | ) |
Replace the Original Program Clock Reference (OPCR) value - 42 bits.
Do nothing if the packet has not OPCR.
opcr | OPCR value to replace. |
bool QtsTsPacket::startPes | ( | ) | const |
Check if the packet contains the start of a clear PES header.
|
inline |
Check if the TS packet contains a Presentation Time Stamp (PTS).
Technically, the PTS and DTS are part of the PES packet, not the TS packet. If the TS packet is the first TS packet of a PES packet, it is possible that the PTS and/or DTS are present in the PES packet but outside the first TS packet. This is possible but rare. So, we provide here a fast way of getting PTS and/or DTS from the TS packet if available.
|
inline |
Check if the TS packet contains a Decoding Time Stamp (DTS).
|
inline |
|
inline |
|
static |
Sanity check routine.
Ensure that the QtsTsPacket structure can be used in contiguous memory array and array of packets. Crash the application if this is not the case. Can be used once at startup time in paranoid applications.
|
private |
Compute the offset of PCR.
|
private |
Compute the offset of OPCR.
|
private |
Compute the offset of PTS.
|
private |
Compute the offset of DTS.
|
private |
Get the PTS or DTS at specified offset.
[in] | offset | Offset in packet. |
quint8 QtsTsPacket::b[QTS_PKT_SIZE] |
Public content is a byte array.
This byte array exactly fills the memory area of a transport packet. This is why arrays of QtsTsPacket can be mapped on transport stream data buffers.