vdr  1.7.27
Public Member Functions | Private Attributes
cTsToPes Class Reference

#include <remux.h>

List of all members.

Public Member Functions

 cTsToPes (void)
 ~cTsToPes ()
void PutTs (const uchar *Data, int Length)
const ucharGetPes (int &Length)
void SetRepeatLast (void)
void Reset (void)
 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 295 of file include/vdr/remux.h.


Constructor & Destructor Documentation

cTsToPes::cTsToPes ( void  )

Definition at line 702 of file remux.c.

References data, Reset(), and size.

Definition at line 709 of file remux.c.

References data.

cTsToPes::cTsToPes ( void  )

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

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.

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 714 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::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.

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 796 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::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().

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

References repeatLast.

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

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


Member Data Documentation

uchar * cTsToPes::data [private]

Definition at line 297 of file include/vdr/remux.h.

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

Definition at line 301 of file include/vdr/remux.h.

Referenced by GetPes(), and Reset().

int cTsToPes::lastLength [private]

Definition at line 302 of file include/vdr/remux.h.

Referenced by GetPes(), and Reset().

int cTsToPes::length [private]

Definition at line 299 of file include/vdr/remux.h.

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

int cTsToPes::offset [private]

Definition at line 300 of file include/vdr/remux.h.

Referenced by GetPes(), and Reset().

bool cTsToPes::repeatLast [private]

Definition at line 303 of file include/vdr/remux.h.

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

int cTsToPes::size [private]

Definition at line 298 of file include/vdr/remux.h.

Referenced by cTsToPes(), and PutTs().


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