PESPacket Class Reference

Allows us to transform TS packets to PES packets, which are used to hold PSIP tables as well as multimedia streams. More...

#include <pespacket.h>

Inheritance diagram for PESPacket:
PSIPTable AggregateDataEventTable AggregateEventInformationTable AggregateExtendedTextTable BouquetAssociationTable ConditionalAccessTable DirectedChannelChangeSelectionCodeTable DirectedChannelChangeTable DiscontinuityInformationTable DVBEventInformationTable EventInformationTable ExtendedTextTable MasterGuideTable NetworkInformationTable NetworkTextTable PremiereContentInformationTable PremiereContentPresentationTable ProgramAssociationTable ProgramInformationMessageTable ProgramMapTable ProgramNameMessageTable RatingRegionTable SCTENetworkInformationTable SCTESystemTimeTable SelectionInformationTable ServiceDescriptionTable ShortVirtualChannelTable SpliceInformationTable SystemTimeTable TimeDateTable VirtualChannelTable

List of all members.

Public Member Functions

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

Static Public Member Functions

static const PESPacket View (const TSPacket &tspacket)
static PESPacket View (TSPacket &tspacket)
static const PESPacket ViewData (const unsigned char *pesdata)

Protected Member Functions

 PESPacket (const TSPacket *tspacket, bool)
 PESPacket (const unsigned char *pesdata, bool)
void Finalize ()

Protected Attributes

unsigned char * _pesdata
 Pointer to PES data in full buffer.
unsigned char * _fullbuffer
 Pointer to allocated data.
uint _psiOffset
 AFCOffset + StartOfFieldPointer.
uint _ccLast
 Continuity counter of last inserted TS Packet.
uint _pesdataSize
 Number of data bytes (TS header + PES data).
uint _allocSize
 Total number of bytes we allocated.
bool _badPacket
 true if a CRC is not good yet

Private Member Functions

void InitPESPacket (TSPacket &tspacket)
 Only handles single TS packet PES packets, for PMT/PAT tables basically.
PESPacketoperator= (const PESPacket &pkt)

Detailed Description

Allows us to transform TS packets to PES packets, which are used to hold PSIP tables as well as multimedia streams.

See also:
PSIPTable, TSPacket

Definition at line 25 of file pespacket.h.


Constructor & Destructor Documentation

PESPacket::PESPacket ( const TSPacket tspacket,
bool   
) [inline, protected]

Definition at line 51 of file pespacket.h.

Referenced by View(), and ViewData().

PESPacket::PESPacket ( const unsigned char *  pesdata,
bool   
) [inline, protected]

Definition at line 60 of file pespacket.h.

PESPacket::PESPacket ( const PESPacket pkt  )  [inline]

Definition at line 75 of file pespacket.h.

PESPacket::PESPacket ( const TSPacket tspacket  )  [inline]

Definition at line 92 of file pespacket.h.

PESPacket::PESPacket ( const TSPacket tspacket,
const unsigned char *  pesdata,
uint  pes_size 
) [inline]

Definition at line 111 of file pespacket.h.

virtual PESPacket::~PESPacket (  )  [inline, virtual]

Definition at line 125 of file pespacket.h.


Member Function Documentation

void PESPacket::InitPESPacket ( TSPacket tspacket  )  [inline, private]

Only handles single TS packet PES packets, for PMT/PAT tables basically.

Definition at line 28 of file pespacket.h.

Referenced by PESPacket().

PESPacket& PESPacket::operator= ( const PESPacket pkt  )  [private]
static const PESPacket PESPacket::View ( const TSPacket tspacket  )  [inline, static]

Reimplemented in PSIPTable.

Definition at line 134 of file pespacket.h.

Referenced by FirewireDevice::ProcessPATPacket(), and PSIPTable::View().

static PESPacket PESPacket::View ( TSPacket tspacket  )  [inline, static]

Reimplemented in PSIPTable.

Definition at line 137 of file pespacket.h.

static const PESPacket PESPacket::ViewData ( const unsigned char *  pesdata  )  [inline, static]
bool PESPacket::IsClone (  )  const [inline]

Definition at line 143 of file pespacket.h.

Referenced by AddTSPacket(), and ~PESPacket().

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

Definition at line 21 of file pespacket.cpp.

Referenced by MPEGStreamData::AssemblePSIP().

bool PESPacket::IsGood (  )  const [inline]

Definition at line 148 of file pespacket.h.

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

const TSHeader* PESPacket::tsheader (  )  const [inline]
TSHeader* PESPacket::tsheader (  )  [inline]

Definition at line 152 of file pespacket.h.

