vdr
1.7.27
|
00001 /*************************************************************************** 00002 * * 00003 * (C) 2001-03 Rolf Hakenes <hakenes@hippomi.de>, under the * 00004 * GNU GPL with contribution of Oleg Assovski, * 00005 * www.satmania.com * 00006 * Adapted and extended by Marcel Wiesweg * 00007 * * 00008 * This program is free software; you can redistribute it and/or modify * 00009 * it under the terms of the GNU General Public License as published by * 00010 * the Free Software Foundation; either version 2 of the License, or * 00011 * (at your option) any later version. * 00012 * * 00013 * $Id: headers.h 2.4 2012/01/11 11:35:17 kls Exp $ 00014 * * 00015 ***************************************************************************/ 00016 00017 #ifndef LIBSI_HEADERS_H 00018 #define LIBSI_HEADERS_H 00019 00020 #include <endian.h> 00021 00022 namespace SI { 00023 00024 typedef unsigned char u_char; 00025 00026 struct SectionHeader { 00027 u_char table_id :8; 00028 #if BYTE_ORDER == BIG_ENDIAN 00029 u_char section_syntax_indicator :1; 00030 u_char :3; 00031 u_char section_length_hi :4; 00032 #else 00033 u_char section_length_hi :4; 00034 u_char :3; 00035 u_char section_syntax_indicator :1; 00036 #endif 00037 u_char section_length_lo :8; 00038 }; 00039 00040 struct ExtendedSectionHeader { 00041 u_char table_id :8; 00042 #if BYTE_ORDER == BIG_ENDIAN 00043 u_char section_syntax_indicator :1; 00044 u_char :3; 00045 u_char section_length_hi :4; 00046 #else 00047 u_char section_length_hi :4; 00048 u_char :3; 00049 u_char section_syntax_indicator :1; 00050 #endif 00051 u_char section_length_lo :8; 00052 u_char table_id_extension_hi :8; 00053 u_char table_id_extension_lo :8; 00054 #if BYTE_ORDER == BIG_ENDIAN 00055 u_char :2; 00056 u_char version_number :5; 00057 u_char current_next_indicator :1; 00058 #else 00059 u_char current_next_indicator :1; 00060 u_char version_number :5; 00061 u_char :2; 00062 #endif 00063 u_char section_number :8; 00064 u_char last_section_number :8; 00065 }; 00066 00067 struct DescriptorHeader { 00068 u_char descriptor_tag :8; 00069 u_char descriptor_length :8; 00070 }; 00071 00072 /* 00073 * 00074 * ETSI ISO/IEC 13818-1 specifies SI which is referred to as PSI. The PSI 00075 * data provides information to enable automatic configuration of the 00076 * receiver to demultiplex and decode the various streams of programs 00077 * within the multiplex. The PSI data is structured as four types of table. 00078 * The tables are transmitted in sections. 00079 * 00080 * 1) Program Association Table (PAT): 00081 * 00082 * - for each service in the multiplex, the PAT indicates the location 00083 * (the Packet Identifier (PID) values of the Transport Stream (TS) 00084 * packets) of the corresponding Program Map Table (PMT). 00085 * It also gives the location of the Network Information Table (NIT). 00086 * 00087 */ 00088 00089 #define PAT_LEN 8 00090 00091 struct pat { 00092 u_char table_id :8; 00093 #if BYTE_ORDER == BIG_ENDIAN 00094 u_char section_syntax_indicator :1; 00095 u_char dummy :1; // has to be 0 00096 u_char :2; 00097 u_char section_length_hi :4; 00098 #else 00099 u_char section_length_hi :4; 00100 u_char :2; 00101 u_char dummy :1; // has to be 0 00102 u_char section_syntax_indicator :1; 00103 #endif 00104 u_char section_length_lo :8; 00105 u_char transport_stream_id_hi :8; 00106 u_char transport_stream_id_lo :8; 00107 #if BYTE_ORDER == BIG_ENDIAN 00108 u_char :2; 00109 u_char version_number :5; 00110 u_char current_next_indicator :1; 00111 #else 00112 u_char current_next_indicator :1; 00113 u_char version_number :5; 00114 u_char :2; 00115 #endif 00116 u_char section_number :8; 00117 u_char last_section_number :8; 00118 }; 00119 00120 #define PAT_PROG_LEN 4 00121 00122 struct pat_prog { 00123 u_char program_number_hi :8; 00124 u_char program_number_lo :8; 00125 #if BYTE_ORDER == BIG_ENDIAN 00126 u_char :3; 00127 u_char network_pid_hi :5; 00128 #else 00129 u_char network_pid_hi :5; 00130 u_char :3; 00131 #endif 00132 u_char network_pid_lo :8; 00133 /* or program_map_pid (if prog_num=0)*/ 00134 }; 00135 00136 /* 00137 * 00138 * 2) Conditional Access Table (CAT): 00139 * 00140 * - the CAT provides information on the CA systems used in the 00141 * multiplex; the information is private and dependent on the CA 00142 * system, but includes the location of the EMM stream, when 00143 * applicable. 00144 * 00145 */ 00146 #define CAT_LEN 8 00147 00148 struct cat { 00149 u_char table_id :8; 00150 #if BYTE_ORDER == BIG_ENDIAN 00151 u_char section_syntax_indicator :1; 00152 u_char dummy :1; // has to be 0 00153 u_char :2; 00154 u_char section_length_hi :4; 00155 #else 00156 u_char section_length_hi :4; 00157 u_char :2; 00158 u_char dummy :1; // has to be 0 00159 u_char section_syntax_indicator :1; 00160 #endif 00161 u_char section_length_lo :8; 00162 u_char reserved_1 :8; 00163 u_char reserved_2 :8; 00164 #if BYTE_ORDER == BIG_ENDIAN 00165 u_char :2; 00166 u_char version_number :5; 00167 u_char current_next_indicator :1; 00168 #else 00169 u_char current_next_indicator :1; 00170 u_char version_number :5; 00171 u_char :2; 00172 #endif 00173 u_char section_number :8; 00174 u_char last_section_number :8; 00175 }; 00176 00177 /* 00178 * 00179 * 3) Program Map Table (PMT): 00180 * 00181 * - the PMT identifies and indicates the locations of the streams that 00182 * make up each service, and the location of the Program Clock 00183 * Reference fields for a service. 00184 * 00185 */ 00186 00187 #define PMT_LEN 12 00188 00189 struct pmt { 00190 u_char table_id :8; 00191 #if BYTE_ORDER == BIG_ENDIAN 00192 u_char section_syntax_indicator :1; 00193 u_char dummy :1; // has to be 0 00194 u_char :2; 00195 u_char section_length_hi :4; 00196 #else 00197 u_char section_length_hi :4; 00198 u_char :2; 00199 u_char dummy :1; // has to be 0 00200 u_char section_syntax_indicator :1; 00201 #endif 00202 u_char section_length_lo :8; 00203 u_char program_number_hi :8; 00204 u_char program_number_lo :8; 00205 #if BYTE_ORDER == BIG_ENDIAN 00206 u_char :2; 00207 u_char version_number :5; 00208 u_char current_next_indicator :1; 00209 #else 00210 u_char current_next_indicator :1; 00211 u_char version_number :5; 00212 u_char :2; 00213 #endif 00214 u_char section_number :8; 00215 u_char last_section_number :8; 00216 #if BYTE_ORDER == BIG_ENDIAN 00217 u_char :3; 00218 u_char PCR_PID_hi :5; 00219 #else 00220 u_char PCR_PID_hi :5; 00221 u_char :3; 00222 #endif 00223 u_char PCR_PID_lo :8; 00224 #if BYTE_ORDER == BIG_ENDIAN 00225 u_char :4; 00226 u_char program_info_length_hi :4; 00227 #else 00228 u_char program_info_length_hi :4; 00229 u_char :4; 00230 #endif 00231 u_char program_info_length_lo :8; 00232 //descriptors 00233 }; 00234 00235 #define PMT_INFO_LEN 5 00236 00237 struct pmt_info { 00238 u_char stream_type :8; 00239 #if BYTE_ORDER == BIG_ENDIAN 00240 u_char :3; 00241 u_char elementary_PID_hi :5; 00242 #else 00243 u_char elementary_PID_hi :5; 00244 u_char :3; 00245 #endif 00246 u_char elementary_PID_lo :8; 00247 #if BYTE_ORDER == BIG_ENDIAN 00248 u_char :4; 00249 u_char ES_info_length_hi :4; 00250 #else 00251 u_char ES_info_length_hi :4; 00252 u_char :4; 00253 #endif 00254 u_char ES_info_length_lo :8; 00255 // descriptors 00256 }; 00257 00258 /* 00259 * 00260 * 4) Transport Stream Description Table (TSDT): 00261 * 00262 * - The TSDT carries a loop of descriptors that apply to 00263 * the whole transport stream. The syntax and semantics 00264 * of the TSDT are defined in newer versions of ISO/IEC 13818-1. 00265 * 00266 */ 00267 00268 #define TSDT_LEN 8 00269 00270 struct tsdt { 00271 u_char table_id :8; 00272 #if BYTE_ORDER == BIG_ENDIAN 00273 u_char section_syntax_indicator :1; 00274 u_char dummy :1; // has to be 0 00275 u_char :2; 00276 u_char section_length_hi :4; 00277 #else 00278 u_char section_length_hi :4; 00279 u_char :2; 00280 u_char dummy :1; // has to be 0 00281 u_char section_syntax_indicator :1; 00282 #endif 00283 u_char section_length_lo :8; 00284 u_char :8; 00285 u_char :8; 00286 #if BYTE_ORDER == BIG_ENDIAN 00287 u_char :2; 00288 u_char version_number :5; 00289 u_char current_next_indicator :1; 00290 #else 00291 u_char current_next_indicator :1; 00292 u_char version_number :5; 00293 u_char :2; 00294 #endif 00295 u_char section_number :8; 00296 u_char last_section_number :8; 00297 }; 00298 00299 /* 00300 * 00301 * 5) Network Information Table (NIT): 00302 * 00303 * - the NIT is intended to provide information about the physical 00304 * network. The syntax and semantics of the NIT are defined in 00305 * ETSI EN 300 468. 00306 * 00307 */ 00308 00309 #define NIT_LEN 10 00310 00311 struct nit { 00312 u_char table_id :8; 00313 #if BYTE_ORDER == BIG_ENDIAN 00314 u_char section_syntax_indicator :1; 00315 u_char :3; 00316 u_char section_length_hi :4; 00317 #else 00318 u_char section_length_hi :4; 00319 u_char :3; 00320 u_char section_syntax_indicator :1; 00321 #endif 00322 u_char section_length_lo :8; 00323 u_char network_id_hi :8; 00324 u_char network_id_lo :8; 00325 #if BYTE_ORDER == BIG_ENDIAN 00326 u_char :2; 00327 u_char version_number :5; 00328 u_char current_next_indicator :1; 00329 #else 00330 u_char current_next_indicator :1; 00331 u_char version_number :5; 00332 u_char :2; 00333 #endif 00334 u_char section_number :8; 00335 u_char last_section_number :8; 00336 #if BYTE_ORDER == BIG_ENDIAN 00337 u_char :4; 00338 u_char network_descriptor_length_hi :4; 00339 #else 00340 u_char network_descriptor_length_hi :4; 00341 u_char :4; 00342 #endif 00343 u_char network_descriptor_length_lo :8; 00344 /* descriptors */ 00345 }; 00346 00347 #define SIZE_NIT_MID 2 00348 00349 struct nit_mid { // after descriptors 00350 #if BYTE_ORDER == BIG_ENDIAN 00351 u_char :4; 00352 u_char transport_stream_loop_length_hi :4; 00353 #else 00354 u_char transport_stream_loop_length_hi :4; 00355 u_char :4; 00356 #endif 00357 u_char transport_stream_loop_length_lo :8; 00358 }; 00359 00360 #define SIZE_NIT_END 4 00361 00362 struct nit_end { 00363 long CRC; 00364 }; 00365 00366 #define NIT_TS_LEN 6 00367 00368 struct ni_ts { 00369 u_char transport_stream_id_hi :8; 00370 u_char transport_stream_id_lo :8; 00371 u_char original_network_id_hi :8; 00372 u_char original_network_id_lo :8; 00373 #if BYTE_ORDER == BIG_ENDIAN 00374 u_char :4; 00375 u_char transport_descriptors_length_hi :4; 00376 #else 00377 u_char transport_descriptors_length_hi :4; 00378 u_char :4; 00379 #endif 00380 u_char transport_descriptors_length_lo :8; 00381 /* descriptors */ 00382 }; 00383 00384 /* 00385 * 00386 * In addition to the PSI, data is needed to provide identification of 00387 * services and events for the user. In contrast with the PAT, CAT, and 00388 * PMT of the PSI, which give information only for the multiplex in which 00389 * they are contained (the actual multiplex), the additional information 00390 * defined within the present document can also provide information on 00391 * services and events carried by different multiplexes, and even on other 00392 * networks. This data is structured as nine tables: 00393 * 00394 * 1) Bouquet Association Table (BAT): 00395 * 00396 * - the BAT provides information regarding bouquets. As well as giving 00397 * the name of the bouquet, it provides a list of services for each 00398 * bouquet. 00399 * 00400 */ 00401 /* SEE NIT (It has the same structure but has different allowed descriptors) */ 00402 /* 00403 * 00404 * 2) Service Description Table (SDT): 00405 * 00406 * - the SDT contains data describing the services in the system e.g. 00407 * names of services, the service provider, etc. 00408 * 00409 */ 00410 00411 #define SDT_LEN 11 00412 00413 struct sdt { 00414 u_char table_id :8; 00415 #if BYTE_ORDER == BIG_ENDIAN 00416 u_char section_syntax_indicator :1; 00417 u_char :3; 00418 u_char section_length_hi :4; 00419 #else 00420 u_char section_length_hi :4; 00421 u_char :3; 00422 u_char section_syntax_indicator :1; 00423 #endif 00424 u_char section_length_lo :8; 00425 u_char transport_stream_id_hi :8; 00426 u_char transport_stream_id_lo :8; 00427 #if BYTE_ORDER == BIG_ENDIAN 00428 u_char :2; 00429 u_char version_number :5; 00430 u_char current_next_indicator :1; 00431 #else 00432 u_char current_next_indicator :1; 00433 u_char version_number :5; 00434 u_char :2; 00435 #endif 00436 u_char section_number :8; 00437 u_char last_section_number :8; 00438 u_char original_network_id_hi :8; 00439 u_char original_network_id_lo :8; 00440 u_char :8; 00441 }; 00442 00443 #define GetSDTTransportStreamId(x) (HILO(((sdt_t *) x)->transport_stream_id)) 00444 #define GetSDTOriginalNetworkId(x) (HILO(((sdt_t *) x)->original_network_id)) 00445 00446 #define SDT_DESCR_LEN 5 00447 00448 struct sdt_descr { 00449 u_char service_id_hi :8; 00450 u_char service_id_lo :8; 00451 #if BYTE_ORDER == BIG_ENDIAN 00452 u_char :6; 00453 u_char eit_schedule_flag :1; 00454 u_char eit_present_following_flag :1; 00455 u_char running_status :3; 00456 u_char free_ca_mode :1; 00457 u_char descriptors_loop_length_hi :4; 00458 #else 00459 u_char eit_present_following_flag :1; 00460 u_char eit_schedule_flag :1; 00461 u_char :6; 00462 u_char descriptors_loop_length_hi :4; 00463 u_char free_ca_mode :1; 00464 u_char running_status :3; 00465 #endif 00466 u_char descriptors_loop_length_lo :8; 00467 }; 00468 00469 /* 00470 * 00471 * 3) Event Information Table (EIT): 00472 * 00473 * - the EIT contains data concerning events or programmes such as event 00474 * name, start time, duration, etc.; - the use of different descriptors 00475 * allows the transmission of different kinds of event information e.g. 00476 * for different service types. 00477 * 00478 */ 00479 00480 #define EIT_LEN 14 00481 00482 struct eit { 00483 u_char table_id :8; 00484 #if BYTE_ORDER == BIG_ENDIAN 00485 u_char section_syntax_indicator :1; 00486 u_char :3; 00487 u_char section_length_hi :4; 00488 #else 00489 u_char section_length_hi :4; 00490 u_char :3; 00491 u_char section_syntax_indicator :1; 00492 #endif 00493 u_char section_length_lo :8; 00494 u_char service_id_hi :8; 00495 u_char service_id_lo :8; 00496 #if BYTE_ORDER == BIG_ENDIAN 00497 u_char :2; 00498 u_char version_number :5; 00499 u_char current_next_indicator :1; 00500 #else 00501 u_char current_next_indicator :1; 00502 u_char version_number :5; 00503 u_char :2; 00504 #endif 00505 u_char section_number :8; 00506 u_char last_section_number :8; 00507 u_char transport_stream_id_hi :8; 00508 u_char transport_stream_id_lo :8; 00509 u_char original_network_id_hi :8; 00510 u_char original_network_id_lo :8; 00511 u_char segment_last_section_number :8; 00512 u_char last_table_id :8; 00513 }; 00514 00515 #define EIT_EVENT_LEN 12 00516 00517 struct eit_event { 00518 u_char event_id_hi :8; 00519 u_char event_id_lo :8; 00520 u_char mjd_hi :8; 00521 u_char mjd_lo :8; 00522 u_char start_time_h :8; 00523 u_char start_time_m :8; 00524 u_char start_time_s :8; 00525 u_char duration_h :8; 00526 u_char duration_m :8; 00527 u_char duration_s :8; 00528 #if BYTE_ORDER == BIG_ENDIAN 00529 u_char running_status :3; 00530 u_char free_ca_mode :1; 00531 u_char descriptors_loop_length_hi :4; 00532 #else 00533 u_char descriptors_loop_length_hi :4; 00534 u_char free_ca_mode :1; 00535 u_char running_status :3; 00536 #endif 00537 u_char descriptors_loop_length_lo :8; 00538 }; 00539 00540 /* 00541 * 00542 * 4) Running Status Table (RST): 00543 * 00544 * - the RST gives the status of an event (running/not running). The RST 00545 * updates this information and allows timely automatic switching to 00546 * events. 00547 * 00548 */ 00549 00550 struct rst { 00551 u_char table_id :8; 00552 #if BYTE_ORDER == BIG_ENDIAN 00553 u_char section_syntax_indicator :1; 00554 u_char :3; 00555 u_char section_length_hi :4; 00556 #else 00557 u_char section_length_hi :4; 00558 u_char :3; 00559 u_char section_syntax_indicator :1; 00560 #endif 00561 u_char section_length_lo :8; 00562 }; 00563 00564 struct rst_info { 00565 u_char transport_stream_id_hi :8; 00566 u_char transport_stream_id_lo :8; 00567 u_char original_network_id_hi :8; 00568 u_char original_network_id_lo :8; 00569 u_char service_id_hi :8; 00570 u_char service_id_lo :8; 00571 u_char event_id_hi :8; 00572 u_char event_id_lo :8; 00573 #if BYTE_ORDER == BIG_ENDIAN 00574 u_char :5; 00575 u_char running_status :3; 00576 #else 00577 u_char running_status :3; 00578 u_char :5; 00579 #endif 00580 }; 00581 00582 /* 00583 * 00584 * 5) Time and Date Table (TDT): 00585 * 00586 * - the TDT gives information relating to the present time and date. 00587 * This information is given in a separate table due to the frequent 00588 * updating of this information. 00589 * 00590 */ 00591 00592 #define TDT_LEN 8 00593 00594 struct tdt { 00595 u_char table_id :8; 00596 #if BYTE_ORDER == BIG_ENDIAN 00597 u_char section_syntax_indicator :1; 00598 u_char :3; 00599 u_char section_length_hi :4; 00600 #else 00601 u_char section_length_hi :4; 00602 u_char :3; 00603 u_char section_syntax_indicator :1; 00604 #endif 00605 u_char section_length_lo :8; 00606 u_char utc_mjd_hi :8; 00607 u_char utc_mjd_lo :8; 00608 u_char utc_time_h :8; 00609 u_char utc_time_m :8; 00610 u_char utc_time_s :8; 00611 }; 00612 00613 /* 00614 * 00615 * 6) Time Offset Table (TOT): 00616 * 00617 * - the TOT gives information relating to the present time and date and 00618 * local time offset. This information is given in a separate table due 00619 * to the frequent updating of the time information. 00620 * 00621 */ 00622 #define TOT_LEN 10 00623 00624 struct tot { 00625 u_char table_id :8; 00626 #if BYTE_ORDER == BIG_ENDIAN 00627 u_char section_syntax_indicator :1; 00628 u_char :3; 00629 u_char section_length_hi :4; 00630 #else 00631 u_char section_length_hi :4; 00632 u_char :3; 00633 u_char section_syntax_indicator :1; 00634 #endif 00635 u_char section_length_lo :8; 00636 u_char utc_mjd_hi :8; 00637 u_char utc_mjd_lo :8; 00638 u_char utc_time_h :8; 00639 u_char utc_time_m :8; 00640 u_char utc_time_s :8; 00641 #if BYTE_ORDER == BIG_ENDIAN 00642 u_char :4; 00643 u_char descriptors_loop_length_hi :4; 00644 #else 00645 u_char descriptors_loop_length_hi :4; 00646 u_char :4; 00647 #endif 00648 u_char descriptors_loop_length_lo :8; 00649 }; 00650 00651 /* 00652 * 00653 * 7) Stuffing Table (ST): 00654 * 00655 * - the ST is used to invalidate existing sections, for example at 00656 * delivery system boundaries. 00657 * 00658 */ 00659 /* TO BE DONE */ 00660 /* 00661 * 00662 * 8) Selection Information Table (SIT): 00663 * 00664 * - the SIT is used only in "partial" (i.e. recorded) bitstreams. It 00665 * carries a summary of the SI information required to describe the 00666 * streams in the partial bitstream. 00667 * 00668 */ 00669 /* TO BE DONE */ 00670 /* 00671 * 00672 * 9) Discontinuity Information Table (DIT): 00673 * 00674 * - the DIT is used only in "partial" (i.e. recorded) bitstreams. 00675 * It is inserted where the SI information in the partial bitstream may 00676 * be discontinuous. Where applicable the use of descriptors allows a 00677 * flexible approach to the organization of the tables and allows for 00678 * future compatible extensions. 00679 * 00680 */ 00681 /* TO BE DONE */ 00682 00683 /* 00684 * 00685 * 3) Application Information Table (AIT): 00686 * 00687 * - the AIT contains data concerning MHP application broadcast by a service. 00688 * 00689 */ 00690 00691 #define AIT_LEN 10 00692 00693 struct ait { 00694 u_char table_id :8; 00695 #if BYTE_ORDER == BIG_ENDIAN 00696 u_char section_syntax_indicator :1; 00697 u_char :3; 00698 u_char section_length_hi :4; 00699 #else 00700 u_char section_length_hi :4; 00701 u_char :3; 00702 u_char section_syntax_indicator :1; 00703 #endif 00704 u_char section_length_lo :8; 00705 u_char application_type_hi :8; 00706 u_char application_type_lo :8; 00707 #if BYTE_ORDER == BIG_ENDIAN 00708 u_char :2; 00709 u_char version_number :5; 00710 u_char current_next_indicator :1; 00711 #else 00712 u_char current_next_indicator :1; 00713 u_char version_number :5; 00714 u_char :2; 00715 #endif 00716 u_char section_number :8; 00717 u_char last_section_number :8; 00718 #if BYTE_ORDER == BIG_ENDIAN 00719 u_char :4; 00720 u_char common_descriptors_length_hi :4; 00721 #else 00722 u_char common_descriptors_length_hi :4; 00723 u_char :4; 00724 #endif 00725 u_char common_descriptors_length_lo :8; 00726 }; 00727 00728 #define SIZE_AIT_MID 2 00729 00730 struct ait_mid { // after descriptors 00731 #if BYTE_ORDER == BIG_ENDIAN 00732 u_char :4; 00733 u_char application_loop_length_hi :4; 00734 #else 00735 u_char application_loop_length_hi :4; 00736 u_char :4; 00737 #endif 00738 u_char application_loop_length_lo :8; 00739 }; 00740 00741 #define SIZE_AIT_END 4 00742 00743 struct ait_end { 00744 long CRC; 00745 }; 00746 00747 #define AIT_APP_LEN 9 00748 00749 struct ait_app { 00750 //how to deal with 32 bit fields? 00751 00752 u_char organisation_id_hi_hi :8; 00753 u_char organisation_id_hi_lo :8; 00754 u_char organisation_id_lo_hi :8; 00755 u_char organisation_id_lo_lo :8; 00756 00757 //long organisation_id :32; 00758 u_char application_id_hi :8; 00759 u_char application_id_lo :8; 00760 u_char application_control_code :8; 00761 #if BYTE_ORDER == BIG_ENDIAN 00762 u_char :4; 00763 u_char application_descriptors_length_hi :4; 00764 #else 00765 u_char application_descriptors_length_hi :4; 00766 u_char :4; 00767 #endif 00768 u_char application_descriptors_length_lo :8; 00769 /* descriptors */ 00770 }; 00771 00772 /* Premiere Content Information Table */ 00773 00774 #define PCIT_LEN 17 00775 00776 struct pcit { 00777 u_char table_id :8; 00778 #if BYTE_ORDER == BIG_ENDIAN 00779 u_char section_syntax_indicator :1; 00780 u_char dummy :1; // has to be 0 00781 u_char :2; 00782 u_char section_length_hi :4; 00783 #else 00784 u_char section_length_hi :4; 00785 u_char :2; 00786 u_char dummy :1; // has to be 0 00787 u_char section_syntax_indicator :1; 00788 #endif 00789 u_char section_length_lo :8; 00790 u_char :8; 00791 u_char :8; 00792 #if BYTE_ORDER == BIG_ENDIAN 00793 u_char :2; 00794 u_char version_number :5; 00795 u_char current_next_indicator :1; 00796 #else 00797 u_char current_next_indicator :1; 00798 u_char version_number :5; 00799 u_char :2; 00800 #endif 00801 u_char section_number :8; 00802 u_char last_section_number :8; 00803 00804 u_char contentId_hi_hi :8; 00805 u_char contentId_hi_lo :8; 00806 u_char contentId_lo_hi :8; 00807 u_char contentId_lo_lo :8; 00808 00809 u_char duration_h :8; 00810 u_char duration_m :8; 00811 u_char duration_s :8; 00812 00813 #if BYTE_ORDER == BIG_ENDIAN 00814 u_char :4; 00815 u_char descriptors_loop_length_hi :4; 00816 #else 00817 u_char descriptors_loop_length_hi :4; 00818 u_char :4; 00819 #endif 00820 u_char descriptors_loop_length_lo :8; 00821 }; 00822 00823 /* 00824 * 00825 * The following describes the different descriptors that can be used within 00826 * the SI. 00827 * 00828 * The following semantics apply to all the descriptors defined in this 00829 * subclause: 00830 * 00831 * descriptor_tag: The descriptor tag is an 8-bit field which identifies 00832 * each descriptor. Those values with MPEG-2 normative 00833 * meaning are described in ISO/IEC 13818-1. The values of 00834 * descriptor_tag are defined in 'libsi.h' 00835 * descriptor_length: The descriptor length is an 8-bit field specifying the 00836 * total number of bytes of the data portion of the 00837 * descriptor following the byte defining the value of 00838 * this field. 00839 * 00840 */ 00841 00842 #define DESCR_GEN_LEN 2 00843 struct descr_gen { 00844 u_char descriptor_tag :8; 00845 u_char descriptor_length :8; 00846 }; 00847 00848 #define GetDescriptorTag(x) (((descr_gen_t *) x)->descriptor_tag) 00849 #define GetDescriptorLength(x) (((descr_gen_t *) x)->descriptor_length+DESCR_GEN_LEN) 00850 00851 /* 0x09 ca_descriptor */ 00852 00853 #define DESCR_CA_LEN 6 00854 struct descr_ca { 00855 u_char descriptor_tag :8; 00856 u_char descriptor_length :8; 00857 u_char CA_type_hi :8; 00858 u_char CA_type_lo :8; 00859 #if BYTE_ORDER == BIG_ENDIAN 00860 u_char reserved :3; 00861 u_char CA_PID_hi :5; 00862 #else 00863 u_char CA_PID_hi :5; 00864 u_char reserved :3; 00865 #endif 00866 u_char CA_PID_lo :8; 00867 }; 00868 00869 /* 0x0A iso_639_language_descriptor */ 00870 00871 #define DESCR_ISO_639_LANGUAGE_LEN 5 00872 struct descr_iso_639_language { 00873 u_char descriptor_tag :8; 00874 u_char descriptor_length :8; 00875 }; 00876 00877 struct descr_iso_639_language_loop { 00878 u_char lang_code1 :8; 00879 u_char lang_code2 :8; 00880 u_char lang_code3 :8; 00881 u_char audio_type :8; 00882 }; 00883 00884 /* 0x13 carousel_identifier_descriptor */ 00885 00886 #define DESCR_CAROUSEL_IDENTIFIER_LEN 7 00887 struct descr_carousel_identifier { 00888 u_char descriptor_tag :8; 00889 u_char descriptor_length :8; 00890 u_char carousel_id_hi_hi :8; 00891 u_char carousel_id_hi_lo :8; 00892 u_char carousel_id_lo_hi :8; 00893 u_char carousel_id_lo_lo :8; 00894 u_char FormatId :8; 00895 /* FormatSpecifier follows */ 00896 }; 00897 00898 /* 0x40 network_name_descriptor */ 00899 00900 #define DESCR_NETWORK_NAME_LEN 2 00901 struct descr_network_name { 00902 u_char descriptor_tag :8; 00903 u_char descriptor_length :8; 00904 }; 00905 00906 /* 0x41 service_list_descriptor */ 00907 00908 #define DESCR_SERVICE_LIST_LEN 2 00909 struct descr_service_list { 00910 u_char descriptor_tag :8; 00911 u_char descriptor_length :8; 00912 }; 00913 00914 #define DESCR_SERVICE_LIST_LOOP_LEN 3 00915 struct descr_service_list_loop { 00916 u_char service_id_hi :8; 00917 u_char service_id_lo :8; 00918 u_char service_type :8; 00919 }; 00920 00921 /* 0x42 stuffing_descriptor */ 00922 00923 #define DESCR_STUFFING_LEN XX 00924 struct descr_stuffing { 00925 u_char descriptor_tag :8; 00926 u_char descriptor_length :8; 00927 /* TBD */ 00928 }; 00929 00930 /* 0x43 satellite_delivery_system_descriptor */ 00931 00932 #define DESCR_SATELLITE_DELIVERY_SYSTEM_LEN 13 00933 struct descr_satellite_delivery_system { 00934 u_char descriptor_tag :8; 00935 u_char descriptor_length :8; 00936 u_char frequency_hi_hi :8; 00937 u_char frequency_hi_lo :8; 00938 u_char frequency_lo_hi :8; 00939 u_char frequency_lo_lo :8; 00940 u_char orbital_position_hi :8; 00941 u_char orbital_position_lo :8; 00942 #if BYTE_ORDER == BIG_ENDIAN 00943 u_char west_east_flag :1; 00944 u_char polarization :2; 00945 u_char roll_off :2; 00946 u_char modulation_system :1; 00947 u_char modulation_type :2; 00948 #else 00949 u_char modulation_type :2; 00950 u_char modulation_system :1; 00951 u_char roll_off :2; 00952 u_char polarization :2; 00953 u_char west_east_flag :1; 00954 #endif 00955 u_char symbol_rate_hi_hi :8; 00956 u_char symbol_rate_hi_lo :8; 00957 u_char symbol_rate_lo_1 :8; 00958 #if BYTE_ORDER == BIG_ENDIAN 00959 u_char symbol_rate_lo_2 :4; 00960 u_char fec_inner :4; 00961 #else 00962 u_char fec_inner :4; 00963 u_char symbol_rate_lo_2 :4; 00964 #endif 00965 }; 00966 00967 /* 0x44 cable_delivery_system_descriptor */ 00968 00969 #define DESCR_CABLE_DELIVERY_SYSTEM_LEN 13 00970 struct descr_cable_delivery_system { 00971 u_char descriptor_tag :8; 00972 u_char descriptor_length :8; 00973 u_char frequency_hi_hi :8; 00974 u_char frequency_hi_lo :8; 00975 u_char frequency_lo_hi :8; 00976 u_char frequency_lo_lo :8; 00977 u_char reserved1 :8; 00978 #if BYTE_ORDER == BIG_ENDIAN 00979 u_char reserved2 :4; 00980 u_char fec_outer :4; 00981 #else 00982 u_char fec_outer :4; 00983 u_char reserved2 :4; 00984 #endif 00985 u_char modulation :8; 00986 u_char symbol_rate_hi_hi :8; 00987 u_char symbol_rate_hi_lo :8; 00988 u_char symbol_rate_lo_1 :8; 00989 #if BYTE_ORDER == BIG_ENDIAN 00990 u_char symbol_rate_lo_2 :4; 00991 u_char fec_inner :4; 00992 #else 00993 u_char fec_inner :4; 00994 u_char symbol_rate_lo_2 :4; 00995 #endif 00996 }; 00997 00998 /* 0x45 vbi_data_descriptor */ 00999 01000 #define DESCR_VBI_DATA_LEN XX 01001 struct descr_vbi_data { 01002 u_char descriptor_tag :8; 01003 u_char descriptor_length :8; 01004 /* TBD */ 01005 }; 01006 01007 /* 0x46 vbi_teletext_descriptor */ 01008 01009 #define DESCR_VBI_TELETEXT_LEN XX 01010 struct descr_vbi_teletext { 01011 u_char descriptor_tag :8; 01012 u_char descriptor_length :8; 01013 /* TBD */ 01014 }; 01015 01016 /* 0x47 bouquet_name_descriptor */ 01017 01018 #define DESCR_BOUQUET_NAME_LEN 2 01019 struct descr_bouquet_name { 01020 u_char descriptor_tag :8; 01021 u_char descriptor_length :8; 01022 }; 01023 01024 /* 0x48 service_descriptor */ 01025 01026 #define DESCR_SERVICE_LEN 4 01027 struct descr_service { 01028 u_char descriptor_tag :8; 01029 u_char descriptor_length :8; 01030 u_char service_type :8; 01031 u_char provider_name_length :8; 01032 }; 01033 01034 struct descr_service_mid { 01035 u_char service_name_length :8; 01036 }; 01037 01038 /* 0x49 country_availability_descriptor */ 01039 01040 #define DESCR_COUNTRY_AVAILABILITY_LEN 3 01041 struct descr_country_availability { 01042 u_char descriptor_tag :8; 01043 u_char descriptor_length :8; 01044 #if BYTE_ORDER == BIG_ENDIAN 01045 u_char country_availability_flag :1; 01046 u_char reserved :7; 01047 #else 01048 u_char reserved :7; 01049 u_char country_availability_flag :1; 01050 #endif 01051 }; 01052 01053 /* 0x4A linkage_descriptor */ 01054 01055 #define DESCR_LINKAGE_LEN 9 01056 struct descr_linkage { 01057 u_char descriptor_tag :8; 01058 u_char descriptor_length :8; 01059 u_char transport_stream_id_hi :8; 01060 u_char transport_stream_id_lo :8; 01061 u_char original_network_id_hi :8; 01062 u_char original_network_id_lo :8; 01063 u_char service_id_hi :8; 01064 u_char service_id_lo :8; 01065 u_char linkage_type :8; 01066 }; 01067 01068 #define DESCR_LINKAGE_8_LEN 3 01069 struct descr_linkage_8 { 01070 #if BYTE_ORDER == BIG_ENDIAN 01071 u_char hand_over_type :4; 01072 u_char reserved :3; 01073 u_char origin_type :1; 01074 #else 01075 u_char origin_type :1; 01076 u_char reserved :3; 01077 u_char hand_over_type :4; 01078 #endif 01079 u_char id_hi :8; 01080 u_char id_lo :8; 01081 }; 01082 01083 /* 0x4B nvod_reference_descriptor */ 01084 01085 #define DESCR_NVOD_REFERENCE_LEN 2 01086 struct descr_nvod_reference { 01087 u_char descriptor_tag :8; 01088 u_char descriptor_length :8; 01089 }; 01090 01091 #define ITEM_NVOD_REFERENCE_LEN 6 01092 struct item_nvod_reference { 01093 u_char transport_stream_id_hi :8; 01094 u_char transport_stream_id_lo :8; 01095 u_char original_network_id_hi :8; 01096 u_char original_network_id_lo :8; 01097 u_char service_id_hi :8; 01098 u_char service_id_lo :8; 01099 }; 01100 01101 /* 0x4C time_shifted_service_descriptor */ 01102 01103 #define DESCR_TIME_SHIFTED_SERVICE_LEN 4 01104 struct descr_time_shifted_service { 01105 u_char descriptor_tag :8; 01106 u_char descriptor_length :8; 01107 u_char reference_service_id_hi :8; 01108 u_char reference_service_id_lo :8; 01109 }; 01110 01111 /* 0x4D short_event_descriptor */ 01112 01113 #define DESCR_SHORT_EVENT_LEN 6 01114 struct descr_short_event { 01115 u_char descriptor_tag :8; 01116 u_char descriptor_length :8; 01117 u_char lang_code1 :8; 01118 u_char lang_code2 :8; 01119 u_char lang_code3 :8; 01120 u_char event_name_length :8; 01121 }; 01122 01123 struct descr_short_event_mid { 01124 u_char text_length :8; 01125 }; 01126 01127 /* 0x4E extended_event_descriptor */ 01128 01129 #define DESCR_EXTENDED_EVENT_LEN 7 01130 struct descr_extended_event { 01131 u_char descriptor_tag :8; 01132 u_char descriptor_length :8; 01133 /* TBD */ 01134 #if BYTE_ORDER == BIG_ENDIAN 01135 u_char descriptor_number :4; 01136 u_char last_descriptor_number :4; 01137 #else 01138 u_char last_descriptor_number :4; 01139 u_char descriptor_number :4; 01140 #endif 01141 u_char lang_code1 :8; 01142 u_char lang_code2 :8; 01143 u_char lang_code3 :8; 01144 u_char length_of_items :8; 01145 }; 01146 01147 struct descr_extended_event_mid { 01148 u_char text_length :8; 01149 }; 01150 01151 #define ITEM_EXTENDED_EVENT_LEN 1 01152 struct item_extended_event { 01153 u_char item_description_length :8; 01154 }; 01155 01156 struct item_extended_event_mid { 01157 u_char item_length :8; 01158 }; 01159 01160 /* 0x4F time_shifted_event_descriptor */ 01161 01162 #define DESCR_TIME_SHIFTED_EVENT_LEN 6 01163 struct descr_time_shifted_event { 01164 u_char descriptor_tag :8; 01165 u_char descriptor_length :8; 01166 u_char reference_service_id_hi :8; 01167 u_char reference_service_id_lo :8; 01168 u_char reference_event_id_hi :8; 01169 u_char reference_event_id_lo :8; 01170 }; 01171 01172 /* 0x50 component_descriptor */ 01173 01174 #define DESCR_COMPONENT_LEN 8 01175 struct descr_component { 01176 u_char descriptor_tag :8; 01177 u_char descriptor_length :8; 01178 #if BYTE_ORDER == BIG_ENDIAN 01179 u_char reserved :4; 01180 u_char stream_content :4; 01181 #else 01182 u_char stream_content :4; 01183 u_char reserved :4; 01184 #endif 01185 u_char component_type :8; 01186 u_char component_tag :8; 01187 u_char lang_code1 :8; 01188 u_char lang_code2 :8; 01189 u_char lang_code3 :8; 01190 }; 01191 01192 /* 0x51 mosaic_descriptor */ 01193 01194 #define DESCR_MOSAIC_LEN XX 01195 struct descr_mosaic { 01196 u_char descriptor_tag :8; 01197 u_char descriptor_length :8; 01198 /* TBD */ 01199 }; 01200 01201 /* 0x52 stream_identifier_descriptor */ 01202 01203 #define DESCR_STREAM_IDENTIFIER_LEN 3 01204 struct descr_stream_identifier { 01205 u_char descriptor_tag :8; 01206 u_char descriptor_length :8; 01207 u_char component_tag :8; 01208 }; 01209 01210 /* 0x53 ca_identifier_descriptor */ 01211 01212 #define DESCR_CA_IDENTIFIER_LEN 2 01213 struct descr_ca_identifier { 01214 u_char descriptor_tag :8; 01215 u_char descriptor_length :8; 01216 }; 01217 01218 /* 0x54 content_descriptor */ 01219 01220 #define DESCR_CONTENT_LEN 2 01221 struct descr_content { 01222 u_char descriptor_tag :8; 01223 u_char descriptor_length :8; 01224 }; 01225 01226 struct nibble_content { 01227 #if BYTE_ORDER == BIG_ENDIAN 01228 u_char content_nibble_level_1 :4; 01229 u_char content_nibble_level_2 :4; 01230 #else 01231 u_char content_nibble_level_2 :4; 01232 u_char content_nibble_level_1 :4; 01233 #endif 01234 #if BYTE_ORDER == BIG_ENDIAN 01235 u_char user_nibble_1 :4; 01236 u_char user_nibble_2 :4; 01237 #else 01238 u_char user_nibble_2 :4; 01239 u_char user_nibble_1 :4; 01240 #endif 01241 }; 01242 01243 /* 0x55 parental_rating_descriptor */ 01244 01245 #define DESCR_PARENTAL_RATING_LEN 2 01246 struct descr_parental_rating { 01247 u_char descriptor_tag :8; 01248 u_char descriptor_length :8; 01249 }; 01250 01251 #define PARENTAL_RATING_LEN 4 01252 struct parental_rating { 01253 u_char lang_code1 :8; 01254 u_char lang_code2 :8; 01255 u_char lang_code3 :8; 01256 u_char rating :8; 01257 }; 01258 01259 /* 0x56 teletext_descriptor */ 01260 01261 #define DESCR_TELETEXT_LEN 2 01262 struct descr_teletext { 01263 u_char descriptor_tag :8; 01264 u_char descriptor_length :8; 01265 }; 01266 01267 #define ITEM_TELETEXT_LEN 5 01268 struct item_teletext { 01269 u_char lang_code1 :8; 01270 u_char lang_code2 :8; 01271 u_char lang_code3 :8; 01272 #if BYTE_ORDER == BIG_ENDIAN 01273 u_char type :5; 01274 u_char magazine_number :3; 01275 #else 01276 u_char magazine_number :3; 01277 u_char type :5; 01278 #endif 01279 u_char page_number :8; 01280 }; 01281 01282 /* 0x57 telephone_descriptor */ 01283 01284 #define DESCR_TELEPHONE_LEN XX 01285 struct descr_telephone { 01286 u_char descriptor_tag :8; 01287 u_char descriptor_length :8; 01288 /* TBD */ 01289 }; 01290 01291 /* 0x58 local_time_offset_descriptor */ 01292 01293 #define DESCR_LOCAL_TIME_OFFSET_LEN 2 01294 struct descr_local_time_offset { 01295 u_char descriptor_tag :8; 01296 u_char descriptor_length :8; 01297 }; 01298 01299 #define LOCAL_TIME_OFFSET_ENTRY_LEN 15 01300 struct local_time_offset_entry { 01301 u_char country_code1 :8; 01302 u_char country_code2 :8; 01303 u_char country_code3 :8; 01304 #if BYTE_ORDER == BIG_ENDIAN 01305 u_char country_region_id :6; 01306 u_char :1; 01307 u_char local_time_offset_polarity :1; 01308 #else 01309 u_char local_time_offset_polarity :1; 01310 u_char :1; 01311 u_char country_region_id :6; 01312 #endif 01313 u_char local_time_offset_h :8; 01314 u_char local_time_offset_m :8; 01315 u_char time_of_change_mjd_hi :8; 01316 u_char time_of_change_mjd_lo :8; 01317 u_char time_of_change_time_h :8; 01318 u_char time_of_change_time_m :8; 01319 u_char time_of_change_time_s :8; 01320 u_char next_time_offset_h :8; 01321 u_char next_time_offset_m :8; 01322 }; 01323 01324 /* 0x59 subtitling_descriptor */ 01325 01326 #define DESCR_SUBTITLING_LEN 2 01327 struct descr_subtitling { 01328 u_char descriptor_tag :8; 01329 u_char descriptor_length :8; 01330 }; 01331 01332 #define ITEM_SUBTITLING_LEN 8 01333 struct item_subtitling { 01334 u_char lang_code1 :8; 01335 u_char lang_code2 :8; 01336 u_char lang_code3 :8; 01337 u_char subtitling_type :8; 01338 u_char composition_page_id_hi :8; 01339 u_char composition_page_id_lo :8; 01340 u_char ancillary_page_id_hi :8; 01341 u_char ancillary_page_id_lo :8; 01342 }; 01343 01344 /* 0x5A terrestrial_delivery_system_descriptor */ 01345 01346 #define DESCR_TERRESTRIAL_DELIVERY_SYSTEM_LEN XX 01347 struct descr_terrestrial_delivery { 01348 u_char descriptor_tag :8; 01349 u_char descriptor_length :8; 01350 u_char frequency_hi_hi :8; 01351 u_char frequency_hi_lo :8; 01352 u_char frequency_lo_hi :8; 01353 u_char frequency_lo_lo :8; 01354 #if BYTE_ORDER == BIG_ENDIAN 01355 u_char bandwidth :3; 01356 u_char priority :1; 01357 u_char time_slicing_indicator :1; 01358 u_char mpe_fec_indicator :1; 01359 u_char reserved1 :2; 01360 #else 01361 u_char reserved1 :2; 01362 u_char mpe_fec_indicator :1; 01363 u_char time_slicing_indicator :1; 01364 u_char priority :1; 01365 u_char bandwidth :3; 01366 #endif 01367 #if BYTE_ORDER == BIG_ENDIAN 01368 u_char constellation :2; 01369 u_char hierarchy :3; 01370 u_char code_rate_HP :3; 01371 #else 01372 u_char code_rate_HP :3; 01373 u_char hierarchy :3; 01374 u_char constellation :2; 01375 #endif 01376 #if BYTE_ORDER == BIG_ENDIAN 01377 u_char code_rate_LP :3; 01378 u_char guard_interval :2; 01379 u_char transmission_mode :2; 01380 u_char other_frequency_flag :1; 01381 #else 01382 u_char other_frequency_flag :1; 01383 u_char transmission_mode :2; 01384 u_char guard_interval :2; 01385 u_char code_rate_LP :3; 01386 #endif 01387 u_char reserver2 :8; 01388 u_char reserver3 :8; 01389 u_char reserver4 :8; 01390 u_char reserver5 :8; 01391 }; 01392 01393 /* 0x5B multilingual_network_name_descriptor */ 01394 01395 #define DESCR_MULTILINGUAL_NETWORK_NAME_LEN XX 01396 struct descr_multilingual_network_name { 01397 u_char descriptor_tag :8; 01398 u_char descriptor_length :8; 01399 }; 01400 01401 struct entry_multilingual_name { 01402 u_char lang_code1 :8; 01403 u_char lang_code2 :8; 01404 u_char lang_code3 :8; 01405 u_char text_length :8; 01406 }; 01407 01408 /* 0x5C multilingual_bouquet_name_descriptor */ 01409 01410 #define DESCR_MULTILINGUAL_BOUQUET_NAME_LEN XX 01411 struct descr_multilingual_bouquet_name { 01412 u_char descriptor_tag :8; 01413 u_char descriptor_length :8; 01414 }; 01415 01416 /* 0x5D multilingual_service_name_descriptor */ 01417 01418 #define DESCR_MULTILINGUAL_SERVICE_NAME_LEN XX 01419 struct descr_multilingual_service_name { 01420 u_char descriptor_tag :8; 01421 u_char descriptor_length :8; 01422 }; 01423 01424 struct entry_multilingual_service_name_mid { 01425 u_char service_name_length :8; 01426 }; 01427 01428 /* 0x5E multilingual_component_descriptor */ 01429 01430 #define DESCR_MULTILINGUAL_COMPONENT_LEN XX 01431 struct descr_multilingual_component { 01432 u_char descriptor_tag :8; 01433 u_char descriptor_length :8; 01434 u_char component_tag :8; 01435 }; 01436 01437 /* 0x5F private_data_specifier_descriptor */ 01438 01439 #define DESCR_PRIVATE_DATA_SPECIFIER_LEN XX 01440 struct descr_private_data_specifier { 01441 u_char descriptor_tag :8; 01442 u_char descriptor_length :8; 01443 u_char private_data_specifier_hi_hi :8; 01444 u_char private_data_specifier_hi_lo :8; 01445 u_char private_data_specifier_lo_hi :8; 01446 u_char private_data_specifier_lo_lo :8; 01447 }; 01448 01449 /* 0x60 service_move_descriptor */ 01450 01451 #define DESCR_SERVICE_MOVE_LEN XX 01452 struct descr_service_move { 01453 u_char descriptor_tag :8; 01454 u_char descriptor_length :8; 01455 u_char new_original_network_id_hi :8; 01456 u_char new_original_network_id_lo :8; 01457 u_char new_transport_stream_id_hi :8; 01458 u_char new_transport_stream_id_lo :8; 01459 u_char new_service_id_hi :8; 01460 u_char new_service_id_lo :8; 01461 }; 01462 01463 /* 0x61 short_smoothing_buffer_descriptor */ 01464 01465 #define DESCR_SHORT_SMOOTHING_BUFFER_LEN XX 01466 struct descr_short_smoothing_buffer { 01467 u_char descriptor_tag :8; 01468 u_char descriptor_length :8; 01469 /* TBD */ 01470 }; 01471 01472 /* 0x62 frequency_list_descriptor */ 01473 01474 #define DESCR_FREQUENCY_LIST_LEN XX 01475 struct descr_frequency_list { 01476 u_char descriptor_tag :8; 01477 u_char descriptor_length :8; 01478 #if BYTE_ORDER == BIG_ENDIAN 01479 u_char :6; 01480 u_char coding_type :2; 01481 #else 01482 u_char coding_type :2; 01483 u_char :6; 01484 #endif 01485 }; 01486 01487 /* 0x63 partial_transport_stream_descriptor */ 01488 01489 #define DESCR_PARTIAL_TRANSPORT_STREAM_LEN XX 01490 struct descr_partial_transport_stream { 01491 u_char descriptor_tag :8; 01492 u_char descriptor_length :8; 01493 /* TBD */ 01494 }; 01495 01496 /* 0x64 data_broadcast_descriptor */ 01497 01498 #define DESCR_DATA_BROADCAST_LEN XX 01499 struct descr_data_broadcast { 01500 u_char descriptor_tag :8; 01501 u_char descriptor_length :8; 01502 /* TBD */ 01503 }; 01504 01505 /* 0x65 scrambling_descriptor */ 01506 01507 #define DESCR_SCRAMBLING_LEN XX 01508 struct descr_scrambling { 01509 u_char descriptor_tag :8; 01510 u_char descriptor_length :8; 01511 /* TBD */ 01512 }; 01513 01514 /* 0x66 data_broadcast_id_descriptor */ 01515 01516 #define DESCR_DATA_BROADCAST_ID_LEN XX 01517 struct descr_data_broadcast_id { 01518 u_char descriptor_tag :8; 01519 u_char descriptor_length :8; 01520 /* TBD */ 01521 }; 01522 01523 /* 0x67 transport_stream_descriptor */ 01524 01525 #define DESCR_TRANSPORT_STREAM_LEN XX 01526 struct descr_transport_stream { 01527 u_char descriptor_tag :8; 01528 u_char descriptor_length :8; 01529 /* TBD */ 01530 }; 01531 01532 /* 0x68 dsng_descriptor */ 01533 01534 #define DESCR_DSNG_LEN XX 01535 struct descr_dsng { 01536 u_char descriptor_tag :8; 01537 u_char descriptor_length :8; 01538 /* TBD */ 01539 }; 01540 01541 /* 0x69 pdc_descriptor */ 01542 01543 #define DESCR_PDC_LEN 5 01544 struct descr_pdc { 01545 u_char descriptor_tag :8; 01546 u_char descriptor_length :8; 01547 u_char pil0 :8; 01548 u_char pil1 :8; 01549 u_char pil2 :8; 01550 }; 01551 01552 /* 0x6A ac3_descriptor */ 01553 01554 #define DESCR_AC3_LEN 3 01555 struct descr_ac3 { 01556 u_char descriptor_tag :8; 01557 u_char descriptor_length :8; 01558 #if BYTE_ORDER == BIG_ENDIAN 01559 u_char ac3_type_flag :1; 01560 u_char bsid_flag :1; 01561 u_char mainid_flag :1; 01562 u_char asvc_flag :1; 01563 u_char reserved :4; 01564 #else 01565 u_char reserved :4; 01566 u_char asvc_flag :1; 01567 u_char mainid_flag :1; 01568 u_char bsid_flag :1; 01569 u_char ac3_type_flag :1; 01570 #endif 01571 u_char ac3_type :8; 01572 u_char bsid :8; 01573 u_char mainid :8; 01574 u_char asvc :8; 01575 }; 01576 01577 /* 0x6B ancillary_data_descriptor */ 01578 01579 #define DESCR_ANCILLARY_DATA_LEN 3 01580 struct descr_ancillary_data { 01581 u_char descriptor_tag :8; 01582 u_char descriptor_length :8; 01583 u_char ancillary_data_identifier :8; 01584 }; 01585 01586 /* 0x6C cell_list_descriptor */ 01587 01588 #define DESCR_CELL_LIST_LEN XX 01589 struct descr_cell_list { 01590 u_char descriptor_tag :8; 01591 u_char descriptor_length :8; 01592 /* TBD */ 01593 }; 01594 01595 /* 0x6D cell_frequency_link_descriptor */ 01596 01597 #define DESCR_CELL_FREQUENCY_LINK_LEN XX 01598 struct descr_cell_frequency_link { 01599 u_char descriptor_tag :8; 01600 u_char descriptor_length :8; 01601 /* TBD */ 01602 }; 01603 01604 /* 0x6E announcement_support_descriptor */ 01605 01606 #define DESCR_ANNOUNCEMENT_SUPPORT_LEN XX 01607 struct descr_announcement_support { 01608 u_char descriptor_tag :8; 01609 u_char descriptor_length :8; 01610 /* TBD */ 01611 }; 01612 01613 /* 0x6F application_signalling_descriptor */ 01614 01615 #define DESCR_APPLICATION_SIGNALLING_LEN 2 01616 struct descr_application_signalling { 01617 u_char descriptor_tag :8; 01618 u_char descriptor_length :8; 01619 }; 01620 01621 #define APPLICATION_SIGNALLING_ENTRY_LEN 3 01622 struct application_signalling_entry { 01623 u_char application_type_hi :8; 01624 u_char application_type_lo :8; 01625 #if BYTE_ORDER == BIG_ENDIAN 01626 u_char :3; 01627 u_char AIT_version_number :5; 01628 #else 01629 u_char AIT_version_number :5; 01630 u_char :3; 01631 #endif 01632 }; 01633 01634 /* 0x71 service_identifier_descriptor (ETSI TS 102 812, MHP) */ 01635 01636 struct descr_service_identifier { 01637 u_char descriptor_tag :8; 01638 u_char descriptor_length :8; 01639 }; 01640 01641 /* 0x72 service_availbility_descriptor */ 01642 01643 struct descr_service_availbility { 01644 u_char descriptor_tag :8; 01645 u_char descriptor_length :8; 01646 #if BYTE_ORDER == BIG_ENDIAN 01647 u_char availability_flag :1; 01648 u_char reserved :7; 01649 #else 01650 u_char reserved :7; 01651 u_char availability_flag :1; 01652 #endif 01653 }; 01654 01655 /* 0x73 default_authority_descriptor (ETSI TS 102 323) */ 01656 01657 struct descr_default_authority { 01658 u_char descriptor_tag :8; 01659 u_char descriptor_length :8; 01660 }; 01661 01662 /* 0x74 related_content_descriptor (ETSI TS 102 323) */ 01663 01664 struct descr_related_content { 01665 u_char descriptor_tag :8; 01666 u_char descriptor_length :8; 01667 }; 01668 01669 /* 0x75 tva_id_descriptor (ETSI TS 102 323) */ 01670 01671 struct descr_tva_id { 01672 u_char descriptor_tag :8; 01673 u_char descriptor_length :8; 01674 }; 01675 01676 /* 0x76 content_identifier_descriptor (ETSI TS 102 323) */ 01677 01678 struct descr_content_identifier { 01679 u_char descriptor_tag :8; 01680 u_char descriptor_length :8; 01681 }; 01682 01683 struct content_identifier_entry { 01684 #if BYTE_ORDER == BIG_ENDIAN 01685 u_char crid_type :6; 01686 u_char crid_location :2; 01687 #else 01688 u_char crid_location :2; 01689 u_char crid_type :6; 01690 #endif 01691 union { 01692 u_char crid_length :8; 01693 u_char crid_ref_hi :8; 01694 }; 01695 union { 01696 u_char crid_byte :8; 01697 u_char crid_ref_lo :8; 01698 }; 01699 }; 01700 01701 /* 0x77 time_slice_fec_identifier_descriptor (ETSI EN 301 192) */ 01702 01703 struct descr_time_slice_fec_identifier { 01704 u_char descriptor_tag :8; 01705 u_char descriptor_length :8; 01706 #if BYTE_ORDER == BIG_ENDIAN 01707 u_char time_slicing :1; 01708 u_char mpe_fec :2; 01709 u_char reserved :2; 01710 u_char frame_size :3; 01711 #else 01712 u_char frame_size :3; 01713 u_char reserved :2; 01714 u_char mpe_fec :2; 01715 u_char time_slicing :1; 01716 #endif 01717 u_char max_burst_duration :8; 01718 #if BYTE_ORDER == BIG_ENDIAN 01719 u_char max_average_rate :4; 01720 u_char time_slice_fec_id :4; 01721 #else 01722 u_char time_slice_fec_id :4; 01723 u_char max_average_rate :4; 01724 #endif 01725 }; 01726 01727 /* 0x78 ecm_repetition_rate_descriptor (ETSI EN 301 192) */ 01728 01729 struct descr_ecm_repetition_rate { 01730 u_char descriptor_tag :8; 01731 u_char descriptor_length :8; 01732 u_char ca_system_id_hi :8; 01733 u_char ca_system_id_lo :8; 01734 u_char ecm_repetition_rate_hi :8; 01735 u_char ecm_repetition_rate_lo :8; 01736 }; 01737 01738 /* 0x79 s2_satellite_delivery_system_descriptor */ 01739 01740 struct descr_s2_satellite_delivery_system { 01741 u_char descriptor_tag :8; 01742 u_char descriptor_length :8; 01743 #if BYTE_ORDER == BIG_ENDIAN 01744 u_char scrambling_sequence_selector :1; 01745 u_char multiple_input_stream_flag :1; 01746 u_char backwards_compatibility_indicator :1; 01747 u_char reserved :5; 01748 #else 01749 u_char reserved :5; 01750 u_char backwards_compatibility_indicator :1; 01751 u_char multiple_input_stream_flag :1; 01752 u_char scrambling_sequence_selector :1; 01753 #endif 01754 }; 01755 01756 struct descr_scrambling_sequence_selector { 01757 #if BYTE_ORDER == BIG_ENDIAN 01758 u_char reserved :6; 01759 u_char scrambling_sequence_index_hi_lo :2; 01760 #else 01761 u_char scrambling_sequence_index_hi_lo :2; 01762 u_char reserved :6; 01763 #endif 01764 u_char scrambling_sequence_index_lo_hi :8; 01765 u_char scrambling_sequence_index_lo_lo :8; 01766 }; 01767 01768 /* 0x7A enhanced_ac3_descriptor */ 01769 01770 struct descr_enhanced_ac3 { 01771 u_char descriptor_tag :8; 01772 u_char descriptor_length :8; 01773 #if BYTE_ORDER == BIG_ENDIAN 01774 u_char component_type_flag :1; 01775 u_char bsid_flag :1; 01776 u_char mainid_flag :1; 01777 u_char asvc_flag :1; 01778 u_char mixinfoexists :1; 01779 u_char substream1_flag :1; 01780 u_char substream2_flag :1; 01781 u_char substream3_flag :1; 01782 #else 01783 u_char substream3_flag :1; 01784 u_char substream2_flag :1; 01785 u_char substream1_flag :1; 01786 u_char mixinfoexists :1; 01787 u_char asvc_flag :1; 01788 u_char mainid_flag :1; 01789 u_char bsid_flag :1; 01790 u_char component_type_flag :1; 01791 #endif 01792 }; 01793 01794 /* 0x7B dts_descriptor */ 01795 01796 struct descr_dts { 01797 u_char descriptor_tag :8; 01798 u_char descriptor_length :8; 01799 #if BYTE_ORDER == BIG_ENDIAN 01800 u_char sample_rate_code :4; 01801 u_char bit_rate_code :6; 01802 u_char nblks :7; 01803 u_char fsize_hi :6; 01804 u_char fsize_lo :8; 01805 u_char surround_mode :6; 01806 u_char lfe_flag :1; 01807 u_char extended_surround_flag :2; 01808 #else 01809 u_char extended_surround_flag :2; 01810 u_char lfe_flag :1; 01811 u_char surround_mode :6; 01812 u_char fsize_lo :8; 01813 u_char fsize_hi :6; 01814 u_char nblks :7; 01815 u_char bit_rate_code :6; 01816 u_char sample_rate_code :4; 01817 #endif 01818 }; 01819 01820 /* 0x7C aac_descriptor */ 01821 01822 struct descr_aac { 01823 u_char descriptor_tag :8; 01824 u_char descriptor_length :8; 01825 u_char profile_and_level :8; 01826 #if BYTE_ORDER == BIG_ENDIAN 01827 u_char aac_type_flag :1; 01828 u_char reserved :7; 01829 #else 01830 u_char reserved :7; 01831 u_char aac_type_flag :1; 01832 #endif 01833 }; 01834 /* 0x7F extension_descriptor */ 01835 01836 struct descr_extension { 01837 u_char descriptor_tag :8; 01838 u_char descriptor_length :8; 01839 u_char descriptor_tag_extension :8; 01840 }; 01841 01842 /* extension 0x04 t2_delivery_system_descriptor */ 01843 01844 struct descr_t2_delivery_system { 01845 u_char descriptor_tag :8; 01846 u_char descriptor_length :8; 01847 u_char descriptor_tag_extension :8; 01848 u_char plp_id :8; 01849 u_char t2_system_id_hi :8; 01850 u_char t2_system_id_lo :8; 01851 #if BYTE_ORDER == BIG_ENDIAN 01852 u_char siso_miso :2; 01853 u_char bandwidth :4; 01854 u_char reserved :2; 01855 u_char guard_interval :3; 01856 u_char transmission_mode :3; 01857 u_char other_frequency_flag :1; 01858 u_char tfs_flag :1; 01859 #else 01860 u_char reserved :2; 01861 u_char bandwidth :4; 01862 u_char siso_miso :2; 01863 u_char tfs_flag :1; 01864 u_char other_frequency_flag :1; 01865 u_char transmission_mode :3; 01866 u_char guard_interval :3; 01867 #endif 01868 /* now follow cell_id, frequency_loop_length, centre_frequency, 01869 subcell_info_loop_length, cell_id_extension, transposer_frequency 01870 fields looping to the end */ 01871 }; 01872 01873 /* MHP 0x00 application_descriptor */ 01874 01875 #define DESCR_APPLICATION_LEN 3 01876 01877 struct descr_application { 01878 u_char descriptor_tag :8; 01879 u_char descriptor_length :8; 01880 u_char application_profiles_length :8; 01881 }; 01882 01883 #define DESCR_APPLICATION_END_LEN 2 01884 01885 struct descr_application_end { 01886 #if BYTE_ORDER == BIG_ENDIAN 01887 u_char service_bound_flag :1; 01888 u_char visibility :2; 01889 u_char :5; 01890 #else 01891 u_char :5; 01892 u_char visibility :2; 01893 u_char service_bound_flag :1; 01894 #endif 01895 u_char application_priority :8; 01896 /*now follow 8bit transport_protocol_label fields to the end */ 01897 }; 01898 01899 #define APPLICATION_PROFILE_ENTRY_LEN 5 01900 01901 struct application_profile_entry { 01902 u_char application_profile_hi :8; 01903 u_char application_profile_lo :8; 01904 u_char version_major :8; 01905 u_char version_minor :8; 01906 u_char version_micro :8; 01907 }; 01908 01909 /* MHP 0x01 application_name_desriptor */ 01910 01911 #define DESCR_APPLICATION_NAME_LEN 2 01912 01913 struct descr_application_name { 01914 u_char descriptor_tag :8; 01915 u_char descriptor_length :8; 01916 }; 01917 01918 #define APPLICATION_NAME_ENTRY_LEN 4 01919 01920 struct descr_application_name_entry { 01921 u_char lang_code1 :8; 01922 u_char lang_code2 :8; 01923 u_char lang_code3 :8; 01924 u_char application_name_length :8; 01925 /* application name string */ 01926 }; 01927 01928 /* MHP 0x02 transport_protocol_descriptor */ 01929 01930 #define DESCR_TRANSPORT_PROTOCOL_LEN 5 01931 01932 struct descr_transport_protocol { 01933 u_char descriptor_tag :8; 01934 u_char descriptor_length :8; 01935 u_char protocol_id_hi :8; 01936 u_char protocol_id_lo :8; 01937 u_char transport_protocol_label :8; 01938 /* protocol_id-specific selector bytes follow */ 01939 }; 01940 01941 struct descr_url_extension_entry { 01942 u_char url_extension_length :8; 01943 /* URL extension string */ 01944 }; 01945 01946 #define TRANSPORT_VIA_OC_LEN 1 01947 01948 struct transport_via_oc { 01949 #if BYTE_ORDER == BIG_ENDIAN 01950 u_char remote :1; 01951 u_char :7; 01952 #else 01953 u_char :7; 01954 u_char remote :1; 01955 #endif 01956 }; 01957 01958 //if remote is true, transport_via_oc_remote_end_t follows, 01959 // else transport_via_oc_end_t. 01960 01961 #define TRANSPORT_VIA_OC_REMOTE_END_LEN 7 01962 01963 struct transport_via_oc_remote_end { 01964 u_char original_network_id_hi :8; 01965 u_char original_network_id_lo :8; 01966 u_char transport_stream_id_hi :8; 01967 u_char transport_stream_id_lo :8; 01968 u_char service_id_hi :8; 01969 u_char service_id_lo :8; 01970 u_char component_tag :8; 01971 }; 01972 01973 #define TRANSPORT_VIA_OC_END_LEN 1 01974 01975 struct transport_via_oc_end { 01976 u_char component_tag :8; 01977 }; 01978 01979 #define TRANSPORT_VIA_HTTP_LEN 1 01980 01981 struct transport_via_http { 01982 u_char url_base_length :8; 01983 }; 01984 01985 /* 0x03 dvb_j_application_descriptor() */ 01986 01987 #define DESCR_DVBJ_APPLICATION_LEN 2 01988 01989 struct descr_dvbj_application { 01990 u_char descriptor_tag :8; 01991 u_char descriptor_length :8; 01992 }; 01993 01994 #define DESCR_DVBJ_APPLICATION_ENTRY_LEN 1 01995 01996 struct descr_dvbj_application_entry { 01997 u_char parameter_length :8; 01998 /* parameter string */ 01999 }; 02000 02001 /* 0x04 dvb_j_application_location_descriptor */ 02002 02003 #define DESCR_DVBJ_APPLICATION_LOCATION_LEN 3 02004 02005 struct descr_dvbj_application_location { 02006 u_char descriptor_tag :8; 02007 u_char descriptor_length :8; 02008 u_char base_directory_length :8; 02009 /* base directory string */ 02010 }; 02011 02012 #define DESCR_DVBJ_APPLICATION_LOCATION_MID_LEN 1 02013 02014 struct descr_dvbj_application_location_mid { 02015 u_char classpath_extension_length :8; 02016 }; 02017 02018 /* 0x0B application_icons_descriptor */ 02019 02020 #define DESCR_APPLICATION_ICONS_LEN 3 02021 02022 struct descr_application_icons_descriptor { 02023 u_char descriptor_tag :8; 02024 u_char descriptor_length :8; 02025 u_char icon_locator_length :8; 02026 /* icon locator */ 02027 }; 02028 02029 #define DESCR_APPLICATION_ICONS_END_LEN 2 02030 02031 struct descr_application_icons_descriptor_end { 02032 u_char icon_flags_hi :8; 02033 u_char icon_flags_lo :8; 02034 }; 02035 02036 /* 0x15 simple application location descrptor */ 02037 02038 #define DESCR_SIMPLE_APPLICATION_LOCATION_LEN 3 02039 02040 struct descr_simple_application_location_descriptor { 02041 u_char descriptor_tag :8; 02042 u_char descriptor_length :8; 02043 /* inital_path_bytes */ 02044 }; 02045 02046 // Private DVB Descriptor Premiere.de 02047 // 0xF2 Content Transmission Descriptor 02048 // http://dvbsnoop.sourceforge.net/examples/example-private-section.html 02049 02050 #define DESCR_PREMIERE_CONTENT_TRANSMISSION_LEN 8 02051 02052 struct descr_premiere_content_transmission { 02053 u_char descriptor_tag :8; 02054 u_char descriptor_length :8; 02055 u_char transport_stream_id_hi :8; 02056 u_char transport_stream_id_lo :8; 02057 u_char original_network_id_hi :8; 02058 u_char original_network_id_lo :8; 02059 u_char service_id_hi :8; 02060 u_char service_id_lo :8; 02061 }; 02062 02063 #define ITEM_PREMIERE_CONTENT_TRANSMISSION_DAY_LEN 3 02064 02065 struct item_premiere_content_transmission_day { 02066 u_char mjd_hi :8; 02067 u_char mjd_lo :8; 02068 u_char start_time_loop :8; 02069 }; 02070 02071 #define ITEM_PREMIERE_CONTENT_TRANSMISSION_TIME_LEN 3 02072 02073 struct item_premiere_content_transmission_time { 02074 u_char start_time_h :8; 02075 u_char start_time_m :8; 02076 u_char start_time_s :8; 02077 }; 02078 02079 /* 0x05 registration_descriptor */ 02080 02081 #define DESCR_REGISTRATION_LEN 6 02082 struct descr_registration { 02083 u_char descriptor_tag :8; 02084 u_char descriptor_length :8; 02085 u_char format_identifier_hi_hi :8; 02086 u_char format_identifier_hi_lo :8; 02087 u_char format_identifier_lo_hi :8; 02088 u_char format_identifier_lo_lo :8; 02089 }; 02090 02091 } //end of namespace 02092 02093 #endif //LIBSI_HEADERS_H