vdr 2.6.1
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
cNonBlockingFileReader Class Reference

Public Member Functions

 cNonBlockingFileReader (void)
 
 ~cNonBlockingFileReader ()
 
void Clear (void)
 
void Request (cUnbufferedFile *File, int Length)
 
int Result (uchar **Buffer)
 
bool Reading (void)
 
bool WaitForDataMs (int msToWait)
 
- 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)
 
 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)
 

Protected Member Functions

void Action (void)
 
- Protected Member Functions inherited from cThread
void SetPriority (int Priority)
 
void SetIOPriority (int Priority)
 
void Lock (void)
 
void Unlock (void)
 
virtual void Action (void)=0
 
bool Running (void)
 
void Cancel (int WaitSeconds=0)
 
void SetPriority (int Priority)
 
void SetIOPriority (int Priority)
 
void Lock (void)
 
void Unlock (void)
 
virtual void Action (void)=0
 
bool Running (void)
 
void Cancel (int WaitSeconds=0)
 

Private Attributes

cUnbufferedFilef
 
ucharbuffer
 
int wanted
 
int length
 
cCondWait newSet
 
cCondVar newDataCond
 
cMutex newDataMutex
 

Additional Inherited Members

- Static Public Member Functions inherited from cThread
static tThreadId ThreadId (void)
 
static tThreadId IsMainThread (void)
 
static void SetMainThreadId (void)
 
static tThreadId ThreadId (void)
 
static tThreadId IsMainThread (void)
 
static void SetMainThreadId (void)
 

Detailed Description

Definition at line 125 of file dvbplayer.c.

Constructor & Destructor Documentation

◆ cNonBlockingFileReader()

cNonBlockingFileReader::cNonBlockingFileReader ( void  )

Definition at line 146 of file dvbplayer.c.

References buffer, f, length, cThread::Start(), and wanted.

◆ ~cNonBlockingFileReader()

cNonBlockingFileReader::~cNonBlockingFileReader ( )

Definition at line 155 of file dvbplayer.c.

References buffer, cThread::Cancel(), newSet, and cCondWait::Signal().

Member Function Documentation

◆ Action()

void cNonBlockingFileReader::Action ( void  )
protectedvirtual

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 195 of file dvbplayer.c.

References cCondVar::Broadcast(), buffer, f, FATALERRNO, length, cThread::Lock(), LOG_ERROR, newDataCond, newDataMutex, newSet, cUnbufferedFile::Read(), cThread::Running(), cThread::Unlock(), cCondWait::Wait(), and wanted.

◆ Clear()

void cNonBlockingFileReader::Clear ( void  )

Definition at line 162 of file dvbplayer.c.

References buffer, f, length, cThread::Lock(), cThread::Unlock(), and wanted.

Referenced by cDvbPlayer::Empty(), and Request().

◆ Reading()

bool cNonBlockingFileReader::Reading ( void  )
inline

Definition at line 142 of file dvbplayer.c.

References buffer.

Referenced by cDvbPlayer::Action().

◆ Request()

void cNonBlockingFileReader::Request ( cUnbufferedFile File,
int  Length 
)

Definition at line 172 of file dvbplayer.c.

References buffer, Clear(), f, cThread::Lock(), MALLOC, newSet, cCondWait::Signal(), cThread::Unlock(), and wanted.

Referenced by cDvbPlayer::Action().

◆ Result()

int cNonBlockingFileReader::Result ( uchar **  Buffer)

Definition at line 183 of file dvbplayer.c.

References buffer, length, LOCK_THREAD, and wanted.

Referenced by cDvbPlayer::Action().

◆ WaitForDataMs()

bool cNonBlockingFileReader::WaitForDataMs ( int  msToWait)

Definition at line 223 of file dvbplayer.c.

References buffer, length, newDataCond, newDataMutex, cCondVar::TimedWait(), and wanted.

Referenced by cDvbPlayer::Action().

Member Data Documentation

◆ buffer

uchar* cNonBlockingFileReader::buffer
private

◆ f

cUnbufferedFile* cNonBlockingFileReader::f
private

Definition at line 127 of file dvbplayer.c.

Referenced by Action(), Clear(), cNonBlockingFileReader(), and Request().

◆ length

int cNonBlockingFileReader::length
private

Definition at line 130 of file dvbplayer.c.

Referenced by Action(), Clear(), cNonBlockingFileReader(), Result(), and WaitForDataMs().

◆ newDataCond

cCondVar cNonBlockingFileReader::newDataCond
private

Definition at line 132 of file dvbplayer.c.

Referenced by Action(), and WaitForDataMs().

◆ newDataMutex

cMutex cNonBlockingFileReader::newDataMutex
private

Definition at line 133 of file dvbplayer.c.

Referenced by Action(), and WaitForDataMs().

◆ newSet

cCondWait cNonBlockingFileReader::newSet
private

Definition at line 131 of file dvbplayer.c.

Referenced by Action(), Request(), and ~cNonBlockingFileReader().

◆ wanted

int cNonBlockingFileReader::wanted
private

Definition at line 129 of file dvbplayer.c.

Referenced by Action(), Clear(), cNonBlockingFileReader(), Request(), Result(), and WaitForDataMs().


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