vdr 2.8.3
cPatPmtGenerator Class Reference

#include <remux.h>

Public Member Functions

 cPatPmtGenerator (const cChannel *Channel=NULL)
void SetVersions (int PatVersion, int PmtVersion)
void SetPids (int Vpid, int Vtype, int Ppid, int Tpid, const int *Apids, const int *Atypes, const char Alangs[][MAXLANGCODE2], const int *Dpids, const int *Dtypes, const char Dlangs[][MAXLANGCODE2], const int *Spids, const uchar *Stypes, const char Slangs[][MAXLANGCODE2], const uint16_t *CompositionPageIds, const uint16_t *AncillaryPageIds)
void SetChannel (const cChannel *Channel)
uchar * GetPat (void)
uchar * GetPmt (int &Index)
int GetPatPmtSize (void)
int GetPatPmt (uchar *Dest, int Size)

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 (int Vpid, int Ppid, int Tpid, const int *Apids, const int *Dpids, const int *Spids)
void GeneratePat (void)

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
uchar * esInfoLength

Detailed Description

Definition at line 298 of file remux.h.

Constructor & Destructor Documentation

◆ cPatPmtGenerator()

cPatPmtGenerator::cPatPmtGenerator ( const cChannel * Channel = NULL)

Definition at line 367 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 486 of file remux.c.

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

Referenced by SetPids().

◆ GeneratePmtPid()

void cPatPmtGenerator::GeneratePmtPid ( int Vpid,
int Ppid,
int Tpid,
const int * Apids,
const int * Dpids,
const int * Spids )
protected

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

Definition at line 471 of file remux.c.

References MAXPID, P_PMT_PID, pmtPid, SETPID, and SETPIDS.

Referenced by SetPids().

◆ GetPat()

uchar * cPatPmtGenerator::GetPat ( void )

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

Definition at line 593 of file remux.c.

References IncCounter(), pat, and patCounter.

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

◆ GetPatPmt()

int cPatPmtGenerator::GetPatPmt ( uchar * Dest,
int Size )

Writes the PAT and all PMT packets to Dest.

Size must be the size of the memory available at Dest, and must be greater than GetPatPmtSize(). Returns the number of bytes written to Dest.

Definition at line 613 of file remux.c.

References GetPatPmtSize(), IncCounter(), numPmtPackets, pat, patCounter, pmt, pmtCounter, and TS_SIZE.

Referenced by cPes2TsConverter::ConvertPesFrame().

◆ GetPatPmtSize()

int cPatPmtGenerator::GetPatPmtSize ( void )

Returns the combined size of PAT and all PMT packets.

Definition at line 608 of file remux.c.

References numPmtPackets, and TS_SIZE.

Referenced by GetPatPmt().

◆ 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 if all packets of the PMT section have been fetched.

Definition at line 599 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 377 of file remux.c.

Referenced by GetPat(), GetPatPmt(), and GetPmt().

◆ IncEsInfoLength()

void cPatPmtGenerator::IncEsInfoLength ( int Length)
private

Definition at line 390 of file remux.c.

References esInfoLength.

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

◆ IncVersion()

void cPatPmtGenerator::IncVersion ( int & Version)
private

Definition at line 384 of file remux.c.

Referenced by GeneratePat(), and SetPids().

◆ MakeAC3Descriptor()

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

Definition at line 411 of file remux.c.

References IncEsInfoLength().

Referenced by SetPids().

◆ MakeCRC()

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

Definition at line 456 of file remux.c.

References SI::CRC32::crc32().

Referenced by GeneratePat(), and SetPids().

◆ MakeLanguageDescriptor()

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

Definition at line 437 of file remux.c.

References IncEsInfoLength(), and SI::ISO639LanguageDescriptorTag.

Referenced by SetPids().

◆ MakeStream()

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

Definition at line 399 of file remux.c.

References esInfoLength.

Referenced by SetPids().

◆ MakeSubtitlingDescriptor()

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

Definition at line 420 of file remux.c.

References IncEsInfoLength(), and SI::SubtitlingDescriptorTag.

Referenced by SetPids().

◆ SetChannel()

◆ SetPids()

void cPatPmtGenerator::SetPids ( int Vpid,
int Vtype,
int Ppid,
int Tpid,
const int * Apids,
const int * Atypes,
const char Alangs[][MAXLANGCODE2],
const int * Dpids,
const int * Dtypes,
const char Dlangs[][MAXLANGCODE2],
const int * Spids,
const uchar * Stypes,
const char Slangs[][MAXLANGCODE2],
const uint16_t * CompositionPageIds,
const uint16_t * AncillaryPageIds )

◆ 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 581 of file remux.c.

References patVersion, and pmtVersion.

Referenced by cRecorder::GetLastPts().

Member Data Documentation

◆ esInfoLength

uchar* cPatPmtGenerator::esInfoLength
private

Definition at line 308 of file remux.h.

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

◆ numPmtPackets

int cPatPmtGenerator::numPmtPackets
private

Definition at line 302 of file remux.h.

Referenced by cPatPmtGenerator(), GetPatPmt(), GetPatPmtSize(), GetPmt(), and SetPids().

◆ pat

uchar cPatPmtGenerator::pat[TS_SIZE]
private

Definition at line 300 of file remux.h.

Referenced by GeneratePat(), GetPat(), and GetPatPmt().

◆ patCounter

int cPatPmtGenerator::patCounter
private

Definition at line 303 of file remux.h.

Referenced by cPatPmtGenerator(), GetPat(), and GetPatPmt().

◆ patVersion

int cPatPmtGenerator::patVersion
private

Definition at line 305 of file remux.h.

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

◆ pmt

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

Definition at line 301 of file remux.h.

Referenced by GetPatPmt(), GetPmt(), and SetPids().

◆ pmtCounter

int cPatPmtGenerator::pmtCounter
private

Definition at line 304 of file remux.h.

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

◆ pmtPid

int cPatPmtGenerator::pmtPid
private

Definition at line 307 of file remux.h.

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

◆ pmtVersion

int cPatPmtGenerator::pmtVersion
private

Definition at line 306 of file remux.h.

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


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