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

A PMT table maps a program described in the ProgramAssociationTable to various PID's which describe the multimedia contents of the program. More...

#include <mpegtables.h>

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

Public Member Functions

 ProgramMapTable (const ProgramMapTable &table)
 
 ProgramMapTable (const PSIPTable &table)
 
uint PCRPID (void) const
 stream that contains program clock reference. More...
 
uint ProgramNumber (void) const
 
uint ProgramInfoLength (void) const
 
const unsigned char * ProgramInfo (void) const
 
uint StreamType (uint i) const
 
uint StreamPID (uint i) const
 
uint StreamInfoLength (uint i) const
 
const unsigned char * StreamInfo (uint i) const
 
uint StreamCount (void) const
 
void SetPCRPID (uint pid)
 
void SetProgramNumber (uint num)
 
void SetStreamPID (uint i, uint pid)
 
void SetStreamType (uint i, uint type)
 
bool IsVideo (uint i, const QString &sistandard) const
 Returns true iff the stream at index i is a video stream. More...
 
bool IsAudio (uint i, const QString &sistandard) const
 Returns true iff the stream at index i is an audio stream. More...
 
bool IsEncrypted (const QString &sistandard) const
 Returns true iff PMT contains CA descriptor for a vid/aud stream. More...
 
bool IsProgramEncrypted (void) const
 Returns true iff PMT's ProgramInfo contains CA descriptor. More...
 
bool IsStreamEncrypted (uint pid) const
 Returns true iff PMT contains CA descriptor. More...
 
bool IsStillPicture (const QString &sistandard) const
 Returns true iff PMT contains a still-picture video stream. More...
 
QString StreamTypeString (uint i) const
 Returns a string representation of type at stream index i. More...
 
QString StreamDescription (uint i, const QString &sistandard) const
 Returns a better (and more expensive) string representation of type at stream index i than StreamTypeString(uint) More...
 
QString GetLanguage (uint i) const
 Returns the canonical language if we find the iso639 descriptor. More...
 
uint GetAudioType (uint i) const
 Returns the audio type from the iso 639 descriptor. More...
 
uint FindPIDs (uint type, vector< uint > &pids, const QString &sistandard) const
 Finds all pids matching type. More...
 
uint FindPIDs (uint type, vector< uint > &pids, vector< uint > &types, const QString &sistandard, bool normalize) const
 Finds all pids w/types, matching type (useful for AnyVideo/AnyAudio). More...
 
int FindPID (uint pid) const
 Locates stream index of pid. More...
 
uint FindUnusedPID (uint desired_pid=0x20)
 
void RemoveAllStreams (void)
 
void AppendStream (uint pid, uint type, unsigned char *streamInfo=nullptr, uint infoLength=0)
 
void Parse (void) const
 
QString toString (void) const override
 
QString toStringXML (uint indent_level) const override
 
- Public Member Functions inherited from PSIPTable
 PSIPTable (const TSPacket &tspacket, const unsigned char *pesdata, uint pes_size)
 
 PSIPTable (const unsigned char *pesdata)
 Constructor for viewing a section, does not create it's own data. More...
 
 PSIPTable (const PSIPTable &table)
 
 PSIPTable (const PESPacket &table)
 
 PSIPTable (const TSPacket &table)
 
uint TableID (void) const
 
bool SectionSyntaxIndicator (void) const
 
bool PrivateIndicator (void) const
 
uint SectionLength (void) const
 
uint TableIDExtension (void) const
 
uint Version (void) const
 
bool IsCurrent (void) const
 
uint Section (void) const
 
uint LastSection (void) const
 
uint ATSCProtocolVersion (void) const
 
const unsigned char * psipdata (void) const
 
unsigned char * psipdata (void)
 
void SetTableID (uint id)
 
void SetSectionLength (uint length)
 
void SetTableIDExtension (uint len)
 
void SetVersionNumber (uint ver)
 
void SetCurrent (bool cur)
 
void SetSection (uint num)
 
void SetLastSection (uint num)
 
void SetATSCProtocolVersion (int ver)
 
bool HasCRC (void) const override
 1 bit Cyclic Redundancy Check present More...
 
bool HasSectionNumber (void) const
 
bool VerifyPSIP (bool verify_crc) const
 
- Public Member Functions inherited from PESPacket
 PESPacket (const unsigned char *pesdata)
 
 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...
 
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
 

Static Public Member Functions

static const ProgramMapTable ViewData (const unsigned char *pesdata)
 
