aboutsummaryrefslogtreecommitdiff
path: root/lib/dvb/lowlevel/eit.h
blob: affd06cfaffa4a94133afb8a4e0892cbc8750d30 (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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163

/*
 * EVENT INFORMATION TABLE
 *
 * Copyright (C) 1998  Thomas Mirlacher
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 * 
 * The author may be reached as dent@cosy.sbg.ac.at, or
 * Thomas Mirlacher, Jakob-Haringerstr. 2, A-5020 Salzburg,
 * Austria
 *
 *------------------------------------------------------------
 *
 */

#ifndef __EIT_H__
#define __EIT_H__

// Service Description Section
#include <sys/types.h>

typedef struct {
	u_char	table_id			: 8;

#if BYTE_ORDER == BIG_ENDIAN
	u_char	section_syntax_indicator	: 1;
	u_char					: 3;
	u_char	section_length_hi		: 4;
#else
	u_char	section_length_hi		: 4;
	u_char					: 3;
	u_char	section_syntax_indicator	: 1;
#endif

	u_char	section_length_lo		: 8;

	u_char	service_id_hi			: 8;
	u_char	service_id_lo			: 8;

#if BYTE_ORDER == BIG_ENDIAN
	u_char					: 2;
	u_char	version_number			: 5;
	u_char	current_next_indicator		: 1;
#else
	u_char	current_next_indicator		: 1;
	u_char	version_number			: 5;
	u_char					: 2;
#endif

	u_char	section_number			: 8;
	u_char	last_section_number		: 8;
	u_char	transport_stream_id_hi		: 8;
	u_char	transport_stream_id_lo		: 8;
	u_char	original_network_id_hi		: 8;
	u_char	original_network_id_lo		: 8;
	u_char	segment_last_section_number	: 8;
	u_char	segment_last_table_id		: 8;
} eit_t;

#define EIT_SIZE 14

struct eit_loop_struct1 {
	u_char	service_id_hi			: 8;
	u_char	service_id_lo			: 8;

#if BYTE_ORDER == BIG_ENDIAN
	u_char					: 6;
	u_char	eit_schedule_flag		: 1;
	u_char	eit_present_following_flag	: 1;

	u_char	running_status			: 3;
	u_char	free_ca_mode			: 1;
	u_char	descriptors_loop_length_hi	: 4;
#else
	u_char	eit_present_following_flag	: 1;
	u_char	eit_schedule_flag		: 1;
	u_char					: 6;

	u_char	descriptors_loop_length_hi	: 4;
	u_char	free_ca_mode			: 1;
	u_char	running_status			: 3;
#endif

	u_char	descriptors_loop_length_lo	: 8;
};

#define EIT_SHORT_EVENT_DESCRIPTOR 0x4d
#define EIT_SHORT_EVENT_DESCRIPTOR_SIZE 6

struct eit_short_event_descriptor_struct {
	u_char	descriptor_tag			: 8;
	u_char	descriptor_length		: 8;
	
	u_char	language_code_1			: 8;
	u_char	language_code_2			: 8;
	u_char	language_code_3			: 8;

	u_char	event_name_length		: 8;
};
	
#define EIT_EXTENDED_EVENT_DESCRIPOR 0x4e

typedef struct eit_event_struct {
	u_char	event_id_hi			: 8;
	u_char	event_id_lo			: 8;
	
	u_char	start_time_1			: 8;
	u_char	start_time_2			: 8;
	u_char	start_time_3			: 8;
	u_char	start_time_4			: 8;
	u_char	start_time_5			: 8;

	u_char	duration_1			: 8;
	u_char	duration_2			: 8;
	u_char	duration_3			: 8;

#if BYTE_ORDER == BIG_ENDIAN
	u_char	running_status			: 3;
	u_char	free_CA_mode			: 1;
	u_char	descriptors_loop_length_hi	: 4;
#else
	u_char	descriptors_loop_length_hi	: 4;
	u_char	free_CA_mode			: 1;
	u_char	running_status			: 3;
#endif

	u_char	descriptors_loop_length_lo	: 8;
	
} eit_event_t;
#define EIT_LOOP_SIZE 12

#define EIT_EXTENDED_EVENT_DESCRIPOR 0x4e

struct eit_extended_descriptor_struct {
	u_char descriptor_tag : 8;
	u_char descriptor_length : 8;
#if BYTE_ORDER == BIG_ENDIAN
	u_char descriptor_number : 4;
	u_char last_descriptor_number : 4;
#else
	u_char last_descriptor_number : 4;
	u_char descriptor_number : 4;
#endif
	u_char iso_639_2_language_code_1 : 8;
	u_char iso_639_2_language_code_2 : 8;
	u_char iso_639_2_language_code_3 : 8;
};


#endif