vdr 2.6.1
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
cPatPmtParser Class Reference

#include <remux.h>

Public Member Functions

 cPatPmtParser (bool UpdatePrimaryDevice=false)
 
void Reset (void)
 
void ParsePat (const uchar *Data, int Length)
 
void ParsePmt (const uchar *Data, int Length)
 
bool ParsePatPmt (const uchar *Data, int Length)
 
bool GetVersions (int &PatVersion, int &PmtVersion) const
 
bool IsPmtPid (int Pid) const
 
int Vpid (void) const
 
int Ppid (void) const
 
int Vtype (void) const
 
bool Completed (void)
 
const int * Apids (void) const
 
const int * Dpids (void) const
 
const int * Spids (void) const
 
int Apid (int i) const
 
int Dpid (int i) const
 
int Spid (int i) const
 
int Atype (int i) const
 
int Dtype (int i) const
 
const char * Alang (int i) const
 
const char * Dlang (int i) const
 
const char * Slang (int i) const
 
uchar SubtitlingType (int i) const
 
uint16_t CompositionPageId (int i) const
 
uint16_t AncillaryPageId (int i) const
 
 cPatPmtParser (bool UpdatePrimaryDevice=false)
 
void Reset (void)
 
void ParsePat (const uchar *Data, int Length)
 
void ParsePmt (const uchar *Data, int Length)
 
bool ParsePatPmt (const uchar *Data, int Length)
 
bool GetVersions (int &PatVersion, int &PmtVersion) const
 
bool IsPmtPid (int Pid) const
 
int Vpid (void) const
 
int Ppid (void) const
 
int Vtype (void) const
 
bool Completed (void)
 
const int * Apids (void) const
 
const int * Dpids (void) const
 
const int * Spids (void) const
 
int Apid (int i) const
 
int Dpid (int i) const
 
int Spid (int i) const
 
int Atype (int i) const
 
int Dtype (int i) const
 
const char * Alang (int i) const
 
const char * Dlang (int i) const
 
const char * Slang (int i) const
 
uchar SubtitlingType (int i) const
 
uint16_t CompositionPageId (int i) const
 
uint16_t AncillaryPageId (int i) const
 

Protected Member Functions

int SectionLength (const uchar *Data, int Length)
 
int SectionLength (const uchar *Data, int Length)
 

Private Attributes

uchar pmt [MAX_SECTION_SIZE]
 
int pmtSize
 
int patVersion
 
int pmtVersion
 
int pmtPids [MAX_PMT_PIDS+1]
 
int vpid
 
int ppid
 
int vtype
 
int apids [MAXAPIDS+1]
 
int atypes [MAXAPIDS+1]
 
char alangs [MAXAPIDS][MAXLANGCODE2]
 
int dpids [MAXDPIDS+1]
 
int dtypes [MAXDPIDS+1]
 
char dlangs [MAXDPIDS][MAXLANGCODE2]
 
int spids [MAXSPIDS+1]
 
char slangs [MAXSPIDS][MAXLANGCODE2]
 
uchar subtitlingTypes [MAXSPIDS]
 
uint16_t compositionPageIds [MAXSPIDS]
 
uint16_t ancillaryPageIds [MAXSPIDS]
 
bool updatePrimaryDevice
 
bool completed
 

Detailed Description

Definition at line 353 of file include/vdr/remux.h.

Constructor & Destructor Documentation

◆ cPatPmtParser() [1/2]

cPatPmtParser::cPatPmtParser ( bool  UpdatePrimaryDevice = false)

Definition at line 611 of file remux.c.

References Reset(), and updatePrimaryDevice.

◆ cPatPmtParser() [2/2]

cPatPmtParser::cPatPmtParser ( bool  UpdatePrimaryDevice = false)

Member Function Documentation

◆ Alang() [1/2]

const char * cPatPmtParser::Alang ( int  i) const
inline

Definition at line 422 of file include/vdr/remux.h.

References alangs, and MAXAPIDS.

◆ Alang() [2/2]

const char * cPatPmtParser::Alang ( int  i) const
inline

Definition at line 422 of file remux.h.

References alangs, and MAXAPIDS.

◆ AncillaryPageId() [1/2]

uint16_t cPatPmtParser::AncillaryPageId ( int  i) const
inline

Definition at line 427 of file include/vdr/remux.h.

References ancillaryPageIds, and MAXSPIDS.

◆ AncillaryPageId() [2/2]

