add teletext parser
[enigma2.git] / lib / dvb / teletext.cpp
1 #include <lib/base/eerror.h>
2 #include <lib/dvb/teletext.h>
3 #include <lib/dvb/idemux.h>
4
5 DEFINE_REF(eDVBTeletextParser);
6
7 eDVBTeletextParser::eDVBTeletextParser(iDVBDemux *demux)
8 {
9         setStreamID(0xBD); // as per en 300 472
10         
11         if (demux->createPESReader(eApp, m_pes_reader))
12                 eDebug("failed to create PES reader!");
13         else
14                 m_pes_reader->connectRead(slot(*this, &eDVBTeletextParser::processData), m_read_connection);
15                 
16 }
17
18 void eDVBTeletextParser::processPESPacket(__u8 *pkt, int len)
19 {
20         eDebug("GOT TELETEXT PACKET:");
21         int i;
22         for (i=0; i<16; ++i)
23                 eDebugNoNewLine("%02x ", pkt[i]);
24         eDebug("<");
25 }
26
27 int eDVBTeletextParser::start(int pid)
28 {
29         if (m_pes_reader)
30                 return m_pes_reader->start(pid);
31         else
32                 return -1;
33 }