openATV enigma2
openATV is an open source SetTopBox Graphical user interface.
opentv.h
Go to the documentation of this file.
1 #ifndef __OPENTV_H__
2 #define __OPENTV_H__
3 
4 #include <dvbsi++/long_crc_section.h>
5 #include <dvbsi++/descriptor_container.h>
6 
7 #define OPENTV_DESCRIPTOR_LOOP 0xb0
8 #define OPENTV_LOGICAL_CHANNEL_DESCRIPTOR 0xb1
9 #define OPENTV_EVENT_TITLE_DESCRIPTOR 0xb5
10 #define OPENTV_EVENT_SUMMARY_DESCRIPTOR 0xb9
11 #define OPENTV_EVENT_DESCRIPTION_DESCRIPTOR 0xbb
12 #define OPENTV_EVENT_SERIES_LINK_DESCRIPTOR 0xc1
13 #define OPENTV_EVENT_TITLE_LENGTH 0xff
14 #define OPENTV_EVENT_SUMMARY_LENGTH 0x3ff
15 
17 {
18 protected:
19  unsigned transportStreamId : 16;
20  unsigned originalNetworkId : 16;
21  unsigned serviceId : 16;
22  unsigned channelId : 16;
23  unsigned serviceType : 6;
24 
25 public:
26  OpenTvChannel(const uint8_t *const buffer);
27  ~OpenTvChannel(void);
28 
29  uint16_t getTransportStreamId(void) const;
30  uint16_t getOriginalNetworkId(void) const;
31  uint16_t getServiceId(void) const;
32  uint16_t getChannelId(void) const;
33  uint8_t getServiceType(void) const;
34 
35  void setTransportStreamId(uint16_t transportstreamid);
36  void setOriginalNetworkId(uint16_t originalnetworkid);
37 };
38 
39 typedef std::list<OpenTvChannel *> OpenTvChannelList;
40 typedef OpenTvChannelList::iterator OpenTvChannelListIterator;
41 typedef OpenTvChannelList::const_iterator OpenTvChannelListConstIterator;
42 
43 class OpenTvChannelSection : public LongCrcSection , public DescriptorContainer
44 {
45 protected:
46  unsigned descriptorsLength : 12;
47  unsigned descriptorLength : 8;
49  unsigned transportStreamId : 16;
50  unsigned originalNetworkId : 16;
52 
53 public:
54  OpenTvChannelSection(const uint8_t * const buffer);
56 
57  const OpenTvChannelList *getChannels(void) const;
58  uint16_t getChannelsListSize(void) const;
59 };
60 
61 class OpenTvTitle : public DescriptorContainer
62 {
63 protected:
64  unsigned channelId : 16;
65  unsigned eventId : 16;
66  unsigned startTimeBcd : 32;
67  unsigned duration : 24;
68  unsigned crc32 : 32;
69  std::string title;
70 
71 public:
72  OpenTvTitle(const uint8_t *const buffer, uint16_t mjdtime);
73  ~OpenTvTitle(void);
74 
75  std::string getTitle(void) const;
76  uint32_t getCRC32(void) const;
77  uint16_t getChannelId(void) const;
78  uint32_t getStartTime(void) const;
79  uint16_t getEventId(void) const;
80  uint32_t getDuration(void) const;
81  void setChannelId(uint16_t channelid);
82  void setEventId(uint16_t eventId);
83 };
84 
85 typedef std::list<OpenTvTitle *> OpenTvTitleList;
86 typedef OpenTvTitleList::iterator OpenTvTitleListIterator;
87 typedef OpenTvTitleList::const_iterator OpenTvTitleListConstIterator;
88 
89 class OpenTvTitleSection : public LongCrcSection , public DescriptorContainer
90 {
91 protected:
92  unsigned channelId : 16;
93  unsigned startTimeMjd : 16;
94  unsigned eventId : 16;
96 
97 public:
98  OpenTvTitleSection(const uint8_t * const buffer);
99  ~OpenTvTitleSection(void);
100 
101  const OpenTvTitleList *getTitles(void) const;
102  uint16_t getTitlesListSize(void) const;
103 };
104 
105 class OpenTvSummary : public DescriptorContainer
106 {
107 protected:
108  unsigned channelId : 16;
109  unsigned eventId : 16;
110  std::string summary;
111 
112 public:
113  OpenTvSummary(const uint8_t *const buffer);
114  ~OpenTvSummary(void);
115 
116  std::string getSummary(void) const;
117  uint16_t getChannelId(void) const;
118  uint16_t getEventId(void) const;
119  void setChannelId(uint16_t channelid);
120  void setEventId(uint16_t eventId);
121 };
122 
123 typedef std::list<OpenTvSummary *> OpenTvSummaryList;
124 typedef OpenTvSummaryList::iterator OpenTvSummaryListIterator;
125 typedef OpenTvSummaryList::const_iterator OpenTvSummaryListConstIterator;
126 
127 class OpenTvSummarySection : public LongCrcSection , public DescriptorContainer
128 {
129 protected:
130  unsigned channelId : 16;
131  unsigned startTimeMjd : 16;
132  unsigned eventId : 16;
134 
135 public:
136  OpenTvSummarySection(const uint8_t * const buffer);
137  ~OpenTvSummarySection(void);
138 
139  const OpenTvSummaryList *getSummaries(void) const;
140  uint16_t getSummariesListSize(void) const;
141 };
142 
143 #endif /* __OPENTV_H__ */
Definition: opentv.h:17
uint8_t getServiceType(void) const
Definition: opentv.cpp:55
unsigned channelId
Definition: opentv.h:22
uint16_t getServiceId(void) const
Definition: opentv.cpp:45
unsigned originalNetworkId
Definition: opentv.h:20
uint16_t getTransportStreamId(void) const
Definition: opentv.cpp:35
uint16_t getOriginalNetworkId(void) const
Definition: opentv.cpp:40
unsigned serviceType
Definition: opentv.h:23
~OpenTvChannel(void)
Definition: opentv.cpp:31
uint16_t getChannelId(void) const
Definition: opentv.cpp:50
unsigned transportStreamId
Definition: opentv.h:19
void setOriginalNetworkId(uint16_t originalnetworkid)
Definition: opentv.cpp:65
void setTransportStreamId(uint16_t transportstreamid)
Definition: opentv.cpp:60
OpenTvChannel(const uint8_t *const buffer)
Definition: opentv.cpp:23
unsigned serviceId
Definition: opentv.h:21
Definition: opentv.h:44
unsigned transportDescriptorsLength
Definition: opentv.h:48
unsigned descriptorsLength
Definition: opentv.h:46
~OpenTvChannelSection(void)
Definition: opentv.cpp:135
uint16_t getChannelsListSize(void) const
Definition: opentv.cpp:146
unsigned descriptorLength
Definition: opentv.h:47
const OpenTvChannelList * getChannels(void) const
Definition: opentv.cpp:141
OpenTvChannelList channels
Definition: opentv.h:51
OpenTvChannelSection(const uint8_t *const buffer)
Definition: opentv.cpp:70
unsigned originalNetworkId
Definition: opentv.h:50
unsigned transportStreamId
Definition: opentv.h:49
Definition: opentv.h:106
unsigned channelId
Definition: opentv.h:108
unsigned eventId
Definition: opentv.h:109
std::string summary
Definition: opentv.h:110
void setChannelId(uint16_t channelid)
Definition: opentv.cpp:360
void setEventId(uint16_t eventId)
Definition: opentv.cpp:365
OpenTvSummary(const uint8_t *const buffer)
Definition: opentv.cpp:288
uint16_t getEventId(void) const
Definition: opentv.cpp:355
uint16_t getChannelId(void) const
Definition: opentv.cpp:350
~OpenTvSummary(void)
Definition: opentv.cpp:341
std::string getSummary(void) const
Definition: opentv.cpp:345
Definition: opentv.h:128
OpenTvSummarySection(const uint8_t *const buffer)
Definition: opentv.cpp:370
unsigned startTimeMjd
Definition: opentv.h:131
OpenTvSummaryList summaries
Definition: opentv.h:133
unsigned channelId
Definition: opentv.h:130
unsigned eventId
Definition: opentv.h:132
~OpenTvSummarySection(void)
Definition: opentv.cpp:402
uint16_t getSummariesListSize(void) const
Definition: opentv.cpp:413
const OpenTvSummaryList * getSummaries(void) const
Definition: opentv.cpp:408
Definition: opentv.h:62
uint32_t getDuration(void) const
Definition: opentv.cpp:227
unsigned channelId
Definition: opentv.h:64
uint32_t getStartTime(void) const
Definition: opentv.cpp:217
unsigned eventId
Definition: opentv.h:65
~OpenTvTitle(void)
Definition: opentv.cpp:198
std::string getTitle(void) const
Definition: opentv.cpp:202
unsigned duration
Definition: opentv.h:67
uint16_t getEventId(void) const
Definition: opentv.cpp:222
uint16_t getChannelId(void) const
Definition: opentv.cpp:212
std::string title
Definition: opentv.h:69
unsigned startTimeBcd
Definition: opentv.h:66
unsigned crc32
Definition: opentv.h:68
OpenTvTitle(const uint8_t *const buffer, uint16_t mjdtime)
Definition: opentv.cpp:151
void setChannelId(uint16_t channelid)
Definition: opentv.cpp:232
uint32_t getCRC32(void) const
Definition: opentv.cpp:207
void setEventId(uint16_t eventId)
Definition: opentv.cpp:237
Definition: opentv.h:90
const OpenTvTitleList * getTitles(void) const
Definition: opentv.cpp:278
OpenTvTitleSection(const uint8_t *const buffer)
Definition: opentv.cpp:242
unsigned channelId
Definition: opentv.h:92
OpenTvTitleList titles
Definition: opentv.h:95
unsigned eventId
Definition: opentv.h:94
~OpenTvTitleSection(void)
Definition: opentv.cpp:272
uint16_t getTitlesListSize(void) const
Definition: opentv.cpp:283
unsigned startTimeMjd
Definition: opentv.h:93
std::list< OpenTvSummary * > OpenTvSummaryList
Definition: opentv.h:123
OpenTvChannelList::const_iterator OpenTvChannelListConstIterator
Definition: opentv.h:41
std::list< OpenTvTitle * > OpenTvTitleList
Definition: opentv.h:85
OpenTvTitleList::const_iterator OpenTvTitleListConstIterator
Definition: opentv.h:87
OpenTvSummaryList::iterator OpenTvSummaryListIterator
Definition: opentv.h:124
OpenTvSummaryList::const_iterator OpenTvSummaryListConstIterator
Definition: opentv.h:125
OpenTvTitleList::iterator OpenTvTitleListIterator
Definition: opentv.h:86
std::list< OpenTvChannel * > OpenTvChannelList
Definition: opentv.h:39
OpenTvChannelList::iterator OpenTvChannelListIterator
Definition: opentv.h:40