diff options
author | zwer <zwer@1f4bef6d-8e0a-0410-8695-e467da8aaccf> | 2006-01-24 12:54:00 +0000 |
---|---|---|
committer | zwer <zwer@1f4bef6d-8e0a-0410-8695-e467da8aaccf> | 2006-01-24 12:54:00 +0000 |
commit | b998c31e7e0f4f84b2f64c50093069c815772808 (patch) | |
tree | 7b65667843ea5db07766d23688f045d20140361c /pes2ts.h | |
download | vdr-plugin-ffnetdev-b998c31e7e0f4f84b2f64c50093069c815772808.tar.gz vdr-plugin-ffnetdev-b998c31e7e0f4f84b2f64c50093069c815772808.tar.bz2 |
FFNetDev-Plugin
git-svn-id: svn://svn.berlios.de/ffnetdev/trunk@1 1f4bef6d-8e0a-0410-8695-e467da8aaccf
Diffstat (limited to 'pes2ts.h')
-rw-r--r-- | pes2ts.h | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/pes2ts.h b/pes2ts.h new file mode 100644 index 0000000..43fa3a1 --- /dev/null +++ b/pes2ts.h @@ -0,0 +1,50 @@ +/* + * pes2ts.h: PES2TS remux + * + * See the README file for copyright information and how to reach the author. + * + */ + +#ifndef PES2TSREMUX_H +#define PES2TSREMUX_H + +#include <vdr/ringbuffer.h> +#include <vdr/tools.h> + +#define INPUTBUFSIZE KILOBYTE(2048) +#define OUTPUTBUFSIZE KILOBYTE(2048) +#define TS_SIZE 188 +#define IPACKS 2048 + +class cPES2TSRemux: public cThread { +private: + cRingBufferLinear *m_OutputBuffer; + cRingBufferLinear *m_InputBuffer; + bool m_Active; + unsigned short vpid; + unsigned short apid; + bool OutputLocked; + cMutex InputMutex; + bool m_PlayModeChanged; + +protected: + virtual void Action(void); + +public: + cPES2TSRemux(int VPid, int APid); + virtual ~cPES2TSRemux(); + + int Free(void) { return m_InputBuffer->Free(); } + int Available(void) { return m_OutputBuffer->Available(); } + int Put(const uchar *Data, int Count); + uchar *Get(int &Count) { return m_OutputBuffer->Get(Count); } + void DelOutput(int Count) { m_OutputBuffer->Del(Count); } + void DelInput (int Count) { InputMutex.Lock(); m_InputBuffer ->Del(Count); InputMutex.Unlock(); } + void ClearOutput() { LockOutput(); m_OutputBuffer->Clear(); UnlockOutput(); } + void ClearInput () { InputMutex.Lock(); m_InputBuffer ->Clear(); InputMutex.Unlock(); } + void LockOutput() { while (OutputLocked) cCondWait::SleepMs(1); OutputLocked = true; } + void UnlockOutput() { OutputLocked = false; } + void PlayModeChange() { m_PlayModeChanged = true; } +}; + +#endif // PES2TSREMUX_H |