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>
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 TSHeader * | tsheader () const |
| TSHeader * | tsheader () |
| 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. | |
| PESPacket & | operator= (const PESPacket &pkt) |
Allows us to transform TS packets to PES packets, which are used to hold PSIP tables as well as multimedia streams.
Definition at line 25 of file pespacket.h.
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.
| 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().
Reimplemented in PSIPTable.
Definition at line 134 of file pespacket.h.
Referenced by FirewireDevice::ProcessPATPacket(), and PSIPTable::View().
Reimplemented in PSIPTable.
Definition at line 137 of file pespacket.h.
| static const PESPacket PESPacket::ViewData | ( | const unsigned char * | pesdata | ) | [inline, static] |
Definition at line 140 of file pespacket.h.
Referenced by AvFormatDecoder::HasVideo(), DVBStreamHandler::RunSR(), AvFormatDecoder::ScanATSCCaptionStreams(), AvFormatDecoder::ScanDSMCCStreams(), and AvFormatDecoder::ScanTeletextCaptions().
| bool PESPacket::IsClone | ( | ) | const [inline] |
Definition at line 143 of file pespacket.h.
Referenced by AddTSPacket(), and ~PESPacket().
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] |
Definition at line 150 of file pespacket.h.
Referenced by AddTSPacket(), MPEGStreamData::CreatePATSingleProgram(), MPEGStreamData::CreatePMTSingleProgram(), ATSCStreamData::DeleteCachedTable(), GetAsTSPackets(), PrintMPEGStreamListener::HandlePMT(), DTVRecorder::HandleSingleProgramPAT(), DTVRecorder::HandleSingleProgramPMT(), ProgramMapTable::toString(), and EventInformationTable::toString().
| TSHeader* PESPacket::tsheader | ( | ) | [inline] |
Definition at line 152 of file pespacket.h.
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] |
Definition at line 158 of file pespacket.h.
Referenced by MPEGStreamData::AssemblePSIP(), PSIPTable::TableID(), VerifyCRC(), and PSIPTable::VerifyPSIP().
| uint PESPacket::Length | ( | void | ) | const [inline] |
Definition at line 159 of file pespacket.h.
Referenced by AddTSPacket(), CalcCRC(), CRC(), GetAsTSPackets(), InitPESPacket(), ProgramMapTable::Parse(), DVBEventInformationTable::Parse(), ServiceDescriptionTable::Parse(), PESPacket(), PSIPTable::SectionLength(), SetCRC(), PSIPTable::toString(), PSIPTable::VerifyPSIP(), and PSIPTable::XMLValues().
| 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] |
Definition at line 231 of file pespacket.h.
Referenced by ProgramMapTable::CreateBlank(), PSIPTable::SetSectionLength(), and SetTotalLength().
| void PESPacket::SetTotalLength | ( | uint | len | ) | [inline] |
Definition at line 236 of file pespacket.h.
Referenced by ProgramMapTable::AppendStream(), ProgramMapTable::CreateBlank(), and ProgramAssociationTable::CreateBlank().
| void PESPacket::SetPSIOffset | ( | uint | offset | ) | [inline] |
Definition at line 243 of file pespacket.h.
Referenced by MPEGStreamData::AssemblePSIP().
| uint PESPacket::CRC | ( | void | ) | const [inline] |
Definition at line 249 of file pespacket.h.
Referenced by insert_crc(), ShortVirtualChannelTable::toString(), NetworkTextTable::toString(), SCTENetworkInformationTable::toString(), VerifyCRC(), and PSIPTable::VerifyPSIP().
| 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 |
Definition at line 145 of file pespacket.cpp.
Referenced by Finalize(), ServiceDescriptionTable::Mutate(), FirewireDevice::ProcessPATPacket(), VerifyCRC(), and PSIPTable::VerifyPSIP().
| bool PESPacket::VerifyCRC | ( | void | ) | const |
Definition at line 153 of file pespacket.cpp.
Referenced by AddTSPacket(), InitPESPacket(), ServiceDescriptionTable::Mutate(), and PESPacket().
| void PESPacket::Finalize | ( | ) | [inline, protected] |
Definition at line 276 of file pespacket.h.
unsigned char* PESPacket::_pesdata [protected] |
Pointer to PES data in full buffer.
Definition at line 278 of file pespacket.h.
Referenced by AddTSPacket(), CalcCRC(), CopyRight(), CRC(), DataAligned(), DTS(), GetAsTSPackets(), HasACI(), HasCRC(), HasDSM(), HasDTS(), HasESCR(), HasESR(), HasExtensionFlags(), HasPTS(), HighPriority(), InitPESPacket(), Length(), OriginalRecording(), pesdata(), PESPacket(), PTS(), ScramblingControl(), SetCRC(), SetLength(), SetPSIOffset(), SetStreamID(), StreamID(), PSIPTable::VerifyPSIP(), and ~PESPacket().
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().
uint PESPacket::_psiOffset [protected] |
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().
uint PESPacket::_pesdataSize [protected] |
Number of data bytes (TS header + PES data).
Definition at line 283 of file pespacket.h.
Referenced by AddTSPacket(), PESPacket(), and TSSizeInBuffer().
uint PESPacket::_allocSize [protected] |
Total number of bytes we allocated.
Definition at line 284 of file pespacket.h.
Referenced by AddTSPacket(), IsClone(), PESPacket(), and PSIPTable::VerifyPSIP().
bool PESPacket::_badPacket [protected] |
true if a CRC is not good yet
Definition at line 285 of file pespacket.h.
Referenced by AddTSPacket(), InitPESPacket(), IsGood(), and PESPacket().
1.6.3