diff options
author | Klaus Schmidinger <kls (at) cadsoft (dot) de> | 2003-01-26 18:00:00 +0100 |
---|---|---|
committer | Klaus Schmidinger <kls (at) cadsoft (dot) de> | 2003-01-26 18:00:00 +0100 |
commit | a3942b4d17a3a7e1af82b1950c39db1f9c7ce250 (patch) | |
tree | 8b88f1d2db36ab8609c79dc02758652a3d235db3 /ringbuffer.h | |
parent | 3e1d34f392792bbcf1bda4884c58ca9cec445d1d (diff) | |
download | vdr-patch-lnbsharing-a3942b4d17a3a7e1af82b1950c39db1f9c7ce250.tar.gz vdr-patch-lnbsharing-a3942b4d17a3a7e1af82b1950c39db1f9c7ce250.tar.bz2 |
Version 1.1.22vdr-1.1.22
- Added 'Hrvatska radiotelevizija' and 'RTV Slovenija' to ca.conf (thanks to
Paul Gohn).
- Implemented actual user input for CAM enquiry menus.
- Since disk file systems apparently don't honor the O_NONBLOCK flag to read from
a file in non-blocking mode the cDvbPlayer now uses a non blocking file reader
class to make sure replay remains smooth even under heavy system load.
- Increased the maximum possible packet size in remux.c to avoid corrupted streams
with broadcasters that send extremely large PES packets (thanks to Teemu Rantanen).
- Added TS error checking to remux.c (thanks to Teemu Rantanen).
- Modified cRingBufferLinear to avoid excessive memmove() calls in 'Transfer Mode'
and during recordings, which dramatically reduces CPU load. Thanks to Teemu
Rantanen for pinpointing the problem with the excessive memmove() calls.
- Updated 'channels.conf' (thanks to Achim Lange).
- Added/improved Swedish language texts (thanks to Jan Ekholm).
- Fixed the description of the "Scroll pages" OSD setup parameter ('yes' and 'no'
were mixed up).
- Fixed handling the LOG_LOCALn parameters in the -l option (thanks to Dimitrios
Dimitrakos).
- Changed EIT processing to always read a full section.
- Fixed handling user defined CFLAGS in libdtv/libvdr/Makefile (thanks to Clemens
Kirchgatterer and Robert Schiele).
- Fixed skipping unavailable channels in the EPG scanner.
Diffstat (limited to 'ringbuffer.h')
-rw-r--r-- | ringbuffer.h | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/ringbuffer.h b/ringbuffer.h index 660a08b..9205df7 100644 --- a/ringbuffer.h +++ b/ringbuffer.h @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: ringbuffer.h 1.7 2002/08/04 10:27:30 kls Exp $ + * $Id: ringbuffer.h 1.9 2003/01/26 09:47:39 kls Exp $ */ #ifndef __RINGBUFFER_H @@ -40,21 +40,31 @@ public: class cRingBufferLinear : public cRingBuffer { private: - int head, tail; + int margin, head, tail; + int lastGet; uchar *buffer; pid_t getThreadPid; public: - cRingBufferLinear(int Size, bool Statistics = false); + cRingBufferLinear(int Size, int Margin = 0, bool Statistics = false); + ///< Creates a linear ring buffer. + ///< The buffer will be able to hold at most Size bytes of data, and will + ///< be guaranteed to return at least Margin bytes in one consecutive block. virtual ~cRingBufferLinear(); virtual int Available(void); virtual void Clear(void); - // Immediately clears the ring buffer. + ///< Immediately clears the ring buffer. int Put(const uchar *Data, int Count); - // Puts at most Count bytes of Data into the ring buffer. - // Returns the number of bytes actually stored. - int Get(uchar *Data, int Count); - // Gets at most Count bytes of Data from the ring buffer. - // Returns the number of bytes actually retrieved. + ///< Puts at most Count bytes of Data into the ring buffer. + ///< \return Returns the number of bytes actually stored. + const uchar *Get(int &Count); + ///< Gets data from the ring buffer. + ///< The data will remain in the buffer until a call to Del() deletes it. + ///< \return Returns a pointer to the data, and stores the number of bytes + ///< actually retrieved in Count. If the returned pointer is NULL, Count has no meaning. + void Del(int Count); + ///< Deletes at most Count bytes from the ring buffer. + ///< Count must be less or equal to the number that was returned by a previous + ///< call to Get(). }; enum eFrameType { ftUnknown, ftVideo, ftAudio, ftDolby }; @@ -69,6 +79,9 @@ private: int index; public: cFrame(const uchar *Data, int Count, eFrameType = ftUnknown, int Index = -1); + ///< Creates a new cFrame object. + ///< If Count is negative, the cFrame object will take ownership of the given + ///< Data. Otherwise it will allocate Count bytes of memory and copy Data. ~cFrame(); const uchar *Data(void) const { return data; } int Count(void) const { return count; } |