uint16_t cPatPmtParser::AncillaryPageId ( int  i) const
inline

Definition at line 427 of file remux.h.

References ancillaryPageIds, and MAXSPIDS.

◆ Apid() [1/2]

int cPatPmtParser::Apid ( int  i) const
inline

Definition at line 417 of file include/vdr/remux.h.

References apids, and MAXAPIDS.

Referenced by cIndexFileGenerator::Action(), and cDvbHdFfDevice::PlayTsAudio().

◆ Apid() [2/2]

int cPatPmtParser::Apid ( int  i) const
inline

Definition at line 417 of file remux.h.

References apids, and MAXAPIDS.

◆ Apids() [1/2]

const int * cPatPmtParser::Apids ( void  ) const
inline

Definition at line 414 of file include/vdr/remux.h.

References apids.

◆ Apids() [2/2]

const int * cPatPmtParser::Apids ( void  ) const
inline

Definition at line 414 of file remux.h.

References apids.

◆ Atype() [1/2]

int cPatPmtParser::Atype ( int  i) const
inline

Definition at line 420 of file include/vdr/remux.h.

References atypes, and MAXAPIDS.

Referenced by cIndexFileGenerator::Action(), and cDvbHdFfDevice::PlayTsAudio().

◆ Atype() [2/2]

int cPatPmtParser::Atype ( int  i) const
inline

Definition at line 420 of file remux.h.

References atypes, and MAXAPIDS.

◆ Completed() [1/2]

bool cPatPmtParser::Completed ( void  )
inline

Returns true if the PMT has been completely parsed.

Definition at line 412 of file include/vdr/remux.h.

References completed.

Referenced by cIndexFileGenerator::Action().

◆ Completed() [2/2]

bool cPatPmtParser::Completed ( void  )
inline

Returns true if the PMT has been completely parsed.

Definition at line 412 of file remux.h.

References completed.

◆ CompositionPageId() [1/2]

uint16_t cPatPmtParser::CompositionPageId ( int  i) const
inline

Definition at line 426 of file include/vdr/remux.h.

References compositionPageIds, and MAXSPIDS.

◆ CompositionPageId() [2/2]

uint16_t cPatPmtParser::CompositionPageId ( int  i) const
inline

Definition at line 426 of file remux.h.

References compositionPageIds, and MAXSPIDS.

◆ Dlang() [1/2]

const char * cPatPmtParser::Dlang ( int  i) const
inline

Definition at line 423 of file include/vdr/remux.h.

References dlangs, and MAXDPIDS.

◆ Dlang() [2/2]

const char * cPatPmtParser::Dlang ( int  i) const
inline

Definition at line 423 of file remux.h.

References dlangs, and MAXDPIDS.

◆ Dpid() [1/2]

int cPatPmtParser::Dpid ( int  i) const
inline

Definition at line 418 of file include/vdr/remux.h.

References dpids, and MAXDPIDS.

Referenced by cDvbHdFfDevice::PlayTsAudio().

◆ Dpid() [2/2]

int cPatPmtParser::Dpid ( int  i) const
inline

Definition at line 418 of file remux.h.

References dpids, and MAXDPIDS.

◆ Dpids() [1/2]

const int * cPatPmtParser::Dpids ( void  ) const
inline

Definition at line 415 of file include/vdr/remux.h.

References dpids.

◆ Dpids() [2/2]

const int * cPatPmtParser::Dpids ( void  ) const
inline

Definition at line 415 of file remux.h.

References dpids.

◆ Dtype() [1/2]

int cPatPmtParser::Dtype ( int  i) const
inline

Definition at line 421 of file include/vdr/remux.h.

References dtypes, and MAXDPIDS.

Referenced by cDvbHdFfDevice::PlayTsAudio().

◆ Dtype() [2/2]

int cPatPmtParser::Dtype ( int  i) const
inline

Definition at line 421 of file remux.h.

References dtypes, and MAXDPIDS.

◆ GetVersions() [1/2]

bool cPatPmtParser::GetVersions ( int &  PatVersion,
int &  PmtVersion 
) const

Returns true if a valid PAT/PMT has been parsed and stores the current version numbers in the given variables.

Definition at line 938 of file remux.c.

References patVersion, and pmtVersion.

Referenced by cFileName::GetLastPatPmtVersions().

◆ GetVersions() [2/2]

bool cPatPmtParser::GetVersions ( int &  PatVersion,
int &  PmtVersion 
) const