static ProgramMapTableCreate (uint programNumber, uint basepid, uint pcrpid, uint version, vector< uint > pids, vector< uint > types)
 
static ProgramMapTableCreate (uint programNumber, uint basepid, uint pcrpid, uint version, const desc_list_t &global_desc, const vector< uint > &pids, const vector< uint > &types, const vector< desc_list_t > &prog_desc)
 
- Static Public Member Functions inherited from PSIPTable
static const PSIPTable View (const TSPacket &tspacket)
 
static PSIPTable View (TSPacket &tspacket)
 
static const PSIPTable ViewData (const unsigned char *pesdata)
 

Private Member Functions

void SetStreamInfoLength (uint i, uint length)
 
void SetStreamProgramInfo (uint i, unsigned char *streamInfo, uint infoLength)
 
void SetProgramInfoLength (uint length)
 
void SetProgramInfo (unsigned char *streamInfo, uint infoLength)
 

Static Private Member Functions

static ProgramMapTableCreateBlank (bool smallPacket=true)
 

Private Attributes

vector< unsigned char * > _ptrs
 

Static Private Attributes

static const uint pmt_header = 4
 

Additional Inherited Members

- Static Public Attributes inherited from PSIPTable
static const uint PSIP_OFFSET = 8
 
- Protected Member Functions inherited from PSIPTable
 PSIPTable (const TSPacket &tspacket, bool)
 
QString XMLValues (uint indent_level) const
 
- Protected Member Functions inherited from PESPacket
 PESPacket ()
 noop constructor, only for use by derived classes More...
 
void Finalize ()
 
- Protected Attributes inherited from PESPacket
unsigned char * _pesdata
 Pointer to PES data in full buffer. More...
 
unsigned char * _fullbuffer
 Pointer to allocated data. More...
 
uint _psiOffset
 AFCOffset + StartOfFieldPointer. More...
 
uint _ccLast
 Continuity counter of last inserted TS Packet. More...
 
uint _pesdataSize
 Number of data bytes (TS header + PES data) More...
 
uint _allocSize
 Total number of bytes we allocated. More...
 
bool _badPacket
 true if a CRC is not good yet More...
 
- Static Protected Attributes inherited from PESPacket
static const uint kTheMagicNoCRCCRC = 0xFFFFFFFF
 

Detailed Description

A PMT table maps a program described in the ProgramAssociationTable to various PID's which describe the multimedia contents of the program.

Definition at line 656 of file mpegtables.h.

Constructor & Destructor Documentation

◆ ProgramMapTable() [1/2]

ProgramMapTable::ProgramMapTable ( const ProgramMapTable table)
inline

Definition at line 660 of file mpegtables.h.

Referenced by CreateBlank().

◆ ProgramMapTable() [2/2]

ProgramMapTable::ProgramMapTable ( const PSIPTable table)
inlineexplicit

Definition at line 666 of file mpegtables.h.

Member Function Documentation

◆ ViewData()

static const ProgramMapTable ProgramMapTable::ViewData ( const unsigned char *  pesdata)
inlinestatic

Definition at line 672 of file mpegtables.h.

◆ Create() [1/2]

ProgramMapTable * ProgramMapTable::Create ( uint  programNumber,
uint  basepid,
uint  pcrpid,
uint  version,
vector< uint pids,
vector< uint types 
)
static

◆ Create() [2/2]

ProgramMapTable * ProgramMapTable::Create ( uint  programNumber,
uint  basepid,
uint  pcrpid,
uint  version,
const desc_list_t global_desc,
const vector< uint > &  pids,
const vector< uint > &  types,
const vector< desc_list_t > &  prog_desc 
)
static

Definition at line 426 of file mpegtables.cpp.

◆ PCRPID()

uint ProgramMapTable::PCRPID ( void  ) const
inline

stream that contains program clock reference.

Definition at line 690 of file mpegtables.h.

Referenced by MPEGStreamData::CreatePMTSingleProgram(), DTVRecorder::HandleSingleProgramPMT(), MPEGStreamData::ProcessTSPacket(), toString(), and toStringXML().

◆ ProgramNumber()

uint ProgramMapTable::ProgramNumber ( void  ) const
inline

◆ ProgramInfoLength()

uint ProgramMapTable::ProgramInfoLength ( void  ) const
inline

◆ ProgramInfo()

const unsigned char* ProgramMapTable::ProgramInfo ( void  ) const
inline

◆ StreamType()

uint ProgramMapTable::StreamType ( uint  i) const
inline

◆ StreamPID()

