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() const { return source; }
19 RESULT setSourcePVR(const std::string &pvr_source);
20 std::string getSourcePVR() const { return pvr_source; }
22 RESULT createSectionReader(eMainloop *context, ePtr<iDVBSectionReader> &reader);
23 RESULT createPESReader(eMainloop *context, ePtr<iDVBPESReader> &reader);
24 RESULT createTSRecorder(ePtr<iDVBTSRecorder> &recorder);
25 RESULT getMPEGDecoder(ePtr<iTSMPEGDecoder> &reader, int decoder_id);
26 RESULT getSTC(pts_t &pts, int num);
27 RESULT getCADemuxID(uint8_t &id) { id = demux; return 0; }
29 RESULT connectEvent(const sigc::slot1<void,int> &event, ePtr<eConnection> &conn);
30 int openDVR(int flags);
32 int getRefCount() { return ref; }
34 int adapter, demux, source;
35 std::string pvr_source;
37 friend class eDVBSectionReader;
38 friend class eDVBPESReader;
39 friend class eDVBAudio;
40 friend class eDVBVideo;
42 friend class eDVBTText;
43 friend class eDVBTSRecorder;
44 friend class eDVBCAService;
45 sigc::signal1<void, int> m_event;
50 class eDVBSectionReader: public iDVBSectionReader, public sigc::trackable
52 DECLARE_REF(eDVBSectionReader);
54 sigc::signal2<void, const __u8*, int> read;
55 ePtr<eDVBDemux> demux;
59 ePtr<eSocketNotifier> notifier;
60 Slot0<__u8*> m_buffer_func;
61 bool m_have_external_buffer_func;
63 eDVBSectionReader(eDVBDemux *demux, eMainloop *context, RESULT &res);
64 virtual ~eDVBSectionReader();
65 RESULT setBufferSize(int size);
66 RESULT start(const eDVBSectionFilterMask &mask);
67 RESULT startWithExternalBufferFunc(const eDVBSectionFilterMask &mask, const Slot0<__u8*> &buffer_func);
69 RESULT connectRead(const sigc::slot2<void,const __u8*, int> &read, ePtr<eConnection> &conn);
72 class eDVBPESReader: public iDVBPESReader, public sigc::trackable
74 DECLARE_REF(eDVBPESReader);
76 sigc::signal2<void, const __u8*, int> m_read;
77 ePtr<eDVBDemux> m_demux;
80 ePtr<eSocketNotifier> m_notifier;
82 eDVBPESReader(eDVBDemux *demux, eMainloop *context, RESULT &res);
83 virtual ~eDVBPESReader();
84 RESULT setBufferSize(int size);
85 RESULT start(int pid);
87 RESULT connectRead(const sigc::slot2<void,const __u8*, int> &read, ePtr<eConnection> &conn);
90 class eDVBRecordFileThread;
92 class eDVBTSRecorder: public iDVBTSRecorder, public sigc::trackable
94 DECLARE_REF(eDVBTSRecorder);
96 eDVBTSRecorder(eDVBDemux *demux);
99 RESULT setBufferSize(int size);
101 RESULT addPID(int pid);
102 RESULT removePID(int pid);
104 RESULT setTimingPID(int pid, int type);
106 RESULT setTargetFD(int fd);
107 RESULT setTargetFilename(const char *filename);
108 RESULT setAccessPoints(bool on);
112 RESULT getCurrentPCR(pts_t &pcr);
114 RESULT connectEvent(const sigc::slot1<void,int> &event, ePtr<eConnection> &conn);
116 RESULT startPID(int pid);
117 void stopPID(int pid);
119 eDVBRecordFileThread *m_thread;
120 void filepushEvent(int event);
122 std::map<int,int> m_pids;
123 sigc::signal1<void,int> m_event;
125 ePtr<eDVBDemux> m_demux;
127 int m_running, m_target_fd, m_source_fd;
128 std::string m_target_filename;