Support turbo2.
[vuplus_dvbapp] / lib / dvb / demux.h
index 7a697d4..015115a 100644 (file)
@@ -3,6 +3,8 @@
 
 #include <lib/dvb/idvb.h>
 #include <lib/dvb/idemux.h>
+#include <lib/dvb/pvrparse.h>
+#include <lib/base/filepush.h>
 
 class eDVBDemux: public iDVBDemux
 {
@@ -26,7 +28,8 @@ public:
        RESULT getCADemuxID(uint8_t &id) { id = demux; return 0; }
        RESULT flush();
        RESULT connectEvent(const Slot1<void,int> &event, ePtr<eConnection> &conn);
-       
+       int openDVR(int flags);
+
        int getRefCount() { return ref; }
 private:
        int adapter, demux, source;
@@ -56,9 +59,9 @@ class eDVBSectionReader: public iDVBSectionReader, public Object
        void data(int);
        ePtr<eSocketNotifier> notifier;
 public:
-       
        eDVBSectionReader(eDVBDemux *demux, eMainloop *context, RESULT &res);
        virtual ~eDVBSectionReader();
+       RESULT setBufferSize(int size);
        RESULT start(const eDVBSectionFilterMask &mask);
        RESULT stop();
        RESULT connectRead(const Slot1<void,const __u8*> &read, ePtr<eConnection> &conn);
@@ -76,12 +79,31 @@ class eDVBPESReader: public iDVBPESReader, public Object
 public:
        eDVBPESReader(eDVBDemux *demux, eMainloop *context, RESULT &res);
        virtual ~eDVBPESReader();
+       RESULT setBufferSize(int size);
        RESULT start(int pid);
        RESULT stop();
        RESULT connectRead(const Slot2<void,const __u8*, int> &read, ePtr<eConnection> &conn);
 };
 
-class eDVBRecordFileThread;
+class eDVBRecordFileThread: public eFilePushThread
+{
+public:
+       eDVBRecordFileThread();
+       void setTimingPID(int pid, int type);
+       
+       void startSaveMetaInformation(const std::string &filename);
+       void stopSaveMetaInformation();
+       void enableAccessPoints(bool enable);
+       int getLastPTS(pts_t &pts);
+protected:
+       int filterRecordData(const unsigned char *data, int len, size_t &current_span_remaining);
+private:
+       eMPEGStreamParserTS m_ts_parser;
+       eMPEGStreamInformation m_stream_info;
+       off_t m_current_offset;
+       pts_t m_last_pcr; /* very approximate.. */
+       int m_pid;
+};
 
 class eDVBTSRecorder: public iDVBTSRecorder, public Object
 {
@@ -90,6 +112,7 @@ public:
        eDVBTSRecorder(eDVBDemux *demux);
        ~eDVBTSRecorder();
 
+       RESULT setBufferSize(int size);
        RESULT start();
        RESULT addPID(int pid);
        RESULT removePID(int pid);
@@ -98,7 +121,9 @@ public:
        
        RESULT setTargetFD(int fd);
        RESULT setTargetFilename(const char *filename);
+       RESULT enableAccessPoints(bool enable);
        RESULT setBoundary(off_t max);
+       RESULT setTimeshift(bool enable);
        
        RESULT stop();