experimental PVR commit support
[enigma2.git] / lib / base / filepush.h
1 #ifndef __lib_base_filepush_h
2 #define __lib_base_filepush_h
3
4 #include <lib/base/thread.h>
5 #include <libsig_comp.h>
6 #include <lib/base/message.h>
7 #include <sys/types.h>
8
9 class eFilePushThread: public eThread, public Object
10 {
11 public:
12         eFilePushThread();
13         void thread();
14         void stop();
15         void start(int sourcefd, int destfd);
16         
17         void pause();
18         void seek(int whence, off_t where);
19         void resume();
20         
21                 /* flushes the internal readbuffer */ 
22         void flush();
23         void enablePVRCommit(int);
24         
25         enum { evtEOF, evtReadError, evtWriteError };
26         Signal1<void,int> m_event;
27         
28 private:
29         int m_stop;
30         unsigned char m_buffer[65536];
31         int m_buf_start, m_buf_end;
32         int m_fd_source, m_fd_dest;
33         int m_send_pvr_commit;
34         
35         eFixedMessagePump<int> m_messagepump;
36         
37         void sendEvent(int evt);
38         void recvEvent(const int &evt);
39 };
40
41 #endif