vdr 2.7.2
cTsToPes Class Reference

#include <remux.h>

Public Member Functions

 cTsToPes (void)
 
 ~cTsToPes ()
 
void PutTs (const uchar *Data, int Length)
 
const ucharGetPes (int &Length)
 
void SetRepeatLast (void)
 
void Reset (void)
 

Private Attributes

uchardata
 
int size
 
int length
 
int offset
 
ucharlastData
 
int lastLength
 
bool repeatLast
 

Detailed Description

Definition at line 450 of file remux.h.

Constructor & Destructor Documentation

◆ cTsToPes()

cTsToPes::cTsToPes ( void )

Definition at line 1034 of file remux.c.

References data, Reset(), and size.

◆ ~cTsToPes()

cTsToPes::~cTsToPes ( )

Definition at line 1041 of file remux.c.

References data.

Member Function Documentation

◆ GetPes()

const uchar * cTsToPes::GetPes ( int & Length)

Gets a pointer to the complete PES packet, or NULL if the packet is not complete yet.

If the packet is complete, Length will contain the total packet length. The returned pointer is only valid until the next call to PutTs() or Reset(), or until this object is destroyed. Once GetPes() has returned a non-NULL value, it must be called repeatedly, and the data processed, until it returns NULL. This is because video packets may be larger than the data a single PES packet with an actual length field can hold, and are therefore split into several PES packets with smaller sizes. Note that for video data GetPes() may only be called if the next TS packet that will be given to PutTs() has the "payload start" flag set, because this is the only way to determine the end of a video PES packet.

Definition at line 1075 of file remux.c.

References data, lastData, lastLength, length, MAXPESLENGTH, min(), offset, PesHasLength(), PesLength(), PesLongEnough(), repeatLast, and Reset().

Referenced by cDevice::PlayTsAudio(), cDevice::PlayTsSubtitle(), cDevice::PlayTsVideo(), and cDevice::StillPicture().

◆ PutTs()

void cTsToPes::PutTs ( const uchar * Data,
int Length )

Puts the payload data of the single TS packet at Data into the converter.

Length is always TS_SIZE. If the given TS packet starts a new PES payload packet, the converter will be automatically reset. Any packets before the first one that starts a new PES payload packet will be ignored. Once a TS packet has been put into a cTsToPes converter, all subsequent packets until the next call to Reset() must belong to the same PID as the first packet. There is no check whether this actually is the case, so the caller is responsible for making sure this condition is met.

Definition at line 1046 of file remux.c.

References data, esyslog, KILOBYTE, length, max(), Reset(), size, TsError(), TsGetPayload(), and TsPayloadStart().

Referenced by cDevice::PlayTsAudio(), cDevice::PlayTsSubtitle(), cDevice::PlayTsVideo(), and cDevice::StillPicture().

◆ Reset()

void cTsToPes::Reset ( void )

Resets the converter.

This needs to be called after a PES packet has been fetched by a call to GetPes(), and before the next call to PutTs().

Definition at line 1128 of file remux.c.

References lastData, lastLength, length, offset, and repeatLast.

Referenced by cTsToPes(), GetPes(), cDevice::PlayTs(), cDevice::PlayTsAudio(), cDevice::PlayTsSubtitle(), cDevice::PlayTsVideo(), PutTs(), and cDevice::StillPicture().

◆ SetRepeatLast()

void cTsToPes::SetRepeatLast ( void )

Makes the next call to GetPes() return exactly the same data as the last one (provided there was no call to Reset() in the meantime).

Definition at line 1123 of file remux.c.

References repeatLast.

Referenced by cDevice::PlayTsAudio(), and cDevice::PlayTsVideo().

Member Data Documentation

◆ data

uchar* cTsToPes::data
private

Definition at line 452 of file remux.h.

Referenced by cTsToPes(), GetPes(), PutTs(), and ~cTsToPes().

◆ lastData

uchar* cTsToPes::lastData
private

Definition at line 456 of file remux.h.

Referenced by GetPes(), and Reset().

◆ lastLength

int cTsToPes::lastLength
private

Definition at line 457 of file remux.h.

Referenced by GetPes(), and Reset().

◆ length

int cTsToPes::length
private

Definition at line 454 of file remux.h.

Referenced by GetPes(), PutTs(), and Reset().

◆ offset

int cTsToPes::offset
private

Definition at line 455 of file remux.h.

Referenced by GetPes(), and Reset().

◆ repeatLast

bool cTsToPes::repeatLast
private

Definition at line 458 of file remux.h.

Referenced by GetPes(), Reset(), and SetRepeatLast().

◆ size

int cTsToPes::size
private

Definition at line 453 of file remux.h.

Referenced by cTsToPes(), and PutTs().


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