| 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 |
unsigned 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[MAXSECLEN]; |
|---|
| 61 |
} ContentDesc; |
|---|
| 62 |
|
|---|
| 63 |
typedef struct _SeriesDesc { |
|---|
| 64 |
int descriptor_tag; |
|---|
| 65 |
int descriptor_length; |
|---|
| 66 |
int series_id; |
|---|
| 67 |
int repeat_label; |
|---|
| 68 |
int program_pattern; |
|---|
| 69 |
int expire_date_valid_flag; |
|---|
| 70 |
int expire_date; |
|---|
| 71 |
int episode_number; |
|---|
| 72 |
int last_episode_number; |
|---|
| 73 |
char series_name_char[MAXSECLEN]; |
|---|
| 74 |
} SeriesDesc; |
|---|
| 75 |
|
|---|
| 76 |
typedef struct _EEVTDhead { |
|---|
| 77 |
int descriptor_tag; |
|---|
| 78 |
int descriptor_length; |
|---|
| 79 |
int descriptor_number; |
|---|
| 80 |
int last_descriptor_number; |
|---|
| 81 |
char ISO_639_language_code[3]; |
|---|
| 82 |
int length_of_items; |
|---|
| 83 |
} EEVTDhead; |
|---|
| 84 |
|
|---|
| 85 |
typedef struct _EEVTDitem { |
|---|
| 86 |
int item_description_length; |
|---|
| 87 |
char item_description[MAXSECLEN]; |
|---|
| 88 |
int item_length; |
|---|
| 89 |
char item[MAXSECLEN]; |
|---|
| 90 |
|
|---|
| 91 |
int descriptor_number; |
|---|
| 92 |
} EEVTDitem; |
|---|
| 93 |
|
|---|
| 94 |
typedef struct _EEVTDtail { |
|---|
| 95 |
int text_length; |
|---|
| 96 |
char text[MAXSECLEN]; |
|---|
| 97 |
} EEVTDtail; |
|---|
| 98 |
|
|---|
| 99 |
#ifdef __cplusplus |
|---|
| 100 |
extern "C"{ |
|---|
| 101 |
#endif |
|---|
| 102 |
|
|---|
| 103 |
int parseEIThead(unsigned char *data, EIThead *h); |
|---|
| 104 |
int parseEITbody(unsigned char *data, EITbody *b); |
|---|
| 105 |
int parseSEVTdesc(unsigned char *data, SEVTdesc *desc) ; |
|---|
| 106 |
|
|---|
| 107 |
int parseContentDesc(unsigned char *data, ContentDesc *desc); |
|---|
| 108 |
int parseSeriesDesc(unsigned char *data, SeriesDesc *desc); |
|---|
| 109 |
|
|---|
| 110 |
int parseEEVTDhead(unsigned char *data, EEVTDhead *desc) ; |
|---|
| 111 |
int parseEEVTDitem(unsigned char *data, EEVTDitem *desc) ; |
|---|
| 112 |
int parseEEVTDtail(unsigned char *data, EEVTDtail *desc) ; |
|---|
| 113 |
|
|---|
| 114 |
void dumpEIT(unsigned char *data, int serv_id, int original_network_id, int transport_stream_id, EIT_CONTROL *eittop); |
|---|
| 115 |
|
|---|
| 116 |
#ifdef __cplusplus |
|---|
| 117 |
} |
|---|
| 118 |
#endif |
|---|
| 119 |
|
|---|
| 120 |
#endif |
|---|