]> git.vomp.tv Git - vompserver.git/blob - transceiver.h
Initial import
[vompserver.git] / transceiver.h
1 /*
2      Edited for VOMP by Chris Tallon
3      Edits Copyright 2004-2005 Chris Tallon
4 */
5
6 /*
7  *   MediaMVP Plugin
8  *
9  *   (C) 2003 Dominic Morris
10  *
11  *   $Id$
12  *   $Date$
13  *
14  *
15  *   Transceiver stuff, stolen from streamdev again...
16  */
17
18 #ifndef VDR_MEDIAMVP_TRANSCEIVER_H
19 #define VDR_MEDIAMVP_TRANSCEIVER_H
20
21 #include <vdr/receiver.h>
22
23 #include <vdr/thread.h>
24 #include <vdr/status.h>
25
26 class cRingBufferLinear;
27 class cRemux;
28 class cTSRemux;
29 class cServerConnection;
30 class cChannel;
31
32
33 #include <pthread.h>
34 #include "ringbuffer.h"
35
36 class cMediamvpTransceiver: public cReceiver, public cThread {
37 //    friend class cMediamvpVdrURL;
38 private:
39         cDevice *m_Device;
40         cRingBufferLinear *m_RingBuffer;
41         cTSRemux *m_Remux;
42     int       m_Socket;
43
44         bool m_Active;
45
46         // CJT
47         Ringbuffer rb;
48         pthread_mutex_t ringLock;
49
50
51 protected:
52         virtual void Receive(uchar *Data, int Length);
53         virtual void Action(void);
54
55 public:
56         cMediamvpTransceiver(const cChannel *Channel, int Priority, int Socket, cDevice *Device);
57         virtual ~cMediamvpTransceiver(void);
58
59         bool Attach(void) { return m_Device->AttachReceiver(this); }
60         void Detach(void) { cReceiver::Detach(); }
61
62         void Stop(void);
63
64
65         // CJT
66         unsigned long getBlock(unsigned char* buffer, unsigned long amount);
67         virtual void Activate(bool On);
68
69 };
70
71 #endif // VDR_MEDIAMVP_TRANSCEIVER_H