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 */
27 std::vector<eDVBTeletextSubtitlePageElement> m_elements;
29 void clear() { m_elements.clear(); }
32 class eDVBTeletextParser: public iObject, public ePESParser, public Object
34 DECLARE_REF(eDVBTeletextParser);
36 eDVBTeletextParser(iDVBDemux *demux);
37 virtual ~eDVBTeletextParser();
39 void setPageAndMagazine(int page, int magazine);
40 void setMagazine(int magazine);
41 void connectNewPage(const Slot1<void,const eDVBTeletextSubtitlePage &> &slot, ePtr<eConnection> &connection);
42 std::set<eDVBServicePMTHandler::subtitleStream> m_found_subtitle_pages;
44 std::map<int, unsigned int> m_modifications;
45 void processPESPacket(__u8 *pkt, int len);
47 ePtr<iDVBPESReader> m_pes_reader;
48 ePtr<eConnection> m_read_connection;
50 eDVBTeletextSubtitlePage m_subtitle_page;
52 int m_C, m_Y, m_pid, m_page_M, m_page_X, m_page_open, m_double_height, m_box_open;
54 void handlePageStart();
55 void handleLine(unsigned char *line, int len);
56 void handlePageEnd(int have_pts, const pts_t &pts);
58 std::string m_subtitle_text;
61 void addSubtitleString(int color, std::string string);
63 void sendSubtitlePage();
65 Signal1<void,const eDVBTeletextSubtitlePage&> m_new_subtitle_page;