vdr  2.0.4
Public Member Functions | Private Attributes | List of all members
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 427 of file remux.h.

Constructor & Destructor Documentation

cTsToPes::cTsToPes ( void  )

Definition at line 954 of file remux.c.

References data, Reset(), and size.

cTsToPes::~cTsToPes ( )

Definition at line 961 of file remux.c.

References data.

Member Function Documentation

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

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

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

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

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

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

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 1048 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().

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

References repeatLast.

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

Member Data Documentation

uchar* cTsToPes::data
private

Definition at line 429 of file remux.h.

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

uchar* cTsToPes::lastData
private

Definition at line 433 of file remux.h.

Referenced by GetPes(), and Reset().

int cTsToPes::lastLength
private

Definition at line 434 of file remux.h.

Referenced by GetPes(), and Reset().

int cTsToPes::length
private

Definition at line 431 of file remux.h.

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

int cTsToPes::offset
private

Definition at line 432 of file remux.h.

Referenced by GetPes(), and Reset().

bool cTsToPes::repeatLast
private

Definition at line 435 of file remux.h.

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

int cTsToPes::size
private

Definition at line 430 of file remux.h.

Referenced by cTsToPes(), and PutTs().


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