MythTV  master
Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
PESPacket Class Reference

Allows us to transform TS packets to PES packets, which are used to hold multimedia streams and very similar to PSIP tables. More...

#include <pespacket.h>

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

Public Member Functions

 PESPacket (const unsigned char *pesdata)
 
PESPacketoperator= (const PESPacket &pkt)=delete
 
 PESPacket (const PESPacket &pkt)
 
virtual ~PESPacket ()
 
bool IsClone () const
 
bool AddTSPacket (const TSPacket *tspacket, bool &broken)
 
bool IsGood () const
 
const TSHeadertsheader () const
 
TSHeadertsheader ()
 
void GetAsTSPackets (vector< TSPacket > &output, uint cc) const
 Returns payload only PESPacket as series of TSPackets. More...
 
uint StreamID () const
 
uint Length () const
 
uint ScramblingControl () const
 
bool HighPriority () const
 1 bit Indicates if this is a high priority packet More...
 
bool DataAligned () const
 1 bit Data alignment indicator (must be 0 for video) More...
 
bool CopyRight () const
 1 bit If true packet may contain copy righted material and is known to have once contained materiale with copy rights. More...
 
bool OriginalRecording () const
 1 bit Original Recording More...
 
bool HasPTS () const
 1 bit Presentation Time Stamp field is present More...
 
bool HasDTS () const
 1 bit Decoding Time Stamp field is present More...
 
bool HasESCR () const
 1 bit Elementary Stream Clock Reference field is present More...
 
bool HasESR () const
 1 bit Elementary Stream Rate field is present More...
 
bool HasDSM () const
 1 bit DSM field present (should always be false for broadcasts) More...
 
bool HasACI () const
 1 bit Additional Copy Info field is present More...
 
virtual bool HasCRC () const
 1 bit Cyclic Redundancy Check present More...
 
bool HasExtensionFlags () const
 1 bit Extension flags are present More...
 
uint64_t PTS (void) const
 Presentation Time Stamp, present if HasPTS() is true. More...
 
uint64_t DTS (void) const
 Decode Time Stamp, present if HasDTS() is true. More...
 
uint TSSizeInBuffer () const
 
uint PSIOffset () const
 
const unsigned char * pesdata () const
 
unsigned char * pesdata ()
 
const unsigned char * data () const
 
unsigned char * data ()
 
void SetStreamID (uint id)
 
void SetLength (uint len)
 
void SetTotalLength (uint len)
 
void SetPSIOffset (uint offset)
 
uint CRC (void) const
 
void SetCRC (uint crc)
 
uint CalcCRC (void) const
 
bool VerifyCRC (void) const
 

Protected Member Functions

 PESPacket ()=default
 noop constructor, only for use by derived classes More...
 
void Finalize ()
 

Protected Attributes

unsigned char * m_pesData { nullptr }
 Pointer to PES data in full buffer. More...
 
unsigned char * m_fullBuffer { nullptr }
 Pointer to allocated data. More...
 
uint m_psiOffset { 0 }
 AFCOffset + StartOfFieldPointer. More...
 
uint m_ccLast { 255 }
 Continuity counter of last inserted TS Packet. More...
 
uint m_pesDataSize { 0 }
 Number of data bytes (TS header + PES data) More...
 
uint m_allocSize { 0 }
 Total number of bytes we allocated. More...
 
bool m_badPacket { false }
 true if a CRC is not good yet More...
 

Static Protected Attributes

static const uint kTheMagicNoCRCCRC = 0xFFFFFFFF
 

Detailed Description

Allows us to transform TS packets to PES packets, which are used to hold multimedia streams and very similar to PSIP tables.

See also
PSIPTable, TSPacket

Definition at line 27 of file pespacket.h.

Constructor & Destructor Documentation

◆ PESPacket() [1/3]

PESPacket::PESPacket ( )
protecteddefault

noop constructor, only for use by derived classes

◆ PESPacket() [2/3]

