vdr  2.2.0
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 435 of file remux.h.

Constructor & Destructor Documentation

cTsToPes::cTsToPes ( void  )

Definition at line 1018 of file remux.c.

cTsToPes::~cTsToPes ( )

Definition at line 1025 of file remux.c.

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

References MAXPESLENGTH, min(), PesHasLength(), PesLength(), and PesLongEnough().

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

References esyslog, KILOBYTE, max(), 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 1112 of file remux.c.

Referenced by cDevice::PlayTs(), cDevice::PlayTsAudio(), cDevice::PlayTsSubtitle(), cDevice::PlayTsVideo(), 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 1107 of file remux.c.

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

Member Data Documentation

uchar* cTsToPes::data
private

Definition at line 437 of file remux.h.

uchar* cTsToPes::lastData
private

Definition at line 441 of file remux.h.

int cTsToPes::lastLength
private

Definition at line 442 of file remux.h.

int cTsToPes::length
private

Definition at line 439 of file remux.h.

int cTsToPes::offset
private

Definition at line 440 of file remux.h.

bool cTsToPes::repeatLast
private

Definition at line 443 of file remux.h.

int cTsToPes::size
private

Definition at line 438 of file remux.h.


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