- started work on EIT
[enigma2.git] / lib / dvb / pmt.h
1 #ifndef __lib_dvb_dvbmid_h
2 #define __lib_dvb_dvbmid_h
3
4 #include <lib/dvb/idvb.h>
5 #include <lib/dvb/isection.h>
6 #include <lib/dvb/esection.h>
7 #include <lib/dvb_si/pmt.h>
8 #include <lib/dvb_si/pat.h>
9
10 class eDVBServicePMTHandler: public Object
11 {
12         eServiceReferenceDVB m_reference;
13 //      ePtr<eDVBService> m_service;
14
15         int m_last_channel_state;
16         
17         eAUTable<eTable<ProgramMapTable> > m_PMT;
18         eAUTable<eTable<ProgramAssociationTable> > m_PAT;
19
20         ePtr<iDVBChannel> m_channel;
21         ePtr<iDVBResourceManager> m_resourceManager;
22         ePtr<iDVBDemux> m_demux;
23         
24         void channelStateChanged(iDVBChannel *);
25         ePtr<eConnection> m_channelStateChanged_connection;
26
27         void PMTready(int error);
28         void PATready(int error);
29 public:
30         eDVBServicePMTHandler();
31         
32         enum
33         {
34                 eventNoResources,  // a requested resource couldn't be allocated
35                 eventNoPAT,        // no pat could be received (timeout)
36                 eventNoPATEntry,   // no pat entry for the corresponding SID could be found
37                 eventNoPMT,        // no pmt could be received (timeout)
38                 eventNewProgramInfo, // we just received a PMT
39                 eventTuned         // a channel was sucessfully (re-)tuned in, you may start additional filters now
40         };
41
42         Signal1<void,int> serviceEvent;
43         
44         struct videoStream
45         {
46                 int pid;
47         };
48         
49         struct audioStream
50         {
51                 int pid;
52                 enum { atMPEG, atAC3, atDTS };
53                 int type; // mpeg2, ac3, dts, ...
54                 // language code, ...
55         };
56         
57         struct program
58         {
59                 std::vector<videoStream> videoStreams;
60                 std::vector<audioStream> audioStreams;
61                 // ca info
62                 int pcrPid;
63         };
64         
65         int getProgramInfo(struct program &program);
66         int getDemux(ePtr<iDVBDemux> &demux);
67         
68         int tune(eServiceReferenceDVB &ref);    
69 };
70
71 #endif