filepush: scatter/gather support
[enigma2.git] / lib / base / filepush.h
index a419d7190e4f97305cca4f0e671e412248e1cd92..7e16fa028aa9a8f5d90fbbc39e46ab1c90b78675 100644 (file)
@@ -2,9 +2,17 @@
 #define __lib_base_filepush_h
 
 #include <lib/base/thread.h>
+#include <libsig_comp.h>
+#include <lib/base/message.h>
 #include <sys/types.h>
 
-class eFilePushThread: public eThread
+class iFilePushScatterGather
+{
+public:
+       virtual void getNextSourceSpan(size_t bytes_read, off_t &start, size_t &size)=0;
+};
+
+class eFilePushThread: public eThread, public Object
 {
 public:
        eFilePushThread();
@@ -18,12 +26,25 @@ public:
        
                /* flushes the internal readbuffer */ 
        void flush();
+       void enablePVRCommit(int);
+       
+       void setSG(iFilePushScatterGather *);
+       
+       enum { evtEOF, evtReadError, evtWriteError };
+       Signal1<void,int> m_event;
        
 private:
+       iFilePushScatterGather *m_sg;
        int m_stop;
        unsigned char m_buffer[65536];
        int m_buf_start, m_buf_end;
        int m_fd_source, m_fd_dest;
+       int m_send_pvr_commit;
+       
+       eFixedMessagePump<int> m_messagepump;
+       
+       void sendEvent(int evt);
+       void recvEvent(const int &evt);
 };
 
 #endif