Returns true if a valid PAT/PMT has been parsed and stores the current version numbers in the given variables.

◆ IsPmtPid() [1/2]

bool cPatPmtParser::IsPmtPid ( int  Pid) const
inline

Returns true if Pid the one of the PMT pids as defined by the current PAT.

If no PAT has been received yet, false will be returned.

Definition at line 400 of file include/vdr/remux.h.

References pmtPids.

Referenced by cIndexFileGenerator::Action(), cCuttingThread::FixFrame(), cFileName::GetLastPatPmtVersions(), cCuttingThread::GetPendingPackets(), ParsePatPmt(), cDevice::PlayTs(), and cDevice::StillPicture().

◆ IsPmtPid() [2/2]

bool cPatPmtParser::IsPmtPid ( int  Pid) const
inline

Returns true if Pid the one of the PMT pids as defined by the current PAT.

If no PAT has been received yet, false will be returned.

Definition at line 400 of file remux.h.

References pmtPids.

◆ ParsePat() [1/2]

void cPatPmtParser::ParsePat ( const uchar Data,
int  Length 
)

◆ ParsePat() [2/2]

void cPatPmtParser::ParsePat ( const uchar Data,
int  Length 
)

Parses the PAT data from the single TS packet in Data.

Length is always TS_SIZE.

◆ ParsePatPmt() [1/2]

bool cPatPmtParser::ParsePatPmt ( const uchar Data,
int  Length 
)

Parses the given Data (which may consist of several TS packets, typically an entire frame) and extracts the PAT and PMT.

Returns true if a valid PAT/PMT has been detected.

Definition at line 919 of file remux.c.

References IsPmtPid(), ParsePat(), ParsePmt(), PATPID, patVersion, pmtVersion, TS_SIZE, TS_SYNC_BYTE, and TsPid().

Referenced by cCuttingThread::FixFrame().

◆ ParsePatPmt() [2/2]

bool cPatPmtParser::ParsePatPmt ( const uchar Data,
int  Length 
)

Parses the given Data (which may consist of several TS packets, typically an entire frame) and extracts the PAT and PMT.

Returns true if a valid PAT/PMT has been detected.

◆ ParsePmt() [1/2]

void cPatPmtParser::ParsePmt ( const uchar Data,
int  Length 
)

Parses the PMT data from the single TS packet in Data.

Length is always TS_SIZE. The PMT may consist of several TS packets, which are delivered to the parser through several subsequent calls to ParsePmt(). The whole PMT data will be processed once the last packet has been received.

Definition at line 659 of file remux.c.

References SI::AC3DescriptorTag, alangs, ancillaryPageIds, apids, atypes, SI::CRCSection::CheckCRCAndParse(), cDevice::ClrAvailableTracks(), completed, compositionPageIds, dbgpatpmt, dlangs, dpids, dtypes, SI::EnhancedAC3DescriptorTag, cDevice::EnsureAudioTrack(), cDevice::EnsureSubtitleTrack(), esyslog, SI::SubtitlingDescriptor::Subtitling::getAncillaryPageId(), SI::SubtitlingDescriptor::Subtitling::getCompositionPageId(), SI::NumberedSection::getCurrentNextIndicator(), SI::Descriptor::getDescriptorTag(), SI::NumberedSection::getLastSectionNumber(), SI::DescriptorLoop::getNext(), SI::PMT::getPCRPid(), SI::PMT::Stream::getPid(), SI::NumberedSection::getSectionNumber(), SI::PMT::getServiceId(), SI::PMT::Stream::getStreamType(), SI::SubtitlingDescriptor::Subtitling::getSubtitlingType(), SI::NumberedSection::getVersionNumber(), I18nNormalizeLanguageCode(), SI::ISO639LanguageDescriptorTag, SI::SubtitlingDescriptor::Subtitling::languageCode, SI::ISO639LanguageDescriptor::languageCode, SI::ISO639LanguageDescriptor::Language::languageCode, SI::ISO639LanguageDescriptor::languageLoop, MAXAPIDS, MAXDPIDS, MAXLANGCODE1, MAXSPIDS, pmt, pmtSize, pmtVersion, ppid, cDevice::PrimaryDevice(), SectionLength(), cDevice::SetAvailableTrack(), Setup, slangs, spids, SI::PMT::Stream::streamDescriptors, SI::PMT::streamLoop, strn0cpy(), SI::SubtitlingDescriptorTag, SI::SubtitlingDescriptor::subtitlingLoop, subtitlingTypes, TsPayloadOffset(), TsPayloadStart(), ttAudio, ttDolby, ttSubtitle, updatePrimaryDevice, cSetup::UseDolbyDigital, vpid, and vtype.

