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 RESULT setSourcePVR(int pvrnum);
20 RESULT createSectionReader(eMainloop *context, ePtr<iDVBSectionReader> &reader);
21 RESULT createPESReader(eMainloop *context, ePtr<iDVBPESReader> &reader);
22 RESULT createTSRecorder(ePtr<iDVBTSRecorder> &recorder);
23 RESULT getMPEGDecoder(ePtr<iTSMPEGDecoder> &reader, int primary);
24 RESULT getSTC(pts_t &pts, int num);
25 RESULT getCADemuxID(uint8_t &id) { id = demux; return 0; }
27 RESULT connectEvent(const Slot1<void,int> &event, ePtr<eConnection> &conn);
29 int getRefCount() { return ref; }
34 friend class eDVBSectionReader;
35 friend class eDVBPESReader;
36 friend class eDVBAudio;
37 friend class eDVBVideo;
39 friend class eDVBTText;
40 friend class eDVBTSRecorder;
41 friend class eDVBCAService;
42 Signal1<void, int> m_event;
47 class eDVBSectionReader: public iDVBSectionReader, public Object
49 DECLARE_REF(eDVBSectionReader);
52 Signal1<void, const __u8*> read;
53 ePtr<eDVBDemux> demux;
57 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);
72 Signal2<void, const __u8*, int> m_read;
73 ePtr<eDVBDemux> m_demux;
76 eSocketNotifier *m_notifier;
78 eDVBPESReader(eDVBDemux *demux, eMainloop *context, RESULT &res);
79 virtual ~eDVBPESReader();
80 RESULT start(int pid);
82 RESULT connectRead(const Slot2<void,const __u8*, int> &read, ePtr<eConnection> &conn);
85 class eDVBRecordFileThread;
87 class eDVBTSRecorder: public iDVBTSRecorder, public Object
89 DECLARE_REF(eDVBTSRecorder);
91 eDVBTSRecorder(eDVBDemux *demux);
95 RESULT addPID(int pid);
96 RESULT removePID(int pid);
98 RESULT setTimingPID(int pid);
100 RESULT setTargetFD(int fd);
101 RESULT setTargetFilename(const char *filename);
102 RESULT setBoundary(off_t max);
106 RESULT connectEvent(const Slot1<void,int> &event, ePtr<eConnection> &conn);
108 RESULT startPID(int pid);
109 void stopPID(int pid);
111 eDVBRecordFileThread *m_thread;
112 void filepushEvent(int event);
114 std::map<int,int> m_pids;
115 Signal1<void,int> m_event;
117 ePtr<eDVBDemux> m_demux;
119 int m_running, m_target_fd, m_source_fd;
120 std::string m_target_filename;