openATV enigma2
openATV is an open source SetTopBox Graphical user interface.
lowlevel/eit.h
Go to the documentation of this file.
1 
2 /*
3  * EVENT INFORMATION TABLE
4  *
5  * Copyright (C) 1998 Thomas Mirlacher
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20  *
21  * The author may be reached as dent@cosy.sbg.ac.at, or
22  * Thomas Mirlacher, Jakob-Haringerstr. 2, A-5020 Salzburg,
23  * Austria
24  *
25  *------------------------------------------------------------
26  *
27  */
28 
29 #ifndef __EIT_H__
30 #define __EIT_H__
31 
32 // Service Description Section
33 #include <sys/types.h>
34 
35 typedef struct {
36  u_char table_id : 8;
37 
38 #if BYTE_ORDER == BIG_ENDIAN
40  u_char : 3;
41  u_char section_length_hi : 4;
42 #else
43  u_char section_length_hi : 4;
44  u_char : 3;
45  u_char section_syntax_indicator : 1;
46 #endif
47 
48  u_char section_length_lo : 8;
49 
50  u_char service_id_hi : 8;
51  u_char service_id_lo : 8;
52 
53 #if BYTE_ORDER == BIG_ENDIAN
54  u_char : 2;
55  u_char version_number : 5;
57 #else
58  u_char current_next_indicator : 1;
59  u_char version_number : 5;
60  u_char : 2;
61 #endif
62 
63  u_char section_number : 8;
64  u_char last_section_number : 8;
71 
72  int getSectionLength() const { return section_length_hi << 8 | section_length_lo; };
73  int getServiceID() const { return service_id_hi << 8 | service_id_lo; };
74  int getTransportStreamId() const { return transport_stream_id_hi << 8 | transport_stream_id_lo; };
75  int getOriginalNetworkId() const { return original_network_id_hi << 8 | original_network_id_lo; };
76 
77  void setSectionLength(int length) { section_length_hi = length >> 8; section_length_lo = length & 0xFF; };
78  void setServiceId(int serviceId) { service_id_hi = serviceId >> 8; service_id_lo = serviceId & 0xFF; };
79  void setTransportStreamId(int tsi) { transport_stream_id_hi = tsi >> 8; transport_stream_id_lo = tsi & 0xFF; };
80  void setOriginalNetworkId(int oni) { original_network_id_hi = oni >> 8; original_network_id_lo = oni & 0xFF; };
81 } eit_t;
82 
83 #define EIT_SIZE 14
84 
86  u_char service_id_hi : 8;
87  u_char service_id_lo : 8;
88 
89 #if BYTE_ORDER == BIG_ENDIAN
90  u_char : 6;
91  u_char eit_schedule_flag : 1;
93 
94  u_char running_status : 3;
95  u_char free_ca_mode : 1;
97 #else
98  u_char eit_present_following_flag : 1;
99  u_char eit_schedule_flag : 1;
100  u_char : 6;
101 
102  u_char descriptors_loop_length_hi : 4;
103  u_char free_ca_mode : 1;
104  u_char running_status : 3;
105 #endif
106 
108 };
109 
110 #define EIT_SHORT_EVENT_DESCRIPTOR 0x4d
111 #define EIT_SHORT_EVENT_DESCRIPTOR_SIZE 6
112 
114  u_char descriptor_tag : 8;
115  u_char descriptor_length : 8;
116 
117  u_char language_code_1 : 8;
118  u_char language_code_2 : 8;
119  u_char language_code_3 : 8;
120 
121  u_char event_name_length : 8;
122 };
123 
124 #define EIT_EXTENDED_EVENT_DESCRIPOR 0x4e
125 #define EIT_EXTENDED_EVENT_DESCRIPTOR_SIZE 6
126 
127 typedef struct eit_event_struct {
128  u_char event_id_hi : 8;
129  u_char event_id_lo : 8;
130 
131  u_char start_time_1 : 8;
132  u_char start_time_2 : 8;
133  u_char start_time_3 : 8;
134  u_char start_time_4 : 8;
135  u_char start_time_5 : 8;
136 
137  u_char duration_1 : 8;
138  u_char duration_2 : 8;
139  u_char duration_3 : 8;
140 
141 #if BYTE_ORDER == BIG_ENDIAN
142  u_char running_status : 3;
143  u_char free_CA_mode : 1;
145 #else
146  u_char descriptors_loop_length_hi : 4;
147  u_char free_CA_mode : 1;
148  u_char running_status : 3;
149 #endif
150 
152 
153  uint16_t getEventId() const { return event_id_hi << 8 | event_id_lo; };
155 
156  void setEventId(uint16_t eventId) { event_id_hi = eventId >> 8; event_id_lo = eventId & 0xFF; };
158 
160 #define EIT_LOOP_SIZE 12
161 
162 #define EIT_EXTENDED_EVENT_DESCRIPOR 0x4e
163 
165  u_char descriptor_tag : 8;
166  u_char descriptor_length : 8;
167 #if BYTE_ORDER == BIG_ENDIAN
168  u_char descriptor_number : 4;
170 #else
171  u_char last_descriptor_number : 4;
172  u_char descriptor_number : 4;
173 #endif
177 };
178 
179 
180 #endif
unsigned char length
Definition: hdmi_cec.h:1
struct eit_event_struct eit_event_t
Definition: lowlevel/eit.h:127
void setEventId(uint16_t eventId)
Definition: lowlevel/eit.h:156
void setDescriptorsLoopLength(int dll)
Definition: lowlevel/eit.h:157
u_char start_time_3
Definition: lowlevel/eit.h:133
u_char event_id_hi
Definition: lowlevel/eit.h:128
u_char start_time_1
Definition: lowlevel/eit.h:131
u_char free_CA_mode
Definition: lowlevel/eit.h:143
u_char start_time_4
Definition: lowlevel/eit.h:134
u_char event_id_lo
Definition: lowlevel/eit.h:129
u_char duration_3
Definition: lowlevel/eit.h:139
u_char duration_1
Definition: lowlevel/eit.h:137
u_char descriptors_loop_length_hi
Definition: lowlevel/eit.h:144
int getDescriptorsLoopLength() const
Definition: lowlevel/eit.h:154
u_char start_time_5
Definition: lowlevel/eit.h:135
u_char duration_2
Definition: lowlevel/eit.h:138
u_char descriptors_loop_length_lo
Definition: lowlevel/eit.h:151
uint16_t getEventId() const
Definition: lowlevel/eit.h:153
u_char start_time_2
Definition: lowlevel/eit.h:132
u_char running_status
Definition: lowlevel/eit.h:142
Definition: lowlevel/eit.h:164
u_char descriptor_tag
Definition: lowlevel/eit.h:165
u_char descriptor_length
Definition: lowlevel/eit.h:166
u_char iso_639_2_language_code_3
Definition: lowlevel/eit.h:176
u_char iso_639_2_language_code_2
Definition: lowlevel/eit.h:175
u_char descriptor_number
Definition: lowlevel/eit.h:168
u_char iso_639_2_language_code_1
Definition: lowlevel/eit.h:174
u_char last_descriptor_number
Definition: lowlevel/eit.h:169
Definition: lowlevel/eit.h:85
u_char free_ca_mode
Definition: lowlevel/eit.h:95
u_char eit_present_following_flag
Definition: lowlevel/eit.h:92
u_char service_id_hi
Definition: lowlevel/eit.h:86
u_char descriptors_loop_length_lo
Definition: lowlevel/eit.h:107
u_char running_status
Definition: lowlevel/eit.h:94
u_char service_id_lo
Definition: lowlevel/eit.h:87
u_char eit_schedule_flag
Definition: lowlevel/eit.h:91
u_char descriptors_loop_length_hi
Definition: lowlevel/eit.h:96
Definition: lowlevel/eit.h:113
u_char language_code_2
Definition: lowlevel/eit.h:118
u_char language_code_1
Definition: lowlevel/eit.h:117
u_char language_code_3
Definition: lowlevel/eit.h:119
u_char descriptor_length
Definition: lowlevel/eit.h:115
u_char event_name_length
Definition: lowlevel/eit.h:121
u_char descriptor_tag
Definition: lowlevel/eit.h:114
Definition: lowlevel/eit.h:35
u_char section_length_lo
Definition: lowlevel/eit.h:48
int getOriginalNetworkId() const
Definition: lowlevel/eit.h:75
u_char section_number
Definition: lowlevel/eit.h:63
u_char version_number
Definition: lowlevel/eit.h:55
u_char segment_last_section_number
Definition: lowlevel/eit.h:69
u_char service_id_hi
Definition: lowlevel/eit.h:50
u_char original_network_id_lo
Definition: lowlevel/eit.h:68
u_char service_id_lo
Definition: lowlevel/eit.h:51
int getSectionLength() const
Definition: lowlevel/eit.h:72
int getTransportStreamId() const
Definition: lowlevel/eit.h:74
void setSectionLength(int length)
Definition: lowlevel/eit.h:77
void setOriginalNetworkId(int oni)
Definition: lowlevel/eit.h:80
u_char table_id
Definition: lowlevel/eit.h:36
u_char original_network_id_hi
Definition: lowlevel/eit.h:67
u_char segment_last_table_id
Definition: lowlevel/eit.h:70
u_char current_next_indicator
Definition: lowlevel/eit.h:56
u_char transport_stream_id_hi
Definition: lowlevel/eit.h:65
u_char transport_stream_id_lo
Definition: lowlevel/eit.h:66
u_char last_section_number
Definition: lowlevel/eit.h:64
int getServiceID() const
Definition: lowlevel/eit.h:73
void setTransportStreamId(int tsi)
Definition: lowlevel/eit.h:79
u_char section_syntax_indicator
Definition: lowlevel/eit.h:39
void setServiceId(int serviceId)
Definition: lowlevel/eit.h:78
u_char section_length_hi
Definition: lowlevel/eit.h:41