Referenced by cIndexFileGenerator::Action(), cFileName::GetLastPatPmtVersions(), ParsePatPmt(), cDevice::PlayTs(), and cDevice::StillPicture().

◆ ParsePmt() [2/2]

void cPatPmtParser::ParsePmt ( const uchar Data,
int  Length 
)

Parses the PMT data from the single TS packet in Data.

Length is always TS_SIZE. The PMT may consist of several TS packets, which are delivered to the parser through several subsequent calls to ParsePmt(). The whole PMT data will be processed once the last packet has been received.

◆ Ppid() [1/2]

int cPatPmtParser::Ppid ( void  ) const
inline

Returns the PCR pid as defined by the current PMT, or 0 if no PCR pid has been detected, yet.

Definition at line 406 of file include/vdr/remux.h.

References ppid.

Referenced by cDevice::PlayTs().

◆ Ppid() [2/2]

int cPatPmtParser::Ppid ( void  ) const
inline

Returns the PCR pid as defined by the current PMT, or 0 if no PCR pid has been detected, yet.

Definition at line 406 of file remux.h.

References ppid.

◆ Reset() [1/2]

void cPatPmtParser::Reset ( void  )

Resets the parser.

This function must be called whenever a new stream is parsed.

Definition at line 617 of file remux.c.

References completed, patVersion, pmtPids, pmtSize, pmtVersion, ppid, vpid, and vtype.

Referenced by cDevice::AttachPlayer(), cPatPmtParser(), and cDevice::Detach().

◆ Reset() [2/2]

void cPatPmtParser::Reset ( void  )

Resets the parser.

This function must be called whenever a new stream is parsed.

◆ SectionLength() [1/2]

int cPatPmtParser::SectionLength ( const uchar Data,
int  Length 
)
inlineprotected

Definition at line 377 of file include/vdr/remux.h.

Referenced by ParsePmt().

◆ SectionLength() [2/2]

int cPatPmtParser::SectionLength ( const uchar Data,
int  Length 
)
inlineprotected

Definition at line 377 of file remux.h.

◆ Slang() [1/2]

const char * cPatPmtParser::Slang ( int  i) const
inline

Definition at line 424 of file include/vdr/remux.h.

References MAXSPIDS, and slangs.

◆ Slang() [2/2]

const char * cPatPmtParser::Slang ( int  i) const
inline

Definition at line 424 of file remux.h.

References MAXSPIDS, and slangs.

◆ Spid() [1/2]

int cPatPmtParser::Spid ( int  i) const
inline

Definition at line 419 of file include/vdr/remux.h.

References MAXSPIDS, and spids.

◆ Spid() [2/2]

int cPatPmtParser::Spid ( int  i) const
inline

Definition at line 419 of file remux.h.

References MAXSPIDS, and spids.

◆ Spids() [1/2]

const int * cPatPmtParser::Spids ( void  ) const
inline

Definition at line 416 of file include/vdr/remux.h.

References spids.

◆ Spids() [2/2]

const int * cPatPmtParser::Spids ( void  ) const
inline

Definition at line 416 of file remux.h.

References spids.

◆ SubtitlingType() [1/2]

uchar cPatPmtParser::SubtitlingType ( int  i) const
inline

Definition at line 425 of file include/vdr/remux.h.

References MAXSPIDS, and subtitlingTypes.

◆ SubtitlingType() [2/2]

uchar cPatPmtParser::SubtitlingType ( int  i) const
inline

Definition at line 425 of file remux.h.

References MAXSPIDS, and subtitlingTypes.

◆ Vpid() [1/2]

int cPatPmtParser::Vpid ( void  ) const
inline

Returns the video pid as defined by the current PMT, or 0 if no video pid has been detected, yet.

Definition at line 403 of file include/vdr/remux.h.

References vpid.

Referenced by cIndexFileGenerator::Action(), cCuttingThread::FixFrame(), cCuttingThread::GetPendingPackets(), cDevice::PlayTs(), and cDevice::StillPicture().

◆ Vpid() [2/2]

int cPatPmtParser::Vpid ( void  ) const
inline

Returns the video pid as defined by the current PMT, or 0 if no video pid has been detected, yet.

Definition at line 403 of file remux.h.

