OSDN Git Service

update epgdump for dist.
[rec10/rec10-git.git] / epgdump / eit.h
1 #ifndef EIT_H
2 #define EIT_H 1
3
4 #include <stdio.h>
5 #include <stdlib.h>
6
7 #include "util.h"
8 #include "ts_ctl.h"
9
10 typedef struct _EIThead {
11         char table_id;
12         int section_syntax_indicator;
13         int reserved_future_use;
14         int reserved1;
15         int section_length;
16         int service_id;
17         int reserved2;
18         int version_number;
19         int current_next_indicator;
20         int section_number;
21         int last_section_number;
22         int transport_stream_id;
23         int original_network_id;
24         int segment_last_section_number;
25         int last_table_id;
26 } EIThead;
27
28 typedef struct _EITbody {
29         int event_id;
30         char start_time[5];
31         char duration[3];
32         int running_status;
33         int free_CA_mode;
34         int descriptors_loop_length;
35         /* 以下は解析結果保存用 */
36         int yy;
37         int mm;
38         int dd;
39         int hh;
40         int hm;
41         int ss;
42         int dhh;
43         int dhm;
44         int dss;
45 } EITbody;
46
47 typedef struct _SEVTdesc {
48         int  descriptor_tag;
49         int  descriptor_length;
50         char ISO_639_language_code[3];
51         int  event_name_length;
52         char event_name[MAXSECLEN];
53         int  text_length;
54         char text[MAXSECLEN];
55 } SEVTdesc;
56
57 typedef struct _ContentDesc {
58         int descriptor_tag;
59         int descriptor_length;
60         char content_nibble_level_1;
61         char content_nibble_level_2;
62         char user_nibble_1;
63         char user_nibble_2;
64 } ContentDesc;
65
66 typedef struct _SeriesDesc {
67         int descriptor_tag;
68         int descriptor_length;
69         int series_id;
70         int repeat_label;
71         int program_pattern;
72         int expire_date_valid_flag;
73         int expire_date;
74         int episode_number;
75         int last_episode_number;
76         char series_name_char[MAXSECLEN];
77 } SeriesDesc;
78
79 typedef struct _ComponentDesc {
80         int descriptor_tag;
81         int descriptor_length;
82         int reserved_future_use;
83         int stream_content;
84         int component_type;
85         int component_tag;
86         char ISO_639_language_code[3];
87         char text_char[MAXSECLEN];
88 } ComponentDesc;
89
90 typedef struct _AudioComponentDesc {
91         int descriptor_tag;
92         int descriptor_length;
93         int reserved_future_use_1;
94         int stream_content;
95         int component_type;
96         int component_tag;
97         int stream_type;
98         int simulcast_group_tag;
99         int ES_multi_lingual_flag;
100         int main_component_flag;
101         int quality_indicator;
102         int sampling_rate;
103         int reserved_future_use_2;
104         char ISO_639_language_code_1[3];
105         char ISO_639_language_code_2[3];
106         char text_char[MAXSECLEN];
107 } AudioComponentDesc;
108
109 typedef struct _EEVTDhead {
110         int  descriptor_tag;
111         int  descriptor_length;
112         int  descriptor_number;
113         int  last_descriptor_number;
114         char ISO_639_language_code[3];
115         int  length_of_items;
116 } EEVTDhead;
117
118 typedef struct _EEVTDitem {
119         int  item_description_length;
120         char item_description[MAXSECLEN];
121         int  item_length;
122         char item[MAXSECLEN];
123         /* 退避用 */
124         int  descriptor_number;
125 } EEVTDitem;
126
127 typedef struct _EEVTDtail {
128         int  text_length;
129         char text[MAXSECLEN];
130 } EEVTDtail;
131
132 #ifdef __cplusplus
133 extern "C"{
134 #endif /* __cplusplus */
135
136         int parseEIThead(unsigned char *data, EIThead *h);
137         int parseEITbody(unsigned char *data, EITbody *b);
138         int parseSEVTdesc(unsigned char *data, SEVTdesc *desc) ;
139
140         int parseContentDesc(unsigned char *data, ContentDesc *desc);
141         int parseSeriesDesc(unsigned char *data, SeriesDesc *desc);
142
143         int parseEEVTDhead(unsigned char *data, EEVTDhead *desc) ;
144         int parseEEVTDitem(unsigned char *data, EEVTDitem *desc) ;
145         int parseEEVTDtail(unsigned char *data, EEVTDtail *desc) ;
146
147         void dumpEIT(unsigned char *data, int serv_id, int original_network_id, int transport_stream_id, EIT_CONTROL *eittop);
148
149 #ifdef __cplusplus
150 }
151 #endif /* __cplusplus */
152
153 #endif