vdr  2.4.1
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
cPatPmtGenerator Class Reference

#include <remux.h>

Public Member Functions

 cPatPmtGenerator (const cChannel *Channel=NULL)
 
void SetVersions (int PatVersion, int PmtVersion)
 
void SetChannel (const cChannel *Channel)
 
ucharGetPat (void)
 
ucharGetPmt (int &Index)
 

Protected Member Functions

int MakeStream (uchar *Target, uchar Type, int Pid)
 
int MakeAC3Descriptor (uchar *Target, uchar Type)
 
int MakeSubtitlingDescriptor (uchar *Target, const char *Language, uchar SubtitlingType, uint16_t CompositionPageId, uint16_t AncillaryPageId)
 
int MakeLanguageDescriptor (uchar *Target, const char *Language)
 
int MakeCRC (uchar *Target, const uchar *Data, int Length)
 
void GeneratePmtPid (const cChannel *Channel)
 
void GeneratePat (void)
 
void GeneratePmt (const cChannel *Channel)
 

Private Member Functions

void IncCounter (int &Counter, uchar *TsPacket)
 
void IncVersion (int &Version)
 
void IncEsInfoLength (int Length)
 

Private Attributes

uchar pat [TS_SIZE]
 
uchar pmt [MAX_PMT_TS][TS_SIZE]
 
int numPmtPackets
 
int patCounter
 
int pmtCounter
 
int patVersion
 
int pmtVersion
 
int pmtPid
 
ucharesInfoLength
 

Detailed Description

Definition at line 304 of file remux.h.

Constructor & Destructor Documentation

◆ cPatPmtGenerator()

cPatPmtGenerator::cPatPmtGenerator ( const cChannel Channel = NULL)

Definition at line 397 of file remux.c.

References esInfoLength, numPmtPackets, patCounter, patVersion, pmtCounter, pmtPid, pmtVersion, and SetChannel().

Member Function Documentation

◆ GeneratePat()

void cPatPmtGenerator::GeneratePat ( void  )
protected

Generates a PAT section for later use with GetPat().

Definition at line 517 of file remux.c.

References IncVersion(), MakeCRC(), P_TSID, pat, PATPID, patVersion, pmtPid, TS_PAYLOAD_START, and TS_SYNC_BYTE.

Referenced by SetChannel().

◆ GeneratePmt()

void cPatPmtGenerator::GeneratePmt ( const cChannel Channel)
protected

◆ GeneratePmtPid()

void cPatPmtGenerator::GeneratePmtPid ( const cChannel Channel)
protected

Generates a PMT pid that doesn't collide with any of the actual pids of the Channel.

Definition at line 502 of file remux.c.

References cChannel::Apids(), cChannel::Dpids(), MAXPID, P_PMT_PID, pmtPid, cChannel::Ppid(), SETPID, SETPIDS, cChannel::Spids(), cChannel::Tpid(), and cChannel::Vpid().

Referenced by SetChannel().

◆ GetPat()

uchar * cPatPmtGenerator::GetPat ( void  )

Returns a pointer to the PAT section, which consists of exactly one TS packet.

Definition at line 630 of file remux.c.

References IncCounter(), pat, and patCounter.

Referenced by cRecorder::Action(), and cTransfer::Activate().

◆ GetPmt()

uchar * cPatPmtGenerator::GetPmt ( int &  Index)

Returns a pointer to the Index'th TS packet of the PMT section.

Index must be initialized to 0 and will be incremented by each call to GetPmt(). Returns NULL is all packets of the PMT section have been fetched..

Definition at line 636 of file remux.c.

References IncCounter(), numPmtPackets, pmt, and pmtCounter.

Referenced by cRecorder::Action(), and cTransfer::Activate().

◆ IncCounter()

void cPatPmtGenerator::IncCounter ( int &  Counter,
uchar TsPacket 
)
private

Definition at line 407 of file remux.c.

Referenced by GetPat(), and GetPmt().

◆ IncEsInfoLength()

void cPatPmtGenerator::IncEsInfoLength ( int  Length)
private

Definition at line 420 of file remux.c.

References esInfoLength.

Referenced by MakeAC3Descriptor(), MakeLanguageDescriptor(), and MakeSubtitlingDescriptor().

◆ IncVersion()

void cPatPmtGenerator::IncVersion ( int &  Version)
private

Definition at line 414 of file remux.c.

