summaryrefslogtreecommitdiff
path: root/p2pvr/scanner/dvbSiReaderHelper.h
blob: 66e12062f7369db15559c544a7f54a4e75b778a9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#ifndef DVBSIREADERHELPER_H
#define DVBSIREADERHELPER_H

#include "scripts.h"
#include "variables.h"
#include <boost/function.hpp>

class RowProcessor;

class DvbSiReaderHelper {
	public:
		typedef boost::function<bool (const u_char *, size_t)> InfoTableParser;

		DvbSiReaderHelper(const ScriptNodePtr p);
		~DvbSiReaderHelper();

		const Variable demux;
		const Variable timeout;

	protected:
		void openInput() const;
		virtual void filterInput(int fd) const = 0;
		void readTables(const InfoTableParser &) const;
		void closeInput() const;

	private:
		mutable int fd_epg;
};

class DvbSiParserHelper {
	protected:
		typedef boost::shared_ptr<Glib::ustring> StrPtr;
		static StrPtr convert(const char * txt, size_t len);
		static const std::string ISO10646;
		static const std::string EitEncoding;
		static const std::string UTF8;
};

#endif