4 #include <lib/dvb/idvb.h>
5 #include <lib/dvb/idemux.h>
7 class eDVBDemux: public iDVBDemux
9 DECLARE_REF(eDVBDemux);
14 eDVBDemux(int adapter, int demux);
17 RESULT setSourceFrontend(int fenum);
18 int getSource() { return source; }
19 RESULT setSourcePVR(int pvrnum);
21 RESULT createSectionReader(eMainloop *context, ePtr<iDVBSectionReader> &reader);
22 RESULT createPESReader(eMainloop *context, ePtr<iDVBPESReader> &reader);
23 RESULT createTSRecorder(ePtr<iDVBTSRecorder> &recorder);
24 RESULT getMPEGDecoder(ePtr<iTSMPEGDecoder> &reader, int primary);
25 RESULT getSTC(pts_t &pts, int num);
26 RESULT getCADemuxID(uint8_t &id) { id = demux; return 0; }
28 RESULT connectEvent(const Slot1<void,int> &event, ePtr<eConnection> &conn);
30 int getRefCount() { return ref; }
32 int adapter, demux, source;
35 friend class eDVBSectionReader;
36 friend class eDVBPESReader;
37 friend class eDVBAudio;
38 friend class eDVBVideo;
40 friend class eDVBTText;
41 friend class eDVBTSRecorder;
42 friend class eDVBCAService;
43 Signal1<void, int> m_event;
48 class eDVBSectionReader: public iDVBSectionReader, public Object
50 DECLARE_REF(eDVBSectionReader);
52 Signal1<void, const __u8*> read;
53 ePtr<eDVBDemux> demux;
57 ePtr<eSocketNotifier> notifier;
60 eDVBSectionReader(eDVBDemux *demux, eMainloop *context, RESULT &res);
61 virtual ~eDVBSectionReader();
62 RESULT start(const eDVBSectionFilterMask &mask);
64 RESULT connectRead(const Slot1<void,const __u8*> &read, ePtr<eConnection> &conn);
67 class eDVBPESReader: public iDVBPESReader, public Object
69 DECLARE_REF(eDVBPESReader);
71 Signal2<void, const __u8*, int> m_read;
72 ePtr<eDVBDemux> m_demux;
75 ePtr<eSocketNotifier> m_notifier;
77 eDVBPESReader(eDVBDemux *demux, eMainloop *context, RESULT &res);
78 virtual ~eDVBPESReader();
79 RESULT start(int pid);
81 RESULT connectRead(const Slot2<void,const __u8*, int> &read, ePtr<eConnection> &conn);
84 class eDVBRecordFileThread;
86 class eDVBTSRecorder: public iDVBTSRecorder, public Object
88 DECLARE_REF(eDVBTSRecorder);
90 eDVBTSRecorder(eDVBDemux *demux);
94 RESULT addPID(int pid);
95 RESULT removePID(int pid);
97 RESULT setTimingPID(int pid, int type);
99 RESULT setTargetFD(int fd);
100 RESULT setTargetFilename(const char *filename);
101 RESULT setBoundary(off_t max);
105 RESULT getCurrentPCR(pts_t &pcr);
107 RESULT connectEvent(const Slot1<void,int> &event, ePtr<eConnection> &conn);
109 RESULT startPID(int pid);
110 void stopPID(int pid);
112 eDVBRecordFileThread *m_thread;
113 void filepushEvent(int event);
115 std::map<int,int> m_pids;
116 Signal1<void,int> m_event;
118 ePtr<eDVBDemux> m_demux;
120 int m_running, m_target_fd, m_source_fd;
121 std::string m_target_filename;