1 #ifndef __lib_dvb_teletext_h
2 #define __lib_dvb_teletext_h
4 #include <lib/base/object.h>
5 #include <lib/dvb/idvb.h>
6 #include <lib/dvb/pesparse.h>
7 #include <lib/dvb/pmt.h>
8 #include <lib/gdi/gpixmap.h>
11 struct eDVBTeletextSubtitlePageElement
16 eDVBTeletextSubtitlePageElement(const gRGB &color, const std::string &text)
17 : m_color(color), m_text(text)
22 struct eDVBTeletextSubtitlePage
26 int m_timeout; /* in pts */
28 std::vector<eDVBTeletextSubtitlePageElement> m_elements;
30 void clear() { m_elements.clear(); }
33 class eDVBTeletextParser: public iObject, public ePESParser, public Object
35 DECLARE_REF(eDVBTeletextParser);
37 eDVBTeletextParser(iDVBDemux *demux);
38 virtual ~eDVBTeletextParser();
40 void setPageAndMagazine(int page, int magazine);
41 void setMagazine(int magazine);
42 void connectNewPage(const Slot1<void,const eDVBTeletextSubtitlePage &> &slot, ePtr<eConnection> &connection);
43 std::set<eDVBServicePMTHandler::subtitleStream> m_found_subtitle_pages;
45 std::map<int, unsigned int> m_modifications;
46 void processPESPacket(__u8 *pkt, int len);
48 ePtr<iDVBPESReader> m_pes_reader;
49 ePtr<eConnection> m_read_connection;
51 eDVBTeletextSubtitlePage m_subtitle_page;
53 int m_pid, m_page_M, m_page_X, m_page_open, m_double_height, m_box_open;
55 void handlePageStart();
56 void handleLine(unsigned char *line, int len);
57 void handlePageEnd(int have_pts, const pts_t &pts);
59 std::string m_subtitle_text;
62 void addSubtitleString(int color, std::string string);
64 void sendSubtitlePage();
66 Signal1<void,const eDVBTeletextSubtitlePage&> m_new_subtitle_page;