void PESPacket::GetAsTSPackets ( vector< TSPacket > &  pkts,
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().

uint PESPacket::StreamID (  )  const [inline]
uint PESPacket::Length ( void   )  const [inline]
uint PESPacket::ScramblingControl (  )  const [inline]

Definition at line 163 of file pespacket.h.

bool PESPacket::HighPriority (  )  const [inline]

1 bit Indicates if this is a high priority packet

Definition at line 166 of file pespacket.h.

bool PESPacket::DataAligned (  )  const [inline]

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

Definition at line 168 of file pespacket.h.

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 173 of file pespacket.h.

bool PESPacket::OriginalRecording (  )  const [inline]

1 bit Original Recording

Definition at line 175 of file pespacket.h.

bool PESPacket::HasPTS (  )  const [inline]

1 bit Presentation Time Stamp field is present

Definition at line 178 of file pespacket.h.

Referenced by DTS().

bool PESPacket::HasDTS (  )  const [inline]

1 bit Decoding Time Stamp field is present

Definition at line 180 of file pespacket.h.

bool PESPacket::HasESCR (  )  const [inline]

1 bit Elementary Stream Clock Reference field is present

Definition at line 182 of file pespacket.h.

bool PESPacket::HasESR (  )  const [inline]

1 bit Elementary Stream Rate field is present

Definition at line 184 of file pespacket.h.

bool PESPacket::HasDSM (  )  const [inline]

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

Definition at line 186 of file pespacket.h.

bool PESPacket::HasACI (  )  const [inline]

1 bit Additional Copy Info field is present

Definition at line 188 of file pespacket.h.

virtual bool PESPacket::HasCRC ( void   )  const [inline, virtual]

1 bit Cyclic Redundancy Check present

Reimplemented in PSIPTable.

Definition at line 190 of file pespacket.h.

Referenced by CRC(), PESPacket(), and VerifyCRC().

bool PESPacket::HasExtensionFlags (  )  const [inline]

1 bit Extension flags are present

Definition at line 192 of file pespacket.h.

uint64_t PESPacket::PTS ( void   )  const [inline]

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

Definition at line 195 of file pespacket.h.

uint64_t PESPacket::DTS ( void   )  const [inline]

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

Definition at line 206 of file pespacket.h.

uint PESPacket::TSSizeInBuffer (  )  const [inline]

Definition at line 221 of file pespacket.h.

Referenced by MPEGStreamData::AssemblePSIP().

uint PESPacket::PSIOffset (  )  const [inline]

Definition at line 222 of file pespacket.h.

Referenced by MPEGStreamData::AssemblePSIP().

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

Definition at line 224 of file pespacket.h.

Referenced by ProgramMapTable::AppendStream(), MPEGStreamData::AssemblePSIP(), PSIPTable::ATSCProtocolVersion(), VirtualChannelTable::ChannelCount(), SpliceInformationTable::CodeWordIndex(), SystemTimeTable::DayDaylightSavingsStarts(), ShortVirtualChannelTable::DefinedChannelsMap(), SCTESystemTimeTable::Descriptors(), ShortVirtualChannelTable::DescriptorsLength(), SCTENetworkInformationTable::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(), ShortVirtualChannelTable::Parse(), SCTENetworkInformationTable::Parse(), SpliceInformationTable::Parse(), DVBEventInformationTable::Parse(), BouquetAssociationTable::Parse(), ServiceDescriptionTable::Parse(), NetworkInformationTable::Parse(), PSIPTable::PrivateIndicator(), PSIPTable::psipdata(), SpliceInformationTable::PTSAdjustment(), CableVirtualChannelTable::SCTEMapId(), MasterGuideTable::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(), ShortVirtualChannelTable::TableSubtype(), NetworkTextTable::TableSubtype(), SCTENetworkInformationTable::TableSubtype(), SpliceInformationTable::TimeSignal(), VirtualChannelTable::toString(), VirtualChannelTable::toStringXML(), ShortVirtualChannelTable::TransmissionMedium(), NetworkTextTable::TransmissionMedium(), SCTENetworkInformationTable::TransmissionMedium(), TimeDateTable::UTCdata(), PSIPTable::Version(), and ShortVirtualChannelTable::VirtualChannelMap().

unsigned char* PESPacket::pesdata (  )  [inline]

Definition at line 225 of file pespacket.h.

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

Definition at line 227 of file pespacket.h.

Referenced by GetAsTSPackets().

unsigned char* PESPacket::data (  )  [inline]

Definition at line 228 of file pespacket.h.

void PESPacket::SetStreamID ( uint  id  )  [inline]

Definition at line 230 of file pespacket.h.

Referenced by PSIPTable::SetTableID().

void PESPacket::SetLength ( uint  len  )  [inline]
void PESPacket::SetTotalLength ( uint  len  )  [inline]
void PESPacket::SetPSIOffset ( uint  offset  )  [inline]

Definition at line 243 of file pespacket.h.

Referenced by MPEGStreamData::AssemblePSIP().

uint PESPacket::CRC ( void   )  const [inline]
void PESPacket::SetCRC ( uint  crc  )  [inline]

Definition at line 260 of file pespacket.h.

Referenced by Finalize(), and ServiceDescriptionTable::Mutate().

uint PESPacket::CalcCRC ( void   )  const
bool PESPacket::VerifyCRC ( void   )  const
void PESPacket::Finalize (  )  [inline, protected]

Definition at line 276 of file pespacket.h.


Member Data Documentation

unsigned char* PESPacket::_pesdata [protected]
unsigned char* PESPacket::_fullbuffer [protected]

Pointer to allocated data.

Definition at line 279 of file pespacket.h.

Referenced by AddTSPacket(), data(), GetAsTSPackets(), PESPacket(), SetPSIOffset(), tsheader(), PSIPTable::VerifyPSIP(), and ~PESPacket().

AFCOffset + StartOfFieldPointer.

Definition at line 281 of file pespacket.h.

Referenced by AddTSPacket(), InitPESPacket(), PESPacket(), PSIOffset(), and SetPSIOffset().

uint PESPacket::_ccLast [protected]

Continuity counter of last inserted TS Packet.

Definition at line 282 of file pespacket.h.

Referenced by AddTSPacket().

Number of data bytes (TS header + PES data).

Definition at line 283 of file pespacket.h.

Referenced by AddTSPacket(), PESPacket(), and TSSizeInBuffer().

Total number of bytes we allocated.

Definition at line 284 of file pespacket.h.

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

true if a CRC is not good yet

Definition at line 285 of file pespacket.h.

Referenced by AddTSPacket(), InitPESPacket(), IsGood(), and PESPacket().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends
Generated on Fri May 25 06:42:18 2012 for MythTV by  doxygen 1.6.3