vdr  2.0.5
Public Member Functions | Private Member Functions | Private Attributes | List of all members
cTSBuffer Class Reference

#include <device.h>

Public Member Functions

 cTSBuffer (int File, int Size, int CardIndex)
 
 ~cTSBuffer ()
 
ucharGet (void)
 
- Public Member Functions inherited from cThread
 cThread (const char *Description=NULL, bool LowPriority=false)
 
virtual ~cThread ()
 
void SetDescription (const char *Description,...) __attribute__((format(printf
 
void bool Start (void)
 
bool Active (void)
 

Private Member Functions

virtual void Action (void)
 

Private Attributes

int f
 
int cardIndex
 
bool delivered
 
cRingBufferLinearringBuffer
 

Additional Inherited Members

- Static Public Member Functions inherited from cThread
static tThreadId ThreadId (void)
 
static tThreadId IsMainThread (void)
 
static void SetMainThreadId (void)
 
- Protected Member Functions inherited from cThread
void SetPriority (int Priority)
 
void SetIOPriority (int Priority)
 
void Lock (void)
 
void Unlock (void)
 
bool Running (void)
 
void Cancel (int WaitSeconds=0)
 

Detailed Description

Derived cDevice classes that can receive channels will have to provide Transport Stream (TS) packets one at a time.

cTSBuffer implements a simple buffer that allows the device to read a larger amount of data from the driver with each call to Read(), thus avoiding the overhead of getting each TS packet separately from the driver. It also makes sure the returned data points to a TS packet and automatically re-synchronizes after broken packets.

Definition at line 816 of file device.h.

Constructor & Destructor Documentation

cTSBuffer::cTSBuffer ( int  File,
int  Size,
int  CardIndex 
)
cTSBuffer::~cTSBuffer ( )

Definition at line 1754 of file device.c.

References cThread::Cancel(), and ringBuffer.

Member Function Documentation

void cTSBuffer::Action ( void  )
privatevirtual

A derived cThread class must implement the code it wants to execute as a separate thread in this function.

If this is a loop, it must check Running() repeatedly to see whether it's time to stop.

Implements cThread.

Definition at line 1760 of file device.c.

References cardIndex, esyslog, f, FATALERRNO, LOG_ERROR, cPoller::Poll(), cRingBufferLinear::Read(), ringBuffer, and cThread::Running().

uchar * cTSBuffer::Get ( void  )

Member Data Documentation

int cTSBuffer::cardIndex
private

Definition at line 819 of file device.h.

Referenced by Action(), cTSBuffer(), and Get().

bool cTSBuffer::delivered
private

Definition at line 820 of file device.h.

Referenced by cTSBuffer(), and Get().

int cTSBuffer::f
private

Definition at line 818 of file device.h.

Referenced by Action(), and cTSBuffer().

cRingBufferLinear* cTSBuffer::ringBuffer
private

Definition at line 821 of file device.h.

Referenced by Action(), cTSBuffer(), Get(), and ~cTSBuffer().


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