References vpid.

◆ Vtype() [1/2]

int cPatPmtParser::Vtype ( void  ) const
inline

Returns the video stream type as defined by the current PMT, or 0 if no video stream type has been detected, yet.

Definition at line 409 of file include/vdr/remux.h.

References vtype.

Referenced by cIndexFileGenerator::Action(), and cCuttingThread::FixFrame().

◆ Vtype() [2/2]

int cPatPmtParser::Vtype ( void  ) const
inline

Returns the video stream type as defined by the current PMT, or 0 if no video stream type has been detected, yet.

Definition at line 409 of file remux.h.

References vtype.

Member Data Documentation

◆ alangs

char cPatPmtParser::alangs
private

Definition at line 365 of file include/vdr/remux.h.

Referenced by Alang(), and ParsePmt().

◆ ancillaryPageIds

uint16_t cPatPmtParser::ancillaryPageIds
private

Definition at line 373 of file include/vdr/remux.h.

Referenced by AncillaryPageId(), and ParsePmt().

◆ apids

int cPatPmtParser::apids
private

Definition at line 363 of file include/vdr/remux.h.

Referenced by Apid(), Apids(), and ParsePmt().

◆ atypes

int cPatPmtParser::atypes
private

Definition at line 364 of file include/vdr/remux.h.

Referenced by Atype(), and ParsePmt().

◆ completed

bool cPatPmtParser::completed
private

Definition at line 375 of file include/vdr/remux.h.

Referenced by Completed(), ParsePmt(), and Reset().

◆ compositionPageIds

uint16_t cPatPmtParser::compositionPageIds
private

Definition at line 372 of file include/vdr/remux.h.

Referenced by CompositionPageId(), and ParsePmt().

◆ dlangs

char cPatPmtParser::dlangs
private

Definition at line 368 of file include/vdr/remux.h.

Referenced by Dlang(), and ParsePmt().

◆ dpids

int cPatPmtParser::dpids
private

Definition at line 366 of file include/vdr/remux.h.

Referenced by Dpid(), Dpids(), and ParsePmt().

◆ dtypes

int cPatPmtParser::dtypes
private

Definition at line 367 of file include/vdr/remux.h.

Referenced by Dtype(), and ParsePmt().

◆ patVersion

int cPatPmtParser::patVersion
private

Definition at line 357 of file include/vdr/remux.h.

Referenced by GetVersions(), ParsePat(), ParsePatPmt(), and Reset().

◆ pmt

uchar cPatPmtParser::pmt
private

Definition at line 355 of file include/vdr/remux.h.

Referenced by ParsePmt().

◆ pmtPids

int cPatPmtParser::pmtPids
private

Definition at line 359 of file include/vdr/remux.h.

Referenced by IsPmtPid(), ParsePat(), and Reset().

◆ pmtSize

int cPatPmtParser::pmtSize
private

Definition at line 356 of file include/vdr/remux.h.

Referenced by ParsePmt(), and Reset().

◆ pmtVersion

int cPatPmtParser::pmtVersion
private

Definition at line 358 of file include/vdr/remux.h.

Referenced by GetVersions(), ParsePatPmt(), ParsePmt(), and Reset().

◆ ppid

int cPatPmtParser::ppid
private

Definition at line 361 of file include/vdr/remux.h.

Referenced by ParsePmt(), Ppid(), and Reset().

◆ slangs

char cPatPmtParser::slangs
private

Definition at line 370 of file include/vdr/remux.h.

Referenced by ParsePmt(), and Slang().

◆ spids

int cPatPmtParser::spids
private

Definition at line 369 of file include/vdr/remux.h.

Referenced by ParsePmt(), Spid(), and Spids().

◆ subtitlingTypes

uchar cPatPmtParser::subtitlingTypes
private

Definition at line 371 of file include/vdr/remux.h.

Referenced by ParsePmt(), and SubtitlingType().

◆ updatePrimaryDevice

bool cPatPmtParser::updatePrimaryDevice
private

Definition at line 374 of file include/vdr/remux.h.

Referenced by cPatPmtParser(), and ParsePmt().

◆ vpid

int cPatPmtParser::vpid
private

Definition at line 360 of file include/vdr/remux.h.

Referenced by ParsePmt(), Reset(), and Vpid().

◆ vtype

int cPatPmtParser::vtype
private

Definition at line 362 of file include/vdr/remux.h.

Referenced by ParsePmt(), Reset(), and Vtype().


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