Referenced by GeneratePat(), and GeneratePmt().

◆ MakeAC3Descriptor()

int cPatPmtGenerator::MakeAC3Descriptor ( uchar Target,
uchar  Type 
)
protected

Definition at line 441 of file remux.c.

References IncEsInfoLength().

Referenced by GeneratePmt().

◆ MakeCRC()

int cPatPmtGenerator::MakeCRC ( uchar Target,
const uchar Data,
int  Length 
)
protected

Definition at line 487 of file remux.c.

References SI::CRC32::crc32().

Referenced by GeneratePat(), and GeneratePmt().

◆ MakeLanguageDescriptor()

int cPatPmtGenerator::MakeLanguageDescriptor ( uchar Target,
const char *  Language 
)
protected

Definition at line 468 of file remux.c.

References IncEsInfoLength(), and SI::ISO639LanguageDescriptorTag.

Referenced by GeneratePmt().

◆ MakeStream()

int cPatPmtGenerator::MakeStream ( uchar Target,
uchar  Type,
int  Pid 
)
protected

Definition at line 429 of file remux.c.

References esInfoLength.

Referenced by GeneratePmt().

◆ MakeSubtitlingDescriptor()

int cPatPmtGenerator::MakeSubtitlingDescriptor ( uchar Target,
const char *  Language,
uchar  SubtitlingType,
uint16_t  CompositionPageId,
uint16_t  AncillaryPageId 
)
protected

Definition at line 451 of file remux.c.

References IncEsInfoLength(), and SI::SubtitlingDescriptorTag.

Referenced by GeneratePmt().

◆ SetChannel()

void cPatPmtGenerator::SetChannel ( const cChannel Channel)

Sets the Channel for which the PAT/PMT shall be generated.

Definition at line 621 of file remux.c.

References GeneratePat(), GeneratePmt(), and GeneratePmtPid().

Referenced by cPatPmtGenerator(), cRecorder::cRecorder(), and cTransfer::cTransfer().

◆ SetVersions()

void cPatPmtGenerator::SetVersions ( int  PatVersion,
int  PmtVersion 
)

Sets the version numbers for the generated PAT and PMT, in case this generator is used to, e.g., continue a previously interrupted recording (in which case the numbers given should be derived from the PAT/PMT versions last used in the existing recording, incremented by 1.

If the given numbers exceed the allowed range of 0..31, the higher bits will automatically be cleared. SetVersions() needs to be called before SetChannel() in order to have an effect from the very start.

Definition at line 615 of file remux.c.

References patVersion, and pmtVersion.

Referenced by cRecorder::cRecorder().

Member Data Documentation

◆ esInfoLength

uchar* cPatPmtGenerator::esInfoLength
private

Definition at line 314 of file remux.h.

Referenced by cPatPmtGenerator(), IncEsInfoLength(), and MakeStream().

◆ numPmtPackets

int cPatPmtGenerator::numPmtPackets
private

Definition at line 308 of file remux.h.

Referenced by cPatPmtGenerator(), GeneratePmt(), and GetPmt().

◆ pat

uchar cPatPmtGenerator::pat[TS_SIZE]
private

Definition at line 306 of file remux.h.

Referenced by GeneratePat(), and GetPat().

◆ patCounter

int cPatPmtGenerator::patCounter
private

Definition at line 309 of file remux.h.

Referenced by cPatPmtGenerator(), and GetPat().

◆ patVersion

int cPatPmtGenerator::patVersion
private

Definition at line 311 of file remux.h.

Referenced by cPatPmtGenerator(), GeneratePat(), and SetVersions().

◆ pmt

uchar cPatPmtGenerator::pmt[MAX_PMT_TS][TS_SIZE]
private

Definition at line 307 of file remux.h.

Referenced by GeneratePmt(), and GetPmt().

◆ pmtCounter

int cPatPmtGenerator::pmtCounter
private

Definition at line 310 of file remux.h.

Referenced by cPatPmtGenerator(), and GetPmt().

◆ pmtPid

int cPatPmtGenerator::pmtPid
private

Definition at line 313 of file remux.h.

Referenced by cPatPmtGenerator(), GeneratePat(), GeneratePmt(), and GeneratePmtPid().

◆ pmtVersion

int cPatPmtGenerator::pmtVersion
private

Definition at line 312 of file remux.h.

Referenced by cPatPmtGenerator(), GeneratePmt(), and SetVersions().


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