MythTV  master
Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Attributes | Friends | List of all members
TSPacket Class Reference

Used to access the data of a Transport Stream packet. More...

#include <tspacket.h>

Inheritance diagram for TSPacket:
Inheritance graph
[legend]
Collaboration diagram for TSPacket:
Collaboration graph
[legend]

Public Member Functions

 TSPacket (void)=default
 
TSPacketCreateClone (void) const
 
void InitPayload (const unsigned char *payload)
 
void InitPayload (const unsigned char *payload, uint size)
 
unsigned int AFCOffset (void) const
 
unsigned int StartOfFieldPointer (void) const
 
void SetStartOfFieldPointer (uint sof)
 
QString toString (void) const
 
- Public Member Functions inherited from TSHeader
 TSHeader (void)
 
 TSHeader (int cc)
 
void InitHeader (const unsigned char *header)
 
bool HasSync (void) const
 
bool TransportError (void) const
 
bool PayloadStart (void) const
 
bool Priority (void) const
 
unsigned int PID (void) const
 
unsigned int ScramblingControl (void) const
 
unsigned int AdaptationFieldControl (void) const
 
unsigned int ContinuityCounter (void) const
 
bool Scrambled (void) const
 
bool HasAdaptationField (void) const
 
size_t AdaptationFieldSize (void) const
 
bool HasPayload (void) const
 
bool GetDiscontinuityIndicator (void) const
 
bool HasPCR (void) const
 
int64_t GetPCRbase (void) const
 
int32_t GetPCRext (void) const
 
int64_t GetPCRraw (void) const
 
TimePoint GetPCR (void) const
 
void SetTransportError (bool err)
 
void SetPayloadStart (bool start)
 
void SetPriority (bool priority)
 
void SetPID (unsigned int pid)
 
void SetScrambled (unsigned int scr)
 
void SetAdaptationFieldControl (unsigned int afc)
 
void SetContinuityCounter (unsigned int cc)
 
const unsigned char * data (void) const
 
unsigned char * data (void)
 

Static Public Member Functions

static TSPacketCreatePayloadOnlyPacket (void)
 

Static Public Attributes

static constexpr unsigned int kSize {188}
 
static constexpr unsigned int kPayloadSize {188-4}
 
static constexpr unsigned int kDVBEmissionSize {204}
 
static constexpr unsigned int kISDBEmissionSize {204}
 
static constexpr unsigned int k8VSBEmissionSize {208}
 
static const TSPacketkNullPacket
 
- Static Public Attributes inherited from TSHeader
static constexpr unsigned int kHeaderSize {4}
 
static const TSHeaderArray kPayloadOnlyHeader
 

Private Attributes

std::array< uint8_t, 184 > m_tsPayload
 

Friends

class PESPacket
 

Additional Inherited Members

- Public Types inherited from TSHeader
using Clock = std::chrono::steady_clock
 
using TimePoint = std::chrono::time_point< Clock, std::chrono::microseconds >
 

Detailed Description

Used to access the data of a Transport Stream packet.

Warning
Be very, very careful when modifying this data structure. This class is used in the core of the received video data path, and for performance reasons overlaid on the buffer of bytes received from the network. It therefore can only contain (per-instance) variables that directly correspond to the data bytes received from the broadcaster. There may be static variables in this class, but absolutely no per-instance variables that are not part of the overlaid byte stream. There also must not be any virtual functions in this class, as the vtable is implemented as a per-instance variable in the class structure, and would mess up the overlaying of this structure on the received byte stream.
See also
TSHeader, PESPacket, HDTVRecorder

Definition at line 205 of file tspacket.h.

Constructor & Destructor Documentation

◆ TSPacket()

TSPacket::TSPacket ( void  )
default

Member Function Documentation

◆ CreatePayloadOnlyPacket()

static TSPacket* TSPacket::CreatePayloadOnlyPacket ( void  )
inlinestatic

◆ CreateClone()

TSPacket* TSPacket::CreateClone ( void  ) const
inline

Definition at line 222 of file tspacket.h.

Referenced by MpegRecorder::ProcessTSPacket().

◆ InitPayload() [1/2]

void TSPacket::InitPayload ( const unsigned char *  payload)
inline

Definition at line 228 of file tspacket.h.

◆ InitPayload() [2/2]

void TSPacket::InitPayload ( const unsigned char *  payload,
uint  size 
)
inline

Definition at line 234 of file tspacket.h.

◆ AFCOffset()

unsigned int TSPacket::AFCOffset ( void  ) const
inline

◆ StartOfFieldPointer()

unsigned int TSPacket::StartOfFieldPointer ( void  ) const
inline

Definition at line 252 of file tspacket.h.

Referenced by MPEGStreamData::AssemblePSIP(), and PSIPTable::InitPESPacket().

◆ SetStartOfFieldPointer()

void TSPacket::SetStartOfFieldPointer ( uint  sof)
inline

Definition at line 254 of file tspacket.h.

◆ toString()

QString TSPacket::toString ( void  ) const

Definition at line 28 of file tspacket.cpp.

Referenced by MPEGStreamData::ProcessTSPacket().

Friends And Related Function Documentation

◆ PESPacket

friend class PESPacket
friend

Definition at line 207 of file tspacket.h.

Member Data Documentation

◆ kSize

constexpr unsigned int TSPacket::kSize {188}
staticconstexpr

◆ kPayloadSize

constexpr unsigned int TSPacket::kPayloadSize {188-4}
staticconstexpr

◆ kDVBEmissionSize

constexpr unsigned int TSPacket::kDVBEmissionSize {204}
staticconstexpr

Definition at line 261 of file tspacket.h.

Referenced by ASIStreamHandler::Open().

◆ kISDBEmissionSize

constexpr unsigned int TSPacket::kISDBEmissionSize {204}
staticconstexpr

Definition at line 262 of file tspacket.h.

◆ k8VSBEmissionSize

constexpr unsigned int TSPacket::k8VSBEmissionSize {208}
staticconstexpr

Definition at line 263 of file tspacket.h.

◆ kNullPacket

const TSPacket * TSPacket::kNullPacket
static
Initial value:
=
reinterpret_cast<const TSPacket*>(NULL_PACKET_BYTES.data())

Definition at line 264 of file tspacket.h.

◆ m_tsPayload

std::array<uint8_t,184> TSPacket::m_tsPayload
private

Definition at line 266 of file tspacket.h.


The documentation for this class was generated from the following files:
TSPacket
Used to access the data of a Transport Stream packet.
Definition: tspacket.h:205
NULL_PACKET_BYTES
const std::array< unsigned char, 188 > NULL_PACKET_BYTES
Definition: tspacket.cpp:15