another new is to small
[enigma2.git] / lib / base / filepush.h
index f2bd98be3be46afc993da9eab3a9de7f792bfeff..75037f6660ff95c35531dc8fcee4503ec6494cfa 100644 (file)
@@ -6,6 +6,13 @@
 #include <lib/base/message.h>
 #include <sys/types.h>
 
+class iFilePushScatterGather
+{
+public:
+       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
 {
 public:
@@ -22,10 +29,17 @@ public:
        void flush();
        void enablePVRCommit(int);
        
-       enum { evtEOF, evtReadError, evtWriteError };
+       void setScatterGather(iFilePushScatterGather *);
+       
+       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;
@@ -34,7 +48,6 @@ private:
        
        eFixedMessagePump<int> m_messagepump;
        
-       void sendEvent(int evt);
        void recvEvent(const int &evt);
 };