4 #include <lib/dvb/idemux.h>
7 class eGTable: public iObject, public Object
11 ePtr<iDVBSectionReader> m_reader;
12 eDVBTableSpec m_table;
18 void sectionRead(const __u8 *data);
20 ePtr<eConnection> m_sectionRead_conn;
22 virtual int createTable(int nr, const __u8 *data, unsigned int max)=0;
24 Signal1<void, int> tableReady;
26 RESULT start(iDVBSectionReader *reader, const eDVBTableSpec &table);
27 RESULT start(iDVBDemux *reader, const eDVBTableSpec &table);
28 RESULT getSpec(eDVBTableSpec &spec) { spec = m_table; return 0; }
34 template <class Section>
35 class eTable: public eGTable
38 std::vector<Section*> sections;
41 int createTable(int nr, const __u8 *data, unsigned int max)
43 if (avail.find(nr) != avail.end())
47 sections[nr] = new Section(data);
50 for (unsigned int i = 0; i < max; ++i)
51 if (avail.find(i) != avail.end())
56 printf(" %d/%d TID %02x\n", avail.size(), max, data[0]);
58 if (avail.size() == max)
66 std::vector<Section*> &getSections() { return sections; }
72 for (typename std::vector<Section*>::iterator i(sections.begin()); i != sections.end(); ++i)
77 class eAUGTable: public Object
80 void slotTableReady(int);
82 Signal1<void, int> tableReady;
83 virtual void getNext(int err)=0;
86 template <class Table>
87 class eAUTable: public eAUGTable
89 ePtr<Table> current, next; // current is READY AND ERRORFREE, next is not yet ready
91 ePtr<iDVBDemux> m_demux;
110 int begin(eMainloop *m, const eDVBTableSpec &spec, ePtr<iDVBDemux> demux)
117 CONNECT(next->tableReady, eAUTable::slotTableReady);
118 next->start(demux, spec);
126 /*emit*/ tableReady(0);
130 /*emit*/ tableReady(-1);
136 RESULT getCurrent(ePtr<Table> &ptr)
147 eDebug("eAUTable: aborted!");
160 void inject(Table *t)
166 void getNext(int error)
173 /*emit*/ tableReady(error);
182 assert(current->ready);
184 /*emit*/ tableReady(0);
188 if (current && (!current->getSpec(spec)))
191 CONNECT(next->tableReady, eAUTable::slotTableReady);
192 spec.flags &= ~(eDVBTableSpec::tfAnyVersion|eDVBTableSpec::tfThisVersion|eDVBTableSpec::tfHaveTimeout);
193 next->eGTable::start(m_demux, spec);