+class eDVBPESReader: public iDVBPESReader, public Object
+{
+ DECLARE_REF(eDVBPESReader);
+ int m_fd;
+ Signal2<void, const __u8*, int> m_read;
+ ePtr<eDVBDemux> m_demux;
+ int m_active;
+ void data(int);
+ ePtr<eSocketNotifier> m_notifier;
+public:
+ eDVBPESReader(eDVBDemux *demux, eMainloop *context, RESULT &res);
+ virtual ~eDVBPESReader();
+ RESULT start(int pid);
+ RESULT stop();
+ RESULT connectRead(const Slot2<void,const __u8*, int> &read, ePtr<eConnection> &conn);
+};
+
+class eDVBRecordFileThread;
+
+class eDVBTSRecorder: public iDVBTSRecorder, public Object
+{
+ DECLARE_REF(eDVBTSRecorder);
+public:
+ eDVBTSRecorder(eDVBDemux *demux);
+ ~eDVBTSRecorder();
+
+ RESULT start();
+ RESULT addPID(int pid);
+ RESULT removePID(int pid);
+
+ RESULT setTimingPID(int pid, int type);
+
+ RESULT setTargetFD(int fd);
+ RESULT setTargetFilename(const char *filename);
+ RESULT setBoundary(off_t max);
+
+ RESULT stop();
+
+ RESULT getCurrentPCR(pts_t &pcr);
+
+ RESULT connectEvent(const Slot1<void,int> &event, ePtr<eConnection> &conn);
+private:
+ RESULT startPID(int pid);
+ void stopPID(int pid);
+
+ eDVBRecordFileThread *m_thread;
+ void filepushEvent(int event);
+
+ std::map<int,int> m_pids;
+ Signal1<void,int> m_event;
+
+ ePtr<eDVBDemux> m_demux;
+
+ int m_running, m_target_fd, m_source_fd;
+ std::string m_target_filename;
+};
+