26 #include <libxml/xmlmemory.h>
27 #include <libxml/parser.h>
39 #define SI_CACHE_FILE_VERSION 0x101u
40 #define SI_CACHE_MAX_FREQUENCIES 255
41 #define SI_CACHE_CRC_QUOTIENT 0x04C11DB7
44 #define DEFAULT_SI_CACHE_FILENAME "SICache"
54 #define SOURCEID_UNKNOWN (0xFFFFFFFF)
55 #define TSID_UNKNOWN (0xFFFFFFFF) // ECR 1072
56 #define SI_DEFAULT_PROGRAM_NUMBER (0xFFFFFFFF)
57 #define PROGRAM_NUMBER_UNKNOWN (0xFFFF)
58 #define VIRTUAL_CHANNEL_UNKNOWN (0xFFFF)
59 #define SI_DEFAULT_CHANNEL_NUMBER 0xFFFFFFFF
61 typedef enum _SIFileType_t_ {
73 SIENTRY_UNSPECIFIED = 0,
90 typedef enum _siChannelType
92 CHANNEL_TYPE_NORMAL = 0x00,
93 CHANNEL_TYPE_HIDDEN = 0x01,
94 CHANNEL_TYPE_RESERVED_2 = 0x02,
95 CHANNEL_TYPE_RESERVED_3 = 0x03,
96 CHANNEL_TYPE_RESERVED_4 = 0x04,
97 CHANNEL_TYPE_RESERVED_5 = 0x05,
98 CHANNEL_TYPE_RESERVED_6 = 0x06,
99 CHANNEL_TYPE_RESERVED_7 = 0x07,
100 CHANNEL_TYPE_RESERVED_8 = 0x08,
101 CHANNEL_TYPE_RESERVED_9 = 0x09,
102 CHANNEL_TYPE_RESERVED_10 = 0x0A,
103 CHANNEL_TYPE_RESERVED_11 = 0x0B,
104 CHANNEL_TYPE_RESERVED_12 = 0x0C,
105 CHANNEL_TYPE_RESERVED_13 = 0x0D,
106 CHANNEL_TYPE_RESERVED_14 = 0x0E,
107 CHANNEL_TYPE_RESERVED_15 = 0x0F,
110 typedef enum _siVideoStandard
112 VIDEO_STANDARD_NTSC = 0x00,
113 VIDEO_STANDARD_PAL625 = 0x01,
114 VIDEO_STANDARD_PAL525 = 0x02,
115 VIDEO_STANDARD_SECAM = 0x03,
116 VIDEO_STANDARD_MAC = 0x04,
117 VIDEO_STANDARD_UNKNOWN = 0x05
130 typedef enum _siServiceType
132 SI_SERVICE_TYPE_UNKNOWN = 0x00,
133 SI_SERVICE_ANALOG_TV = 0x01,
134 SI_SERVICE_DIGITAL_TV = 0x02,
135 SI_SERVICE_DIGITAL_RADIO = 0x03,
136 SI_SERVICE_DATA_BROADCAST = 0x04,
137 SI_SERVICE_NVOD_REFERENCE = 0x05,
138 SI_SERVICE_NVOD_TIME_SHIFTED = 0x06,
139 SI_SERVICE_ANALOG_RADIO = 0x07,
140 SI_SERVICE_DATA_APPLICATION = 0x08
145 uint32_t virtual_channel_number;
147 uint32_t modulation_mode;
148 uint32_t carrier_frequency;
149 uint32_t program_number;
153 typedef struct _LangSpecificStringList
157 struct LangSpecificStringList *next;
158 } LangSpecificStringList;
175 long long ptime_service;
180 uint16_t virtual_channel_number;
184 uint32_t dsgAttached;
195 uint32_t major_channel_number;
209 list<ProgramDetails> m_program_list;
213 bool load_xml_file(
string xml_file);
214 int xml_parse_attributes(xmlNodePtr parent);
215 void init_mpeg2_crc(
void);
216 uint32_t calc_mpeg2_crc(uint8_t * data, uint32_t len);
218 bool parse_program_details(
siTableEntry **si_entry_head, uint32_t frequency[], uint32_t modulation[],
int &f_index,
int &m_index);
219 bool cache_si_data (
string sidbFileName);
220 bool cache_sns_data (
string snsdbFileName);
221 bool write_crc_for_si_cache(
string sidbFileName);
222 bool write_crc_for_si_and_sns_cache(
string sidbFileName,
string snsdbFileName);
223 unsigned int get_file_size(
const char * location);
224 bool load_si_data(
string sidbFileName);
228 bool Load(
string file_name,
int mode);
229 bool GenerateSICache (
string sidbFileName );
230 bool GenerateSICache (
string sidbFileName,
string snsdbFileName );
231 bool GenerateXML (
string sixmlFileName);
232 void DumpChannelMap();