diff options
author | Lars Heer <l.heer@gmx.de> | 2013-09-18 05:50:03 +0200 |
---|---|---|
committer | Lars Heer <l.heer@gmx.de> | 2013-09-18 05:50:03 +0200 |
commit | ccf6e0f9c6b0481ed13e0f4794e3fbead750f385 (patch) | |
tree | ed86efb54f7ee41edfba5c89ca519b5fd10aa0d5 /packetbuffer.h | |
download | vdr-plugin-mcli-ccf6e0f9c6b0481ed13e0f4794e3fbead750f385.tar.gz vdr-plugin-mcli-ccf6e0f9c6b0481ed13e0f4794e3fbead750f385.tar.bz2 |
added vdr-plugin-mcli-0.0.1+svn20120927
Diffstat (limited to 'packetbuffer.h')
-rw-r--r-- | packetbuffer.h | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/packetbuffer.h b/packetbuffer.h new file mode 100644 index 0000000..d3d63f0 --- /dev/null +++ b/packetbuffer.h @@ -0,0 +1,57 @@ +/* + * (c) BayCom GmbH, http://www.baycom.de, info@baycom.de + * + * See the COPYING file for copyright information and + * how to reach the author. + * + */ + +#ifndef VDR_MCLI_PACKETBUFFER_H +#define VDR_MCLI_PACKETBUFFER_H + +#define USE_VDR_PACKET_BUFFER +#ifdef USE_VDR_PACKET_BUFFER +#include <vdr/ringbuffer.h> +#endif +//-------------------------------------------------------------------------- +// Packetized Buffer +//-------------------------------------------------------------------------- + +typedef struct +{ + int offset; + int size; + int realSize; // incl. alignment + int flags; + uint64_t timestamp; +} posData; + +class cMyPacketBuffer +{ + int dataSize; + int posSize; + uchar *dataBuffer; + posData *posBuffer; + int rp, wp; + posData *posRead, *posWrite; + int posReadNum; + int invalidate; + int putTimeout, getTimeout; + pthread_mutex_t m_lock; + + int FindSpace (int size); + + uchar *GetStartSub (int *readp, int timeout, int *size, int *flags, uint64_t * timestamp); + public: + cMyPacketBuffer (int Size, int Packets); + ~cMyPacketBuffer (); + uchar *PutStart (int size); + void PutEnd (int size, int flags, uint64_t timestamp); + uchar *GetStart (int *size, int *flags, uint64_t * timestamp); + uchar *GetStartMultiple (int maxsize, int *size, int *flags, uint64_t * timestamp); + void GetEnd (void); +// void GetEndMultiple(void); + void Invalidate (void); + void SetTimeouts (int PutTimeout, int GetTimeout); +}; +#endif |