PESPacket::PESPacket ( const unsigned char *  pesdata)
inlineexplicit

Definition at line 35 of file pespacket.h.

◆ PESPacket() [3/3]

PESPacket::PESPacket ( const PESPacket pkt)
inline

Definition at line 48 of file pespacket.h.

◆ ~PESPacket()

virtual PESPacket::~PESPacket ( )
inlinevirtual

Definition at line 69 of file pespacket.h.

Member Function Documentation

◆ operator=()

PESPacket& PESPacket::operator= ( const PESPacket pkt)
delete

◆ IsClone()

bool PESPacket::IsClone ( ) const
inline

Definition at line 78 of file pespacket.h.

◆ AddTSPacket()

bool PESPacket::AddTSPacket ( const TSPacket tspacket,
bool broken 
)

Definition at line 21 of file pespacket.cpp.

Referenced by MPEGStreamData::AssemblePSIP().

◆ IsGood()

bool PESPacket::IsGood ( ) const
inline

Definition at line 83 of file pespacket.h.

Referenced by MPEGStreamData::AssemblePSIP(), and MPEGStreamData::HandleTSTables().

◆ tsheader() [1/2]

const TSHeader* PESPacket::tsheader ( ) const
inline

◆ tsheader() [2/2]

TSHeader* PESPacket::tsheader ( )
inline

Definition at line 87 of file pespacket.h.

◆ GetAsTSPackets()

void PESPacket::GetAsTSPackets ( vector< TSPacket > &  output,
uint  cc 
) const

Returns payload only PESPacket as series of TSPackets.

Definition at line 104 of file pespacket.cpp.

Referenced by DTVRecorder::HandleSingleProgramPAT(), and DTVRecorder::HandleSingleProgramPMT().

◆ StreamID()

uint PESPacket::StreamID ( ) const
inline

◆ Length()

uint PESPacket::Length ( ) const
inline

◆ ScramblingControl()

uint PESPacket::ScramblingControl ( ) const
inline

Definition at line 98 of file pespacket.h.

◆ HighPriority()

bool PESPacket::HighPriority ( ) const
inline

1 bit Indicates if this is a high priority packet

Definition at line 101 of file pespacket.h.

◆ DataAligned()

bool PESPacket::DataAligned ( ) const
inline

1 bit Data alignment indicator (must be 0 for video)

Definition at line 103 of file pespacket.h.

◆ CopyRight()

bool PESPacket::CopyRight ( ) const
inline

1 bit If true packet may contain copy righted material and is known to have once contained materiale with copy rights.

If false packet may contain copy righted material but is not known to have ever contained materiale with copy rights.

Definition at line 108 of file pespacket.h.

◆ OriginalRecording()

bool PESPacket::OriginalRecording ( ) const
inline

1 bit Original Recording

Definition at line 110 of file pespacket.h.

◆ HasPTS()

bool PESPacket::HasPTS ( ) const
inline

1 bit Presentation Time Stamp field is present

Definition at line 113 of file pespacket.h.

◆ HasDTS()

bool PESPacket::HasDTS ( ) const
inline

1 bit Decoding Time Stamp field is present

Definition at line 115 of file pespacket.h.

◆ HasESCR()

bool PESPacket::HasESCR ( ) const
inline

1 bit Elementary Stream Clock Reference field is present

Definition at line 117 of file pespacket.h.

◆ HasESR()

bool PESPacket::HasESR ( ) const
inline

1 bit Elementary Stream Rate field is present

Definition at line 119 of file pespacket.h.

◆ HasDSM()

bool PESPacket::HasDSM ( ) const
inline

1 bit DSM field present (should always be false for broadcasts)

Definition at line 121 of file pespacket.h.

◆ HasACI()

bool PESPacket::HasACI ( ) const
inline

1 bit Additional Copy Info field is present

Definition at line 123 of file pespacket.h.

◆ HasCRC()

virtual bool PESPacket::HasCRC ( ) const
inlinevirtual

