add invalidate to eListboxPythonStringContent
[enigma2.git] / lib / dvb / demux.h
1 #ifndef __dvb_demux_h
2 #define __dvb_demux_h
3
4 #include <lib/dvb/idvb.h>
5 #include <lib/dvb/idemux.h>
6
7 class eDVBDemux: public iDVBDemux
8 {
9         int adapter, demux;
10         
11         int m_dvr_busy;
12         friend class eDVBSectionReader;
13         friend class eDVBAudio;
14         friend class eDVBVideo;
15         friend class eDVBPCR;
16         friend class eDVBTSRecorder;
17         friend class eDVBCAService;
18 public:
19         DECLARE_REF(eDVBDemux);
20         eDVBDemux(int adapter, int demux);
21         virtual ~eDVBDemux();
22         RESULT createSectionReader(eMainloop *context, ePtr<iDVBSectionReader> &reader);
23         RESULT createTSRecorder(ePtr<iDVBTSRecorder> &recorder);
24         RESULT getMPEGDecoder(ePtr<iTSMPEGDecoder> &reader);
25         RESULT getSTC(pts_t &pts);
26         RESULT getCADemuxID(uint8_t &id) { id = demux; return 0; }
27 };
28
29 class eDVBSectionReader: public iDVBSectionReader, public Object
30 {
31         DECLARE_REF(eDVBSectionReader);
32 private:
33         int fd;
34         Signal1<void, const __u8*> read;
35         ePtr<eDVBDemux> demux;
36         int active;
37         int checkcrc;
38         void data(int);
39         eSocketNotifier *notifier;
40 public:
41         
42         eDVBSectionReader(eDVBDemux *demux, eMainloop *context, RESULT &res);
43         virtual ~eDVBSectionReader();
44         RESULT start(const eDVBSectionFilterMask &mask);
45         RESULT stop();
46         RESULT connectRead(const Slot1<void,const __u8*> &read, ePtr<eConnection> &conn);
47 };
48
49 class eFilePushThread;
50
51 class eDVBTSRecorder: public iDVBTSRecorder, public Object
52 {
53         DECLARE_REF(eDVBTSRecorder);
54 public:
55         eDVBTSRecorder(eDVBDemux *demux);
56         ~eDVBTSRecorder();
57
58         RESULT start();
59         RESULT addPID(int pid);
60         RESULT removePID(int pid);
61         
62         RESULT setFormat(int pid);
63         
64         RESULT setTargetFD(int fd);
65         RESULT setBoundary(off_t max);
66         
67         RESULT stop();
68         
69         RESULT connectEvent(const Slot1<void,int> &event, ePtr<eConnection> &conn);
70 private:
71         RESULT startPID(int pid);
72         void stopPID(int pid);
73         
74         eFilePushThread *m_thread;
75         
76         std::map<int,int> m_pids;
77         Signal1<void,int> m_event;
78         
79         ePtr<eDVBDemux> m_demux;
80         
81         int m_running, m_format, m_target_fd, m_source_fd;
82 };
83
84 #endif