| 1 | #ifndef _SCTE_SI_H_ |
|---|
| 2 | #define _SCTE_SI_H_ |
|---|
| 3 | |
|---|
| 4 | |
|---|
| 5 | |
|---|
| 6 | #ifndef DST_ATSC_PSIP_H |
|---|
| 7 | #include "dsthalPsiAtscPsip.h" |
|---|
| 8 | #endif |
|---|
| 9 | |
|---|
| 10 | #ifndef _DSTHALERROR_H_ |
|---|
| 11 | #include "dsthalerror.h" |
|---|
| 12 | #endif |
|---|
| 13 | |
|---|
| 14 | |
|---|
| 15 | #ifdef __cplusplus |
|---|
| 16 | extern "C" { |
|---|
| 17 | #endif |
|---|
| 18 | |
|---|
| 19 | |
|---|
| 20 | |
|---|
| 21 | /* |
|---|
| 22 | * SI Section syntax macro definitions |
|---|
| 23 | */ |
|---|
| 24 | |
|---|
| 25 | #define SECTION_NIT_SUBTYPE 6 /*Network Info Table - table_subtype*/ |
|---|
| 26 | #define SECTION_NIT_SUBTYPE_MASK 0x00ff /*NIT table_subtype mask*/ |
|---|
| 27 | #define SECTION_SVCT_SUBTYPE 4 /*Shortform Virtual Channel Table - table_subtype*/ |
|---|
| 28 | #define SECTION_SVCT_SUBTYPE_MASK 0x00ff /*SVCT table_subtype mask*/ |
|---|
| 29 | |
|---|
| 30 | |
|---|
| 31 | typedef enum { |
|---|
| 32 | ver_cds , |
|---|
| 33 | ver_mms , |
|---|
| 34 | ver_vcm , |
|---|
| 35 | ver_icm , |
|---|
| 36 | ver_sns , |
|---|
| 37 | ver_dcm |
|---|
| 38 | }SI_table_version_k; |
|---|
| 39 | |
|---|
| 40 | |
|---|
| 41 | /*in the Network Information Table...*/ |
|---|
| 42 | typedef enum { |
|---|
| 43 | st_CDS = 0x01, |
|---|
| 44 | st_MMS |
|---|
| 45 | }SI_nit_subtype_k; |
|---|
| 46 | |
|---|
| 47 | /*in the CDS...*/ |
|---|
| 48 | typedef enum { |
|---|
| 49 | fu_10Khz = 0x00, |
|---|
| 50 | fu_125Khz = 0x01 |
|---|
| 51 | }SI_frequency_unit_k; |
|---|
| 52 | |
|---|
| 53 | /*in the MMS...*/ |
|---|
| 54 | typedef enum { |
|---|
| 55 | icm_rate_5_11_coding = 0x00, |
|---|
| 56 | icm_rate_1_2_coding = 0x01, |
|---|
| 57 | /*reserved*/ |
|---|
| 58 | icm_rate_3_5_coding = 0x03, |
|---|
| 59 | /*reserved*/ |
|---|
| 60 | icm_rate_2_3_coding = 0x05, |
|---|
| 61 | /*reserved*/ |
|---|
| 62 | icm_rate_3_4_coding = 0x07, |
|---|
| 63 | icm_rate_4_5_coding = 0x08, |
|---|
| 64 | icm_rate_5_6_coding = 0x09, |
|---|
| 65 | /*reserved*/ |
|---|
| 66 | icm_rate_7_8_coding = 0x0B, |
|---|
| 67 | /*reserved 12-14*/ |
|---|
| 68 | icm_rate_none = 0x0f /*indicates the waveform does not use concaternated coding*/ |
|---|
| 69 | }SI_inner_coding_mode_k; |
|---|
| 70 | |
|---|
| 71 | /*in the MMS...*/ |
|---|
| 72 | typedef enum{ |
|---|
| 73 | mf_unknown = 0, /*The modulation format is unknown.*/ |
|---|
| 74 | mf_QPSK = 1, /*The modulation format is Quadrature Phase Shift Keying.*/ |
|---|
| 75 | mf_BPSK = 2, /*The modulation format is Binary Phase Shift Keying.*/ |
|---|
| 76 | mf_OQPSK = 3, /*The modulation format is offset QPSK.*/ |
|---|
| 77 | mf_VSB8 = 4, /*The modulation format is 8-level Vestigial Sideband.*/ |
|---|
| 78 | mf_VSB16 = 5, /*The modulation format is 16-level Vstigial Sideband.*/ |
|---|
| 79 | mf_QAM16 = 6, /*Modulation format 16-level Quadrature Amplitude Modulation(QAM).*/ |
|---|
| 80 | mf_QAM32 = 7, /*32-level QAM*/ |
|---|
| 81 | mf_QAM64 = 8, /*64-level QAM*/ |
|---|
| 82 | mf_QAM80 = 9, /*80-level QAM*/ |
|---|
| 83 | mf_QAM96 = 10, /*96-level QAM*/ |
|---|
| 84 | mf_QAM112 = 11, /*112-level QAM*/ |
|---|
| 85 | mf_QAM128 = 12, /*128-level QAM*/ |
|---|
| 86 | mf_QAM160 = 13, /*160-level QAM*/ |
|---|
| 87 | mf_QAM192 = 14, /*192-level QAM*/ |
|---|
| 88 | mf_QAM224 = 15, /*224-level QAM*/ |
|---|
| 89 | mf_QAM256 = 16, /*256-level QAM*/ |
|---|
| 90 | mf_QAM320 = 17, /*320-level QAM*/ |
|---|
| 91 | mf_QAM384 = 18, /*384-level QAM*/ |
|---|
| 92 | mf_QAM448 = 19, /*448-level QAM*/ |
|---|
| 93 | mf_QAM512 = 20, /*512-level QAM*/ |
|---|
| 94 | mf_QAM640 = 21, /*640-level QAM*/ |
|---|
| 95 | mf_QAM768 = 22, /*768-level QAM*/ |
|---|
| 96 | mf_QAM896 = 23, /*896-level QAM*/ |
|---|
| 97 | mf_QAM1024 = 24, /*1024-level QAM*/ |
|---|
| 98 | }SI_modulation_format_k; |
|---|
| 99 | |
|---|
| 100 | |
|---|
| 101 | |
|---|
| 102 | typedef struct generalDescriptor { |
|---|
| 103 | DS_U8 descriptor_tag; |
|---|
| 104 | DS_U8 descriptor_length; |
|---|
| 105 | DS_U8* descriptor_data; |
|---|
| 106 | } generalDescriptor_t , *generalDescriptorPtr_t; |
|---|
| 107 | |
|---|
| 108 | |
|---|
| 109 | |
|---|
| 110 | |
|---|
| 111 | /*define a set of carrier frequencies.*/ |
|---|
| 112 | typedef struct CarrierDefinitionSubtable { |
|---|
| 113 | DS_U8 number_of_carriers; /*8bits*/ |
|---|
| 114 | DS_U8 spacing_unit; /*1bit */ |
|---|
| 115 | /*zero : 1bit*/ |
|---|
| 116 | DS_U16 frequency_spacing; /*14bits*/ |
|---|
| 117 | DS_U8 frequency_unit; /*1bit */ |
|---|
| 118 | DS_U16 first_carrier_frequency;/*15bits*/ |
|---|
| 119 | |
|---|
| 120 | DS_U8 descriptors_count; |
|---|
| 121 | generalDescriptor_t *descriptor_structure; |
|---|
| 122 | // DS_U8 *descriptor; |
|---|
| 123 | |
|---|
| 124 | } CDS_t , *CDSPtr_t; |
|---|
| 125 | |
|---|
| 126 | |
|---|
| 127 | typedef struct ModulationModeSubtable { |
|---|
| 128 | DS_U8 transmission_system; /*4bits*/ |
|---|
| 129 | SI_inner_coding_mode_k inner_coding_mode; /*4bits*/ |
|---|
| 130 | DS_U8 split_bitstream_mode; /*1bit*/ |
|---|
| 131 | /*zero : 2bits*/ |
|---|
| 132 | SI_modulation_format_k modulation_format; /*5bits*/ |
|---|
| 133 | /*zero : 4bits*/ |
|---|
| 134 | DS_U32 symbol_rate; /*28bits*/ |
|---|
| 135 | |
|---|
| 136 | DS_U8 descriptors_count; |
|---|
| 137 | generalDescriptor_t *descriptor_structure; |
|---|
| 138 | // DS_U8 *descriptor; |
|---|
| 139 | } MMS_t , *MMSPtr_t; |
|---|
| 140 | |
|---|
| 141 | typedef struct NetworkInfoTableSection { |
|---|
| 142 | |
|---|
| 143 | /*½ÇÁ¦·Ð ¾øÁö¸¸, °ü¸®»ó ÆíÀǸ¦ À§Çؼ Ãß°¡ ÇÑ´Ù.... |
|---|
| 144 | ÀÌ Á¤º¸´Â Revision Detection Descriptor(if exists)·ÎºÎÅÍ °¡Á® ¿Â´Ù.*/ |
|---|
| 145 | DS_U8 table_version_number; /*5bits*/ |
|---|
| 146 | DS_U8 section_number; /*8bits*/ |
|---|
| 147 | DS_U8 last_section_number; /*8bits*/ |
|---|
| 148 | /******************************************************************/ |
|---|
| 149 | |
|---|
| 150 | DS_U8 protocol_version; /*5bits*/ |
|---|
| 151 | DS_U8 first_index; /*8bits*/ |
|---|
| 152 | DS_U8 number_of_records; /*8bits*/ |
|---|
| 153 | DS_U8 transmission_medium; /*4bits*/ |
|---|
| 154 | SI_nit_subtype_k table_subtype; /*4bits*/ |
|---|
| 155 | |
|---|
| 156 | CDS_t * CDSs; |
|---|
| 157 | MMS_t * MMSs; |
|---|
| 158 | |
|---|
| 159 | DS_U8 descriptors_length; /*8bits*/ |
|---|
| 160 | DS_U8 *descriptor; |
|---|
| 161 | DS_U32 CRC32; |
|---|
| 162 | |
|---|
| 163 | } nitSection_t , *nitSectionPtr_t; |
|---|
| 164 | |
|---|
| 165 | |
|---|
| 166 | typedef struct NetworkInfoTable { |
|---|
| 167 | DS_U8 table_version_number; |
|---|
| 168 | DS_U8 protocol_version; /*5bits*/ |
|---|
| 169 | DS_U8 first_index; /*8bits*/ |
|---|
| 170 | DS_U8 number_of_records; /*8bits*/ |
|---|
| 171 | DS_U8 transmission_medium; /*4bits*/ |
|---|
| 172 | SI_nit_subtype_k table_subtype; /*4bits*/ |
|---|
| 173 | |
|---|
| 174 | CDS_t * CDSs; |
|---|
| 175 | MMS_t * MMSs; |
|---|
| 176 | |
|---|
| 177 | DS_U8 descriptors_length; /*8bits*/ |
|---|
| 178 | DS_U8 *descriptor; |
|---|
| 179 | DS_U32 CRC32; |
|---|
| 180 | |
|---|
| 181 | } nit_t , *nitPtr_t; |
|---|
| 182 | |
|---|
| 183 | |
|---|
| 184 | /*in the Network Text Table...*/ |
|---|
| 185 | typedef enum { |
|---|
| 186 | st_SNS = 0x06 /*source name subtable*/ |
|---|
| 187 | }SI_ntt_subtype_k; |
|---|
| 188 | |
|---|
| 189 | |
|---|
| 190 | |
|---|
| 191 | typedef struct SnsRecord { |
|---|
| 192 | DS_U8 application_type; /*1bit*/ |
|---|
| 193 | /*zero : 7bits*/ |
|---|
| 194 | DS_U16 application_ID; /*16bits*/ |
|---|
| 195 | DS_U16 source_ID; /*16bits*/ |
|---|
| 196 | DS_U8 name_length; /*8bits*/ |
|---|
| 197 | DS_U8 *source_name; |
|---|
| 198 | DS_U8 SNS_descriptors_count; /*8bits*/ |
|---|
| 199 | generalDescriptor_t *descriptor_structure; |
|---|
| 200 | |
|---|
| 201 | } snsRecord_t, *snsRecordPtr_t; |
|---|
| 202 | |
|---|
| 203 | |
|---|
| 204 | |
|---|
| 205 | typedef struct NetworkTextTableSection { |
|---|
| 206 | |
|---|
| 207 | /*½ÇÁ¦·Ð ¾øÁö¸¸, °ü¸®»ó ÆíÀǸ¦ À§Çؼ Ãß°¡ ÇÑ´Ù.... |
|---|
| 208 | ÀÌ Á¤º¸´Â Revision Detection Descriptor(if exists)·ÎºÎÅÍ °¡Á® ¿Â´Ù.*/ |
|---|
| 209 | DS_U8 table_version_number; /*5bits*/ |
|---|
| 210 | DS_U8 section_number; /*8bits*/ |
|---|
| 211 | DS_U8 last_section_number; /*8bits*/ |
|---|
| 212 | /******************************************************************/ |
|---|
| 213 | |
|---|
| 214 | |
|---|
| 215 | DS_U8 protocol_version; /*5bits*/ |
|---|
| 216 | DS_U32 ISO_639_language_code; /*24bits*/ |
|---|
| 217 | DS_U8 transmission_medium; /*4bits*/ |
|---|
| 218 | SI_ntt_subtype_k table_subtype; /*4bits*/ |
|---|
| 219 | DS_U8 number_of_SNS_records; /*8bits*/ |
|---|
| 220 | snsRecord_t *SNS_records; |
|---|
| 221 | |
|---|
| 222 | DS_U8 descriptors_length; |
|---|
| 223 | DS_U8 *descriptor; |
|---|
| 224 | DS_U32 CRC32; |
|---|
| 225 | |
|---|
| 226 | } nttSection_t , *nttSectionPtr_t; |
|---|
| 227 | |
|---|
| 228 | |
|---|
| 229 | typedef struct NetworkTextTable { |
|---|
| 230 | DS_U8 table_version_number; |
|---|
| 231 | DS_U8 protocol_version; /*5bits*/ |
|---|
| 232 | DS_U32 ISO_639_language_code; /*24bits*/ |
|---|
| 233 | DS_U8 transmission_medium; /*4bits*/ |
|---|
| 234 | SI_ntt_subtype_k table_subtype; /*4bits*/ |
|---|
| 235 | DS_U8 number_of_SNS_records; /*8bits*/ |
|---|
| 236 | snsRecord_t *SNS_records; |
|---|
| 237 | |
|---|
| 238 | DS_U8 descriptors_length; |
|---|
| 239 | DS_U8 *descriptor; |
|---|
| 240 | DS_U32 CRC32; |
|---|
| 241 | |
|---|
| 242 | } ntt_t , *nttPtr_t; |
|---|
| 243 | |
|---|
| 244 | |
|---|
| 245 | typedef enum { |
|---|
| 246 | st_VCM = 0x00, /*Virtual Channel Map*/ |
|---|
| 247 | st_DCM = 0x01, /*Defined Channel Map*/ |
|---|
| 248 | st_ICM = 0x02 /*Inverse Channel Map*/ |
|---|
| 249 | } SI_svct_subtype_k; |
|---|
| 250 | |
|---|
| 251 | |
|---|
| 252 | typedef enum{ |
|---|
| 253 | ps_path_1 = 0x00, |
|---|
| 254 | ps_path_2 = 0x01 |
|---|
| 255 | } SI_svct_pathselect_k; |
|---|
| 256 | |
|---|
| 257 | |
|---|
| 258 | typedef enum{ |
|---|
| 259 | tt_MPEG2_transport = 0x00, |
|---|
| 260 | tt_non_MPEG2_transport = 0x01 |
|---|
| 261 | } SI_svct_transporttype_k; |
|---|
| 262 | |
|---|
| 263 | typedef enum { |
|---|
| 264 | ct_normal = 0x00, /*indicates that the record is a regular virtual channel record.*/ |
|---|
| 265 | ct_hidden = 0x01 /*indicated that the record identifies a virtual channel that may not be accessed by the user |
|---|
| 266 | by direct entry of the channel number.*/ |
|---|
| 267 | } SI_svct_channeltype_k; |
|---|
| 268 | |
|---|
| 269 | typedef enum { |
|---|
| 270 | vs_NTSC = 0x00, |
|---|
| 271 | vs_PAL625 = 0x01, |
|---|
| 272 | vs_PAL525 = 0x02, |
|---|
| 273 | vs_SECAM = 0x03, |
|---|
| 274 | vs_MAC = 0x04 |
|---|
| 275 | } SI_svct_videostandard_k; |
|---|
| 276 | |
|---|
| 277 | typedef struct DcmData { |
|---|
| 278 | DS_U8 range_defined; /*1bit*/ |
|---|
| 279 | DS_U8 channels_count; /*7bits*/ |
|---|
| 280 | } dcm_data_t , *dcm_dataPtr_t; |
|---|
| 281 | |
|---|
| 282 | typedef struct DefinedChannelMap { |
|---|
| 283 | DS_U16 first_virtual_channel; /*12bits*/ |
|---|
| 284 | DS_U8 DCM_data_length; /*7bits*/ |
|---|
| 285 | dcm_data_t * DCM_data; |
|---|
| 286 | } DCM_t, *DCMPtr_t; |
|---|
| 287 | |
|---|
| 288 | typedef struct VirtualChannel { |
|---|
| 289 | DS_U16 virtual_channel_number; /*12bits*/ |
|---|
| 290 | DS_U8 application_virtual_channel;/*1bit*/ |
|---|
| 291 | /*zero : 1bit */ |
|---|
| 292 | SI_svct_pathselect_k path_select; /*1bit*/ |
|---|
| 293 | SI_svct_transporttype_k transport_type; /*1bit*/ |
|---|
| 294 | SI_svct_channeltype_k channel_type; /*4bits*/ |
|---|
| 295 | |
|---|
| 296 | /*if application_virtual_channel*/ |
|---|
| 297 | DS_U16 application_ID; /*16bits*/ |
|---|
| 298 | /*esle*/ |
|---|
| 299 | DS_U16 source_ID; /*16bits*/ |
|---|
| 300 | |
|---|
| 301 | /*if transport == MEPG_2*/ |
|---|
| 302 | DS_U8 CDS_reference; /*8bits : range 1-255*/ |
|---|
| 303 | DS_U16 program_number; /*16bits*/ |
|---|
| 304 | DS_U8 MMS_reference; /*8bits : range 1-255*/ |
|---|
| 305 | |
|---|
| 306 | /*else : non-MPEG_2*/ |
|---|
| 307 | DS_U8 scrambled; /*1bit*/ |
|---|
| 308 | /*zero : 3bits*/ |
|---|
| 309 | SI_svct_videostandard_k video_standard; /*4bits*/ |
|---|
| 310 | |
|---|
| 311 | DS_U8 descriptors_count; /*8bits*/ |
|---|
| 312 | generalDescriptor_t *descriptor_structure; |
|---|
| 313 | // DS_U8 *descriptor; |
|---|
| 314 | } virtualChannel_t , *virtualChannelPtr_t; |
|---|
| 315 | |
|---|
| 316 | typedef struct VirtualChannelMap { |
|---|
| 317 | DS_U8 descriptors_included; /*1bit*/ |
|---|
| 318 | /*zero : 5bits*/ |
|---|
| 319 | DS_U8 splice; /*1bit*/ |
|---|
| 320 | /*zero : 7bits*/ |
|---|
| 321 | DS_U32 activation_time; /*32bits*/ |
|---|
| 322 | DS_U8 number_of_VC_records; /*8bits*/ |
|---|
| 323 | |
|---|
| 324 | virtualChannel_t *virtual_channel; |
|---|
| 325 | } VCM_t , *VCMPtr_t; |
|---|
| 326 | |
|---|
| 327 | |
|---|
| 328 | typedef struct icmRecord { |
|---|
| 329 | DS_U16 source_ID; /*16bits*/ |
|---|
| 330 | /*zero : 4bits*/ |
|---|
| 331 | DS_U16 virtual_channel_number; /*12bits*/ |
|---|
| 332 | } icmRecord_t , *icmRecordPtr_t; |
|---|
| 333 | |
|---|
| 334 | |
|---|
| 335 | typedef struct InverseChannelMap { |
|---|
| 336 | DS_U16 first_map_index; /*12bits*/ |
|---|
| 337 | /*zero : 1bit*/ |
|---|
| 338 | DS_U8 record_count; /*7bits*/ |
|---|
| 339 | |
|---|
| 340 | icmRecord_t * icmRecords; |
|---|
| 341 | } ICM_t , *ICMPtr_t; |
|---|
| 342 | |
|---|
| 343 | |
|---|
| 344 | typedef struct ShortformVirtualChannelTableSection { |
|---|
| 345 | /*½ÇÁ¦·Ð ¾øÁö¸¸, °ü¸®»ó ÆíÀǸ¦ À§Çؼ Ãß°¡ ÇÑ´Ù.... |
|---|
| 346 | ÀÌ Á¤º¸´Â Revision Detection Descriptor(if exists)·ÎºÎÅÍ °¡Á® ¿Â´Ù.*/ |
|---|
| 347 | DS_U8 table_version_number; /*5bits*/ |
|---|
| 348 | DS_U8 section_number; /*8bits*/ |
|---|
| 349 | DS_U8 last_section_number; /*8bits*/ |
|---|
| 350 | /******************************************************************/ |
|---|
| 351 | |
|---|
| 352 | DS_U8 protocol_version; /*5bits*/ |
|---|
| 353 | DS_U8 transmission_medium; /*4bits*/ |
|---|
| 354 | SI_svct_subtype_k table_subtype; /*4bits*/ |
|---|
| 355 | DS_U16 VCT_ID; /*16bits*/ |
|---|
| 356 | |
|---|
| 357 | DCM_t *DCM; |
|---|
| 358 | VCM_t *VCM; |
|---|
| 359 | ICM_t *ICM; |
|---|
| 360 | |
|---|
| 361 | DS_U8 descriptors_length; |
|---|
| 362 | DS_U8 *descriptor; |
|---|
| 363 | DS_U32 CRC32; |
|---|
| 364 | |
|---|
| 365 | /*descriptors*/ |
|---|
| 366 | } svctSection_t , *svctSectionPtr_t; |
|---|
| 367 | |
|---|
| 368 | |
|---|
| 369 | typedef struct ShortformVirtualChannelTable { |
|---|
| 370 | |
|---|
| 371 | DS_U8 table_version_number; |
|---|
| 372 | DS_U8 protocol_version; /*5bits*/ |
|---|
| 373 | DS_U8 transmission_medium; /*4bits*/ |
|---|
| 374 | SI_svct_subtype_k table_subtype; /*4bits*/ |
|---|
| 375 | DS_U16 VCT_ID; /*16bits*/ |
|---|
| 376 | |
|---|
| 377 | DCM_t *DCM; |
|---|
| 378 | VCM_t *VCM; |
|---|
| 379 | ICM_t *ICM; |
|---|
| 380 | |
|---|
| 381 | DS_U8 descriptors_length; |
|---|
| 382 | DS_U8 *descriptor; |
|---|
| 383 | DS_U32 CRC32; |
|---|
| 384 | |
|---|
| 385 | }svct_t , *svctPtr_t; |
|---|
| 386 | |
|---|
| 387 | |
|---|
| 388 | |
|---|
| 389 | /*in the mgt*/ |
|---|
| 390 | typedef enum { |
|---|
| 391 | |
|---|
| 392 | tt_lf_VCT_cni_1 = 0x02, /*Long-form Virtual Channel Table with current_next_indicator = 1.*/ |
|---|
| 393 | tt_lf_VCT_cni_0 = 0x03, /*Long-form Virtual Channel Table with current_next_indicator = 0.*/ |
|---|
| 394 | |
|---|
| 395 | tt_sf_VCT_vcm = 0x10, /*Short-form Virtual Channel Table with--VCM Subtype.*/ |
|---|
| 396 | tt_sf_VCT_dcm = 0x11, /*Short-form Virtual Channel Table with--DCM Subtype.*/ |
|---|
| 397 | tt_sf_VCT_icm = 0x12, /*Short-form Virtual Channel Table with--ICM subtype.*/ |
|---|
| 398 | |
|---|
| 399 | tt_NIT_cds = 0x20, /*Network Information Table-CDS Table Subtype.*/ |
|---|
| 400 | tt_NIT_mms = 0x21, /*Network Information Table-MMS Table Subtype.*/ |
|---|
| 401 | |
|---|
| 402 | tt_NTT = 0x30, /*Network Text Table--SNS Subtype*/ |
|---|
| 403 | |
|---|
| 404 | /*rrt is defined in ATSC....*/ |
|---|
| 405 | |
|---|
| 406 | tt_AEIT_0 = 0x1000, /*Aggregate Event Information Table with MGT_tag 0.*/ |
|---|
| 407 | tt_AEIT_255 = 0x10FF, /*Aggregate Event Information Table with MGT_tag 255.*/ |
|---|
| 408 | |
|---|
| 409 | tt_AETT_0 = 0x1100, /*Aggregate Extended Text Table with MGT_tag 0.*/ |
|---|
| 410 | tt_AETT_255 = 0x11FF, /*Aggregate Extended Text Table with MGT_tag 255.*/ |
|---|
| 411 | |
|---|
| 412 | } SI_table_type_k; |
|---|
| 413 | |
|---|
| 414 | |
|---|
| 415 | /*in the NIT, NTT , SVCT...*/ |
|---|
| 416 | typedef struct revisionDetectionDescriptor { |
|---|
| 417 | DS_U8 table_version_number; /*5bits*/ |
|---|
| 418 | DS_U8 section_number; /*8bits*/ |
|---|
| 419 | DS_U8 last_section_number; /*8bits*/ |
|---|
| 420 | } revisionDetectionDescriptor_t , *revisionDetectionDescriptorPtr_t; |
|---|
| 421 | |
|---|
| 422 | /*in the virtual_channel() record, contained in the VCM_structure.*/ |
|---|
| 423 | typedef struct twoPartChannelNumberDescriptor { |
|---|
| 424 | DS_U16 major_channel_number; /*10 bits : 0~999*/ |
|---|
| 425 | DS_U16 minor_channel_number; /*10 bits : 0~999*/ |
|---|
| 426 | } twoPartChannelNumberDescriptor_t , *twoPartChannelNumberDescriptorPtr_t; |
|---|
| 427 | |
|---|
| 428 | /*in the virtual_channel() record, contained in the VCM_structure.*/ |
|---|
| 429 | typedef struct channelPropertiesDescriptor { |
|---|
| 430 | DS_U16 channel_TSID; /*16 bits*/ |
|---|
| 431 | DS_U8 out_of_band_channel; /*1 bit*/ |
|---|
| 432 | DS_U8 access_controlled; /*1 bit*/ |
|---|
| 433 | DS_U8 hide_guide; /*1 bit*/ |
|---|
| 434 | DS_U8 service_type; /*6 bits*/ |
|---|
| 435 | } channelPropertiesDescriptor_t , *channelPropertiesDescriptorPtr_t; |
|---|
| 436 | |
|---|
| 437 | |
|---|
| 438 | typedef struct daylightSavingsTimeDescriptor { |
|---|
| 439 | DS_U8 DS_status; /*1bit*/ |
|---|
| 440 | DS_U8 DS_day_of_month;/*5bits*/ |
|---|
| 441 | DS_U8 DS_hour; /*8bits*/ |
|---|
| 442 | } daylightSavingsTimeDescriptor_t , *daylightSavingsTimeDescriptorPtr_t; |
|---|
| 443 | |
|---|
| 444 | typedef enum { |
|---|
| 445 | tid_network_information_table = 0xC2, |
|---|
| 446 | tid_network_text_table = 0xC3, |
|---|
| 447 | tid_shortform_virtual_channel_table = 0xC4, |
|---|
| 448 | tid_si_master_guide_table = 0xc7, /*same with MGT*/ |
|---|
| 449 | tid_si_system_time_table = 0xC5, |
|---|
| 450 | tid_lf_virtual_channel_table = 0xC9, /*It is same with CVCT*/ |
|---|
| 451 | tid_si_rating_region_table = 0xCA, /*same with RRT*/ |
|---|
| 452 | tid_aggregate_event_information_table = 0xD6, |
|---|
| 453 | tid_aggregate_extended_text_table = 0xD7, |
|---|
| 454 | tid_cable_emergency_alert_message = 0xD8 |
|---|
| 455 | } SI_table_id_k; |
|---|
| 456 | |
|---|
| 457 | typedef struct systemTimeTableSection { |
|---|
| 458 | DS_U8 protocol_version; /*5bits*/ |
|---|
| 459 | DS_U32 system_time; /*32bits*/ |
|---|
| 460 | DS_U8 GPS_UTC_offset; /*8bits*/ |
|---|
| 461 | DS_U8 descriptors_length; /*no bits*/ |
|---|
| 462 | DS_U8 *descriptor; /*variable*/ |
|---|
| 463 | } SI_sttSection_t , * SI_sttSectionPtr_t; |
|---|
| 464 | |
|---|
| 465 | |
|---|
| 466 | |
|---|
| 467 | typedef struct siEvent { |
|---|
| 468 | DS_U16 event_ID; /*14bits*/ |
|---|
| 469 | DS_U32 start_time; /*32bits*/ |
|---|
| 470 | DS_U8 ETM_present; /*2bits*/ |
|---|
| 471 | DS_U32 duration; /*32bits*/ |
|---|
| 472 | DS_U8 title_length; /*8bits*/ |
|---|
| 473 | DS_U8 *title_text; |
|---|
| 474 | DS_U16 descriptors_length; /*12bits*/ |
|---|
| 475 | DS_U8 *descriptor; |
|---|
| 476 | } SI_event_t , *SI_eventPtr_t; |
|---|
| 477 | |
|---|
| 478 | typedef struct siEventInformationTableSection { |
|---|
| 479 | DS_U16 source_ID; /*16bits*/ |
|---|
| 480 | |
|---|
| 481 | DS_U8 num_events; /*8bits*/ |
|---|
| 482 | SI_eventPtr_t events; |
|---|
| 483 | } SI_eitSection_t , *SI_eitSectionPtr_t; |
|---|
| 484 | |
|---|
| 485 | typedef struct aggregateEventInformationTableSection { |
|---|
| 486 | DS_U8 AEIT_subtype; /*8bits*/ |
|---|
| 487 | DS_U8 MGT_tag; /*8bits*/ |
|---|
| 488 | DS_U8 version_number; /*5bits*/ |
|---|
| 489 | DS_U8 current_next_indicator; /*1bit*/ |
|---|
| 490 | DS_U8 section_number; /*8bits*/ |
|---|
| 491 | DS_U8 last_section_number; /*8bits*/ |
|---|
| 492 | |
|---|
| 493 | DS_U8 num_sources_in_section; /*8bits*/ |
|---|
| 494 | SI_eitSectionPtr_t eits; |
|---|
| 495 | DS_U32 CRC32; |
|---|
| 496 | |
|---|
| 497 | } aeitSection_t , *aeitSectionPtr_t; |
|---|
| 498 | |
|---|
| 499 | typedef struct aggregateEventInformationTable { |
|---|
| 500 | DS_U8 AEIT_subtype; /*8bits*/ |
|---|
| 501 | DS_U8 MGT_tag; /*8bits*/ |
|---|
| 502 | DS_U8 version_number; /*5bits*/ |
|---|
| 503 | DS_U8 num_sources; |
|---|
| 504 | SI_eitSectionPtr_t eits; |
|---|
| 505 | DS_U32 CRC32; |
|---|
| 506 | |
|---|
| 507 | } aeit_t , *aeitPtr_t; |
|---|
| 508 | |
|---|
| 509 | typedef struct siExtendedTextTableSection { |
|---|
| 510 | DS_U32 ETM_ID; |
|---|
| 511 | DS_U16 extended_text_length; |
|---|
| 512 | DS_U8 *extended_text_message; |
|---|
| 513 | |
|---|
| 514 | } SI_ettSection_t , *SI_ettSectionPtr_t; |
|---|
| 515 | |
|---|
| 516 | typedef struct aggregageExtendedTextTableSection { |
|---|
| 517 | DS_U8 AETT_subtype; /*8bits*/ |
|---|
| 518 | DS_U8 MGT_tag; /*8bits*/ |
|---|
| 519 | DS_U8 version_number; /*5bits*/ |
|---|
| 520 | DS_U8 current_next_indicator; /*1bit*/ |
|---|
| 521 | DS_U8 section_number; /*8bits*/ |
|---|
| 522 | DS_U8 last_section_number; /*8bits*/ |
|---|
| 523 | |
|---|
| 524 | DS_U8 num_blocks_in_section; /*8bits*/ |
|---|
| 525 | DS_U32 CRC32; |
|---|
| 526 | |
|---|
| 527 | SI_ettSectionPtr_t etts; |
|---|
| 528 | |
|---|
| 529 | } aettSection_t , *aettSectionPtr_t; |
|---|
| 530 | |
|---|
| 531 | typedef struct aggregateExtendedTextTable { |
|---|
| 532 | DS_U8 AETT_subtype; /*8bits*/ |
|---|
| 533 | DS_U8 MGT_tag; /*8bits*/ |
|---|
| 534 | DS_U8 version_number; /*8bits*/ |
|---|
| 535 | |
|---|
| 536 | DS_U8 num_blocks; |
|---|
| 537 | SI_ettSectionPtr_t etts; |
|---|
| 538 | DS_U32 CRC32; |
|---|
| 539 | |
|---|
| 540 | } aett_t , *aettPtr_t; |
|---|
| 541 | |
|---|
| 542 | |
|---|
| 543 | |
|---|
| 544 | |
|---|
| 545 | /*SI descriptor tag*/ |
|---|
| 546 | |
|---|
| 547 | #define Revision_Detection_Descriptor_tag 0x93 |
|---|
| 548 | #define Two_Part_Channel_Number_Descriptor_tag 0x94 |
|---|
| 549 | #define Channel_Properties_Descriptor_tag 0x95 |
|---|
| 550 | #define Daylight_Savings_Time_Descriptor_tag 0x96 |
|---|
| 551 | |
|---|
| 552 | |
|---|
| 553 | |
|---|
| 554 | DHL_RESULT DHL_PSI_ParseAett(DS_U8 **sectionArr, aettPtr_t *aettPtr); |
|---|
| 555 | DHL_RESULT DHL_PSI_ParseAettSection(DS_U8 *section, aettSectionPtr_t *aettSectionPtr); |
|---|
| 556 | void DHL_PSI_FreeSISection (void *sectionPtr); |
|---|
| 557 | DHL_RESULT DHL_PSI_MonitorNit ( PSIMode siMode, PSIUpdateMode updateMode, PSIEventProc_f eventProc, DS_U32 userParam, DHL_TBL_HANDLE *psiCtl); |
|---|
| 558 | DHL_RESULT DHL_PSI_MonitorNit_Ex ( SI_nit_subtype_k subType , PSIMode siMode, PSIUpdateMode updateMode, PSIEventProc_f eventProc, DS_U32 userParam, DHL_TBL_HANDLE *psiCtl); |
|---|
| 559 | DHL_RESULT DHL_PSI_MonitorNtt ( PSIMode siMode, PSIUpdateMode updateMode, PSIEventProc_f eventProc, DS_U32 userParam, DHL_TBL_HANDLE* psiCtl); |
|---|
| 560 | DHL_RESULT DHL_PSI_MonitorNtt_Ex ( SI_ntt_subtype_k subType , PSIMode siMode, PSIUpdateMode updateMode, PSIEventProc_f eventProc, DS_U32 userParam, DHL_TBL_HANDLE *psiCtl); |
|---|
| 561 | DHL_RESULT DHL_PSI_MonitorSvct ( PSIMode siMode, PSIUpdateMode updateMode, PSIEventProc_f eventProc, DS_U32 userParam, DHL_TBL_HANDLE *psiCtl); |
|---|
| 562 | DHL_RESULT DHL_PSI_MonitorSvct_Ex ( SI_nit_subtype_k subType , PSIMode psiMode, PSIUpdateMode updateMode, PSIEventProc_f eventProc, DS_U32 userParam, DHL_TBL_HANDLE *returnPSICtl); |
|---|
| 563 | DHL_RESULT DHL_PSI_MonitorSiStt ( PSIUpdateMode updateMode, PSIEventProc_f eventProc, DS_U32 userParam, DHL_TBL_HANDLE *psiCtl); |
|---|
| 564 | DHL_RESULT DHL_PSI_MonitorSiMgt ( PSIUpdateMode updateMode, PSIEventProc_f eventProc, DS_U32 userParam, DHL_TBL_HANDLE *psiCtl); |
|---|
| 565 | DHL_RESULT DHL_PSI_MonitorLvct( PSIMode psiMode, PSIUpdateMode updateMode, PSIEventProc_f eventProc, DS_U32 userParam, DHL_TBL_HANDLE *psiCtl); |
|---|
| 566 | DHL_RESULT DHL_PSI_MonitorAeit ( DS_U32 pid , PSIMode psiMode, PSIUpdateMode updateMode, PSIEventProc_f eventProc, DS_U32 userParam, DHL_TBL_HANDLE *psiCtl); |
|---|
| 567 | DHL_RESULT DHL_PSI_MonitorAett ( DS_U32 pid , PSIMode psiMode, PSIUpdateMode updateMode, PSIEventProc_f eventProc, DS_U32 userParam, DHL_TBL_HANDLE *psiCtl); |
|---|
| 568 | DHL_RESULT DHL_PSI_MonitorSiRrt ( DS_U8 region , PSIUpdateMode updateMode, PSIEventProc_f eventProc, DS_U32 userParam, DHL_TBL_HANDLE *psiCtl); |
|---|
| 569 | DHL_RESULT DHL_PSI_GetSiSttSection ( SI_sttSectionPtr_t *sttSectPtr, int timeOut); |
|---|
| 570 | DHL_RESULT DHL_PSI_GetSiMgtSection ( mgtSectionPtr_t *mgtSectPtr, int timeOut); |
|---|
| 571 | DHL_RESULT DHL_PSI_GetSiRrtSection (DS_U8 region , rrtSectionPtr_t *rrtSectPtr, int timeOut); |
|---|
| 572 | DHL_RESULT DHL_PSI_GetNitSection ( nitSectionPtr_t *nitSectPtr, int timeOut); |
|---|
| 573 | DHL_RESULT DHL_PSI_GetNttSection ( nttSectionPtr_t *nttSectPtr, int timeOut); |
|---|
| 574 | DHL_RESULT DHL_PSI_GetLvct ( cvctPtr_t *lvctSectPtr, int timeOut); |
|---|
| 575 | DHL_RESULT DHL_PSI_GetSvctSection ( svctSectionPtr_t *svctSectPtr, int timeOut); |
|---|
| 576 | DHL_RESULT DHL_PSI_ParseRevisionDetectionDescriptor (DS_U8* p, revisionDetectionDescriptorPtr_t *descripPtr); |
|---|
| 577 | DHL_RESULT DHL_PSI_ParseTwoPartChannelNumberDescriptor (DS_U8* p, twoPartChannelNumberDescriptorPtr_t *descripPtr); |
|---|
| 578 | DHL_RESULT DHL_PSI_ParseChannelPropertiesDescriptor (DS_U8* p, channelPropertiesDescriptorPtr_t *descripPtr); |
|---|
| 579 | DHL_RESULT DHL_PSI_ParseDaylightSavingsTimeDescriptor (DS_U8* p, daylightSavingsTimeDescriptorPtr_t *descripPtr); |
|---|
| 580 | DHL_RESULT DHL_PSI_GetSvctSection_Ex ( SI_svct_subtype_k subType , svctSectionPtr_t *svctSectPtr, int timeOut); |
|---|
| 581 | DHL_RESULT DHL_PSI_GetNitSection_Ex ( SI_nit_subtype_k subType , nitSectionPtr_t *nitSectPtr, int timeOut); |
|---|
| 582 | DHL_RESULT DHL_PSI_GetNttSection_Ex ( SI_ntt_subtype_k subType , nttSectionPtr_t *nttSectPtr, int timeOut); |
|---|
| 583 | void DHL_PSI_GetInfoFromRevisionDetectionDescriptor (DS_U8 *pDescriptorDump , int iDescriptorLength , DS_U8* sectionNumber , DS_U8* lastSectionNumber , DS_U8* versionNumber ); |
|---|
| 584 | |
|---|
| 585 | |
|---|
| 586 | |
|---|
| 587 | DHL_RESULT DHL_PSI_ParseNtt ( DS_U8 **sectionArr ,nttPtr_t *nttPtr ); |
|---|
| 588 | DHL_RESULT DHL_PSI_ParseNit ( DS_U8 **sectionArr, nitPtr_t *nitPtr ); |
|---|
| 589 | DHL_RESULT DHL_PSI_ParseSvct (DS_U8 **sectionArr , svctPtr_t *svctPtr); |
|---|
| 590 | |
|---|
| 591 | |
|---|
| 592 | DHL_RESULT DHL_PSI_ParseNitSection (DS_U8 *section, nitSectionPtr_t *nitSectPtr ); |
|---|
| 593 | DHL_RESULT DHL_PSI_ParseNttSection (DS_U8 *section, nttSectionPtr_t *nttSectionPtr); |
|---|
| 594 | DHL_RESULT DHL_PSI_ParseSvctSection (DS_U8 *section, svctSectionPtr_t *svctSectPtr ); |
|---|
| 595 | DHL_RESULT DHL_PSI_ParseSiSttSection (DS_U8 *section, SI_sttSectionPtr_t *sttSectionPtr); |
|---|
| 596 | DHL_RESULT DHL_PSI_ParseAett(DS_U8 **sectionArr, aettPtr_t *aettPtr); |
|---|
| 597 | DHL_RESULT DHL_PSI_ParseAettSection(DS_U8 *section, aettSectionPtr_t *aettSectionPtr); |
|---|
| 598 | DHL_RESULT DHL_PSI_ParseAeitSection(DS_U8 *section, aeitSectionPtr_t *aeitSectionPtr); |
|---|
| 599 | DHL_RESULT DHL_PSI_ParseAeit(DS_U8 **sectionArr, aeitPtr_t *aeitPtr); |
|---|
| 600 | |
|---|
| 601 | void DHL_PSI_ParseMultipleTextString( unsigned char *pInText , unsigned int iInSize , |
|---|
| 602 | unsigned char **pOutText , unsigned int *iOutSize , unsigned char* nMode ); |
|---|
| 603 | |
|---|
| 604 | |
|---|
| 605 | void DHL_PSI_FreeSISection (void *sectionPtr); |
|---|
| 606 | void DHL_PSI_FreeSITable (void *tablePtr); |
|---|
| 607 | void DHL_PSI_FreeSIDescriptor ( void *descriptorPtr ); |
|---|
| 608 | |
|---|
| 609 | |
|---|
| 610 | DHL_RESULT DHL_PSI_ParseRevisionDetectionDescriptor (DS_U8* p, revisionDetectionDescriptorPtr_t *descripPtr); |
|---|
| 611 | DHL_RESULT DHL_PSI_ParseTwoPartChannelNumberDescriptor (DS_U8* p, twoPartChannelNumberDescriptorPtr_t *descripPtr); |
|---|
| 612 | DHL_RESULT DHL_PSI_ParseChannelPropertiesDescriptor (DS_U8* p, channelPropertiesDescriptorPtr_t *descripPtr); |
|---|
| 613 | DHL_RESULT DHL_PSI_ParseDaylightSavingsTimeDescriptor (DS_U8* p, daylightSavingsTimeDescriptorPtr_t *descripPtr); |
|---|
| 614 | DHL_RESULT DHL_PSI_ParseTwoPartChannelNumberDescriptor_Ex (generalDescriptorPtr_t genDescPtr , twoPartChannelNumberDescriptorPtr_t *descripPtr); |
|---|
| 615 | DHL_RESULT DHL_PSI_ParseChannelPropertiesDescriptor_Ex ( generalDescriptorPtr_t genDescPtr , channelPropertiesDescriptorPtr_t *descripPtr); |
|---|
| 616 | |
|---|
| 617 | void DHL_PSI_PrintNit( nitPtr_t pNit ); |
|---|
| 618 | void DHL_PSI_PrintNitSection( nitSectionPtr_t pNit ); |
|---|
| 619 | void DHL_PSI_PrintVCM ( VCMPtr_t pvcm ); |
|---|
| 620 | void DHL_PSI_PrintDCM( DCMPtr_t pDcm ); |
|---|
| 621 | void DHL_PSI_PrintICM( ICMPtr_t pIcm ); |
|---|
| 622 | void DHL_PSI_PrintSvct ( svctPtr_t pSvct ); |
|---|
| 623 | void DHL_PSI_PrintSvctSection ( svctSectionPtr_t pSvct ); |
|---|
| 624 | void DHL_PSI_PrintSiSttSection( SI_sttSectionPtr_t pSiStt ); |
|---|
| 625 | void DHL_PSI_PrintNtt( nttPtr_t pNttSect ); |
|---|
| 626 | void DHL_PSI_PrintNttSection( nttSectionPtr_t pNttSect ); |
|---|
| 627 | void DHL_PSI_PrintAeit ( aeitPtr_t pAeit ); |
|---|
| 628 | void DHL_PSI_PrintAett( aettPtr_t pAett ); |
|---|
| 629 | void DHL_PSI_PrintRevisionDetectionDescriptor ( revisionDetectionDescriptorPtr_t pRDD ); |
|---|
| 630 | void DHL_PSI_PrintTwoPartChannelNumberDescriptor( twoPartChannelNumberDescriptorPtr_t pTPCN ); |
|---|
| 631 | void DHL_PSI_PrintChannelPropertiesDescriptor ( channelPropertiesDescriptorPtr_t pCPD ); |
|---|
| 632 | void DHL_PSI_PrintSiMgtSection ( mgtSectionPtr_t mgtSectPtr ); |
|---|
| 633 | |
|---|
| 634 | #ifdef __cplusplus |
|---|
| 635 | } |
|---|
| 636 | #endif |
|---|
| 637 | |
|---|
| 638 | #endif //#ifndef _SCTE_SI_H_ |
|---|
| 639 | |
|---|
| 640 | |
|---|
| 641 | |
|---|
| 642 | |
|---|
| 643 | |
|---|