uint ProgramMapTable::StreamPID ( uint  i) const
inline

◆ StreamInfoLength()

uint ProgramMapTable::StreamInfoLength ( uint  i) const
inline

◆ StreamInfo()

const unsigned char* ProgramMapTable::StreamInfo ( uint  i) const
inline

◆ StreamCount()

uint ProgramMapTable::StreamCount ( void  ) const
inline

◆ SetPCRPID()

void ProgramMapTable::SetPCRPID ( uint  pid)
inline

Definition at line 718 of file mpegtables.h.

◆ SetProgramNumber()

void ProgramMapTable::SetProgramNumber ( uint  num)
inline

Definition at line 724 of file mpegtables.h.

◆ SetStreamPID()

void ProgramMapTable::SetStreamPID ( uint  i,
uint  pid 
)
inline

Definition at line 726 of file mpegtables.h.

Referenced by AppendStream().

◆ SetStreamType()

void ProgramMapTable::SetStreamType ( uint  i,
uint  type 
)
inline

Definition at line 732 of file mpegtables.h.

Referenced by AppendStream().

◆ IsVideo()

bool ProgramMapTable::IsVideo ( uint  i,
const QString &  sistandard 
) const

Returns true iff the stream at index i is a video stream.

This of course returns true if StreamID::IsVideo() is true. And, it also returns true if IsVideo returns true after StreamID::Normalize() is used on the stream type.

Parameters
iindex of stream
sistandardstandard to use in determining if this is a A/V stream

Definition at line 514 of file mpegtables.cpp.

Referenced by FindPIDs(), DTVRecorder::HandlePMT(), DTVSignalMonitor::HandlePMT(), AvFormatDecoder::HasVideo(), IsEncrypted(), IsStillPicture(), AvFormatDecoder::ScanATSCCaptionStreams(), and MPEGStreamData::TestDecryption().

◆ IsAudio()

bool ProgramMapTable::IsAudio ( uint  i,
const QString &  sistandard 
) const

Returns true iff the stream at index i is an audio stream.

This of course returns true if StreamID::IsAudio() is true. And, it also returns true if IsAudio returns true after StreamID::Normalize() is used on the stream type.

Parameters
iindex of stream
sistandardstandard to use in determining if this is a A/V stream

Definition at line 536 of file mpegtables.cpp.

Referenced by FindPIDs(), DTVRecorder::HandlePMT(), DTVSignalMonitor::HandlePMT(), IsEncrypted(), and MPEGStreamData::TestDecryption().

◆ IsEncrypted()

bool ProgramMapTable::IsEncrypted ( const QString &  sistandard) const

Returns true iff PMT contains CA descriptor for a vid/aud stream.

Parameters
sistandardstandard to use in determining if this is a A/V stream

Definition at line 552 of file mpegtables.cpp.

Referenced by ChannelScanSM::GetChannelList(), DTVSignalMonitor::HandlePMT(), ChannelScanSM::HandlePMT(), and DVBRecorder::SetCAMPMT().

◆ IsProgramEncrypted()

bool ProgramMapTable::IsProgramEncrypted ( void  ) const

Returns true iff PMT's ProgramInfo contains CA descriptor.

Definition at line 568 of file mpegtables.cpp.

Referenced by IsEncrypted(), and MPEGStreamData::TestDecryption().

◆ IsStreamEncrypted()

bool ProgramMapTable::IsStreamEncrypted ( uint  i) const

Returns true iff PMT contains CA descriptor.

Parameters
iindex of stream

Definition at line 596 of file mpegtables.cpp.

Referenced by IsEncrypted(), and MPEGStreamData::TestDecryption().

◆ IsStillPicture()

bool ProgramMapTable::IsStillPicture ( const QString &  sistandard) const

Returns true iff PMT contains a still-picture video stream.

Definition at line 618 of file mpegtables.cpp.

◆ StreamTypeString()

QString ProgramMapTable::StreamTypeString ( uint  i) const
inline

Returns a string representation of type at stream index i.

Definition at line 744 of file mpegtables.h.

Referenced by toString(), and toStringXML().

◆ StreamDescription()

QString ProgramMapTable::StreamDescription ( uint  i,
const QString &  sistandard 
) const

Returns a better (and more expensive) string representation of type at stream index i than StreamTypeString(uint)

Definition at line 1154 of file mpegtables.cpp.

Referenced by CreateCAPMT().

◆ GetLanguage()

QString ProgramMapTable::GetLanguage ( uint  i) const

