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 noVideo
int numUPTerrors
bool synced
int skipped
cTS2PESts2pes [MAXTRACKS]
int numTracks
cRingBufferLinearresultBuffer
int resultSkipped


Detailed Description

Definition at line 35 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 1899 of file remux.c.

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

Here is the call graph for this function:

cRemux::~cRemux (  ) 

Definition at line 1941 of file remux.c.

References numTracks, resultBuffer, and ts2pes.


Member Function Documentation

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

Definition at line 1948 of file remux.c.

References PID_MASK_HI.

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

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

Referenced by cTransfer::Action(), cRecorder::Action(), and cLiveSubtitle::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 2064 of file remux.c.

References B_FRAME, cRingBufferLinear::Del(), esyslog, exitOnFailure, cRingBufferLinear::Get(), GetPacketLength(), I_FRAME, MAXNUMUPTERRORS, NO_PICTURE, noVideo, numUPTerrors, cShutdownHandler::RequestEmergencyExit(), resultBuffer, resultSkipped, ScanVideoPacket(), SetBrokenLink(), ShutdownHandler, synced, VIDEO_STREAM_E, and VIDEO_STREAM_S.

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

Here is the call graph for this function:

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

References cRingBufferLinear::Del(), and resultBuffer.

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

Here is the call graph for this function:

void cRemux::Clear ( void   ) 

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

Definition at line 2159 of file remux.c.

References cRingBufferLinear::Clear(), numTracks, resultBuffer, resultSkipped, skipped, synced, and ts2pes.

Referenced by cTransfer::Action().

Here is the call graph for this function:

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

Definition at line 2169 of file remux.c.

References AnalyzePesHeader(), dsyslog, phMPEG1, and VIDEO_STREAM_S.

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

Here is the call graph for this function:

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

Definition at line 1953 of file remux.c.

Referenced by Get(), and ScanVideoPacket().

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

Definition at line 1963 of file remux.c.

References AnalyzePesHeader(), GetPacketLength(), NO_PICTURE, phMPEG1, SC_GROUP, SC_PICTURE, and SC_SEQUENCE.

Referenced by Get().

Here is the call graph for this function:


Member Data Documentation

bool cRemux::exitOnFailure [private]

Definition at line 37 of file remux.h.

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

bool cRemux::noVideo [private]

Definition at line 38 of file remux.h.

Referenced by cRemux(), and Get().

int cRemux::numUPTerrors [private]

Definition at line 39 of file remux.h.

Referenced by cRemux(), and Get().

bool cRemux::synced [private]

Definition at line 40 of file remux.h.

Referenced by Clear(), cRemux(), Get(), and Put().

int cRemux::skipped [private]

Definition at line 41 of file remux.h.

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

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

Definition at line 42 of file remux.h.

Referenced by Clear(), cRemux(), Put(), and ~cRemux().

int cRemux::numTracks [private]

Definition at line 43 of file remux.h.

Referenced by Clear(), cRemux(), Put(), and ~cRemux().

Definition at line 44 of file remux.h.

Referenced by Clear(), cRemux(), Del(), Get(), Put(), SetTimeouts(), and ~cRemux().

int cRemux::resultSkipped [private]

Definition at line 45 of file remux.h.

Referenced by Clear(), cRemux(), and Get().


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

Generated on Tue Nov 4 20:01:10 2008 for VDR by  doxygen 1.5.6