vdr
2.2.0
|
#include <remux.h>
Public Member Functions | |
cTsToPes (void) | |
~cTsToPes () | |
void | PutTs (const uchar *Data, int Length) |
const uchar * | GetPes (int &Length) |
void | SetRepeatLast (void) |
void | Reset (void) |
Private Attributes | |
uchar * | data |
int | size |
int | length |
int | offset |
uchar * | lastData |
int | lastLength |
bool | repeatLast |
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().