MythTV
master
|
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>
Public Member Functions | |
PESPacket (const unsigned char *pesdata) | |
PESPacket (const std::vector< uint8_t > &pesdata) | |
PESPacket & | operator= (const PESPacket &pkt)=delete |
PESPacket (const PESPacket &pkt) | |
virtual | ~PESPacket () |
bool | IsClone () const |
bool | AddTSPacket (const TSPacket *tspacket, int cardid, bool &broken) |
bool | IsGood () const |
const TSHeader * | tsheader () const |
TSHeader * | tsheader () |
void | GetAsTSPackets (std::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 |
bool | VerifyCRC (int cardid, int pid) 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 |
Allows us to transform TS packets to PES packets, which are used to hold multimedia streams and very similar to PSIP tables.
Definition at line 26 of file pespacket.h.
|
protecteddefault |
noop constructor, only for use by derived classes
|
inlineexplicit |
Definition at line 34 of file pespacket.h.
|
inlineexplicit |
Definition at line 41 of file pespacket.h.
|
inline |
Definition at line 54 of file pespacket.h.
|
inlinevirtual |
Definition at line 75 of file pespacket.h.
|
inline |
Definition at line 84 of file pespacket.h.
Referenced by AddTSPacket().
Definition at line 19 of file pespacket.cpp.
Referenced by MPEGStreamData::AssemblePSIP().
|
inline |
Definition at line 89 of file pespacket.h.
Referenced by MPEGStreamData::AssemblePSIP(), and MPEGStreamData::HandleTSTables().
|
inline |
Definition at line 91 of file pespacket.h.
Referenced by AddTSPacket(), ProgramMapTable::Create(), MPEGStreamData::CreatePATSingleProgram(), MPEGStreamData::CreatePMTSingleProgram(), ATSCStreamData::DeleteCachedTable(), GetAsTSPackets(), DTVRecorder::HandleSingleProgramPAT(), DTVRecorder::HandleSingleProgramPMT(), EventInformationTable::toString(), and ProgramMapTable::toString().
|
inline |
Definition at line 93 of file pespacket.h.
Returns payload only PESPacket as series of TSPackets.
Definition at line 121 of file pespacket.cpp.
Referenced by DTVRecorder::HandleSingleProgramPAT(), and DTVRecorder::HandleSingleProgramPMT().
|
inline |
Definition at line 99 of file pespacket.h.
Referenced by MPEGStreamData::AssemblePSIP(), PSIPTable::TableID(), and VerifyCRC().
|
inline |
Definition at line 100 of file pespacket.h.
Referenced by AddTSPacket(), CalcCRC(), GetAsTSPackets(), ServiceDescriptionTable::Parse(), DVBEventInformationTable::Parse(), ShortVirtualChannelTable::Parse(), ProgramMapTable::Parse(), PSIPTable::SectionLength(), PSIPTable::toString(), PSIPTable::VerifyPSIP(), and PSIPTable::XMLValues().
|
inline |
Definition at line 104 of file pespacket.h.
|
inline |
1 bit Indicates if this is a high priority packet
Definition at line 107 of file pespacket.h.
|
inline |
1 bit Data alignment indicator (must be 0 for video)
Definition at line 109 of file pespacket.h.
|
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 114 of file pespacket.h.
|
inline |
1 bit Original Recording
Definition at line 116 of file pespacket.h.
|
inline |
1 bit Presentation Time Stamp field is present
Definition at line 119 of file pespacket.h.
|
inline |
1 bit Decoding Time Stamp field is present
Definition at line 121 of file pespacket.h.
|
inline |
1 bit Elementary Stream Clock Reference field is present
Definition at line 123 of file pespacket.h.
|
inline |
1 bit Elementary Stream Rate field is present
Definition at line 125 of file pespacket.h.
|
inline |
1 bit DSM field present (should always be false for broadcasts)
Definition at line 127 of file pespacket.h.
|
inline |
1 bit Additional Copy Info field is present
Definition at line 129 of file pespacket.h.
|
inlinevirtual |
1 bit Cyclic Redundancy Check present
Reimplemented in PSIPTable.
Definition at line 131 of file pespacket.h.
Referenced by PESPacket(), and VerifyCRC().
|
inline |
1 bit Extension flags are present
Definition at line 133 of file pespacket.h.
|
inline |
Presentation Time Stamp, present if HasPTS() is true.
Definition at line 136 of file pespacket.h.
|
inline |
Decode Time Stamp, present if HasDTS() is true.
Definition at line 147 of file pespacket.h.
|
inline |
Definition at line 162 of file pespacket.h.
Referenced by MPEGStreamData::AssemblePSIP().
|
inline |
Definition at line 163 of file pespacket.h.
Referenced by MPEGStreamData::AssemblePSIP().
|
inline |
Definition at line 165 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(), NetworkInformationTable::Parse(), ServiceDescriptionTable::Parse(), BouquetAssociationTable::Parse(), SCTENetworkInformationTable::Parse(), DVBEventInformationTable::Parse(), ShortVirtualChannelTable::Parse(), SpliceInformationTable::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().
|
inline |
Definition at line 166 of file pespacket.h.
|
inline |
Definition at line 168 of file pespacket.h.
Referenced by GetAsTSPackets().
|
inline |
Definition at line 169 of file pespacket.h.
|
inline |
Definition at line 171 of file pespacket.h.
Referenced by PSIPTable::SetTableID().
|
inline |
Definition at line 172 of file pespacket.h.
Referenced by ProgramAssociationTable::CreateBlank(), ProgramMapTable::CreateBlank(), and PSIPTable::SetSectionLength().
|
inline |
Definition at line 177 of file pespacket.h.
Referenced by ProgramMapTable::AppendStream(), ProgramAssociationTable::Create(), and ProgramMapTable::CreateBlank().
|
inline |
Definition at line 184 of file pespacket.h.
Referenced by MPEGStreamData::AssemblePSIP().
|
inline |
Definition at line 190 of file pespacket.h.
Referenced by insert_crc(), SCTENetworkInformationTable::toString(), NetworkTextTable::toString(), ShortVirtualChannelTable::toString(), VerifyCRC(), and PSIPTable::VerifyPSIP().
|
inline |
Definition at line 201 of file pespacket.h.
Referenced by NetworkInformationTable::Mutate(), and ServiceDescriptionTable::Mutate().
uint PESPacket::CalcCRC | ( | void | ) | const |
Definition at line 162 of file pespacket.cpp.
Referenced by NetworkInformationTable::Mutate(), ServiceDescriptionTable::Mutate(), FirewireDevice::ProcessPATPacket(), VerifyCRC(), and PSIPTable::VerifyPSIP().
bool PESPacket::VerifyCRC | ( | void | ) | const |
Definition at line 170 of file pespacket.cpp.
Referenced by AddTSPacket(), PSIPTable::InitPESPacket(), NetworkInformationTable::Mutate(), and ServiceDescriptionTable::Mutate().
bool PESPacket::VerifyCRC | ( | int | cardid, |
int | pid | ||
) | const |
Definition at line 183 of file pespacket.cpp.
|
inlineprotected |
Definition at line 218 of file pespacket.h.
Referenced by ProgramAssociationTable::Create(), and ProgramMapTable::Create().
|
protected |
Pointer to PES data in full buffer.
Definition at line 220 of file pespacket.h.
Referenced by AddTSPacket(), CalcCRC(), GetAsTSPackets(), PESPacket(), and PSIPTable::VerifyPSIP().
|
protected |
Pointer to allocated data.
Definition at line 221 of file pespacket.h.
Referenced by AddTSPacket(), GetAsTSPackets(), PESPacket(), PSIPTable::PSIPTable(), and PSIPTable::VerifyPSIP().
|
protected |
AFCOffset + StartOfFieldPointer.
Definition at line 223 of file pespacket.h.
Referenced by AddTSPacket(), and PSIPTable::PSIPTable().
|
protected |
Continuity counter of last inserted TS Packet.
Definition at line 224 of file pespacket.h.
Referenced by AddTSPacket().
|
protected |
Number of data bytes (TS header + PES data)
Definition at line 225 of file pespacket.h.
Referenced by AddTSPacket(), and PESPacket().
|
protected |
Total number of bytes we allocated.
Definition at line 226 of file pespacket.h.
Referenced by AddTSPacket(), and PSIPTable::VerifyPSIP().
true if a CRC is not good yet
Definition at line 227 of file pespacket.h.
Referenced by AddTSPacket().
|
staticprotected |
Definition at line 231 of file pespacket.h.
Referenced by CalcCRC().