Returns the canonical language if we find the iso639 descriptor.

Definition at line 1115 of file mpegtables.cpp.

Referenced by StreamDescription().

◆ GetAudioType()

uint ProgramMapTable::GetAudioType ( uint  i) const

Returns the audio type from the iso 639 descriptor.

Definition at line 1131 of file mpegtables.cpp.

Referenced by AvFormatDecoder::GetAudioTrackType().

◆ FindPIDs() [1/2]

uint ProgramMapTable::FindPIDs ( uint  type,
vector< uint > &  pids,
const QString &  sistandard 
) const

Finds all pids matching type.

Parameters
typeStreamType to match
pidsvector pids will be added to
sistandardstandard to use in determining if this is a A/V stream
Returns
number of pids in list

Definition at line 642 of file mpegtables.cpp.

◆ FindPIDs() [2/2]

uint ProgramMapTable::FindPIDs ( uint  type,
vector< uint > &  pids,
vector< uint > &  types,
const QString &  sistandard,
bool  normalize 
) const

Finds all pids w/types, matching type (useful for AnyVideo/AnyAudio).

Parameters
typeStreamType to match
pidsvector pids will be added to
typesvector types will be added to
sistandardstandard to use in determining if this is a A/V stream
normalizeif set types will be normalized
Returns
number of items in pids and types lists.

Definition at line 678 of file mpegtables.cpp.

◆ FindPID()

int ProgramMapTable::FindPID ( uint  pid) const
inline

Locates stream index of pid.

Returns
stream index if successful, -1 otherwise

Definition at line 761 of file mpegtables.h.

Referenced by MPEGStreamData::CreatePMTSingleProgram(), FindPIDs(), FindUnusedPID(), and DTVRecorder::HandleSingleProgramPMT().

◆ FindUnusedPID()

uint ProgramMapTable::FindUnusedPID ( uint  desired_pid = 0x20)

Definition at line 731 of file mpegtables.cpp.

◆ RemoveAllStreams()

void ProgramMapTable::RemoveAllStreams ( void  )
inline

Definition at line 770 of file mpegtables.h.

◆ AppendStream()

void ProgramMapTable::AppendStream ( uint  pid,
uint  type,
unsigned char *  streamInfo = nullptr,
uint  infoLength = 0 
)

Definition at line 490 of file mpegtables.cpp.

◆ Parse()

void ProgramMapTable::Parse ( void  ) const

Definition at line 469 of file mpegtables.cpp.

Referenced by MPEGStreamData::CreatePMTSingleProgram().

◆ toString()

QString ProgramMapTable::toString ( void  ) const
overridevirtual

Reimplemented from PSIPTable.

Definition at line 873 of file mpegtables.cpp.

Referenced by MPEGStreamData::CreatePMTSingleProgram(), ChannelScanSM::HandlePMT(), and Parse().

◆ toStringXML()

QString ProgramMapTable::toStringXML ( uint  indent_level) const
overridevirtual

Reimplemented from PSIPTable.

Definition at line 908 of file mpegtables.cpp.

◆ SetStreamInfoLength()

void ProgramMapTable::SetStreamInfoLength ( uint  i,
uint  length 
)
inlineprivate

Definition at line 783 of file mpegtables.h.

◆ SetStreamProgramInfo()

void ProgramMapTable::SetStreamProgramInfo ( uint  i,
unsigned char *  streamInfo,
uint  infoLength 
)
inlineprivate

Definition at line 789 of file mpegtables.h.

Referenced by AppendStream().

◆ SetProgramInfoLength()

void ProgramMapTable::SetProgramInfoLength ( uint  length)
inlineprivate

Definition at line 796 of file mpegtables.h.

◆ SetProgramInfo()

void ProgramMapTable::SetProgramInfo ( unsigned char *  streamInfo,
uint  infoLength 
)
inlineprivate

Definition at line 802 of file mpegtables.h.

◆ CreateBlank()

ProgramMapTable * ProgramMapTable::CreateBlank ( bool  smallPacket = true)
staticprivate

Definition at line 381 of file mpegtables.cpp.

Referenced by Create().

Member Data Documentation

◆ pmt_header

const uint ProgramMapTable::pmt_header = 4
staticprivate

Definition at line 810 of file mpegtables.h.

Referenced by AppendStream(), and Parse().

◆ _ptrs

vector<unsigned char*> ProgramMapTable::_ptrs
mutableprivate

Definition at line 811 of file mpegtables.h.

Referenced by AppendStream(), and Parse().


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