X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/df88846fa78ebe40f935e0486462af0fc0ea81e9..61111fab026bb61d70ffcf74c36e51da56aa7ad2:/lib/base/filepush.h diff --git a/lib/base/filepush.h b/lib/base/filepush.h index 35671cd6..a4457f67 100644 --- a/lib/base/filepush.h +++ b/lib/base/filepush.h @@ -2,6 +2,7 @@ #define __lib_base_filepush_h #include +#include #include #include #include @@ -16,21 +17,26 @@ public: class eFilePushThread: public eThread, public Object { + int prio_class, prio; public: - eFilePushThread(); + eFilePushThread(int prio_class=IOPRIO_CLASS_BE, int prio_level=0, int blocksize=188); void thread(); void stop(); void start(int sourcefd, int destfd); int start(const char *filename, int destfd); - + + void start(ePtr &source, int destfd); + void pause(); - void seek(int whence, off_t where); void resume(); /* flushes the internal readbuffer */ void flush(); void enablePVRCommit(int); + /* stream mode will wait on EOF until more data is available. */ + void setStreamMode(int); + void setScatterGather(iFilePushScatterGather *); enum { evtEOF, evtReadError, evtWriteError, evtUser }; @@ -42,19 +48,22 @@ public: /* you can send private events if you want */ void sendEvent(int evt); protected: - virtual void filterRecordData(const unsigned char *data, int len); + virtual int filterRecordData(const unsigned char *data, int len, size_t ¤t_span_remaining); private: iFilePushScatterGather *m_sg; int m_stop; unsigned char m_buffer[65536]; - int m_buf_start, m_buf_end; + int m_buf_start, m_buf_end, m_filter_end; int m_fd_dest; int m_send_pvr_commit; - - eRawFile m_raw_source; - + int m_stream_mode; + int m_blocksize; + off_t m_current_position; + + ePtr m_source; + eFixedMessagePump m_messagepump; - + void recvEvent(const int &evt); };