1 bit Cyclic Redundancy Check present

Reimplemented in PSIPTable.

Definition at line 125 of file pespacket.h.

Referenced by PESPacket().

◆ HasExtensionFlags()

bool PESPacket::HasExtensionFlags ( ) const
inline

1 bit Extension flags are present

Definition at line 127 of file pespacket.h.

◆ PTS()

uint64_t PESPacket::PTS ( void  ) const
inline

Presentation Time Stamp, present if HasPTS() is true.

Definition at line 130 of file pespacket.h.

◆ DTS()

uint64_t PESPacket::DTS ( void  ) const
inline

Decode Time Stamp, present if HasDTS() is true.

Definition at line 141 of file pespacket.h.

◆ TSSizeInBuffer()

uint PESPacket::TSSizeInBuffer ( ) const
inline

Definition at line 156 of file pespacket.h.

Referenced by MPEGStreamData::AssemblePSIP().

◆ PSIOffset()

uint PESPacket::PSIOffset ( ) const
inline

Definition at line 157 of file pespacket.h.

Referenced by MPEGStreamData::AssemblePSIP().

◆ pesdata() [1/2]

const unsigned char* PESPacket::pesdata ( ) const
inline

Definition at line 159 of file pespacket.h.

Referenced by ProgramMapTable::AppendStream(), MPEGStreamData::AssemblePSIP(), PSIPTable::ATSCProtocolVersion(), VirtualChannelTable::ChannelCount(), SpliceInformationTable::CodeWordIndex(), ProgramAssociationTable::Create(), SystemTimeTable::DayDaylightSavingsStarts(), ShortVirtualChannelTable::DefinedChannelsMap(), SCTESystemTimeTable::Descriptors(), SCTENetworkInformationTable::DescriptorsLength(), ShortVirtualChannelTable::DescriptorsLength(), SpliceInformationTable::EncryptionAlgorithm(), SCTENetworkInformationTable::FirstIndex(), SystemTimeTable::GPSOffset(), SystemTimeTable::GPSRaw(), SCTESystemTimeTable::GPSUTCOffset(), SystemTimeTable::HourDaylightSavingsStarts(), ShortVirtualChannelTable::ID(), SystemTimeTable::InDaylightSavingsTime(), ShortVirtualChannelTable::InverseChannelMap(), PSIPTable::IsCurrent(), SpliceInformationTable::IsEncryptedPacket(), NetworkTextTable::LanguageKey(), PSIPTable::LastSection(), SCTENetworkInformationTable::NumberOfRecords(), SpliceInformationTable::Parse(), SCTENetworkInformationTable::Parse(), ShortVirtualChannelTable::Parse(), NetworkInformationTable::Parse(), ServiceDescriptionTable::Parse(), BouquetAssociationTable::Parse(), DVBEventInformationTable::Parse(), PSIPTable::PrivateIndicator(), PSIPTable::psipdata(), SpliceInformationTable::PTSAdjustment(), MasterGuideTable::SCTEMapId(), CableVirtualChannelTable::SCTEMapId(), PSIPTable::Section(), PSIPTable::SectionSyntaxIndicator(), PSIPTable::SetATSCProtocolVersion(), SpliceInformationTable::SetCodeWordIndex(), PSIPTable::SetCurrent(), SpliceInformationTable::SetEncryptedPacket(), SpliceInformationTable::SetEncryptionAlgorithm(), PSIPTable::SetLastSection(), SpliceInformationTable::SetPTSAdjustment(), PSIPTable::SetSection(), SpliceInformationTable::SetSpliceCommandLength(), SpliceInformationTable::SetSpliceCommandType(), SpliceInformationTable::SetSpliceProtocolVersion(), PSIPTable::SetTableIDExtension(), PSIPTable::SetVersionNumber(), SpliceInformationTable::SpliceCommandLength(), SpliceInformationTable::SpliceCommandType(), SpliceInformationTable::SpliceProtocolVersion(), SCTESystemTimeTable::SystemTimeRaw(), MasterGuideTable::TableCount(), PSIPTable::TableIDExtension(), SCTENetworkInformationTable::TableSubtype(), NetworkTextTable::TableSubtype(), ShortVirtualChannelTable::TableSubtype(), SpliceInformationTable::TimeSignal(), VirtualChannelTable::toString(), VirtualChannelTable::toStringXML(), SCTENetworkInformationTable::TransmissionMedium(), NetworkTextTable::TransmissionMedium(), ShortVirtualChannelTable::TransmissionMedium(), TimeDateTable::UTCdata(), PSIPTable::Version(), and ShortVirtualChannelTable::VirtualChannelMap().

