summaryrefslogtreecommitdiff
path: root/ringbuffer.h
diff options
context:
space:
mode:
authorKlaus Schmidinger <kls (at) cadsoft (dot) de>2002-06-16 18:00:00 +0200
committerKlaus Schmidinger <kls (at) cadsoft (dot) de>2002-06-16 18:00:00 +0200
commitf06d2c27fca449148d9d8fac19d81c668744f170 (patch)
tree8f21a604339719672bf7ab8b6e9d69bfa1817ac5 /ringbuffer.h
parentd07e3829f7c44d713b2677ef73f864af80b3dea3 (diff)
downloadvdr-patch-lnbsharing-f06d2c27fca449148d9d8fac19d81c668744f170.tar.gz
vdr-patch-lnbsharing-f06d2c27fca449148d9d8fac19d81c668744f170.tar.bz2
Version 1.1.3vdr-1.1.3
- Improved the VDR Makefile to avoid a warning if the '.dependencies' file does not exist, and also using $(MAKE) to call recursive makes. - Changed the name of the 'package' target in the plugin Makefiles to 'dist' (following the suggestions in the "GNU Make" manual). If you already have started a plugin project, you may want to change this in your Makefile accordingly. - Improved the plugin Makefile to avoid a warning if the '.dependencies' file does not exist, and also using $(shell...) to get the version numbers. If you already have started a plugin project, you may want to change this in your Makefile accordingly. - Fixed some function headers to make them compile with gcc 3.x (thanks to Gregoire Favre). - Fixed the cutting mechanism to make it re-sync in case a frame is larger than the buffer (thanks to Sven Grothklags). - Added an error message if the directory specified in the '-L' option can't be accessed (suggested by Stefan Huelswitt). - Rearranged OSD class names to make 'cOsd' available for the main OSD interface. - Completely moved OSD handling out of the cDvbApi class, into the new cOsd. - Implemented cStatus to allow plugins to set up a status monitor. See PLUGINS.html for details. - Moved the cEITScanner out of dvbapi.h/.c, into the new eitscan.h/.c. - Added Swedish language texts (thanks to Tomas Prybil). - Fixed parsing 'E' records in epg2html.pl (thanks to Matthias Fechner for pointing out this one). - Removed compiler option '-m486' to make it work on non-Intel platforms. If you have already started a plugin project, you may want to make sure you remove this option from your existing Makefile. - Completely rearranged the recording and replay functions to make them available to plugins. - Replay is now done in a single thread (no more syncing between input and output thread necessary). - It is now possible to record several channels on the same transponder with "budget cards". VDR automatically attaches a recording timer to a card that already records on the appropriate transponder. How many parallel recordings can actually be done depends on the computer's performance. Currently any number of recordings gets attached to a card, so you should carefully plan your timers to not exceed the limit. On a K6-II/450 it was possible to record three channels from transponder 12480 with a single WinTV NOVA-S. - Timers that record two successive shows on the same channel may now overlap and will use the same DVB card. During the time where both timers record the data is simply saved to both files. - The following limitations apply to this version: + Transfer mode doesn't work yet. + The '-a' option (for Dolby Digital audio) doesn't work yet. + Switching between different language tracks doesn't work yet. + Cutting doesn't work yet.
Diffstat (limited to 'ringbuffer.h')
-rw-r--r--ringbuffer.h42
1 files changed, 12 insertions, 30 deletions
diff --git a/ringbuffer.h b/ringbuffer.h
index 7e1025b..43176bd 100644
--- a/ringbuffer.h
+++ b/ringbuffer.h
@@ -1,10 +1,10 @@
/*
- * ringbuffer.h: A threaded ring buffer
+ * ringbuffer.h: A ring buffer
*
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: ringbuffer.h 1.5 2001/11/03 10:41:33 kls Exp $
+ * $Id: ringbuffer.h 1.6 2002/06/16 11:30:07 kls Exp $
*/
#ifndef __RINGBUFFER_H
@@ -12,24 +12,17 @@
#include "thread.h"
-typedef unsigned char uchar;
-
-class cRingBufferInputThread;
-class cRingBufferOutputThread;
+typedef unsigned char uchar;//XXX+
class cRingBuffer {
- friend class cRingBufferInputThread;
- friend class cRingBufferOutputThread;
private:
- cRingBufferInputThread *inputThread;
- cRingBufferOutputThread *outputThread;
cMutex mutex;
cCondVar readyForPut, readyForGet;
cMutex putMutex, getMutex;
int size;
- bool busy;
protected:
int maxFill;//XXX
+ int lastPercent;
bool statistics;//XXX
void WaitForPut(void);
void WaitForGet(void);
@@ -41,26 +34,19 @@ protected:
void Lock(void) { mutex.Lock(); }
void Unlock(void) { mutex.Unlock(); }
int Size(void) { return size; }
- bool Busy(void) { return busy; }
- virtual void Input(void) = 0;
- // Runs as a separate thread and shall continuously read data from
- // a source and call Put() to store the data in the ring buffer.
- virtual void Output(void) = 0;
- // Runs as a separate thread and shall continuously call Get() to
- // retrieve data from the ring buffer and write it to a destination.
public:
cRingBuffer(int Size, bool Statistics = false);
virtual ~cRingBuffer();
- bool Start(void);
- bool Active(void);
- void Stop(void);
};
class cRingBufferLinear : public cRingBuffer {
private:
int head, tail;
uchar *buffer;
-protected:
+ pid_t getThreadPid;
+public:
+ cRingBufferLinear(int Size, bool Statistics = false);
+ virtual ~cRingBufferLinear();
virtual int Available(void);
virtual void Clear(void);
// Immediately clears the ring buffer.
@@ -70,9 +56,6 @@ protected:
int Get(uchar *Data, int Count);
// Gets at most Count bytes of Data from the ring buffer.
// Returns the number of bytes actually retrieved.
-public:
- cRingBufferLinear(int Size, bool Statistics = false);
- virtual ~cRingBufferLinear();
};
enum eFrameType { ftUnknown, ftVideo, ftAudio, ftDolby };
@@ -99,21 +82,20 @@ private:
cFrame *head;
int currentFill;
void Delete(const cFrame *Frame);
-protected:
+public:
+ cRingBufferFrame(int Size, bool Statistics = false);
+ virtual ~cRingBufferFrame();
virtual int Available(void);
virtual void Clear(void);
// Immediately clears the ring buffer.
bool Put(cFrame *Frame);
// Puts the Frame into the ring buffer.
// Returns true if this was possible.
- const cFrame *Get(bool Wait = true);
+ const cFrame *Get(void);
// Gets the next frame from the ring buffer.
// The actual data still remains in the buffer until Drop() is called.
void Drop(const cFrame *Frame);
// Drops the Frame that has just been fetched with Get().
-public:
- cRingBufferFrame(int Size, bool Statistics = false);
- virtual ~cRingBufferFrame();
};
#endif // __RINGBUFFER_H