cRemux Class Reference

#include <remux.h>

Collaboration diagram for cRemux:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 cRemux (int VPid, const int *APids, const int *DPids, const int *SPids, bool ExitOnFailure=false)
 ~cRemux ()
void SetTimeouts (int PutTimeout, int GetTimeout)
int Put (const uchar *Data, int Count)
ucharGet (int &Count, uchar *PictureType=NULL)
void Del (int Count)
void Clear (void)

Static Public Member Functions

static void SetBrokenLink (uchar *Data, int Length)
static int GetPacketLength (const uchar *Data, int Count, int Offset)
static int ScanVideoPacket (const uchar *Data, int Count, int Offset, uchar &PictureType)

Private Member Functions

int GetPid (const uchar *Data)

Private Attributes

bool exitOnFailure
bool isRadio
int numUPTerrors
bool synced
int skipped
cTS2PESts2pes [MAXTRACKS]
int numTracks
cRingBufferLinearresultBuffer
int resultSkipped


Detailed Description

Definition at line 37 of file remux.h.


Constructor & Destructor Documentation

cRemux::cRemux ( int  VPid,
const int *  APids,
const int *  DPids,
const int *  SPids,
bool  ExitOnFailure = false 
)

Creates a new remuxer for the given PIDs. VPid is the video PID, while APids, DPids and SPids are pointers to zero terminated lists of audio, dolby and subtitle PIDs (the pointers may be NULL if there is no such PID). If ExitOnFailure is true, the remuxer will initiate an "emergency exit" in case of problems with the data stream.

Definition at line 1856 of file remux.c.

References exitOnFailure, IPACKS, isRadio, MAXAPIDS, MAXDPIDS, MAXTRACKS, numTracks, numUPTerrors, resultBuffer, RESULTBUFFERSIZE, resultSkipped, cRingBuffer::SetTimeouts(), skipped, synced, and ts2pes.

Here is the call graph for this function:

cRemux::~cRemux (  ) 

Definition at line 1898 of file remux.c.


Member Function Documentation

int cRemux::GetPid ( const uchar Data  )  [private]

Definition at line 1905 of file remux.c.

Referenced by Put().

void cRemux::SetTimeouts ( int  PutTimeout,
int  GetTimeout 
) [inline]

By default cRemux assumes that Put() and Get() are called from different threads, and uses a timeout in the Get() function in case there is no data available. SetTimeouts() can be used to modify these timeouts. Especially if Put() and Get() are called from the same thread, setting both timeouts to 0 is recommended.

Definition at line 57 of file remux.h.

References resultBuffer, and cRingBuffer::SetTimeouts().

Here is the call graph for this function:

int cRemux::Put ( const uchar Data,
int  Count 
)

Puts at most Count bytes of Data into the remuxer.

Returns:
Returns the number of bytes actually consumed from Data.

Definition at line 1969 of file remux.c.

References cThread::EmergencyExit(), esyslog, exitOnFailure, cRingBufferLinear::Free(), GetPid(), IPACKS, MAXNONUSEFULDATA, numTracks, resultBuffer, skipped, synced, ts2pes, TS_SIZE, TS_SYNC_BYTE, and cTS2PES::ts_to_pes().

Referenced by cTransfer::Action(), and cRecorder::Action().

Here is the call graph for this function:

uchar * cRemux::Get ( int &  Count,
uchar PictureType = NULL 
)

Gets all currently available data from the remuxer.

Returns:
Count contains the number of bytes the result points to, and PictureType (if not NULL) will contain one of NO_PICTURE, I_FRAME, P_FRAME or B_FRAME.

Definition at line 2021 of file remux.c.

Referenced by cTransfer::Action(), and cFileWriter::Action().

void cRemux::Del ( int  Count  ) 

Deletes Count bytes from the remuxer. Count must be the number returned from a previous call to Get(). Several calls to Del() with fractions of a previously returned Count may be made, but the total sum of all Count values must be exactly what the previous Get() has returned.

Definition at line 2109 of file remux.c.

Referenced by cTransfer::Action(), and cFileWriter::Action().

void cRemux::Clear ( void   ) 

Clears the remuxer of all data it might still contain, keeping the PID settings as they are.

Definition at line 2114 of file remux.c.

Referenced by cTransfer::Action().

void cRemux::SetBrokenLink ( uchar Data,
int  Length 
) [static]

Definition at line 2124 of file remux.c.

Referenced by cDvbPlayer::Action(), and cCuttingThread::Action().

int cRemux::GetPacketLength ( const uchar Data,
int  Count,
int  Offset 
) [static]

Definition at line 1910 of file remux.c.

int cRemux::ScanVideoPacket ( const uchar Data,
int  Count,
int  Offset,
uchar PictureType 
) [static]

Definition at line 1920 of file remux.c.


Member Data Documentation

bool cRemux::exitOnFailure [private]

Definition at line 39 of file remux.h.

Referenced by cRemux(), and Put().

bool cRemux::isRadio [private]

Definition at line 40 of file remux.h.

Referenced by cRemux().

int cRemux::numUPTerrors [private]

Definition at line 41 of file remux.h.

Referenced by cRemux().

bool cRemux::synced [private]

Definition at line 42 of file remux.h.

Referenced by cRemux(), and Put().

int cRemux::skipped [private]

Definition at line 43 of file remux.h.

Referenced by cRemux(), and Put().

cTS2PES* cRemux::ts2pes[MAXTRACKS] [private]

Definition at line 44 of file remux.h.

Referenced by cRemux(), and Put().

int cRemux::numTracks [private]

Definition at line 45 of file remux.h.

Referenced by cRemux(), and Put().

cRingBufferLinear* cRemux::resultBuffer [private]

Definition at line 46 of file remux.h.

Referenced by cRemux(), Put(), and SetTimeouts().

int cRemux::resultSkipped [private]

Definition at line 47 of file remux.h.

Referenced by cRemux().


The documentation for this class was generated from the following files:
Generated on Tue Nov 6 20:24:24 2007 for VDR by  doxygen 1.5.3-20071008