◆ pesdata() [2/2]

unsigned char* PESPacket::pesdata ( )
inline

Definition at line 160 of file pespacket.h.

◆ data() [1/2]

const unsigned char* PESPacket::data ( ) const
inline

Definition at line 162 of file pespacket.h.

◆ data() [2/2]

unsigned char* PESPacket::data ( )
inline

Definition at line 163 of file pespacket.h.

◆ SetStreamID()

void PESPacket::SetStreamID ( uint  id)
inline

Definition at line 165 of file pespacket.h.

Referenced by PSIPTable::SetTableID().

◆ SetLength()

void PESPacket::SetLength ( uint  len)
inline

◆ SetTotalLength()

void PESPacket::SetTotalLength ( uint  len)
inline

◆ SetPSIOffset()

void PESPacket::SetPSIOffset ( uint  offset)
inline

Definition at line 178 of file pespacket.h.

Referenced by MPEGStreamData::AssemblePSIP().

◆ CRC()

uint PESPacket::CRC ( void  ) const
inline

◆ SetCRC()

void PESPacket::SetCRC ( uint  crc)
inline

◆ CalcCRC()

uint PESPacket::CalcCRC ( void  ) const

◆ VerifyCRC()

bool PESPacket::VerifyCRC ( void  ) const

◆ Finalize()

void PESPacket::Finalize ( )
inlineprotected

Definition at line 211 of file pespacket.h.

Referenced by ProgramMapTable::Create(), and ProgramAssociationTable::Create().

Member Data Documentation

◆ m_pesData

unsigned char* PESPacket::m_pesData { nullptr }
protected

Pointer to PES data in full buffer.

Definition at line 213 of file pespacket.h.

Referenced by PESPacket(), and PSIPTable::VerifyPSIP().

◆ m_fullBuffer

unsigned char* PESPacket::m_fullBuffer { nullptr }
protected

Pointer to allocated data.

Definition at line 214 of file pespacket.h.

Referenced by PESPacket(), PSIPTable::PSIPTable(), and PSIPTable::VerifyPSIP().

◆ m_psiOffset

uint PESPacket::m_psiOffset { 0 }
protected

AFCOffset + StartOfFieldPointer.

Definition at line 216 of file pespacket.h.

Referenced by PSIPTable::PSIPTable().

◆ m_ccLast

uint PESPacket::m_ccLast { 255 }
protected

Continuity counter of last inserted TS Packet.

Definition at line 217 of file pespacket.h.

◆ m_pesDataSize

uint PESPacket::m_pesDataSize { 0 }
protected

Number of data bytes (TS header + PES data)

Definition at line 218 of file pespacket.h.

Referenced by PESPacket().

◆ m_allocSize

uint PESPacket::m_allocSize { 0 }
protected

Total number of bytes we allocated.

Definition at line 219 of file pespacket.h.

Referenced by PSIPTable::VerifyPSIP().

◆ m_badPacket

bool PESPacket::m_badPacket { false }
protected

true if a CRC is not good yet

Definition at line 220 of file pespacket.h.

◆ kTheMagicNoCRCCRC

const uint PESPacket::kTheMagicNoCRCCRC = 0xFFFFFFFF
staticprotected

Definition at line 224 of file pespacket.h.


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