4 #include <lib/dvb/idemux.h>
7 class eGTable: public iObject, public Object
11 ePtr<iDVBSectionReader> m_reader;
12 eDVBTableSpec m_table;
16 void sectionRead(const __u8 *data);
18 ePtr<eConnection> m_sectionRead_conn;
20 virtual int createTable(int nr, const __u8 *data, unsigned int max)=0;
22 Signal1<void, int> tableReady;
24 RESULT start(iDVBSectionReader *reader, const eDVBTableSpec &table);
25 RESULT start(iDVBDemux *reader, const eDVBTableSpec &table);
26 RESULT getSpec(eDVBTableSpec &spec) { spec = m_table; return 0; }
32 template <class Section>
33 class eTable: public eGTable
36 std::vector<Section*> sections;
39 int createTable(int nr, const __u8 *data, unsigned int max)
41 if (avail.find(nr) != avail.end())
46 sections[nr] = new Section(data);
49 for (unsigned int i = 0; i < max; ++i)
50 if (avail.find(i) != avail.end())
55 printf(" %d/%d TID %02x\n", avail.size(), max, data[0]);
57 if (avail.size() == max)
65 std::vector<Section*> &getSections() { return sections; }
71 for (typename std::vector<Section*>::iterator i(sections.begin()); i != sections.end(); ++i)
76 class eAUGTable: public Object
79 void slotTableReady(int);
81 Signal1<void, int> tableReady;
82 virtual void getNext(int err)=0;
85 template <class Table>
86 class eAUTable: public eAUGTable
88 ePtr<Table> current, next; // current is READY AND ERRORFREE, next is not yet ready
90 ePtr<iDVBDemux> m_demux;
103 int begin(eMainloop *m, const eDVBTableSpec &spec, ePtr<iDVBDemux> demux)
110 CONNECT(next->tableReady, eAUTable::slotTableReady);
111 next->start(demux, spec);
119 /*emit*/ tableReady(0);
123 /*emit*/ tableReady(-1);
129 RESULT getCurrent(ePtr<Table> &ptr)
140 eDebug("eAUTable: aborted!");
153 void inject(Table *t)
159 void getNext(int error)
166 /*emit*/ tableReady(error);
175 assert(current->ready);
177 /*emit*/ tableReady(0);
181 if (current && (!current->getSpec(spec)))
184 CONNECT(next->tableReady, eAUTable::slotTableReady);
185 spec.flags &= ~(eDVBTableSpec::tfAnyVersion|eDVBTableSpec::tfThisVersion|eDVBTableSpec::tfHaveTimeout);
186 next->eGTable::start(m_demux, spec);