enable playback of multifile (split) movies
[enigma2.git] / lib / base / filepush.h
index 7e16fa028aa9a8f5d90fbbc39e46ab1c90b78675..25257880d4056c28c00f3b59ffcbda2f87f92b35 100644 (file)
@@ -5,11 +5,13 @@
 #include <libsig_comp.h>
 #include <lib/base/message.h>
 #include <sys/types.h>
+#include <lib/base/rawfile.h>
 
 class iFilePushScatterGather
 {
 public:
-       virtual void getNextSourceSpan(size_t bytes_read, off_t &start, size_t &size)=0;
+       virtual void getNextSourceSpan(off_t current_offset, size_t bytes_read, off_t &start, size_t &size)=0;
+       virtual ~iFilePushScatterGather() {}
 };
 
 class eFilePushThread: public eThread, public Object
@@ -19,6 +21,7 @@ public:
        void thread();
        void stop();
        void start(int sourcefd, int destfd);
+       int start(const char *filename, int destfd);
        
        void pause();
        void seek(int whence, off_t where);
@@ -28,22 +31,27 @@ public:
        void flush();
        void enablePVRCommit(int);
        
-       void setSG(iFilePushScatterGather *);
+       void setScatterGather(iFilePushScatterGather *);
        
-       enum { evtEOF, evtReadError, evtWriteError };
+       enum { evtEOF, evtReadError, evtWriteError, evtUser };
        Signal1<void,int> m_event;
        
+               /* you can send private events if you want */
+       void sendEvent(int evt);
+protected:
+       virtual void filterRecordData(const unsigned char *data, int len);
 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_fd_dest;
        int m_send_pvr_commit;
        
+       eRawFile m_raw_source;
+       
        eFixedMessagePump<int> m_messagepump;
        
-       void sendEvent(int evt);
        void recvEvent(const int &evt);
 };