MythTV  master
Public Types | Public Member Functions | Static Public Attributes | Private Attributes | List of all members
TSHeader Class Reference

Used to access header of a TSPacket. More...

#include <tspacket.h>

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

Public Types

using Clock = std::chrono::steady_clock
 
using TimePoint = std::chrono::time_point< Clock, std::chrono::microseconds >
 

Public Member Functions

 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 Attributes

static constexpr unsigned int kHeaderSize {4}
 
static const TSHeaderArray kPayloadOnlyHeader
 

Private Attributes

TSHeaderArray m_tsData
 

Detailed Description

Used to access header of a TSPacket.

This class is also used to determine which PID a PESPacket arrived on.

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
TSPacket, PESPacket, HDTVRecorder

Definition at line 44 of file tspacket.h.

Member Typedef Documentation

◆ Clock

using TSHeader::Clock = std::chrono::steady_clock

Definition at line 47 of file tspacket.h.

◆ TimePoint

using TSHeader::TimePoint = std::chrono::time_point<Clock, std::chrono::microseconds>

Definition at line 48 of file tspacket.h.

Constructor & Destructor Documentation

◆ TSHeader() [1/2]

TSHeader::TSHeader ( void  )
inline

Definition at line 50 of file tspacket.h.

◆ TSHeader() [2/2]

TSHeader::TSHeader ( int  cc)
inlineexplicit

Definition at line 58 of file tspacket.h.

Member Function Documentation

◆ InitHeader()

void TSHeader::InitHeader ( const unsigned char *  header)
inline

Definition at line 67 of file tspacket.h.

◆ HasSync()

bool TSHeader::HasSync ( void  ) const
inline

Definition at line 81 of file tspacket.h.

Referenced by TSPacket::toString().

◆ TransportError()

bool TSHeader::TransportError ( void  ) const
inline

◆ PayloadStart()

bool TSHeader::PayloadStart ( void  ) const
inline

◆ Priority()

bool TSHeader::Priority ( void  ) const
inline

Definition at line 89 of file tspacket.h.

Referenced by TSPacket::toString().

◆ PID()

unsigned int TSHeader::PID ( void  ) const
inline

◆ ScramblingControl()

unsigned int TSHeader::ScramblingControl ( void  ) const
inline

Definition at line 95 of file tspacket.h.

Referenced by TSPacket::toString().

◆ AdaptationFieldControl()

unsigned int TSHeader::AdaptationFieldControl ( void  ) const
inline

◆ ContinuityCounter()

unsigned int TSHeader::ContinuityCounter ( void  ) const
inline

◆ Scrambled()

bool TSHeader::Scrambled ( void  ) const
inline

◆ HasAdaptationField()

bool TSHeader::HasAdaptationField ( void  ) const
inline

◆ AdaptationFieldSize()

size_t TSHeader::AdaptationFieldSize ( void  ) const
inline

Definition at line 112 of file tspacket.h.

Referenced by PESPacket::AddTSPacket(), and MPEGStreamData::ProcessTSPacket().

◆ HasPayload()

bool TSHeader::HasPayload ( void  ) const
inline

◆ GetDiscontinuityIndicator()

bool TSHeader::GetDiscontinuityIndicator ( void  ) const
inline

Definition at line 116 of file tspacket.h.

◆ HasPCR()

bool TSHeader::HasPCR ( void  ) const
inline

Definition at line 119 of file tspacket.h.

Referenced by MPEGStreamData::ProcessTSPacket().

◆ GetPCRbase()

int64_t TSHeader::GetPCRbase ( void  ) const
inline

Definition at line 129 of file tspacket.h.

◆ GetPCRext()

int32_t TSHeader::GetPCRext ( void  ) const
inline

Definition at line 137 of file tspacket.h.

◆ GetPCRraw()

int64_t TSHeader::GetPCRraw ( void  ) const
inline

Definition at line 142 of file tspacket.h.

◆ GetPCR()

TimePoint TSHeader::GetPCR ( void  ) const
inline

Definition at line 146 of file tspacket.h.

Referenced by MPEGStreamData::ProcessTSPacket().

◆ SetTransportError()

void TSHeader::SetTransportError ( bool  err)
inline

Definition at line 149 of file tspacket.h.

◆ SetPayloadStart()

void TSHeader::SetPayloadStart ( bool  start)
inline

Definition at line 152 of file tspacket.h.

◆ SetPriority()

void TSHeader::SetPriority ( bool  priority)
inline

Definition at line 155 of file tspacket.h.

◆ SetPID()

void TSHeader::SetPID ( unsigned int  pid)
inline

Definition at line 158 of file tspacket.h.

Referenced by ProgramMapTable::Create(), and PESPacket::GetAsTSPackets().

◆ SetScrambled()

void TSHeader::SetScrambled ( unsigned int  scr)
inline

Definition at line 162 of file tspacket.h.

◆ SetAdaptationFieldControl()

void TSHeader::SetAdaptationFieldControl ( unsigned int  afc)
inline

Definition at line 165 of file tspacket.h.

◆ SetContinuityCounter()

void TSHeader::SetContinuityCounter ( unsigned int  cc)
inline

◆ data() [1/2]

const unsigned char* TSHeader::data ( void  ) const
inline

◆ data() [2/2]

unsigned char* TSHeader::data ( void  )
inline

Definition at line 173 of file tspacket.h.

Member Data Documentation

◆ kHeaderSize

constexpr unsigned int TSHeader::kHeaderSize {4}
staticconstexpr

Definition at line 175 of file tspacket.h.

Referenced by PESPacket::AddTSPacket().

◆ kPayloadOnlyHeader

const TSHeaderArray TSHeader::kPayloadOnlyHeader
static
Initial value:
{
0x40,
0x0,
0x10,
}

Definition at line 176 of file tspacket.h.

◆ m_tsData

TSHeaderArray TSHeader::m_tsData
private

Definition at line 178 of file tspacket.h.


The documentation for this class was generated from the following files:
SYNC_BYTE
static constexpr uint8_t SYNC_BYTE
Definition: tspacket.h:19