135 #ifdef STB_SI_PRINT_REQUIRED 136 #define STB_SI_PRINT(x) DEBUG_PRINTX_CONDITIONAL(DEBUG_STB_SI) x 139 #define STB_SI_PRINT(x) STB_SPDebugWrite x 141 #define STB_SI_PRINT(x) 145 #ifdef DEBUG_SI_EIT_CONTENT 146 #define DEBUG_SI_EIT_CONTENT_VALUE TRUE 148 #define DEBUG_SI_EIT_CONTENT_VALUE FALSE 151 #ifdef DEBUG_SI_SDT_CONTENT 152 #define DEBUG_SI_SDT_CONTENT_VALUE TRUE 154 #define DEBUG_SI_SDT_CONTENT_VALUE FALSE 157 #ifdef DEBUG_SI_PMT_CONTENT 158 #define DEBUG_SI_PMT_CONTENT_VALUE TRUE 160 #define DEBUG_SI_PMT_CONTENT_VALUE FALSE 163 #ifdef DEBUG_SI_NIT_CONTENT 164 #define DEBUG_SI_NIT_CONTENT_VALUE TRUE 166 #define DEBUG_SI_NIT_CONTENT_VALUE FALSE 169 #ifdef DEBUG_SI_BAT_CONTENT 170 #define DEBUG_SI_BAT_CONTENT_VALUE TRUE 172 #define DEBUG_SI_BAT_CONTENT_VALUE FALSE 175 #ifdef DEBUG_RCT_LINK_INFO 176 #define DEBUG_RCT_LINK_INFO_VALUE TRUE 178 #define DEBUG_RCT_LINK_INFO_VALUE FALSE 181 #ifdef DEBUG_SI_RCT_CONTENT 182 #define DEBUG_SI_RCT_CONTENT_VALUE TRUE 184 #define DEBUG_SI_RCT_CONTENT_VALUE FALSE 187 #ifdef DEBUG_SI_TDT_TOT_CONTENT 188 #define DEBUG_SI_TDT_TOT_CONTENT_VALUE TRUE 190 #define DEBUG_SI_TDT_TOT_CONTENT_VALUE FALSE 193 #ifdef DEBUG_SERVICE_DESC 194 #define DEBUG_SERVICE_DESC_VALUE TRUE 196 #define DEBUG_SERVICE_DESC_VALUE FALSE 199 #ifdef DEBUG_SHORT_EVENT_DESC 200 #define DEBUG_SHORT_EVENT_DESC_VALUE TRUE 202 #define DEBUG_SHORT_EVENT_DESC_VALUE FALSE 205 #ifdef DEBUG_TERR_DEL_SYS_DESC 206 #define DEBUG_TERR_DEL_SYS_DESC_VALUE TRUE 208 #define DEBUG_TERR_DEL_SYS_DESC_VALUE FALSE 211 #ifdef DEBUG_SAT_DEL_SYS_DESC 212 #define DEBUG_SAT_DEL_SYS_DESC_VALUE TRUE 214 #define DEBUG_SAT_DEL_SYS_DESC_VALUE FALSE 217 #ifdef DEBUG_CABLE_DEL_SYS_DESC 218 #define DEBUG_CABLE_DEL_SYS_DESC_VALUE TRUE 220 #define DEBUG_CABLE_DEL_SYS_DESC_VALUE FALSE 224 #define SI_PAT_PID 0x0000 225 #define SI_CAT_PID 0x0001 226 #define SI_NIT_PID 0x0010 227 #define SI_SDT_PID 0x0011 228 #define SI_BAT_PID 0x0011 229 #define SI_EIT_PID 0x0012 230 #define SI_TDT_PID 0x0014 231 #define SI_TOT_PID 0x0014 234 #define SI_PAT_TID 0x00 235 #define SI_CAT_TID 0x01 236 #define SI_PMT_TID 0x02 237 #define SI_NIT_ACTUAL_TID 0x40 238 #define SI_NIT_OTHER_TID 0x41 239 #define SI_SDT_ACTUAL_TID 0x42 240 #define SI_SDT_OTHER_TID 0x46 241 #define SI_BAT_TID 0x4A 242 #define SI_EITPF_ACTUAL_TID 0x4E 243 #define SI_EITPF_OTHER_TID 0x4F 244 #define SI_EITSC_ACTUAL_TID 0x50 // range 0x50 to 0x5f 245 #define SI_EITSC_OTHER_TID 0x60 // range 0x60 to 0x6f 246 #define SI_TDT_TID 0x70 247 #define SI_TOT_TID 0x73 248 #define SI_AIT_TID 0x74 249 #define SI_RCT_TID 0x76 250 #define SI_EIT_PLUS_TID 0xD1 256 #define ISO_LANG_DTAG 0x0a 257 #define CAROUSEL_ID_DTAG 0x13 260 #define PRIV_DATA_INDICATOR_DTAG 0x0f 261 #define NET_NAME_DTAG 0x40 262 #define SERV_LIST_DTAG 0x41 263 #define SAT_DEL_SYS_DTAG 0x43 264 #define CABLE_DEL_SYS_DTAG 0x44 265 #define SERVICE_DTAG 0x48 266 #define LINKAGE_DTAG 0x4a 267 #define SHORT_EVENT_DTAG 0x4d 268 #define EXTENDED_EVENT_DTAG 0x4e 269 #define COMPONENT_DTAG 0x50 270 #define STREAM_ID_DTAG 0x52 271 #define CA_ID_DTAG 0x53 272 #define CONTENT_DTAG 0x54 273 #define PARENTAL_RATING_DTAG 0x55 274 #define TELETEXT_DTAG 0x56 275 #define LOCAL_TIME_OFFSET_DTAG 0x58 276 #define SUBTITLE_DTAG 0x59 277 #define TERR_DEL_SYS_DTAG 0x5a 278 #define MULTILING_NET_NAME_DTAG 0x5b 279 #define MULTILING_SERV_NAME_DTAG 0x5d 280 #define MULTILING_COMPONENT_DTAG 0x5e 281 #define PRIV_DATA_SPEC_DTAG 0x5f 282 #define SERVICE_MOVE_DTAG 0x60 283 #define FREQ_LIST_DTAG 0x62 284 #define AC3_DTAG 0x6a 285 #define APP_SIG_DTAG 0x6f 286 #define SERV_AVAIL_DESC_DTAG 0x72 287 #define DEF_AUTH_DTAG 0x73 288 #define RELATED_CONTENT_DTAG 0x74 289 #define CONT_ID_DTAG 0x76 290 #define EAC3_DTAG 0x7a 291 #define AAC_DTAG 0x7c 292 #define FTA_CONTENT_DTAG 0x7e 293 #define EXT_DTAG 0x7f 296 #define USER_DEFINED_DTAG_0x83 0x83 297 #define USER_DEFINED_DTAG_0x84 0x84 298 #define USER_DEFINED_DTAG_0x85 0x85 299 #define USER_DEFINED_DTAG_0x86 0x86 300 #define USER_DEFINED_DTAG_0x87 0x87 301 #define USER_DEFINED_DTAG_0x88 0x88 302 #define USER_DEFINED_DTAG_0x89 0x89 303 #define USER_DEFINED_DTAG_0xA0 0xa0 306 #define BOUQUET_NAME_DTAG 0x47 307 #define LOGICAL_CHANNEL_DTAG 0x83 310 #define CIPLUS_SERVICE_DTAG 0xcc 311 #define CIPLUS_PROTECTION_DTAG 0xce 312 #define CIPLUS_VIRTUAL_CHAN_DTAG 0xd2 316 #define FREESAT_TUNNELLED_DTAG 0xd0 317 #define FREESAT_ALT_TUNNELLED_DTAG 0xd1 318 #define FREESAT_LINK_DTAG 0xd2 319 #define FREESAT_REGION_LCN_DTAG 0xd3 320 #define FREESAT_REGION_NAME_DTAG 0xd4 321 #define FREESAT_SERV_GROUP_DTAG 0xd5 322 #define FREESAT_IACTIVE_STORAGE_DTAG 0xd6 323 #define FREESAT_INFO_LOCATION_DTAG 0xd7 324 #define FREESAT_SERV_GROUP_NAME_DTAG 0xd8 325 #define FREESAT_SERV_NAME_DTAG 0xd9 326 #define FREESAT_GUIDANCE_DTAG 0xda 327 #define FREESAT_IACTIVE_RESTRICT_DTAG 0xdb 328 #define FREESAT_CONTENT_MANAGE_DTAG 0xdc 329 #define FREESAT_PREFIX_DTAG 0xdf 330 #define FREESAT_MEDIA_LOCATOR_DTAG 0xe0 334 #define IMAGE_ICON_DTAG 0x00 335 #define T2_DELIVERY_SYS_DTAG 0x04 336 #define SUPPLEMENTARY_AUDIO_DTAG 0x06 337 #define NETWORK_CHANGE_NOTIFY_DTAG 0x07 338 #define MESSAGE_DTAG 0x08 339 #define TARGET_REGION_DTAG 0x09 340 #define TARGET_REGION_NAME_DTAG 0x0a 341 #define URI_LINKAGE_DTAG 0x13 345 #define UK_DTT_PRIVATE_DATA_SPECIFIER 0x0000233a 346 #define CIPLUS_PRIVATE_DATA_SPECIFIER 0x00000040 347 #define FREESAT_PRIVATE_DATA_SPECIFIER 0x46534154 348 #define NORDIG_PRIVATE_DATA_SPECIFIER 0x00000029 349 #define EACEM_PRIVATE_DATA_SPECIFIER 0x00000028 350 #define NZ_DTT_PRIVATE_DATA_SPECIFIER 0x00000037 351 #define NZ_SAT_PRIVATE_DATA_SPECIFIER 0x00000029 352 #define ZAF_DTT_PRIVATE_DATA_SPECIFIER 0x000022c6 355 #define LANG_CODE_NAR 0x6e6172 365 static const U8BIT eit_tid_match[] =
373 static const U8BIT eit_tid_mask[] =
377 (~(SI_EITPF_ACTUAL_TID ^ SI_EITPF_OTHER_TID) & 0xff),
381 static const U8BIT sched_tid_match[] =
387 (SI_EITSC_ACTUAL_TID | SI_EITSC_OTHER_TID),
388 (SI_EITSC_ACTUAL_TID | SI_EITSC_OTHER_TID),
389 (SI_EITSC_ACTUAL_TID | SI_EITSC_OTHER_TID)
392 static const U8BIT sched_tid_mask[] =
398 (~(SI_EITSC_ACTUAL_TID ^ SI_EITSC_OTHER_TID) & 0xff),
399 (~(SI_EITSC_ACTUAL_TID ^ SI_EITSC_OTHER_TID) & 0xfe),
400 (~(SI_EITSC_ACTUAL_TID ^ SI_EITSC_OTHER_TID) & 0xf0)
407 static STB_SI_USER_DEF_DESCRIP_FUNCTION GetUserDefinedDescriptorFunction(U8BIT dtag);
409 static U8BIT* ReadLanguageCode(U8BIT *dptr, U32BIT *code_ptr);
410 static U8BIT* SkipDescriptor(U8BIT *dptr, U8BIT dtag, BOOLEAN db_print);
412 static U8BIT* ParseAACDescriptor(U8BIT *dptr,
SI_AAC_DESC **desc_ptr, BOOLEAN db_print);
413 static U8BIT* ParseAC3Descriptor(U8BIT *dptr, U8BIT dtag,
SI_AC3_DESC **desc_ptr, BOOLEAN db_print);
414 static U8BIT* ParseAppSignallingDescriptor(U8BIT *dptr, U16BIT *num_ptr,
SI_APP_SIG_DESC **array_ptr,
416 static U8BIT* ParseCaDescriptor(U8BIT *dptr, U16BIT *num_ptr,
SI_CA_DESC **array_ptr, BOOLEAN db_print);
417 static U8BIT* ParseCaIdentifierDescriptor(U8BIT *dptr, U8BIT *num_ptr, U16BIT **array_ptr, BOOLEAN db_print);
418 static U8BIT* ParseCarouselIdDescriptor(U8BIT *dptr, U32BIT *carousel_id, BOOLEAN db_print);
419 static U8BIT* ParseComponentDescriptor(U8BIT *dptr, U8BIT *num_ptr,
SI_COMPONENT_DESC **array_ptr,
421 static U8BIT* ParseContentDescriptor(U8BIT *dptr, U8BIT *num_ptr,
SI_CONTENT_DESC **array_ptr, BOOLEAN db_print);
423 static U8BIT* ParseFTAContentDescriptor(U8BIT *dptr,
SI_FTA_CONTENT_DESC **desc_ptr, BOOLEAN db_print);
424 static U8BIT* ParseGuidanceDescriptor(U8BIT *dptr,
SI_GUIDANCE_DESC **desc_ptr, BOOLEAN db_print);
425 static U8BIT* ParseIsoLangDescriptor(U8BIT *dptr, U16BIT *num_ptr,
SI_ISO_LANG_DESC **array_ptr, BOOLEAN db_print);
426 static U8BIT* ParseLocalTimeOffsetDescriptor(U8BIT *dptr, U16BIT *num_ptr,
SI_LTO_DESC **array_ptr,
428 static U8BIT* ParseMultilingComponentDescriptor(U8BIT *dptr, U8BIT *num_ptr,
430 static U8BIT* ParseMultilingNetNameDescriptor(U8BIT *dptr, U16BIT *num_ptr,
432 static U8BIT* ParseMultilingServNameDescriptor(U8BIT *dptr, U16BIT *num_ptr,
434 static U8BIT* ParseParentalRatingDescriptor(U8BIT *dptr, U8BIT *num_ptr,
436 static U8BIT* ParseServiceListDescriptor(U8BIT *dptr, U16BIT *num_ptr,
SI_SERV_LIST_DESC **array_ptr,
438 static U8BIT* ParseShortServiceNameDescriptor(U8BIT *dptr,
SI_STRING_DESC **name_ptr, BOOLEAN db_print);
439 static U8BIT* ParseShortEventDescriptor(U8BIT *dptr, U8BIT *num_ptr,
SI_SHORT_EVENT_DESC **array_ptr,
441 static U8BIT* ParseExtendedEventDescriptor(U8BIT *dptr, U8BIT *num_ptr,
443 static U8BIT* ParseSubtitleDescriptor(U8BIT *dptr, U16BIT *num_ptr,
SI_SUBTITLE_DESC **array_ptr,
445 static U8BIT* ParseTeletextDescriptor(U8BIT *dptr, U16BIT *num_ptr,
SI_TELETEXT_DESC **array_ptr,
447 static U8BIT* ParseLogicalChannelDescriptor(U8BIT *dptr, U8BIT dtag, U16BIT *num_ptr,
449 static U8BIT* ParseServiceAttributeDescriptor(U8BIT *dptr, U16BIT *num_ptr,
451 static U8BIT* ParseNordigLCN2Descriptor(U8BIT *dptr, U16BIT *num_ptr,
SI_NORDIG_LCN_DESC **array_ptr,
453 static U8BIT* ParsePreferredNameListDescriptor(U8BIT *dptr, U16BIT *num_ptr,
459 static U8BIT* ParseNetNameDescriptor(U8BIT *dptr,
SI_STRING_DESC **name_ptr, BOOLEAN db_print);
460 static U8BIT* ParsePrivateDataSpecifierDescriptor(U8BIT *dptr, U32BIT *code_ptr, BOOLEAN db_print);
461 static U8BIT* ParseServiceDescriptor(U8BIT *dptr, U8BIT *type_ptr,
SI_STRING_DESC **provider_ptr,
463 static U8BIT* ParseStreamIdDescriptor(U8BIT *dptr, U8BIT **tag_array_ptr, U8BIT *num_entries_ptr, BOOLEAN db_print);
464 static U8BIT* ParseTerrestrialDeliverySysDescriptor(U8BIT *dptr,
SI_DELIVERY_SYS_DESC **desc_ptr,
466 static U8BIT* ParseT2DeliverySysDescriptor(U8BIT *dptr,
SI_DELIVERY_SYS_DESC **desc_ptr, BOOLEAN db_print);
467 static U8BIT* ParseSatelliteDeliverySysDescriptor(U8BIT *dptr,
SI_DELIVERY_SYS_DESC **desc_ptr, BOOLEAN db_print);
470 static U8BIT* ParsePreferredNameIdDescriptor(U8BIT *dptr, U8BIT *id_ptr, BOOLEAN db_print);
472 static U8BIT* ParseDefaultAuthorityDescriptor(U8BIT *dptr,
SI_STRING_DESC **authority_ptr, BOOLEAN db_print);
473 static U8BIT* ParseContentIdentifierDescriptor(U8BIT *dptr, U8BIT *num_ptr,
SI_CRID_DESC **list_ptr,
475 static U8BIT* ParseNetworkChangeNotifyDescriptor(U8BIT *dptr, U16BIT *num_change_notifies,
478 static U8BIT* ParseMessageDescriptor(U8BIT *dptr, U16BIT *num_messages,
484 static U8BIT* ParseSupplementaryAudioDescriptor(U8BIT *dptr,
SI_AD_DESC **audio_desc, BOOLEAN db_print);
485 static U8BIT* ParseRctLinkInfo(U8BIT *dptr,
SI_RCT_LINK_INFO *link_info, BOOLEAN db_print);
486 static U8BIT* ParseImageIconDesc(U8BIT *dptr, U8BIT *num_icons,
SI_IMAGE_ICON_DESC **icon_array, BOOLEAN db_print);
487 static U8BIT* ParseURILinkageDesc(U8BIT *dptr,
SI_URI_LINKAGE_DESC **desc_list, U32BIT private_data_code,
489 static U8BIT* ParseNordigContentProtectionDesc(U8BIT *dptr, U8BIT *protection_level, BOOLEAN db_print);
491 static U8BIT* ParseServiceMoveDescriptor(U8BIT *dptr,
SI_SERVICE_MOVE_DESC **desc_ptr, BOOLEAN db_print);
494 static U8BIT* ParseFreesatTunnelledDataDescriptor(U8BIT *dptr, U8BIT *num_entries,
496 static U8BIT* ParseFreesatServiceGroupNameDescriptor(U8BIT *dptr,
499 U16BIT *num_entries, BOOLEAN db_print);
501 static U8BIT* ParseFreesatInteractiveRestrictionDescriptor(U8BIT *dptr, U16BIT **int_res_array, U8BIT *num_entries, BOOLEAN db_print);
503 static U8BIT* ParseFreesatShortServiceNameDescriptor(U8BIT *dptr, U16BIT *num_ptr,
506 static U8BIT* ParseRegionNameDescriptor(U8BIT *dptr,
SI_BAT_FREESAT_REGION **region_list, BOOLEAN db_print);
507 static U8BIT* ParseIActiveStorageDescriptor(U8BIT *dptr,
509 static U8BIT* ParseFreesatInfoLocationDescriptor(U8BIT *dptr,
512 static U8BIT* SaveCIProtectionDescriptor(U8BIT *dptr, U8BIT **desc, BOOLEAN db_print);
513 static U8BIT* ParseCIPlusServiceDescriptor(U8BIT *dptr, U16BIT *num_services,
516 static float BCDToFloat(U8BIT *data_ptr, U8BIT len, U8BIT point);
520 static U32BIT country_private_data_specifier_code = 0;
521 static BOOLEAN freesat_private_data_specifier = FALSE;
522 static BOOLEAN ciplus_private_data_specifier = FALSE;
523 static BOOLEAN eacem_private_data_specifier = FALSE;
524 static BOOLEAN nzsat_private_data_specifier = FALSE;
525 static BOOLEAN nordig_private_data_specifier = FALSE;
531 #define FIRST_USER_DEFINED_DTAG 0x80 532 #define LAST_USER_DEFINED_DTAG 0xfe 533 #define NUM_USER_DEFINED_DTAGS (LAST_USER_DEFINED_DTAG - FIRST_USER_DEFINED_DTAG + 1) 534 static STB_SI_USER_DEF_DESCRIP_FUNCTION user_defined_dtag_function[NUM_USER_DEFINED_DTAGS];
557 static STB_SI_USER_DEF_DESCRIP_FUNCTION GetUserDefinedDescriptorFunction(U8BIT dtag)
559 STB_SI_USER_DEF_DESCRIP_FUNCTION retval;
561 FUNCTION_START(GetUserDefinedDescriptorFunction);
563 if ((FIRST_USER_DEFINED_DTAG <= dtag) && (dtag <= LAST_USER_DEFINED_DTAG))
565 retval = user_defined_dtag_function[dtag - FIRST_USER_DEFINED_DTAG];
567 FUNCTION_FINISH(GetUserDefinedDescriptorFunction);
583 static U8BIT* ReadLanguageCode(U8BIT *dptr, U32BIT *code_ptr)
589 FUNCTION_START(ReadLanguageCode);
592 for (i = 0; i < 3; i++)
596 if ((code_char >=
'A') && (code_char <=
'Z'))
600 lcode = (lcode << 8) | code_char;
603 FUNCTION_FINISH(ReadLanguageCode);
620 static U8BIT* SkipDescriptor(U8BIT *dptr, U8BIT dtag, BOOLEAN db_print)
625 FUNCTION_START(SkipDescriptor);
627 #ifndef DEBUG_SKIPPED_DESC 628 USE_UNWANTED_PARAM(dtag);
629 USE_UNWANTED_PARAM(db_print);
634 end_ptr = dptr + dlen;
636 #ifdef DEBUG_SKIPPED_DESC 643 if (db_print == TRUE)
645 STB_SI_PRINT((
" dtag=0x%02x, len=%d", dtag, dlen));
649 msg_ptr = &msg_buff[3];
654 while ((j < 16) && (i < dlen))
656 sprintf((
char *)msg_ptr,
" %02x", *dptr);
663 STB_SI_PRINT((
"%s", msg_buff));
664 msg_ptr = &msg_buff[3];
670 FUNCTION_FINISH(SkipDescriptor);
681 static U8BIT* ParseAACDescriptor(U8BIT *dptr,
SI_AAC_DESC **desc_ptr, BOOLEAN db_print)
686 FUNCTION_START(ParseAACDescriptor);
690 end_ptr = dptr + dlen;
692 #ifdef DEBUG_AAC_DESC 693 if (db_print == TRUE)
695 STB_SI_PRINT((
" AAC desc: (%d bytes)", dlen));
698 USE_UNWANTED_PARAM(db_print);
703 if (*desc_ptr == NULL)
706 if (*desc_ptr != NULL)
709 (*desc_ptr)->profile_level = *dptr;
712 if ((dlen > 1) && ((*dptr & 0x80) != 0))
715 (*desc_ptr)->type_present = TRUE;
717 (*desc_ptr)->aac_type = *dptr;
718 #ifdef DEBUG_AAC_DESC 719 if (db_print == TRUE)
721 STB_SI_PRINT((
" profile=0x%02x, type=0x%02x", (*desc_ptr)->profile_level,
722 (*desc_ptr)->aac_type));
728 (*desc_ptr)->type_present = FALSE;
729 #ifdef DEBUG_AAC_DESC 730 if (db_print == TRUE)
732 STB_SI_PRINT((
" profile=0x%02x", (*desc_ptr)->profile_level));
739 FUNCTION_FINISH(ParseAACDescriptor);
758 static U8BIT* ParseAC3Descriptor(U8BIT *dptr, U8BIT dtag,
SI_AC3_DESC **desc_ptr, BOOLEAN db_print)
763 FUNCTION_START(ParseAC3Descriptor);
767 end_ptr = dptr + dlen;
769 #ifdef DEBUG_AC3_DESC 772 if (dtag == AC3_DTAG)
774 STB_SI_PRINT((
" AC-3 desc: (%u bytes)", dlen));
776 else if (dtag == EAC3_DTAG)
778 STB_SI_PRINT((
" E-AC-3 desc: (%u bytes)", dlen));
782 STB_SI_PRINT((
" AC-3 desc: (%u bytes) descriptor_tag=0x%02x", dlen, dtag));
786 USE_UNWANTED_PARAM(db_print);
791 if ((*desc_ptr == NULL) && (dlen >= 1))
796 if (*desc_ptr != NULL)
801 (*desc_ptr)->dtag = dtag;
803 if ((*dptr & 0x80) != 0)
805 (*desc_ptr)->component_type_flag = TRUE;
808 if ((*dptr & 0x40) != 0)
810 (*desc_ptr)->bsid_flag = TRUE;
813 if ((*dptr & 0x20) != 0)
815 (*desc_ptr)->mainid_flag = TRUE;
818 if ((*dptr & 0x10) != 0)
820 (*desc_ptr)->asvc_flag = TRUE;
823 if (dtag == EAC3_DTAG)
825 if ((*dptr & 0x08) != 0)
827 (*desc_ptr)->mixinfoexists = TRUE;
830 if ((*dptr & 0x04) != 0)
832 (*desc_ptr)->substream1_flag = TRUE;
835 if ((*dptr & 0x02) != 0)
837 (*desc_ptr)->substream2_flag = TRUE;
840 if ((*dptr & 0x01) != 0)
842 (*desc_ptr)->substream3_flag = TRUE;
848 if ((*desc_ptr)->component_type_flag)
850 (*desc_ptr)->component_type = *dptr;
851 #ifdef DEBUG_AC3_DESC 854 STB_SI_PRINT((
" component_type=0x%02x", (*desc_ptr)->component_type));
860 if ((*desc_ptr)->bsid_flag)
862 (*desc_ptr)->bsid = *dptr;
863 #ifdef DEBUG_AC3_DESC 866 STB_SI_PRINT((
" bsid=0x%02x", (*desc_ptr)->bsid));
872 if ((*desc_ptr)->mainid_flag)
874 (*desc_ptr)->mainid = *dptr;
875 #ifdef DEBUG_AC3_DESC 878 STB_SI_PRINT((
" mainid=0x%02x", (*desc_ptr)->mainid));
884 if ((*desc_ptr)->asvc_flag)
886 (*desc_ptr)->asvc = *dptr;
887 #ifdef DEBUG_AC3_DESC 890 STB_SI_PRINT((
" asvc=0x%02x", (*desc_ptr)->asvc));
896 if ((*desc_ptr)->substream1_flag)
898 (*desc_ptr)->substream1 = *dptr;
899 #ifdef DEBUG_AC3_DESC 902 STB_SI_PRINT((
" substream1=0x%02x", (*desc_ptr)->substream1));
908 if ((*desc_ptr)->substream2_flag)
910 (*desc_ptr)->substream2 = *dptr;
911 #ifdef DEBUG_AC3_DESC 914 STB_SI_PRINT((
" substream2=0x%02x", (*desc_ptr)->substream2));
920 if ((*desc_ptr)->substream3_flag)
922 (*desc_ptr)->substream3 = *dptr;
923 #ifdef DEBUG_AC3_DESC 926 STB_SI_PRINT((
" substream3=0x%02x", (*desc_ptr)->substream3));
933 FUNCTION_FINISH(ParseAC3Descriptor);
951 static U8BIT* ParseAppSignallingDescriptor(U8BIT *dptr, U16BIT *num_ptr,
SI_APP_SIG_DESC **array_ptr, BOOLEAN db_print)
960 FUNCTION_START(ParseAppSignallingDescriptor);
962 ASSERT(dptr != NULL);
963 ASSERT(num_ptr != NULL);
964 ASSERT(array_ptr != NULL);
968 end_ptr = dptr + dlen;
970 #ifdef DEBUG_APP_SIG_DESC 973 STB_SI_PRINT((
" App sig desc: (%d bytes)", dlen));
976 USE_UNWANTED_PARAM(db_print);
981 app_type = ((dptr[0] & 0x7f) << 8) + dptr[1];
982 ait_version = dptr[2] & 0x1f;
984 #ifdef DEBUG_APP_SIG_DESC 987 STB_SI_PRINT((
" app_type=0x%02x, ait_version=%u", app_type, ait_version));
991 if (*array_ptr == NULL)
1000 num_entries = *num_ptr + 1;
1013 array[num_entries - 1].app_type = app_type;
1014 array[num_entries - 1].ait_version = ait_version;
1016 *num_ptr = num_entries;
1020 #ifdef DEBUG_APP_SIG_DESC 1021 if (db_print == TRUE)
1023 STB_SI_PRINT((
"CAN'T ALLOCATE MEMORY FOR DESCRIPTOR ARRAY ENTRY"));
1032 FUNCTION_FINISH(ParseAppSignallingDescriptor);
1052 static U8BIT* ParseCaDescriptor(U8BIT *dptr, U16BIT *num_ptr,
SI_CA_DESC **array_ptr,
1062 FUNCTION_START(ParseCaDescriptor);
1064 ASSERT(dptr != NULL);
1065 ASSERT(num_ptr != NULL);
1066 ASSERT(array_ptr != NULL);
1070 end_ptr = dptr + dlen;
1074 ca_id = (dptr[0] << 8) | dptr[1];
1075 ca_pid = ((dptr[2] & 0x1f) << 8) | dptr[3];
1076 #ifdef DEBUG_CA_DESC 1077 if (db_print == TRUE)
1079 STB_SI_PRINT((
" CA desc: (%d bytes) id=0x%04x, pid=0x%04x", dlen, ca_id, ca_pid));
1082 USE_UNWANTED_PARAM(db_print);
1087 if (*array_ptr == NULL)
1096 num_entries = *num_ptr + 1;
1101 memcpy(array, *array_ptr, (*num_ptr *
sizeof(
SI_CA_DESC)));
1109 array[num_entries - 1].ca_id = ca_id;
1110 array[num_entries - 1].ca_pid = ca_pid;
1112 *num_ptr = num_entries;
1116 #ifdef DEBUG_CA_DESC 1117 if (db_print == TRUE)
1119 STB_SI_PRINT((
" CAN'T ALLOCATE MEMORY FOR DESCRIPTOR ARRAY ENTRY"));
1126 #ifdef DEBUG_CA_DESC 1127 if (db_print == TRUE)
1129 STB_SI_PRINT((
" Invalid CA desc: (%d bytes)", dlen));
1134 FUNCTION_FINISH(ParseCaDescriptor);
1152 static U8BIT* ParseCaIdentifierDescriptor(U8BIT *dptr, U8BIT *num_ptr, U16BIT **array_ptr, BOOLEAN db_print)
1160 FUNCTION_START(ParseCaIdentifierDescriptor);
1162 ASSERT(dptr != NULL);
1163 ASSERT(num_ptr != NULL);
1164 ASSERT(array_ptr != NULL);
1168 end_ptr = dptr + dlen;
1172 num_entries = dlen / 2;
1173 #ifdef DEBUG_CA_ID_DESC 1174 if (db_print == TRUE)
1176 STB_SI_PRINT((
" CA identifier desc: %d entries", num_entries));
1179 USE_UNWANTED_PARAM(db_print);
1184 if (*array_ptr == NULL)
1187 array = (U16BIT *)
STB_GetMemory(num_entries *
sizeof(U16BIT));
1192 num_entries += *num_ptr;
1193 array = (U16BIT *)
STB_GetMemory(num_entries *
sizeof(U16BIT));
1197 memcpy(array, *array_ptr, (*num_ptr *
sizeof(U16BIT)));
1205 for (i = *num_ptr; i < num_entries; i++)
1207 array[i] = (dptr[0] << 8) | dptr[1];
1209 #ifdef DEBUG_CA_ID_DESC 1210 if (db_print == TRUE)
1212 STB_SI_PRINT((
" id=0x%04x", array[i]));
1217 *num_ptr = num_entries;
1221 #ifdef DEBUG_CA_ID_DESC 1222 if (db_print == TRUE)
1224 STB_SI_PRINT((
" CAN'T ALLOCATE MEMORY FOR DESCRIPTOR ARRAY ENTRY"));
1231 #ifdef DEBUG_CA_ID_DESC 1232 if (db_print == TRUE)
1234 STB_SI_PRINT((
" Invalid CA identifier desc: (%d bytes)", dlen));
1239 FUNCTION_FINISH(ParseCaIdentifierDescriptor);
1243 static U8BIT* ParseCarouselIdDescriptor(U8BIT *dptr, U32BIT *carousel_id, BOOLEAN db_print)
1248 FUNCTION_START(ParseCarouselIdDescriptor);
1250 ASSERT(dptr != NULL);
1254 end_ptr = dptr + dlen;
1258 *carousel_id = (dptr[0] << 24) | (dptr[1] << 16) | (dptr[2] << 8) | dptr[3];
1260 #ifdef DEBUG_CAROUSEL_ID_DESC 1263 STB_SI_PRINT((
" Carousel ID: 0x%08x", *carousel_id));
1266 USE_UNWANTED_PARAM(db_print);
1269 #ifdef DEBUG_CAROUSEL_ID_DESC 1272 STB_SI_PRINT((
" Invalid carousel ID desc: %u bytes", dlen));
1276 FUNCTION_FINISH(ParseCarouselIdDescriptor);
1295 static U8BIT* ParseComponentDescriptor(U8BIT *dptr, U8BIT *num_ptr,
SI_COMPONENT_DESC **array_ptr,
1308 FUNCTION_START(ParseComponentDescriptor);
1310 ASSERT(dptr != NULL);
1311 ASSERT(num_ptr != NULL);
1312 ASSERT(array_ptr != NULL);
1316 end_ptr = dptr + dlen;
1320 content = dptr[0] & 0x0f;
1324 dptr = ReadLanguageCode(dptr, &lang_code);
1327 #ifdef DEBUG_COMPONENT_DESC 1329 char *tmp_str =
"NULL";
1330 if (db_print == TRUE)
1332 if (str_desc != NULL)
1334 if (str_desc->str_ptr != NULL)
1336 tmp_str = (
char *)str_desc->str_ptr;
1339 STB_SI_PRINT((
" Component desc: tag=%d, cont=%d, type=0x%02x, lang=%c%c%c, str=%s",
1340 tag, content, type, (lang_code >> 16), (lang_code >> 8), lang_code, tmp_str));
1344 USE_UNWANTED_PARAM(db_print);
1349 if (*array_ptr == NULL)
1358 num_entries = *num_ptr + 1;
1371 array[num_entries - 1].tag = tag;
1372 array[num_entries - 1].content = content;
1373 array[num_entries - 1].type = type;
1374 array[num_entries - 1].lang_code = lang_code;
1375 array[num_entries - 1].desc_str = str_desc;
1377 *num_ptr = num_entries;
1381 #ifdef DEBUG_COMPONENT_DESC 1382 if (db_print == TRUE)
1384 STB_SI_PRINT((
" CAN'T ALLOCATE MEMORY FOR DESCRIPTOR ARRAY ENTRY"));
1391 #ifdef DEBUG_COMPONENT_DESC 1392 if (db_print == TRUE)
1394 STB_SI_PRINT((
" Invalid Component desc: (%d bytes)", dlen));
1399 USE_UNWANTED_PARAM(dptr);
1400 FUNCTION_FINISH(ParseComponentDescriptor);
1418 static U8BIT* ParseContentDescriptor(U8BIT *dptr, U8BIT *num_ptr,
SI_CONTENT_DESC **array_ptr, BOOLEAN db_print)
1426 FUNCTION_START(ParseContentDescriptor);
1428 ASSERT(dptr != NULL);
1429 ASSERT(num_ptr != NULL);
1430 ASSERT(array_ptr != NULL);
1434 end_ptr = dptr + dlen;
1438 num_entries = dlen / 2;
1439 #ifdef DEBUG_CONTENT_DESC 1440 if (db_print == TRUE)
1442 STB_SI_PRINT((
" Content desc: %d entries", num_entries));
1445 USE_UNWANTED_PARAM(db_print);
1450 if (*array_ptr == NULL)
1458 num_entries += *num_ptr;
1471 for (i = *num_ptr; i < num_entries; i++)
1473 array[i].level_1 = dptr[0] >> 4;
1474 array[i].level_2 = dptr[0] & 0x0f;
1475 array[i].user_1 = dptr[1] >> 4;
1476 array[i].user_2 = dptr[1] & 0x0f;
1478 #ifdef DEBUG_CONTENT_DESC 1479 if (db_print == TRUE)
1481 STB_SI_PRINT((
" L1=0x%02x, L2=0x%02x, U1=0x%02x, U2=0x%02x",
1482 array[i].level_1, array[i].level_2, array[i].user_1, array[i].user_2));
1487 *num_ptr = num_entries;
1491 #ifdef DEBUG_CONTENT_DESC 1492 if (db_print == TRUE)
1494 STB_SI_PRINT((
" CAN'T ALLOCATE MEMORY FOR DESCRIPTOR ARRAY ENTRY"));
1501 #ifdef DEBUG_CONTENT_DESC 1502 if (db_print == TRUE)
1504 STB_SI_PRINT((
" Invalid Content desc: (%d bytes)", dlen));
1509 FUNCTION_FINISH(ParseContentDescriptor);
1534 FUNCTION_START(ParseFrequencyListDescriptor);
1536 ASSERT(dptr != NULL);
1537 ASSERT(freq_list != NULL);
1541 end_ptr = dptr + dlen;
1545 coding_type = *dptr & 0x03;
1549 if (coding_type != 0)
1552 num_freqs = dlen / 4;
1555 if (list_entry != NULL)
1559 list_entry->frequency_array =
STB_GetMemory(num_freqs *
sizeof(U32BIT));
1560 if (list_entry->frequency_array != NULL)
1562 list_entry->coding_type = coding_type;
1563 list_entry->num_frequencies = num_freqs;
1565 #ifdef DEBUG_FREQ_LIST_DESC 1568 STB_SI_PRINT((
" Frequency list desc: coding_type %u with %u frequencies", coding_type, num_freqs));
1572 for (i = 0; i < num_freqs; dptr += 4, i++)
1574 switch (coding_type)
1577 list_entry->frequency_array[i] = (U32BIT)BCDToFloat(dptr, 8, 6);
1580 list_entry->frequency_array[i] = (U32BIT)(BCDToFloat(dptr, 8, 4) * 1000000);
1583 list_entry->frequency_array[i] = ((dptr[0] << 24) | (dptr[1] << 16) | (dptr[2] << 8) | dptr[3]) * 10;
1587 #ifdef DEBUG_FREQ_LIST_DESC 1590 STB_SI_PRINT((
" %u=%lu Hz", i, list_entry->frequency_array[i]));
1596 list_entry->next = *freq_list;
1597 *freq_list = list_entry;
1607 #ifdef DEBUG_FREQ_LIST_DESC 1610 STB_SI_PRINT((
" Frequency list desc: coding_type 0 is not defined"));
1617 #ifdef DEBUG_FREQ_LIST_DESC 1620 STB_SI_PRINT((
" Frequency list desc: invalid length, %u bytes", dlen));
1623 USE_UNWANTED_PARAM(db_print);
1627 FUNCTION_FINISH(ParseFrequencyListDescriptor);
1644 static U8BIT* ParseFTAContentDescriptor(U8BIT *dptr,
SI_FTA_CONTENT_DESC **desc_ptr, BOOLEAN db_print)
1649 FUNCTION_START(ParseFTAContentDescriptor);
1653 end_ptr = dptr + dlen;
1657 if (*desc_ptr == NULL)
1660 if (*desc_ptr != NULL)
1662 (*desc_ptr)->do_not_scramble = ((dptr[0] & 0x08) == 0x08) ? TRUE : FALSE;
1663 (*desc_ptr)->access_over_internet = (dptr[0] & 0x06) >> 1;
1664 (*desc_ptr)->do_not_apply_revocation = ((dptr[0] & 0x01) == 1) ? TRUE : FALSE;
1666 #ifdef DEBUG_FTA_CONTENT_DESC 1669 STB_SI_PRINT((
" FTA content desc: do_not_scramble=%s",
1670 ((*desc_ptr)->do_not_scramble ?
"TRUE" :
"FALSE")));
1671 STB_SI_PRINT((
" : do_not_apply_revocation=%s",
1672 ((*desc_ptr)->do_not_apply_revocation ?
"TRUE" :
"FALSE")));
1675 USE_UNWANTED_PARAM(db_print);
1680 FUNCTION_FINISH(ParseFTAContentDescriptor);
1698 static U8BIT* ParseGuidanceDescriptor(U8BIT *dptr,
SI_GUIDANCE_DESC **desc_ptr, BOOLEAN db_print)
1706 FUNCTION_START(ParseGuidanceDescriptor);
1708 ASSERT(dptr != NULL);
1709 ASSERT(desc_ptr != NULL);
1713 end_ptr = dptr + dlen;
1716 if ((*desc_ptr == NULL) && (dlen >= 4))
1720 (*desc_ptr)->guidance_type = 0xff;
1723 if ((*desc_ptr != NULL) && (dlen >= 4))
1729 (*desc_ptr)->guidance_type = *dptr & 0x03;
1733 if ((*desc_ptr)->guidance_type < 0x02)
1735 (*desc_ptr)->guidance_mode = FALSE;
1738 if ((*desc_ptr)->guidance_type == 0x01)
1740 if ((*dptr & 0x01) != 0)
1742 (*desc_ptr)->guidance_mode = TRUE;
1748 if ((*desc_ptr)->num_langs == 0)
1756 index = (*desc_ptr)->num_langs;
1758 (index + 1) *
sizeof(U32BIT));
1763 if ((lang_codes != NULL) && (strings != NULL))
1765 dptr = ReadLanguageCode(dptr, &lang_codes[index]);
1769 (*desc_ptr)->lang_codes = lang_codes;
1770 (*desc_ptr)->strings = strings;
1771 (*desc_ptr)->num_langs++;
1775 if (lang_codes != NULL)
1779 if (strings != NULL)
1784 (*desc_ptr)->num_langs = 0;
1788 STB_SI_PRINT((
" Guidance desc: Out of memory!"));
1793 #ifdef DEBUG_GUIDANCE_DESC 1795 if ((*desc_ptr)->guidance_type < 0x02)
1797 char *tmp_str =
"NULL";
1798 U8BIT index = (*desc_ptr)->num_langs - 1;
1801 if (((*desc_ptr)->strings != NULL) && ((*desc_ptr)->strings[index] != NULL))
1803 if ((*desc_ptr)->strings[index]->str_ptr != NULL)
1805 tmp_str = (
char *)(*desc_ptr)->strings[index]->str_ptr;
1809 lang_code = (*desc_ptr)->lang_codes[index];
1811 STB_SI_PRINT((
" Guidance desc: type=%u, mode=%u, lang=0x%02x%02x%02x, text=\"%s\"",
1812 (*desc_ptr)->guidance_type, (*desc_ptr)->guidance_mode, ((lang_code >> 16) & 0xff),
1813 ((lang_code >> 8) & 0xff), (lang_code & 0xff), tmp_str));
1817 STB_SI_PRINT((
" Guidance desc: unsupported type=%u", (*desc_ptr)->guidance_type));
1824 #ifdef DEBUG_GUIDANCE_DESC 1825 if (db_print == TRUE)
1827 STB_SI_PRINT((
" Guidance desc: invalid length, %u", dlen));
1832 USE_UNWANTED_PARAM(dptr);
1833 FUNCTION_FINISH(ParseGuidanceDescriptor);
1852 static U8BIT* ParseIsoLangDescriptor(U8BIT *dptr, U16BIT *num_ptr,
SI_ISO_LANG_DESC **array_ptr, BOOLEAN db_print)
1860 FUNCTION_START(ParseIsoLangDescriptor);
1862 ASSERT(dptr != NULL);
1863 ASSERT(num_ptr != NULL);
1864 ASSERT(array_ptr != NULL);
1868 end_ptr = dptr + dlen;
1872 num_entries = dlen / 4;
1873 #ifdef DEBUG_ISO_LANG_DESC 1874 if (db_print == TRUE)
1876 STB_SI_PRINT((
" ISO lang desc: %d entries", num_entries));
1879 USE_UNWANTED_PARAM(db_print);
1884 if (*array_ptr == NULL)
1892 num_entries += *num_ptr;
1905 for (i = *num_ptr; i < num_entries; i++)
1907 dptr = ReadLanguageCode(dptr, &array[i].lang_code);
1908 array[i].audio_type = dptr[0];
1910 #ifdef DEBUG_ISO_LANG_DESC 1911 if (db_print == TRUE)
1913 STB_SI_PRINT((
" lang=%c%c%c, type=%d", (array[i].lang_code >> 16),
1914 (array[i].lang_code >> 8), array[i].lang_code, array[i].audio_type));
1919 *num_ptr = num_entries;
1923 #ifdef DEBUG_ISO_LANG_DESC 1924 if (db_print == TRUE)
1926 STB_SI_PRINT((
" CAN'T ALLOCATE MEMORY FOR DESCRIPTOR ARRAY ENTRY"));
1933 #ifdef DEBUG_ISO_LANG_DESC 1934 if (db_print == TRUE)
1936 STB_SI_PRINT((
" Invalid ISO lang desc: (%d bytes)", dlen));
1941 FUNCTION_FINISH(ParseIsoLangDescriptor);
1961 static U8BIT* ParseLinkageDescriptor(U8BIT *dptr, U16BIT *num_ptr,
SI_LINKAGE_DESC_ENTRY **list_ptr,
1969 FUNCTION_START(ParseLinkageDescriptor);
1971 ASSERT(dptr != NULL);
1972 ASSERT(num_ptr != NULL);
1973 ASSERT(list_ptr != NULL);
1975 #ifndef DEBUG_LINKAGE_DESC 1976 USE_UNWANTED_PARAM(db_print);
1981 end_ptr = dptr + dlen;
1987 if (desc_ptr != NULL)
1989 desc_ptr->next = NULL;
1990 desc_ptr->private_data_code = private_data_code;
1991 desc_ptr->tran_id = (dptr[0] << 8) | dptr[1];
1992 desc_ptr->orig_net_id = (dptr[2] << 8) | dptr[3];
1993 desc_ptr->serv_id = (dptr[4] << 8) | dptr[5];
1994 desc_ptr->link_type = dptr[6];
1995 desc_ptr->data_length = dsize;
1999 memcpy(&(desc_ptr->data), &dptr[7], dsize);
2003 if (*last_entry_ptr == NULL)
2006 *list_ptr = desc_ptr;
2011 (*last_entry_ptr)->next = desc_ptr;
2013 *last_entry_ptr = desc_ptr;
2017 #ifdef DEBUG_LINKAGE_DESC 2018 if (db_print == TRUE)
2020 STB_SI_PRINT((
" Linkage desc: tid=0x%04x, onid=0x%04x, sid=0x%04x, type=0x%02x (private_data_code=0x%02x), dlen=%d",
2021 desc_ptr->tran_id, desc_ptr->orig_net_id, desc_ptr->serv_id,
2022 desc_ptr->link_type, private_data_code, dsize));
2027 for (i = 0; i < dsize; i++)
2029 if ((i & 0x07) == 0)
2033 else if (((i & 0x07) == 7) || (i == (dsize - 1)))
2048 #ifdef DEBUG_LINKAGE_DESC 2049 if (db_print == TRUE)
2051 STB_SI_PRINT((
" CAN'T ALLOCATE MEMORY FOR DESCRIPTOR ARRAY ENTRY"));
2058 #ifdef DEBUG_LINKAGE_DESC 2059 if (db_print == TRUE)
2061 STB_SI_PRINT((
" Invalid linkage desc: (%d bytes)", dlen));
2066 FUNCTION_FINISH(ParseLinkageDescriptor);
2084 static U8BIT* ParseLocalTimeOffsetDescriptor(U8BIT *dptr, U16BIT *num_ptr,
SI_LTO_DESC **array_ptr,
2093 FUNCTION_START(ParseLocalTimeOffsetDescriptor);
2095 ASSERT(dptr != NULL);
2096 ASSERT(num_ptr != NULL);
2097 ASSERT(array_ptr != NULL);
2101 end_ptr = dptr + dlen;
2105 num_entries = dlen / 13;
2106 #ifdef DEBUG_LOCAL_TIME_OFFSET_DESC 2107 if (db_print == TRUE)
2109 STB_SI_PRINT((
" Local time offset desc: %d entries", num_entries));
2112 USE_UNWANTED_PARAM(db_print);
2117 if (*array_ptr == NULL)
2125 num_entries += *num_ptr;
2130 memcpy(array, *array_ptr, (*num_ptr *
sizeof(
SI_LTO_DESC)));
2138 for (i = *num_ptr; i < num_entries; i++)
2140 dptr = ReadLanguageCode(dptr, &(array[i].country_code));
2141 array[i].region = (dptr[0] >> 2);
2142 array[i].offset_negative = ((dptr[0] & 0x01) == 1);
2143 array[i].offset_hrs = ((dptr[1] >> 4) * 10) + (dptr[1] & 0x0f);
2144 array[i].offset_mins = ((dptr[2] >> 4) * 10) + (dptr[2] & 0x0f);
2145 array[i].change_date = (dptr[3] << 8) | dptr[4];
2146 array[i].change_hrs = ((dptr[5] >> 4) * 10) + (dptr[5] & 0x0f);
2147 array[i].change_mins = ((dptr[6] >> 4) * 10) + (dptr[6] & 0x0f);
2148 array[i].change_secs = ((dptr[7] >> 4) * 10) + (dptr[7] & 0x0f);
2149 array[i].next_offset_hrs = ((dptr[8] >> 4) * 10) + (dptr[8] & 0x0f);
2150 array[i].next_offset_mins = ((dptr[9] >> 4) * 10) + (dptr[9] & 0x0f);
2153 #ifdef DEBUG_LOCAL_TIME_OFFSET_DESC 2157 if (db_print == TRUE)
2159 if (array[i].offset_negative == FALSE)
2167 STB_SI_PRINT((
" %c%c%c: %c%d:%02d until %d %02d:%02d:%02d then %c%d:%02d",
2168 (array[i].country_code >> 16), (array[i].country_code >> 8), array[i].country_code,
2169 pol_char, array[i].offset_hrs, array[i].offset_mins,
2170 array[i].change_date, array[i].change_hrs, array[i].change_mins, array[i].change_secs,
2171 pol_char, array[i].next_offset_hrs, array[i].next_offset_mins));
2177 *num_ptr = num_entries;
2181 #ifdef DEBUG_LOCAL_TIME_OFFSET_DESC 2182 if (db_print == TRUE)
2184 STB_SI_PRINT((
" CAN'T ALLOCATE MEMORY FOR DESCRIPTOR ARRAY ENTRY"));
2191 #ifdef DEBUG_LOCAL_TIME_OFFSET_DESC 2192 if (db_print == TRUE)
2194 STB_SI_PRINT((
" Invalid local time offset desc: (%d bytes)", dlen));
2199 FUNCTION_FINISH(ParseLocalTimeOffsetDescriptor);
2218 static U8BIT* ParseMultilingComponentDescriptor(U8BIT *dptr, U8BIT *num_ptr,
2230 FUNCTION_START(ParseMultilingComponentDescriptor);
2232 ASSERT(dptr != NULL);
2233 ASSERT(num_ptr != NULL);
2234 ASSERT(array_ptr != NULL);
2238 end_ptr = dptr + dlen;
2245 while (tmp_ptr < end_ptr)
2247 name_len = tmp_ptr[3];
2248 tmp_ptr += (name_len + 4);
2252 #ifdef DEBUG_MULTILING_COMPONENT_DESC 2253 if (db_print == TRUE)
2255 STB_SI_PRINT((
" Multilingual component desc: %d entries", num_entries));
2258 USE_UNWANTED_PARAM(db_print);
2263 if (*array_ptr == NULL)
2271 num_entries += *num_ptr;
2286 for (i = *num_ptr; i < num_entries; i++)
2289 dptr = ReadLanguageCode(dptr, &array[i].lang_code);
2292 #ifdef DEBUG_MULTILING_COMPONENT_DESC 2294 char *tmp_str =
"NULL";
2295 if (db_print == TRUE)
2297 if (array[i].desc_str != NULL)
2299 if (array[i].desc_str->str_ptr != NULL)
2301 tmp_str = (
char *)array[i].desc_str->str_ptr;
2304 STB_SI_PRINT((
" tag=%d, lang=%c%c%c, string=%s",
2305 array[i].tag, (array[i].lang_code >> 16), (array[i].lang_code >> 8),
2306 array[i].lang_code, tmp_str));
2312 *num_ptr = num_entries;
2316 #ifdef DEBUG_MULTILING_COMPONENT_DESC 2317 if (db_print == TRUE)
2319 STB_SI_PRINT((
" CAN'T ALLOCATE MEMORY FOR DESCRIPTOR ARRAY ENTRY"));
2326 #ifdef DEBUG_MULTILING_COMPONENT_DESC 2327 if (db_print == TRUE)
2329 STB_SI_PRINT((
" Invalid multilingual component desc: (%d bytes)", dlen));
2334 FUNCTION_FINISH(ParseMultilingComponentDescriptor);
2353 static U8BIT* ParseMultilingNetNameDescriptor(U8BIT *dptr, U16BIT *num_ptr,
2364 FUNCTION_START(ParseMultilingNetNameDescriptor);
2366 ASSERT(dptr != NULL);
2367 ASSERT(num_ptr != NULL);
2368 ASSERT(array_ptr != NULL);
2372 end_ptr = dptr + dlen;
2379 while (tmp_ptr < end_ptr)
2381 name_len = tmp_ptr[3];
2382 tmp_ptr += (name_len + 4);
2386 #ifdef DEBUG_MULTILING_NET_NAME_DESC 2387 if (db_print == TRUE)
2389 STB_SI_PRINT((
" Multilingual net name desc: %d entries", num_entries));
2392 USE_UNWANTED_PARAM(db_print);
2397 if (*array_ptr == NULL)
2405 num_entries += *num_ptr;
2418 for (i = *num_ptr; i < num_entries; i++)
2420 dptr = ReadLanguageCode(dptr, &array[i].lang_code);
2423 #ifdef DEBUG_MULTILING_NET_NAME_DESC 2425 char *tmp_str =
"NULL";
2426 if (db_print == TRUE)
2428 if (array[i].name_str != NULL)
2430 if (array[i].name_str->str_ptr != NULL)
2432 tmp_str = (
char *)array[i].name_str->str_ptr;
2435 STB_SI_PRINT((
" lang=%c%c%c, name=%s", (array[i].lang_code >> 16),
2436 (array[i].lang_code >> 8), array[i].lang_code, tmp_str));
2442 *num_ptr = num_entries;
2446 #ifdef DEBUG_MULTILING_NET_NAME_DESC 2447 if (db_print == TRUE)
2449 STB_SI_PRINT((
" CAN'T ALLOCATE MEMORY FOR DESCRIPTOR ARRAY ENTRY"));
2456 #ifdef DEBUG_MULTILING_NET_NAME_DESC 2457 if (db_print == TRUE)
2459 STB_SI_PRINT((
" Invalid multilingual net name desc: (%d bytes)", dlen));
2464 FUNCTION_FINISH(ParseMultilingNetNameDescriptor);
2483 static U8BIT* ParseMultilingServNameDescriptor(U8BIT *dptr, U16BIT *num_ptr,
2494 FUNCTION_START(ParseMultilingServNameDescriptor);
2496 ASSERT(dptr != NULL);
2497 ASSERT(num_ptr != NULL);
2498 ASSERT(array_ptr != NULL);
2502 end_ptr = dptr + dlen;
2509 while (tmp_ptr < end_ptr)
2511 name_len = tmp_ptr[3];
2512 tmp_ptr += (name_len + 4);
2513 name_len = tmp_ptr[0];
2514 tmp_ptr += (name_len + 1);
2518 #ifdef DEBUG_MULTILING_SERV_NAME_DESC 2519 if (db_print == TRUE)
2521 STB_SI_PRINT((
" Multilingual serv name desc: %d entries", num_entries));
2524 USE_UNWANTED_PARAM(db_print);
2529 if (*array_ptr == NULL)
2537 num_entries += *num_ptr;
2550 for (i = *num_ptr; i < num_entries; i++)
2552 dptr = ReadLanguageCode(dptr, &array[i].lang_code);
2556 #ifdef DEBUG_MULTILING_SERV_NAME_DESC 2558 char *tmp_prov_str =
"NULL";
2559 char *tmp_name_str =
"NULL";
2561 if (db_print == TRUE)
2563 if (array[i].provider_str != NULL)
2565 if (array[i].provider_str->str_ptr != NULL)
2567 tmp_prov_str = (
char *)array[i].provider_str->str_ptr;
2570 if (array[i].name_str != NULL)
2572 if (array[i].name_str->str_ptr != NULL)
2574 tmp_name_str = (
char *)array[i].name_str->str_ptr;
2578 STB_SI_PRINT((
" lang=%c%c%c, provider=%s, name=%s",
2579 (array[i].lang_code >> 16), (array[i].lang_code >> 8), array[i].lang_code,
2580 tmp_prov_str, tmp_name_str));
2586 *num_ptr = num_entries;
2590 #ifdef DEBUG_MULTILING_SERV_NAME_DESC 2591 if (db_print == TRUE)
2593 STB_SI_PRINT((
" CAN'T ALLOCATE MEMORY FOR DESCRIPTOR ARRAY ENTRY"));
2600 #ifdef DEBUG_MULTILING_SERV_NAME_DESC 2601 if (db_print == TRUE)
2603 STB_SI_PRINT((
" Invalid multilingual serv name desc: (%d bytes)", dlen));
2608 FUNCTION_FINISH(ParseMultilingServNameDescriptor);
2625 static U8BIT* ParseNetNameDescriptor(U8BIT *dptr,
SI_STRING_DESC **name_ptr, BOOLEAN db_print)
2630 FUNCTION_START(ParseNetNameDescriptor);
2632 ASSERT(dptr != NULL);
2633 ASSERT(name_ptr != NULL);
2637 end_ptr = dptr + dlen;
2641 if (*name_ptr == NULL)
2644 #ifdef DEBUG_NET_NAME_DESC 2646 char *tmp_str =
"NULL";
2647 if (db_print == TRUE)
2649 if (*name_ptr != NULL)
2651 if ((*name_ptr)->str_ptr != NULL)
2653 tmp_str = (
char *)(*name_ptr)->str_ptr;
2656 STB_SI_PRINT((
" Net name desc=%s", tmp_str));
2660 USE_UNWANTED_PARAM(db_print);
2665 #ifdef DEBUG_NET_NAME_DESC 2666 if (db_print == TRUE)
2668 STB_SI_PRINT((
" Net name desc: duplicate entry ignored"));
2673 USE_UNWANTED_PARAM(dptr);
2674 FUNCTION_FINISH(ParseNetNameDescriptor);
2692 static U8BIT* ParseParentalRatingDescriptor(U8BIT *dptr, U8BIT *num_ptr,
2701 FUNCTION_START(ParseParentalRatingDescriptor);
2703 ASSERT(dptr != NULL);
2704 ASSERT(num_ptr != NULL);
2705 ASSERT(array_ptr != NULL);
2709 end_ptr = dptr + dlen;
2713 num_entries = dlen / 4;
2714 #ifdef DEBUG_PARENTAL_RATING_DESC 2715 if (db_print == TRUE)
2717 STB_SI_PRINT((
" Parental rating desc: %d entries", num_entries));
2720 USE_UNWANTED_PARAM(db_print);
2725 if (*array_ptr == NULL)
2733 num_entries += *num_ptr;
2746 for (i = *num_ptr; i < num_entries; i++)
2748 dptr = ReadLanguageCode(dptr, &(array[i].country_code));
2749 array[i].rating = dptr[0];
2751 #ifdef DEBUG_PARENTAL_RATING_DESC 2752 if (db_print == TRUE)
2754 STB_SI_PRINT((
" country=%c%c%c, rating=0x%02x", (array[i].country_code >> 16),
2755 (array[i].country_code >> 8), array[i].country_code, array[i].rating));
2760 *num_ptr = num_entries;
2764 #ifdef DEBUG_PARENTAL_RATING_DESC 2765 if (db_print == TRUE)
2767 STB_SI_PRINT((
" CAN'T ALLOCATE MEMORY FOR DESCRIPTOR ARRAY ENTRY"));
2774 #ifdef DEBUG_PARENTAL_RATING_DESC 2775 if (db_print == TRUE)
2777 STB_SI_PRINT((
" Invalid parental rating desc: (%d bytes)", dlen));
2782 FUNCTION_FINISH(ParseParentalRatingDescriptor);
2801 static U8BIT* ParsePrivateDataSpecifierDescriptor(U8BIT *dptr, U32BIT *code_ptr, BOOLEAN db_print)
2806 FUNCTION_START(ParsePrivateDataSpecifierDescriptor);
2808 ASSERT(dptr != NULL);
2809 ASSERT(code_ptr != NULL);
2813 end_ptr = dptr + dlen;
2817 *code_ptr = (dptr[0] << 24) | (dptr[1] << 16) | (dptr[2] << 8) | dptr[3];
2819 #ifdef DEBUG_PRIV_DATA_SPEC_DESC 2820 if (db_print == TRUE)
2822 STB_SI_PRINT((
" Private data specifier desc: (returned 0x%08x)", *code_ptr));
2825 USE_UNWANTED_PARAM(db_print);
2831 #ifdef DEBUG_PRIV_DATA_SPEC_DESC 2832 if (db_print == TRUE)
2834 STB_SI_PRINT((
" Invalid private data specifier desc: (%d bytes)", dlen));
2839 FUNCTION_FINISH(ParsePrivateDataSpecifierDescriptor);
2858 static U8BIT* ParseServiceDescriptor(U8BIT *dptr, U8BIT *type_ptr,
SI_STRING_DESC **provider_ptr,
2864 FUNCTION_START(ParseServiceDescriptor);
2866 ASSERT(dptr != NULL);
2867 ASSERT(type_ptr != NULL);
2868 ASSERT(provider_ptr != NULL);
2869 ASSERT(name_ptr != NULL);
2873 end_ptr = dptr + dlen;
2877 if (*provider_ptr != NULL)
2881 if (*name_ptr != NULL)
2886 *type_ptr = dptr[0];
2891 #ifdef DEBUG_SERVICE_DESC 2893 char *tmp_prov_str =
"NULL";
2894 char *tmp_name_str =
"NULL";
2896 if (db_print == TRUE)
2898 if (*provider_ptr != NULL)
2900 if ((*provider_ptr)->str_ptr != NULL)
2902 tmp_prov_str = (
char *)(*provider_ptr)->str_ptr;
2905 if (*name_ptr != NULL)
2907 if ((*name_ptr)->str_ptr != NULL)
2909 tmp_name_str = (
char *)(*name_ptr)->str_ptr;
2913 STB_SI_PRINT((
" Service desc: type=%d, prov=%s, name=%s", *type_ptr,
2914 tmp_prov_str, tmp_name_str));
2918 USE_UNWANTED_PARAM(db_print);
2923 #ifdef DEBUG_SERVICE_DESC 2924 if (db_print == TRUE)
2926 STB_SI_PRINT((
" Invalid service desc: (%d bytes)", dlen));
2931 USE_UNWANTED_PARAM(dptr);
2932 FUNCTION_FINISH(ParseServiceDescriptor);
2950 static U8BIT* ParseServiceListDescriptor(U8BIT *dptr, U16BIT *num_ptr,
2959 FUNCTION_START(ParseServiceListDescriptor);
2961 ASSERT(dptr != NULL);
2962 ASSERT(num_ptr != NULL);
2963 ASSERT(array_ptr != NULL);
2967 end_ptr = dptr + dlen;
2971 num_entries = dlen / 3;
2972 #ifdef DEBUG_SERV_LIST_DESC 2973 if (db_print == TRUE)
2975 STB_SI_PRINT((
" Service list desc: %d entries", num_entries));
2978 USE_UNWANTED_PARAM(db_print);
2983 if (*array_ptr == NULL)
2991 num_entries += *num_ptr;
3004 for (i = *num_ptr; i < num_entries; i++)
3006 array[i].serv_id = (dptr[0] << 8) | dptr[1];
3007 array[i].serv_type = dptr[2];
3009 #ifdef DEBUG_SERV_LIST_DESC 3010 if (db_print == TRUE)
3012 STB_SI_PRINT((
" id=0x%04x, type=0x%02x", array[i].serv_id, array[i].serv_type));
3017 *num_ptr = num_entries;
3021 #ifdef DEBUG_SERV_LIST_DESC 3022 if (db_print == TRUE)
3024 STB_SI_PRINT((
" CAN'T ALLOCATE MEMORY FOR DESCRIPTOR ARRAY ENTRY"));
3031 #ifdef DEBUG_SERV_LIST_DESC 3032 if (db_print == TRUE)
3034 STB_SI_PRINT((
" Invalid service list desc: (%d bytes)", dlen));
3039 FUNCTION_FINISH(ParseServiceListDescriptor);
3056 static U8BIT* ParseShortServiceNameDescriptor(U8BIT *dptr,
SI_STRING_DESC **name_ptr, BOOLEAN db_print)
3061 FUNCTION_START(ParseShortServiceNameDescriptor);
3063 ASSERT(dptr != NULL);
3064 ASSERT(name_ptr != NULL);
3068 end_ptr = dptr + dlen;
3072 if (*name_ptr != NULL)
3079 #ifdef DEBUG_SHORT_SERVICE_NAME 3081 char *tmp_name_str =
"NULL";
3083 if (db_print == TRUE)
3085 if (*name_ptr != NULL)
3087 if ((*name_ptr)->str_ptr != NULL)
3089 tmp_name_str = (
char *)(*name_ptr)->str_ptr;
3093 STB_SI_PRINT((
" Short service name: name=%s", tmp_name_str));
3097 USE_UNWANTED_PARAM(db_print);
3102 #ifdef DEBUG_SHORT_SERVICE_NAME 3103 if (db_print == TRUE)
3105 STB_SI_PRINT((
" Invalid short service name: (%d bytes)", dlen));
3110 USE_UNWANTED_PARAM(dptr);
3111 FUNCTION_FINISH(ParseShortServiceNameDescriptor);
3129 static U8BIT* ParseShortEventDescriptor(U8BIT *dptr, U8BIT *num_ptr,
3140 FUNCTION_START(ParseShortEventDescriptor);
3142 ASSERT(dptr != NULL);
3143 ASSERT(num_ptr != NULL);
3144 ASSERT(array_ptr != NULL);
3148 end_ptr = dptr + dlen;
3152 dptr = ReadLanguageCode(dptr, &lang_code);
3156 #ifdef DEBUG_SHORT_EVENT_DESC 3158 char *tmp_name_str =
"NULL";
3159 char *tmp_desc_str =
"NULL";
3161 if (db_print == TRUE)
3163 if (name_str != NULL)
3165 if (name_str->str_ptr != NULL)
3167 tmp_name_str = (
char *)name_str->str_ptr;
3170 if (desc_str != NULL)
3172 if (desc_str->str_ptr != NULL)
3174 tmp_desc_str = (
char *)desc_str->str_ptr;
3178 STB_SI_PRINT((
" Short event desc: lang=%c%c%c",
3179 (lang_code >> 16), (lang_code >> 8), lang_code));
3180 STB_SI_PRINT((
" name: %s", tmp_name_str));
3181 STB_SI_PRINT((
" text: %s", tmp_desc_str));
3185 USE_UNWANTED_PARAM(db_print);
3190 if (*array_ptr == NULL)
3199 num_entries = *num_ptr + 1;
3212 array[num_entries - 1].lang_code = lang_code;
3213 array[num_entries - 1].name_str = name_str;
3214 array[num_entries - 1].desc_str = desc_str;
3217 *num_ptr = num_entries;
3221 #ifdef DEBUG_SHORT_EVENT_DESC 3222 if (db_print == TRUE)
3224 STB_SI_PRINT((
" CAN'T ALLOCATE MEMORY FOR DESCRIPTOR ARRAY ENTRY"));
3231 #ifdef DEBUG_SHORT_EVENT_DESC 3232 if (db_print == TRUE)
3234 STB_SI_PRINT((
" Invalid short event desc: (%d bytes)", dlen));
3239 USE_UNWANTED_PARAM(dptr);
3240 FUNCTION_FINISH(ParseShortEventDescriptor);
3258 static U8BIT* ParseExtendedEventDescriptor(U8BIT *dptr, U8BIT *num_ptr,
3265 U8BIT desc_num, last_desc_num;
3273 FUNCTION_START(ParseExtendedEventDescriptor);
3275 ASSERT(dptr != NULL);
3276 ASSERT(num_ptr != NULL);
3277 ASSERT(array_ptr != NULL);
3281 end_ptr = dptr + dlen;
3285 desc_num = *dptr >> 4;
3286 last_desc_num = *dptr & 0x0f;
3289 dptr = ReadLanguageCode(dptr, &lang_code);
3291 item_end = dptr + *dptr + 1;
3295 item_desc_array = NULL;
3296 item_text_array = NULL;
3298 while ((dptr < item_end) && (dptr < end_ptr))
3328 #ifdef DEBUG_EXTENDED_EVENT_DESC 3332 if (db_print == TRUE)
3334 STB_SI_PRINT((
" Extended event desc: lang=%c%c%c",
3335 (lang_code >> 16), (lang_code >> 8), lang_code));
3336 STB_SI_PRINT((
" desc num : %u", desc_num));
3337 STB_SI_PRINT((
" last desc num: %u", last_desc_num));
3338 STB_SI_PRINT((
" num items: %u", num_items));
3340 for (i = 0; i < num_items; i++)
3342 STB_SI_PRINT((
" %u: item_desc=%s, item=%s", i,
3343 ((item_desc_array[i]->str_ptr != NULL) ? (
char *)item_desc_array[i]->str_ptr :
"NULL"),
3344 ((item_text_array[i]->str_ptr != NULL) ? (
char *)item_text_array[i]->str_ptr :
"NULL")));
3347 if (text_str != NULL)
3349 STB_SI_PRINT((
" text=%s", ((text_str->str_ptr != NULL) ? (
char *)text_str->str_ptr :
"NULL")));
3354 USE_UNWANTED_PARAM(db_print);
3359 if (*array_ptr == NULL)
3368 num_entries = *num_ptr + 1;
3376 array[num_entries - 1].desc_number = desc_num;
3377 array[num_entries - 1].last_desc_number = last_desc_num;
3378 array[num_entries - 1].lang_code = lang_code;
3379 array[num_entries - 1].num_items = num_items;
3380 array[num_entries - 1].item_desc_array = item_desc_array;
3381 array[num_entries - 1].item_text_array = item_text_array;
3382 array[num_entries - 1].text_str = text_str;
3385 *num_ptr = num_entries;
3389 #ifdef DEBUG_EXTENDED_EVENT_DESC 3390 if (db_print == TRUE)
3392 STB_SI_PRINT((
" CAN'T ALLOCATE MEMORY FOR DESCRIPTOR ARRAY ENTRY"));
3399 #ifdef DEBUG_EXTENDED_EVENT_DESC 3400 if (db_print == TRUE)
3402 STB_SI_PRINT((
" Invalid extended event desc: (%d bytes)", dlen));
3407 USE_UNWANTED_PARAM(dptr);
3408 FUNCTION_FINISH(ParseExtendedEventDescriptor);
3425 static U8BIT* ParseStreamIdDescriptor(U8BIT *dptr, U8BIT **tag_array_ptr, U8BIT *num_entries_ptr, BOOLEAN db_print)
3431 FUNCTION_START(ParseStreamIdDescriptor);
3433 ASSERT(dptr != NULL);
3435 #ifndef DEBUG_STREAM_ID_DESC 3436 USE_UNWANTED_PARAM(db_print);
3441 end_ptr = dptr + dlen;
3445 if (*tag_array_ptr == NULL)
3454 num_entries = *num_entries_ptr + 1;
3456 num_entries *
sizeof(U8BIT));
3460 if (*tag_array_ptr != NULL)
3462 (*tag_array_ptr)[num_entries - 1] = dptr[0];
3463 *num_entries_ptr = num_entries;
3467 #ifdef DEBUG_STREAM_ID_DESC 3468 if (db_print == TRUE)
3470 STB_SI_PRINT((
" CAN'T ALLOCATE MEMORY FOR DESCRIPTOR ARRAY ENTRY"));
3477 #ifdef DEBUG_STREAM_ID_DESC 3478 if (db_print == TRUE)
3480 STB_SI_PRINT((
" Invalid stream id desc: (%d bytes)", dlen));
3485 FUNCTION_FINISH(ParseStreamIdDescriptor);
3503 static U8BIT* ParseSubtitleDescriptor(U8BIT *dptr, U16BIT *num_ptr,
3512 FUNCTION_START(ParseSubtitleDescriptor);
3514 ASSERT(dptr != NULL);
3515 ASSERT(num_ptr != NULL);
3516 ASSERT(array_ptr != NULL);
3520 end_ptr = dptr + dlen;
3524 num_entries = dlen / 8;
3525 #ifdef DEBUG_SUBTITLE_DESC 3526 if (db_print == TRUE)
3528 STB_SI_PRINT((
" Subtitle desc: %d entries", num_entries));
3531 USE_UNWANTED_PARAM(db_print);
3536 if (*array_ptr == NULL)
3544 num_entries += *num_ptr;
3557 for (i = *num_ptr; i < num_entries; i++)
3559 dptr = ReadLanguageCode(dptr, &(array[i].lang_code));
3560 array[i].type = dptr[0];
3561 array[i].composition_page = (dptr[1] << 8) | dptr[2];
3562 array[i].ancillary_page = (dptr[3] << 8) | dptr[4];
3564 #ifdef DEBUG_SUBTITLE_DESC 3565 if (db_print == TRUE)
3567 STB_SI_PRINT((
" lang=%c%c%c, type=0x%02x, comp pg=%d, anc pg=%d",
3568 (array[i].lang_code >> 16), (array[i].lang_code >> 8), array[i].lang_code,
3569 array[i].type, array[i].composition_page, array[i].ancillary_page));
3574 *num_ptr = num_entries;
3578 #ifdef DEBUG_SUBTITLE_DESC 3579 if (db_print == TRUE)
3581 STB_SI_PRINT((
" CAN'T ALLOCATE MEMORY FOR DESCRIPTOR ARRAY ENTRY"));
3588 #ifdef DEBUG_SUBTITLE_DESC 3589 if (db_print == TRUE)
3591 STB_SI_PRINT((
" Invalid subtitle desc: (%d bytes)", dlen));
3596 FUNCTION_FINISH(ParseSubtitleDescriptor);
3614 static U8BIT* ParseTeletextDescriptor(U8BIT *dptr, U16BIT *num_ptr,
3623 FUNCTION_START(ParseTeletextDescriptor);
3625 ASSERT(dptr != NULL);
3626 ASSERT(num_ptr != NULL);
3627 ASSERT(array_ptr != NULL);
3631 end_ptr = dptr + dlen;
3635 num_entries = dlen / 5;
3636 #ifdef DEBUG_TELETEXT_DESC 3637 if (db_print == TRUE)
3639 STB_SI_PRINT((
" Teletext desc: %d entries", num_entries));
3642 USE_UNWANTED_PARAM(db_print);
3647 if (*array_ptr == NULL)
3655 num_entries += *num_ptr;
3668 for (i = *num_ptr; i < num_entries; i++)
3670 dptr = ReadLanguageCode(dptr, &(array[i].lang_code));
3671 array[i].type = (dptr[0] >> 3);
3672 array[i].magazine = (dptr[0] & 0x07);
3673 array[i].page = dptr[1];
3675 #ifdef DEBUG_TELETEXT_DESC 3676 if (db_print == TRUE)
3678 STB_SI_PRINT((
" lang=%c%c%c, type=%d, mag=%d, page=0x%02x",
3679 (array[i].lang_code >> 16), (array[i].lang_code >> 8), array[i].lang_code,
3680 array[i].type, array[i].magazine, array[i].page));
3685 *num_ptr = num_entries;
3689 #ifdef DEBUG_TELETEXT_DESC 3690 if (db_print == TRUE)
3692 STB_SI_PRINT((
" CAN'T ALLOCATE MEMORY FOR DESCRIPTOR ARRAY ENTRY"));
3699 #ifdef DEBUG_TELETEXT_DESC 3700 if (db_print == TRUE)
3702 STB_SI_PRINT((
" Invalid teletext desc: (%d bytes)", dlen));
3707 FUNCTION_FINISH(ParseTeletextDescriptor);
3724 static U8BIT* ParseTerrestrialDeliverySysDescriptor(U8BIT *dptr,
SI_DELIVERY_SYS_DESC **desc_ptr,
3730 #ifdef DEBUG_TERR_DEL_SYS_DESC 3731 U8BIT constellation;
3739 FUNCTION_START(ParseTerrestrialDeliverySysDescriptor);
3741 ASSERT(dptr != NULL);
3745 end_ptr = dptr + dlen;
3747 #ifdef DEBUG_TERR_DEL_SYS_DESC 3748 if (db_print == TRUE)
3750 STB_SI_PRINT((
" Terrestrial delivery system desc:"));
3753 USE_UNWANTED_PARAM(db_print);
3756 if (*desc_ptr == NULL)
3760 del_sys = *desc_ptr;
3762 if (del_sys != NULL)
3764 del_sys->terr.is_t2 = FALSE;
3765 del_sys->terr.u.t1.freq_hz = ((dptr[0] << 24) | (dptr[1] << 16) | (dptr[2] << 8) | dptr[3]) * 10;
3767 switch (dptr[4] >> 5)
3770 del_sys->terr.u.t1.bwidth = TBWIDTH_8MHZ;
3774 del_sys->terr.u.t1.bwidth = TBWIDTH_7MHZ;
3778 del_sys->terr.u.t1.bwidth = TBWIDTH_6MHZ;
3782 del_sys->terr.u.t1.bwidth = TBWIDTH_5MHZ;
3786 del_sys->terr.u.t1.bwidth = TBWIDTH_UNDEFINED;
3790 #ifdef DEBUG_TERR_DEL_SYS_DESC 3791 constellation = (dptr[5] >> 6);
3792 hierarchy = ((dptr[5] >> 3) & 0x07);
3793 code_rate_hp = (dptr[5] & 0x07);
3794 code_rate_lp = (dptr[6] >> 5);
3795 guard = ((dptr[6] >> 3) & 0x03);
3796 alt_freq = (dptr[6] & 0x01);
3799 switch ((dptr[6] >> 1) & 0x03)
3802 del_sys->terr.u.t1.mode = MODE_COFDM_2K;
3806 del_sys->terr.u.t1.mode = MODE_COFDM_8K;
3810 del_sys->terr.u.t1.mode = MODE_COFDM_4K;
3814 del_sys->terr.u.t1.mode = MODE_COFDM_UNDEFINED;
3818 #ifdef DEBUG_TERR_DEL_SYS_DESC 3819 if (db_print == TRUE)
3821 STB_SI_PRINT((
" f=%dHz, bw=%d, m=%d, c=%d, h=%d, rhp=%d, rlp=%d, g=%d, alt=%d",
3822 del_sys->terr.u.t1.freq_hz, del_sys->terr.u.t1.bwidth, del_sys->terr.u.t1.mode,
3823 constellation, hierarchy, code_rate_hp, code_rate_lp, guard, alt_freq));
3828 FUNCTION_FINISH(ParseTerrestrialDeliverySysDescriptor);
3845 static U8BIT* ParseT2DeliverySysDescriptor(U8BIT *dptr,
SI_DELIVERY_SYS_DESC **desc_ptr, BOOLEAN db_print)
3855 #ifdef DEBUG_TERR_DEL_SYS_DESC 3859 FUNCTION_START(ParseT2DeliverySysDescriptor);
3861 ASSERT(dptr != NULL);
3865 end_ptr = dptr + dlen;
3870 #ifdef DEBUG_TERR_DEL_SYS_DESC 3871 if (db_print == TRUE)
3873 STB_SI_PRINT((
" T2 delivery system desc:"));
3876 USE_UNWANTED_PARAM(db_print);
3879 if (*desc_ptr == NULL)
3884 del_sys = *desc_ptr;
3886 if (del_sys != NULL)
3888 del_sys->terr.is_t2 = TRUE;
3891 del_sys->terr.u.t2.plp_id = dptr[0];
3892 del_sys->terr.u.t2.t2_system_id = (dptr[1] << 8) + dptr[2];
3896 switch ((dptr[3] & 0x3c) >> 2)
3899 del_sys->terr.u.t2.bwidth = TBWIDTH_8MHZ;
3903 del_sys->terr.u.t2.bwidth = TBWIDTH_7MHZ;
3907 del_sys->terr.u.t2.bwidth = TBWIDTH_6MHZ;
3911 del_sys->terr.u.t2.bwidth = TBWIDTH_5MHZ;
3915 del_sys->terr.u.t2.bwidth = TBWIDTH_10MHZ;
3919 del_sys->terr.u.t2.bwidth = TBWIDTH_UNDEFINED;
3923 switch ((dptr[4] & 0x1c) >> 2)
3926 del_sys->terr.u.t2.mode = MODE_COFDM_2K;
3930 del_sys->terr.u.t2.mode = MODE_COFDM_8K;
3934 del_sys->terr.u.t2.mode = MODE_COFDM_4K;
3938 del_sys->terr.u.t2.mode = MODE_COFDM_1K;
3942 del_sys->terr.u.t2.mode = MODE_COFDM_16K;
3946 del_sys->terr.u.t2.mode = MODE_COFDM_32K;
3950 del_sys->terr.u.t2.mode = MODE_COFDM_UNDEFINED;
3954 tfs = dptr[4] & 0x01;
3956 del_sys->terr.u.t2.num_cells = 0;
3957 del_sys->terr.u.t2.cell = NULL;
3964 while (dptr < end_ptr)
3978 cell[num_cells - 1].cell_id = (dptr[0] << 8) + dptr[1];
3982 cell[num_cells - 1].num_freqs = dptr[2] / 4;
3985 for (i = 0, freq_ptr = dptr; i < cell[num_cells - 1].num_freqs; freq_ptr += 4, i++)
3987 cell[num_cells - 1].freq_hz[i] = ((freq_ptr[0] << 24) | (freq_ptr[1] << 16) |
3988 (freq_ptr[2] << 8) | freq_ptr[3]) * 10;
3994 cell[num_cells - 1].num_freqs = 1;
3995 cell[num_cells - 1].freq_hz[0] = ((dptr[2] << 24) | (dptr[3] << 16) | (dptr[4] << 8) | dptr[5]) * 10;
4005 del_sys->terr.u.t2.num_cells = num_cells;
4006 del_sys->terr.u.t2.cell = cell;
4010 del_sys->terr.u.t2.bwidth = TBWIDTH_UNDEFINED;
4011 del_sys->terr.u.t2.mode = MODE_COFDM_UNDEFINED;
4012 del_sys->terr.u.t2.num_cells = 0;
4013 del_sys->terr.u.t2.cell = NULL;
4016 #ifdef DEBUG_TERR_DEL_SYS_DESC 4017 if (db_print == TRUE)
4019 STB_SI_PRINT((
" plp=%u, t2_system_id=0x%04x, bw=%d, m=%d", del_sys->terr.u.t2.plp_id,
4020 del_sys->terr.u.t2.t2_system_id, del_sys->terr.u.t2.bwidth, del_sys->terr.u.t2.mode));
4021 if (del_sys->terr.u.t2.num_cells > 0)
4023 for (i = 0; i < del_sys->terr.u.t2.num_cells; i++)
4025 STB_SI_PRINT((
" cell=0x%04x", del_sys->terr.u.t2.cell[i].cell_id));
4026 for (j = 0; j < del_sys->terr.u.t2.cell[i].num_freqs; j++)
4028 STB_SI_PRINT((
" freq=%luHz", del_sys->terr.u.t2.cell[i].freq_hz[j]));
4036 FUNCTION_FINISH(ParseT2DeliverySysDescriptor);
4041 static U8BIT* ParseSatelliteDeliverySysDescriptor(U8BIT *dptr,
SI_DELIVERY_SYS_DESC **desc_ptr, BOOLEAN db_print)
4046 FUNCTION_START(ParseSatelliteDeliverySysDescriptor);
4048 ASSERT(dptr != NULL);
4052 end_ptr = dptr + dlen;
4054 #ifdef DEBUG_SAT_DEL_SYS_DESC 4055 if (db_print == TRUE)
4057 STB_SI_PRINT((
" Satellite delivery system desc:"));
4060 USE_UNWANTED_PARAM(db_print);
4063 if (*desc_ptr == NULL)
4067 del_sys = *desc_ptr;
4069 if (del_sys != NULL)
4071 del_sys->sat.freq_hz = (U32BIT)BCDToFloat(dptr, 8, 6);
4075 del_sys->sat.position = (U16BIT)(BCDToFloat(dptr, 4, 3) * 10);
4078 del_sys->sat.east_west = ((((*dptr & 0x80) >> 7) == 1) ? TRUE : FALSE);
4079 del_sys->sat.polarity = (E_STB_DP_POLARITY)((*dptr & 0x60) >> 5);
4080 del_sys->sat.dvb_s2 = (((*dptr & 0x04) != 0) ? TRUE : FALSE);
4082 switch (*dptr & 0x03)
4085 del_sys->sat.modulation = MOD_AUTO;
4089 del_sys->sat.modulation = MOD_QPSK;
4093 del_sys->sat.modulation = MOD_8PSK;
4097 del_sys->sat.modulation = MOD_16QAM;
4102 del_sys->sat.sym_rate = (U16BIT)((BCDToFloat(dptr, 7, 3) * 1000) + 0.5);
4104 del_sys->sat.fec_code = (E_STB_DP_FEC)(*dptr & 0x0f);
4106 #ifdef DEBUG_SAT_DEL_SYS_DESC 4107 if (db_print == TRUE)
4109 STB_SI_PRINT((
" f=%dHz, sym=%d, fec=%d, pol=%d, [pos=%d, we=%s, s2=%u, mod=%s]\n",
4110 del_sys->sat.freq_hz,
4111 del_sys->sat.sym_rate,
4112 del_sys->sat.fec_code,
4113 del_sys->sat.polarity,
4114 del_sys->sat.position,
4115 (del_sys->sat.east_west ?
"E" :
"W"),
4116 del_sys->sat.dvb_s2,
4117 ((del_sys->sat.modulation == MOD_QPSK) ?
"QPSK" :
4118 ((del_sys->sat.modulation == MOD_8PSK) ?
"8PSK" :
4119 ((del_sys->sat.modulation == MOD_16QAM) ?
"16QAM" :
"Auto")))));
4124 FUNCTION_FINISH(ParseSatelliteDeliverySysDescriptor);
4129 static U8BIT* ParseCableDeliverySysDescriptor(U8BIT *dptr,
SI_DELIVERY_SYS_DESC **desc_ptr, BOOLEAN db_print)
4135 FUNCTION_START(ParseCableDeliverySysDescriptor);
4137 ASSERT(dptr != NULL);
4141 end_ptr = dptr + dlen;
4143 #ifdef DEBUG_CABLE_DEL_SYS_DESC 4144 if (db_print == TRUE)
4146 STB_SI_PRINT((
" Cable delivery system desc:"));
4149 USE_UNWANTED_PARAM(db_print);
4152 if (*desc_ptr == NULL)
4157 del_sys = *desc_ptr;
4159 if (del_sys != NULL)
4162 del_sys->cable.freq_hz = (U32BIT)(BCDToFloat(dptr, 8, 4) * 1000000);
4168 del_sys->cable.fec_outer = *dptr & 0x0f;
4171 del_sys->cable.modulation = *dptr;
4174 del_sys->cable.symbol_rate = (U32BIT)(BCDToFloat(dptr, 7, 3) * 1000);
4177 del_sys->cable.fec_inner = *dptr & 0x0f;
4179 #ifdef DEBUG_CABLE_DEL_SYS_DESC 4180 if (db_print == TRUE)
4182 STB_SI_PRINT((
" freq=%u, fec_outer=0x%x, modulation=0x%02x, symbol_rate=%u, fec_inner=0x%x",
4183 del_sys->cable.freq_hz, del_sys->cable.fec_outer, del_sys->cable.modulation,
4184 del_sys->cable.symbol_rate, del_sys->cable.fec_inner));
4189 FUNCTION_FINISH(ParseCableDeliverySysDescriptor);
4200 U8BIT tun_loop_length;
4203 FUNCTION_START(ParseFreesatLinkageDescriptor);
4205 ASSERT(dptr != NULL);
4209 end_ptr = dptr + dlen;
4211 #ifdef DEBUG_FREESAT_LINKAGE_DESC 4212 if (db_print == TRUE)
4214 STB_SI_PRINT((
" Free sat linkage desc: len=%u", dlen));
4217 USE_UNWANTED_PARAM(db_print);
4225 while (dptr < end_ptr)
4228 if (new_item != NULL)
4230 new_item->next = NULL;
4231 new_item->trans_id = (dptr[0] << 8) | dptr[1];
4232 new_item->onet_id = (dptr[2] << 8) | dptr[3];
4236 dptr += (*dptr) + 1;
4238 new_item->serv_id = (dptr[0] << 8) | dptr[1];
4240 #ifdef DEBUG_FREESAT_LINKAGE_DESC 4241 STB_SI_PRINT((
" onid=0x%04x, tid=0x%04x, sid=0x%04x",
4242 new_item->onet_id, new_item->trans_id, new_item->serv_id));
4245 tun_loop_length = dptr[2];
4248 if (tun_loop_length > 0)
4250 new_item->num_data_types = tun_loop_length;
4253 new_item->data_types = (U8BIT *)
STB_GetMemory(tun_loop_length *
sizeof(U8BIT));
4254 if (new_item->data_types != NULL)
4256 for (i = 0; i < tun_loop_length; i++)
4258 new_item->data_types[i] = dptr[i];
4260 #ifdef DEBUG_FREESAT_LINKAGE_DESC 4261 STB_SI_PRINT((
" tunnelled data type 0x%02x", dptr[i]));
4270 #ifdef DEBUG_FREESAT_LINKAGE_DESC 4271 STB_SI_PRINT((
" Failed to allocate memory for tunnelled data types, descriptor ignored"));
4280 #ifdef DEBUG_FREESAT_LINKAGE_DESC 4281 STB_SI_PRINT((
" No tunnelled data, descriptor ignored"));
4285 dptr += tun_loop_length;
4287 if (new_item != NULL)
4296 last_item->next = new_item;
4299 last_item = new_item;
4302 #ifdef DEBUG_FREESAT_LINKAGE_DESC 4305 STB_SI_PRINT((
" Failed to allocate memory for freesat linkage desc"));
4311 FUNCTION_FINISH(ParseFreesatLinkageDescriptor);
4322 FUNCTION_START(ParseFreesatPrefixDescriptor);
4324 ASSERT(dptr != NULL);
4328 end_ptr = dptr + dlen;
4330 #ifdef DEBUG_FREESAT_PREFIX_DESC 4333 STB_SI_PRINT((
" Freesat prefix desc: len=%u", dlen));
4336 USE_UNWANTED_PARAM(db_print);
4339 while (dptr < end_ptr)
4344 prefix->prefix_index = *dptr & 0x7f;
4349 #ifdef DEBUG_FREESAT_PREFIX_DESC 4350 STB_SI_PRINT((
" index=%u, prefix=\"%s\"", prefix->prefix_index, prefix->uri_prefix->str_ptr));
4354 prefix->next = *list;
4357 #ifdef DEBUG_FREESAT_PREFIX_DESC 4360 STB_SI_PRINT((
" Failed to allocate memory for freesat prefix desc"));
4365 FUNCTION_FINISH(ParseFreesatPrefixDescriptor);
4385 static U8BIT* ParseLogicalChannelDescriptor(U8BIT *dptr, U8BIT dtag, U16BIT *num_ptr,
4394 FUNCTION_START(ParseLogicalChannelDescriptor);
4396 ASSERT(dptr != NULL);
4397 ASSERT(num_ptr != NULL);
4398 ASSERT(array_ptr != NULL);
4400 USE_UNWANTED_PARAM(dtag);
4402 #ifndef DEBUG_LCN_DESC 4403 USE_UNWANTED_PARAM(db_print);
4408 end_ptr = dptr + dlen;
4412 num_entries = dlen / 4;
4413 #ifdef DEBUG_LCN_DESC 4414 if (db_print == TRUE)
4416 STB_SI_PRINT((
" Logical channel desc 0x%02x: %d entries", dtag, num_entries));
4419 USE_UNWANTED_PARAM(db_print);
4424 if (*array_ptr == NULL)
4432 num_entries += *num_ptr;
4437 memcpy(lcns, *array_ptr, (*num_ptr *
sizeof(
SI_LCN_DESC)));
4445 for (i = *num_ptr; i < num_entries; i++)
4447 lcns[i].serv_id = (dptr[0] << 8) | dptr[1];
4448 lcns[i].serv_lcn = ((dptr[2] & 0x03) << 8) | dptr[3];
4453 if ((dptr[2] & 0x80) != 0)
4455 lcns[i].visible = TRUE;
4459 lcns[i].visible = FALSE;
4463 #ifdef DEBUG_LCN_DESC 4464 if (db_print == TRUE)
4466 STB_SI_PRINT((
" id=0x%04x, lcn=%d, visible=%s", lcns[i].serv_id, lcns[i].serv_lcn,
4467 (lcns[i].visible ?
"TRUE" :
"FALSE")));
4472 *num_ptr = num_entries;
4476 #ifdef DEBUG_LCN_DESC 4477 if (db_print == TRUE)
4479 STB_SI_PRINT((
" CAN'T ALLOCATE MEMORY FOR DESCRIPTOR ARRAY ENTRY"));
4486 #ifdef DEBUG_LCN_DESC 4487 if (db_print == TRUE)
4489 STB_SI_PRINT((
" Invalid Logical channel desc: (%d bytes)", dlen));
4494 FUNCTION_FINISH(ParseLogicalChannelDescriptor);
4512 static U8BIT* ParseServiceAttributeDescriptor(U8BIT *dptr, U16BIT *num_ptr,
4521 FUNCTION_START(ParseServiceAttributeDescriptor);
4523 ASSERT(dptr != NULL);
4524 ASSERT(num_ptr != NULL);
4525 ASSERT(array_ptr != NULL);
4529 end_ptr = dptr + dlen;
4533 num_entries = dlen / 3;
4534 #ifdef DEBUG_LCN_DESC 4535 if (db_print == TRUE)
4537 STB_SI_PRINT((
" Service attribute desc: %d entries", num_entries));
4540 USE_UNWANTED_PARAM(db_print);
4545 if (*array_ptr == NULL)
4553 num_entries += *num_ptr;
4566 for (i = *num_ptr; i < num_entries; i++)
4568 array[i].serv_id = (dptr[0] << 8) | dptr[1];
4570 if ((dptr[2] & 0x01) != 0)
4572 array[i].service_visible = TRUE;
4573 array[i].service_selectable = TRUE;
4577 array[i].service_visible = FALSE;
4578 if ((dptr[2] & 0x02) != 0)
4580 array[i].service_selectable = TRUE;
4584 array[i].service_selectable = FALSE;
4589 #ifdef DEBUG_LCN_DESC 4590 if (db_print == TRUE)
4592 STB_SI_PRINT((
" id=0x%04x, visible=%d, selectable=%d", array[i].serv_id,
4593 array[i].service_visible, array[i].service_selectable));
4598 *num_ptr = num_entries;
4602 #ifdef DEBUG_LCN_DESC 4603 if (db_print == TRUE)
4605 STB_SI_PRINT((
" CAN'T ALLOCATE MEMORY FOR DESCRIPTOR ARRAY ENTRY"));
4612 #ifdef DEBUG_LCN_DESC 4613 if (db_print == TRUE)
4615 STB_SI_PRINT((
" Invalid service attribute desc: (%d bytes)", dlen));
4620 FUNCTION_FINISH(ParseServiceAttributeDescriptor);
4638 static U8BIT* ParseNordigLCN2Descriptor(U8BIT *dptr, U16BIT *num_ptr,
SI_NORDIG_LCN_DESC **array_ptr,
4647 FUNCTION_START(ParseNordigLCN2Descriptor);
4649 ASSERT(dptr != NULL);
4650 ASSERT(num_ptr != NULL);
4651 ASSERT(array_ptr != NULL);
4655 end_ptr = dptr + dlen;
4657 num_entries = *num_ptr;
4659 #ifdef DEBUG_LCN_DESC 4660 if (db_print == TRUE)
4662 STB_SI_PRINT((
" Nordig logical channel desc:"));
4665 USE_UNWANTED_PARAM(db_print);
4668 for (i = num_entries; dlen > 6; i++)
4675 if ((array != NULL) && (*array_ptr != NULL))
4685 array[i].chan_list_id = *dptr;
4691 dptr = ReadLanguageCode(dptr, &array[i].country_code);
4694 array[i].num_services = *dptr / 4;
4696 #ifdef DEBUG_LCN_DESC 4700 U32BIT lang = array[i].country_code;
4702 if (array[i].chan_list_name != NULL)
4704 if (array[i].chan_list_name->str_ptr != NULL)
4706 tmp_str = (
char *)array[i].chan_list_name->str_ptr;
4710 STB_SI_PRINT((
" list_id=%u, list_name=\"%s\", lang=%c%c%c, num servs=%u",
4711 array[i].chan_list_id, tmp_str, (lang >> 16), (lang >> 8), lang,
4712 array[i].num_services));
4716 if (array[i].num_services > 0)
4719 if (array[i].serv_array != NULL)
4723 for (j = 0; j < array[i].num_services; j++)
4725 array[i].serv_array[j].serv_id = (dptr[0] << 8) | dptr[1];
4726 array[i].serv_array[j].visible = ((dptr[2] & 0x80) != 0) ? TRUE : FALSE;
4727 array[i].serv_array[j].serv_lcn = ((dptr[2] & 0x03) << 8) | dptr[3];
4730 #ifdef DEBUG_LCN_DESC 4731 if (db_print == TRUE)
4733 STB_SI_PRINT((
" id=0x%04x, lcn=%d, visible=%s", array[i].serv_array[j].serv_id,
4734 array[i].serv_array[j].serv_lcn,
4735 (array[i].serv_array[j].visible ?
"TRUE" :
"FALSE")));
4742 array[i].num_services = 0;
4749 array[i].serv_array = NULL;
4758 #ifdef DEBUG_LCN_DESC 4759 if (db_print == TRUE)
4761 STB_SI_PRINT((
" CAN'T ALLOCATE MEMORY FOR DESCRIPTOR ARRAY ENTRY"));
4767 dlen = end_ptr - dptr;
4770 *num_ptr = num_entries;
4772 FUNCTION_FINISH(ParseNordigLCN2Descriptor);
4789 static U8BIT* ParsePreferredNameIdDescriptor(U8BIT *dptr, U8BIT *id_ptr, BOOLEAN db_print)
4794 FUNCTION_START(ParsePreferredNameIdDescriptor);
4796 ASSERT(dptr != NULL);
4797 ASSERT(id_ptr != NULL);
4801 end_ptr = dptr + dlen;
4806 #ifdef DEBUG_PREF_NAME_ID_DESC 4807 if (db_print == TRUE)
4809 STB_SI_PRINT((
" Preferred name id desc: id=%d", *id_ptr));
4812 USE_UNWANTED_PARAM(db_print);
4818 #ifdef DEBUG_PREF_NAME_ID_DESC 4819 if (db_print == TRUE)
4821 STB_SI_PRINT((
" Invalid Preferred name id desc: (%d bytes)", dlen));
4826 FUNCTION_FINISH(ParsePreferredNameIdDescriptor);
4844 static U8BIT* ParsePreferredNameListDescriptor(U8BIT *dptr, U16BIT *num_ptr,
4858 FUNCTION_START(ParsePreferredNameListDescriptor);
4860 ASSERT(dptr != NULL);
4861 ASSERT(num_ptr != NULL);
4862 ASSERT(array_ptr != NULL);
4866 end_ptr = dptr + dlen;
4873 while (tmp_ptr < end_ptr)
4875 name_count = tmp_ptr[3];
4877 for (i = 0; i < name_count; i++)
4879 name_len = tmp_ptr[1];
4880 tmp_ptr += (name_len + 2);
4882 num_entries += name_count;
4885 #ifdef DEBUG_PREF_NAME_LIST_DESC 4886 if (db_print == TRUE)
4888 STB_SI_PRINT((
" Preferred name list desc: %d entries", num_entries));
4891 USE_UNWANTED_PARAM(db_print);
4896 if (*array_ptr == NULL)
4904 num_entries += *num_ptr;
4917 entry_no = *num_ptr;
4918 while ((dptr < end_ptr) && (entry_no < num_entries))
4920 dptr = ReadLanguageCode(dptr, &lang_code);
4921 name_count = dptr[0];
4923 for (i = 0; i < name_count; i++, entry_no++)
4925 array[entry_no].lang_code = lang_code;
4926 array[entry_no].name_id = dptr[0];
4930 #ifdef DEBUG_PREF_NAME_LIST_DESC 4932 char *tmp_str =
"NULL";
4934 if (db_print == TRUE)
4936 if (array[entry_no].name_str != NULL)
4938 if (array[entry_no].name_str->str_ptr != NULL)
4940 tmp_str = (
char *)array[entry_no].name_str->str_ptr;
4944 STB_SI_PRINT((
" lang=%c%c%c, id=%d, name=%s",
4945 (lang_code >> 16), (lang_code >> 8), lang_code, array[entry_no].name_id, tmp_str));
4952 *num_ptr = num_entries;
4956 #ifdef DEBUG_PREF_NAME_LIST_DESC 4957 if (db_print == TRUE)
4959 STB_SI_PRINT((
" CAN'T ALLOCATE MEMORY FOR DESCRIPTOR ARRAY ENTRY"));
4966 #ifdef DEBUG_PREF_NAME_LIST_DESC 4967 if (db_print == TRUE)
4969 STB_SI_PRINT((
" Invalid Preferred name list desc: (%d bytes)", dlen));
4974 FUNCTION_FINISH(ParsePreferredNameListDescriptor);
4991 static U8BIT* ParseDefaultAuthorityDescriptor(U8BIT *dptr,
SI_STRING_DESC **auth_ptr, BOOLEAN db_print)
4996 FUNCTION_START(ParseDefaultAuthorityDescriptor);
4998 ASSERT(dptr != NULL);
4999 ASSERT(auth_ptr != NULL);
5003 end_ptr = dptr + dlen;
5007 if (*auth_ptr == NULL)
5010 #ifdef DEBUG_DEF_AUTH_DESC 5012 char *tmp_str =
"NULL";
5013 if (db_print == TRUE)
5015 if (*auth_ptr != NULL)
5017 if ((*auth_ptr)->str_ptr != NULL)
5019 tmp_str = (
char *)(*auth_ptr)->str_ptr;
5022 STB_SI_PRINT((
" Default authority desc=\"%s\"", tmp_str));
5026 USE_UNWANTED_PARAM(db_print);
5031 #ifdef DEBUG_DEF_AUTH_DESC 5032 if (db_print == TRUE)
5034 STB_SI_PRINT((
" Default authority desc: duplicate entry ignored"));
5039 USE_UNWANTED_PARAM(dptr);
5040 FUNCTION_FINISH(ParseDefaultAuthorityDescriptor);
5059 static U8BIT* ParseContentIdentifierDescriptor(U8BIT *dptr, U8BIT *num_ptr,
5069 FUNCTION_START(ParseContentIdentifierDescriptor);
5071 ASSERT(dptr != NULL);
5072 ASSERT(num_ptr != NULL);
5073 ASSERT(list_ptr != NULL);
5074 ASSERT(last_entry_ptr != NULL);
5078 end_ptr = dptr + dlen;
5082 while (dptr < end_ptr)
5089 location = (crid_type & CRID_LOCATION_MASK);
5090 if (location == CRID_LOCATION_0)
5093 crid_type &= CRID_TYPE_MASK;
5094 crid_type >>= CRID_TYPE_SHIFT;
5098 crid_entry->next = NULL;
5099 crid_entry->type = crid_type;
5103 #ifdef DEBUG_CID_DESC 5104 if (db_print == TRUE)
5106 STB_SI_PRINT((
" EIT CRID type: 0x%x, CRID=\"%s\"", crid_type, crid_entry->crid_str->str_ptr));
5109 USE_UNWANTED_PARAM(db_print);
5112 if (*last_entry_ptr == NULL)
5115 *list_ptr = crid_entry;
5120 (*last_entry_ptr)->next = crid_entry;
5123 *last_entry_ptr = crid_entry;
5128 #ifdef DEBUG_CID_DESC 5129 if (db_print == TRUE)
5131 STB_SI_PRINT((
" Invalid CRID location: 0x%x", (U32BIT)location));
5134 if (location == CRID_LOCATION_1)
5143 #ifdef DEBUG_CID_DESC 5144 if ((db_print == TRUE) && (dlen != 0))
5146 STB_SI_PRINT((
" Invalid content identifier desc: (%d bytes)", dlen));
5151 FUNCTION_FINISH(ParseContentIdentifierDescriptor);
5166 static U8BIT* ParseNetworkChangeNotifyDescriptor(U8BIT *dptr, U16BIT *num_change_notifies,
5176 FUNCTION_START(ParseNetworkChangeNotifyDescriptor);
5178 #ifndef DEBUG_SI_NIT_CONTENT 5179 USE_UNWANTED_PARAM(db_print);
5184 end_ptr = dptr + dlen;
5192 if (*num_change_notifies == 0)
5195 *num_change_notifies = 1;
5200 *num_change_notifies += 1;
5203 desc = &(*desc_ptr)[*num_change_notifies - 1];
5208 desc->cell_id = (dptr[0] << 8) + dptr[1];
5211 #ifdef DEBUG_SI_NIT_CONTENT 5214 STB_SI_PRINT((
" Change notify for cell_id 0x%04x", desc->cell_id));
5218 loop_length = *dptr;
5221 desc->num_changes = 0;
5222 desc->change_array = NULL;
5226 for (i = 0; (loop_length >= 12) && (dptr < end_ptr); i++)
5228 if (desc->change_array == NULL)
5238 entry = &desc->change_array[desc->num_changes];
5240 desc->num_changes++;
5244 entry->change_id = *dptr;
5247 entry->version = *dptr;
5250 #ifdef DEBUG_SI_NIT_CONTENT 5253 STB_SI_PRINT((
" Change id %u, version %u", entry->change_id, entry->version));
5257 entry->start_date = (dptr[0] << 8) | dptr[1];
5258 entry->start_hours = ((dptr[2] >> 4) * 10) + (dptr[2] & 0x0f);
5259 entry->start_mins = ((dptr[3] >> 4) * 10) + (dptr[3] & 0x0f);
5260 entry->start_secs = ((dptr[4] >> 4) * 10) + (dptr[4] & 0x0f);
5263 entry->dur_hours = ((dptr[0] >> 4) * 10) + (dptr[0] & 0x0f);
5264 entry->dur_mins = ((dptr[1] >> 4) * 10) + (dptr[1] & 0x0f);
5265 entry->dur_secs = ((dptr[2] >> 4) * 10) + (dptr[2] & 0x0f);
5268 entry->receiver_category = (*dptr >> 5);
5270 if ((*dptr & 0x10) != 0)
5272 entry->invariant_ts_present = TRUE;
5275 entry->change_type = *dptr & 0x0f;
5278 entry->message_id = *dptr;
5283 #ifdef DEBUG_SI_NIT_CONTENT 5286 STB_SI_PRINT((
" Starts on %u @ %02u:%02u:%02u, duration %02u:%02u:%02u",
5287 entry->start_date, entry->start_hours, entry->start_mins, entry->start_secs,
5288 entry->dur_hours, entry->dur_mins, entry->dur_secs));
5289 STB_SI_PRINT((
" Receiver type %u, change type %u", entry->receiver_category,
5290 entry->change_type));
5291 STB_SI_PRINT((
" Message id %u", entry->message_id));
5295 if (entry->invariant_ts_present && (loop_length >= 4))
5298 entry->invariant_ts_tsid = (U16BIT)(dptr[0] << 8) + dptr[1];
5299 entry->invariant_ts_onid = (U16BIT)(dptr[2] << 8) + dptr[3];
5304 #ifdef DEBUG_SI_NIT_CONTENT 5307 STB_SI_PRINT((
" Invariant TS ids: tsid=0x%04x, onid=0x%04x", entry->invariant_ts_tsid,
5308 entry->invariant_ts_onid));
5316 FUNCTION_FINISH(ParseNetworkChangeNotifyDescriptor);
5333 static U8BIT* ParseMessageDescriptor(U8BIT *dptr, U16BIT *num_messages,
5340 FUNCTION_START(ParseMessageDescriptor);
5342 #ifndef DEBUG_SI_NIT_CONTENT 5343 USE_UNWANTED_PARAM(db_print);
5348 end_ptr = dptr + dlen;
5355 if (*message_array == NULL)
5360 entry = *message_array;
5367 entry = &(*message_array)[*num_messages - 1];
5372 entry->message_id = *dptr;
5375 dptr = ReadLanguageCode(dptr, &entry->lang_code);
5379 #ifdef DEBUG_SI_NIT_CONTENT 5382 STB_SI_PRINT((
" Message id %u, lang \"%c%c%c\"", entry->message_id,
5383 (entry->lang_code >> 16) & 0xff, (entry->lang_code >> 8) & 0xff, entry->lang_code & 0xff));
5384 if ((*entry->message->str_ptr >= 0x20) && (*entry->message->str_ptr <= 0x7f))
5386 STB_SI_PRINT((
" \"%s\"", entry->message->str_ptr));
5390 STB_SI_PRINT((
" message is non-ascii"));
5397 USE_UNWANTED_PARAM(dptr);
5398 FUNCTION_FINISH(ParseMessageDescriptor);
5422 FUNCTION_START(ParseTargetRegionNameDescriptor);
5424 #ifndef DEBUG_TARGET_REGION_DESC 5425 USE_UNWANTED_PARAM(db_print);
5430 end_ptr = dptr + dlen;
5440 dptr = ReadLanguageCode(dptr, &entry->country_code);
5441 dptr = ReadLanguageCode(dptr, &entry->lang_code);
5445 entry->num_names = 0;
5446 entry->name_array = NULL;
5449 for (eptr = dptr; dlen > 0; )
5451 region_depth = (*eptr >> 6) & 0x03;
5452 name_len = *eptr & 0x3f;
5463 if (region_depth >= 2)
5467 if (region_depth == 3)
5475 #ifdef DEBUG_TARGET_REGION_DESC 5478 STB_SI_PRINT((
" Target region name: country=%c%c%c, lang=%c%c%c, num_names=%u",
5479 entry->country_code >> 16, entry->country_code >> 8, entry->country_code & 0xff,
5480 entry->lang_code >> 16, entry->lang_code >> 8, entry->lang_code & 0xff,
5485 if (entry->num_names > 0)
5488 if (entry->name_array != NULL)
5490 for (i = 0; i < entry->num_names; i++)
5492 name_entry = &entry->name_array[i];
5493 name_entry->region_depth = (*dptr >> 6) & 0x03;
5495 dptr =
STB_SIReadString((dptr[0] & 0x3f), dptr + 1, &name_entry->region_name);
5497 name_entry->primary_region_code = *dptr;
5499 if (name_entry->region_depth >= 2)
5501 name_entry->secondary_region_code = *dptr;
5503 if (name_entry->region_depth == 3)
5505 name_entry->tertiary_region_code = (dptr[0] << 8) | dptr[1];
5509 #ifdef DEBUG_TARGET_REGION_DESC 5512 if (name_entry->region_depth == 3)
5514 STB_SI_PRINT((
" Tertiary region name: %u:%u:%u = \"%s\"",
5515 name_entry->primary_region_code, name_entry->secondary_region_code,
5516 name_entry->tertiary_region_code, name_entry->region_name->str_ptr));
5518 else if (name_entry->region_depth == 2)
5520 STB_SI_PRINT((
" Secondary region name: %u:%u = \"%s\"",
5521 name_entry->primary_region_code, name_entry->secondary_region_code,
5522 name_entry->region_name->str_ptr));
5526 STB_SI_PRINT((
" Primary region name: %u = \"%s\"",
5527 name_entry->primary_region_code, name_entry->region_name->str_ptr));
5536 entry->next = *desc_list;
5540 #ifdef DEBUG_TARGET_REGION_DESC 5543 STB_SI_PRINT((
" Target region name desc, skipped, invalid size: %u", dlen));
5547 FUNCTION_FINISH(ParseTargetRegionNameDescriptor);
5564 U32BIT country_code;
5568 BOOLEAN read_country;
5570 FUNCTION_START(ParseTargetRegionDescriptor);
5572 #ifndef DEBUG_TARGET_REGION_DESC 5573 USE_UNWANTED_PARAM(db_print);
5578 end_ptr = dptr + dlen;
5584 read_country = TRUE;
5593 dptr = ReadLanguageCode(dptr, &country_code);
5596 #ifdef DEBUG_TARGET_REGION_DESC 5599 STB_SI_PRINT((
" Target region: country=%c%c%c",
5600 country_code >> 16, country_code >> 8, country_code & 0xff));
5605 for (cptr = *desc_list; (cptr != NULL) && (cptr->country_code != country_code); )
5616 cptr->country_code = country_code;
5617 cptr->region_list = NULL;
5620 cptr->next = *desc_list;
5625 read_country = FALSE;
5630 while (!read_country && (dlen > 0))
5632 if ((*dptr & 0x04) != 0)
5634 read_country = TRUE;
5639 region_depth = *dptr & 0x03;
5643 if (region_depth > 0)
5649 rptr->region_depth = region_depth;
5650 rptr->primary_region_code = *dptr;
5654 if (region_depth > 1)
5656 rptr->secondary_region_code = *dptr;
5660 if (region_depth > 2)
5662 rptr->tertiary_region_code = (dptr[0] << 8) | dptr[1];
5668 #ifdef DEBUG_TARGET_REGION_DESC 5671 if (rptr->region_depth == 3)
5673 STB_SI_PRINT((
" Tertiary region: %u:%u:%u",
5674 rptr->primary_region_code, rptr->secondary_region_code,
5675 rptr->tertiary_region_code));
5677 else if (rptr->region_depth == 2)
5679 STB_SI_PRINT((
" Secondary region: %u:%u",
5680 rptr->primary_region_code, rptr->secondary_region_code));
5684 STB_SI_PRINT((
" Primary region: %u",
5685 rptr->primary_region_code));
5691 rptr->next = cptr->region_list;
5692 cptr->region_list = rptr;
5700 FUNCTION_FINISH(ParseTargetRegionDescriptor);
5715 static U8BIT* ParseServiceAvailabilityDescriptor(U8BIT *dptr,
SI_SERV_AVAIL_DESC **serv_avail_list, BOOLEAN db_print)
5723 FUNCTION_START(ParseServiceAvailabilityDescriptor);
5725 #ifndef DEBUG_SI_SDT_CONTENT 5726 USE_UNWANTED_PARAM(db_print);
5731 end_ptr = dptr + dlen;
5733 #ifdef DEBUG_SERV_AVAIL_DESC 5734 STB_SI_PRINT((
"ParseServiceAvailabilityDescriptor: descriptor length = %d", dlen));
5738 num_of_ids = (dlen - 1) / 2;
5743 desc->next = *serv_avail_list;
5744 *serv_avail_list = desc;
5746 #ifdef DEBUG_SERV_AVAIL_DESC 5747 STB_SI_PRINT((
"ParseServiceAvailabilityDescriptor: availability flag = %s", ((*dptr & 0x80) == 0) ?
"FALSE" :
"TRUE"));
5749 if ((*dptr & 0x80) == 0)
5751 desc->availability_flag = FALSE;
5755 desc->availability_flag = TRUE;
5761 if (desc->cell_ids != NULL)
5763 desc->num_of_cell_ids = num_of_ids;
5764 for (i = 0; i < num_of_ids; i++)
5766 desc->cell_ids[i] = (dptr[0] << 8) + dptr[1];
5767 #ifdef DEBUG_SERV_AVAIL_DESC 5768 STB_SI_PRINT((
"ParseServiceAvailabilityDescriptor: id[%d]=0x%x", i, desc->cell_ids[i]));
5776 #ifdef DEBUG_SERV_AVAIL_DESC 5777 STB_SI_PRINT((
"ParseServiceAvailabilityDescriptor: end"));
5780 FUNCTION_FINISH(ParseServiceAvailabilityDescriptor);
5791 static U8BIT* ParseSupplementaryAudioDescriptor(U8BIT *dptr,
SI_AD_DESC **audio_desc, BOOLEAN db_print)
5797 FUNCTION_START(ParseSupplementaryAudioDescriptor);
5799 ASSERT(dptr != NULL);
5801 #ifndef DEBUG_SUPP_AUDIO_DESC 5802 USE_UNWANTED_PARAM(db_print);
5807 end_ptr = dptr + dlen;
5813 if (*audio_desc != NULL)
5815 (*audio_desc)->mix_type = (*dptr >> 7) & 0x1;
5816 (*audio_desc)->edit_class = (*dptr >> 2) & 0x1f;
5818 lang_present = *dptr & 0x1;
5820 if ((dlen >= 2) && (lang_present != 0))
5822 dptr = ReadLanguageCode(&dptr[1], &((*audio_desc)->lang_code));
5824 #ifdef DEBUG_SUPP_AUDIO_DESC 5827 STB_SI_PRINT((
" Supplementary audio: invalid desc len %u", dlen));
5831 #ifdef DEBUG_SUPP_AUDIO_DESC 5834 STB_SI_PRINT((
" Supplementary audio: mix %s, class %u lang=%c%c%c",
5835 ((*audio_desc)->mix_type == 1 ?
"independent" :
"supplementary"),
5836 (*audio_desc)->edit_class,
5837 (
char)((*audio_desc)->lang_code >> 16),
5838 (
char)((*audio_desc)->lang_code >> 8),
5839 (
char)(*audio_desc)->lang_code));
5840 STB_SI_PRINT((
" data(%d):%*.*s", dlen - 5, dlen - 5, dlen - 5, dptr));
5846 #ifdef DEBUG_SUPP_AUDIO_DESC 5849 STB_SI_PRINT((
" CAN'T ALLOCATE MEMORY FOR DESCRIPTOR ARRAY ENTRY"));
5854 USE_UNWANTED_PARAM(dptr);
5855 FUNCTION_FINISH(ParseSupplementaryAudioDescriptor);
5874 static U8BIT* ParseFreesatTunnelledDataDescriptor(U8BIT *dptr, U8BIT *num_entries,
5881 FUNCTION_START(ParseFreesatTunnelledDataDescriptor);
5885 end_ptr = dptr + dlen;
5899 #ifdef DEBUG_FREESAT_TUNNELLED_DATA_DESC 5902 STB_SI_PRINT((
" Freesat tunnelled data desc: alternative=%u, %u entries", alt_descriptor, num));
5905 USE_UNWANTED_PARAM(db_print);
5907 if (*desc_array != NULL)
5917 if (*desc_array != NULL)
5919 for (i = 0; i < num; i++)
5921 (*desc_array)[i + *num_entries].data_type = *dptr;
5924 if (!alt_descriptor)
5927 (*desc_array)[i + *num_entries].component_tag = *dptr;
5930 #ifdef DEBUG_FREESAT_TUNNELLED_DATA_DESC 5935 STB_SI_PRINT((
" type=%u", (*desc_array)[i + *num_entries].data_type));
5939 STB_SI_PRINT((
" type=%u, tag=%u", (*desc_array)[i + *num_entries].data_type,
5940 (*desc_array)[i + *num_entries].component_tag));
5946 *num_entries += num;
5950 FUNCTION_FINISH(ParseFreesatTunnelledDataDescriptor);
5968 static U8BIT* ParseRegionNameDescriptor(U8BIT *dptr,
SI_BAT_FREESAT_REGION **region_list, BOOLEAN db_print)
5974 FUNCTION_START(ParseRegionNameDescriptor);
5976 USE_UNWANTED_PARAM(db_print);
5980 end_ptr = dptr + dlen;
5982 while (dptr < end_ptr)
5986 region->region_id = (dptr[0] << 8) | (dptr[1]);
5988 dptr = ReadLanguageCode(dptr, ®ion->lang_code);
5992 region->next = *region_list;
5993 *region_list = region;
5997 FUNCTION_FINISH(ParseRegionNameDescriptor);
6015 static U8BIT* ParseIActiveStorageDescriptor(U8BIT *dptr,
6022 FUNCTION_START(ParseIActiveStorageDescriptor);
6024 ASSERT(dptr != NULL);
6028 end_ptr = dptr + dlen;
6032 #ifdef DEBUG_PRIV_DATA_SPEC_DESC 6033 if (db_print == TRUE)
6035 STB_SI_PRINT((
" Interactive storage descriptor : (len = %d)", dlen));
6038 USE_UNWANTED_PARAM(db_print);
6042 if (new_entry != NULL)
6046 if (new_entry->data != NULL)
6048 memcpy(new_entry->data, dptr, dlen);
6049 new_entry->next_desc = *desc_list;
6050 new_entry->length = dlen;
6051 *desc_list = new_entry;
6061 #ifdef DEBUG_PRIV_DATA_SPEC_DESC 6062 if (db_print == TRUE)
6064 STB_SI_PRINT((
" Invalid interactive storage descriptor: (%d bytes)", dlen));
6069 FUNCTION_FINISH(ParseIActiveStorageDescriptor);
6073 static U8BIT* ParseFreesatInfoLocationDescriptor(U8BIT *dptr,
6082 FUNCTION_START(ParseFreesatInfoLocationDescriptor);
6086 end_ptr = dptr + dlen;
6089 last_pointer = location_list;
6090 while (*last_pointer)
6091 last_pointer = &((*last_pointer)->next);
6095 #ifdef DEBUG_FREESAT_INFO_LOCATION_DESC 6098 STB_SI_PRINT((
" %s:", __FUNCTION__));
6101 USE_UNWANTED_PARAM(db_print);
6104 while (dptr < end_ptr)
6112 #ifdef DEBUG_FREESAT_INFO_LOCATION_DESC 6115 STB_SI_PRINT((
" tunnelled loop length = %u", loop_len));
6119 while ((loop_len >= 6) && (dptr < end_ptr))
6122 if (new_entry != NULL)
6124 memset(new_entry, 0,
sizeof(*new_entry));
6126 new_entry->transport_id = (dptr[0] << 8) | dptr[1];
6127 new_entry->orig_net_id = (dptr[2] << 8) | dptr[3];
6128 new_entry->service_id = (dptr[4] << 8) | dptr[5];
6133 #ifdef DEBUG_FREESAT_INFO_LOCATION_DESC 6136 STB_SI_PRINT((
" service = 0x%04x/0x%04x/0x%04x", new_entry->orig_net_id,
6137 new_entry->transport_id, new_entry->service_id));
6142 new_entry->next = NULL;
6143 *last_pointer = new_entry;
6144 last_pointer = &(new_entry->next);
6148 #ifdef DEBUG_FREESAT_INFO_LOCATION_DESC 6151 STB_SI_PRINT((
" Failed to allocate memory"));
6160 FUNCTION_FINISH(ParseFreesatInfoLocationDescriptor);
6189 FUNCTION_START(ParseRegionLcnDescriptor);
6191 #ifndef DEBUG_FREESAT_LCN_DESC 6192 USE_UNWANTED_PARAM(db_print);
6195 last_region = *lcn_array;
6196 while (last_region != NULL)
6198 if (last_region->next != NULL)
6200 last_region = last_region->next;
6211 end_ptr = dptr + dlen;
6213 while (dptr < end_ptr)
6216 if (region_entry != NULL)
6218 memset(region_entry, 0,
sizeof(*region_entry));
6220 region_entry->service_id = (dptr[0] << 8) | dptr[1];
6223 region_entry->freesat_id = ((dptr[0] & 0x7F) << 8) | dptr[1];
6226 #ifdef DEBUG_FREESAT_LCN_DESC 6229 STB_SI_PRINT((
" ParseRegionLcnDescriptor: serv_id = 0x%04x, freesat_id = 0x%04x",
6230 region_entry->service_id, region_entry->freesat_id));
6234 loop_ptr = dptr + 1;
6235 end_loop = loop_ptr + dptr[0];
6239 while (loop_ptr < end_loop)
6241 if (end_loop - loop_ptr >= 4)
6244 if (lcn_entry != NULL)
6246 memset(lcn_entry, 0,
sizeof(*lcn_entry));
6248 lcn_entry->numeric_selection = ((loop_ptr[0] & 0x80) >> 7);
6249 lcn_entry->visible_flag = ((loop_ptr[0] & 0x40) >> 6);
6250 lcn_entry->user_cust = ((loop_ptr[0] & 0x20) >> 5);
6251 lcn_entry->lcn = (((loop_ptr[0] & 0x0F) << 8) | (loop_ptr[1]));
6252 lcn_entry->region_id = (loop_ptr[2] << 8) | (loop_ptr[3]);
6255 #ifdef DEBUG_FREESAT_LCN_DESC 6256 STB_SI_PRINT((
" numeric_selection=%d, visible=%d, user_cust=%d, lcn=%d, region_id=0x%04x",
6257 lcn_entry->numeric_selection, lcn_entry->visible_flag, lcn_entry->user_cust,
6258 lcn_entry->lcn, lcn_entry->region_id));
6261 if (last_lcn == NULL)
6264 region_entry->freesat_lcn_list = lcn_entry;
6269 last_lcn->next = lcn_entry;
6272 last_lcn = lcn_entry;
6276 loop_ptr = end_loop;
6281 loop_ptr = end_loop;
6287 if (last_region == NULL)
6290 *lcn_array = region_entry;
6295 last_region->next = region_entry;
6298 last_region = region_entry;
6306 FUNCTION_FINISH(ParseRegionLcnDescriptor);
6311 static U8BIT* ParseFreesatShortServiceNameDescriptor(U8BIT *dptr, U16BIT *num_ptr,
6322 FUNCTION_START(ParseFreesatShortServiceNameDescriptor);
6324 ASSERT(dptr != NULL);
6325 ASSERT(num_ptr != NULL);
6326 ASSERT(array_ptr != NULL);
6330 end_ptr = dptr + dlen;
6337 while (tmp_ptr < end_ptr)
6339 name_len = tmp_ptr[3];
6340 tmp_ptr += (name_len + 4);
6344 #ifdef DEBUG_MULTILING_SHORT_NAME_DESC 6345 if (db_print == TRUE)
6347 STB_SI_PRINT((
" Multilingual short name desc: %d entries", num_entries));
6350 USE_UNWANTED_PARAM(db_print);
6355 if (*array_ptr == NULL)
6363 num_entries += *num_ptr;
6371 for (i = *num_ptr; i < num_entries; i++)
6373 dptr = ReadLanguageCode(dptr, &array[i].lang_code);
6376 #ifdef DEBUG_MULTILING_SHORT_NAME_DESC 6378 char *tmp_name_str =
"NULL";
6380 if (db_print == TRUE)
6382 if (array[i].name_str != NULL)
6384 if (array[i].name_str->str_ptr != NULL)
6386 tmp_name_str = (
char *)array[i].name_str->str_ptr;
6390 STB_SI_PRINT((
" lang=%c%c%c, name=%s",
6391 (array[i].lang_code >> 16), (array[i].lang_code >> 8), array[i].lang_code,
6398 *num_ptr = num_entries;
6402 #ifdef DEBUG_MULTILING_SHORT_NAME_DESC 6403 if (db_print == TRUE)
6405 STB_SI_PRINT((
" CAN'T ALLOCATE MEMORY FOR DESCRIPTOR ARRAY ENTRY"));
6412 #ifdef DEBUG_MULTILING_SHORT_NAME_DESC 6413 if (db_print == TRUE)
6415 STB_SI_PRINT((
" Invalid multilingual short name desc: (%d bytes)", dlen));
6420 FUNCTION_FINISH(ParseFreesatShortServiceNameDescriptor);
6431 static U8BIT* ParseFreesatServiceGroupNameDescriptor(U8BIT *dptr,
6436 U8BIT *end_name_loop_ptr;
6440 FUNCTION_START(ParseFreesatServiceGroupNameDescriptor);
6442 #ifndef DEBUG_FREESAT_GROUP_NAME_DESC 6443 USE_UNWANTED_PARAM(db_print);
6448 end_ptr = dptr + dlen;
6450 while (dptr < end_ptr)
6453 if (new_entry != NULL)
6455 memset(new_entry, 0,
sizeof(*new_entry));
6457 new_entry->group_type = (dptr[0] & 0xF8) >> 3;
6458 new_entry->group_id = (((dptr[0] & 0x07) << 8) | dptr[1]);
6461 #ifdef DEBUG_FREESAT_GROUP_NAME_DESC 6464 STB_SI_PRINT((
" Freesat service group name: group type=%d, group ID=%u",
6465 new_entry->group_type, new_entry->group_id));
6470 end_name_loop_ptr = dptr + dlen;
6473 new_entry->num_group_names = 0;
6476 while (temp_dptr < end_name_loop_ptr)
6479 temp_dptr += *temp_dptr;
6481 new_entry->num_group_names++;
6485 new_entry->string_array =
STB_GetMemory(new_entry->num_group_names *
6487 if (new_entry->string_array != NULL)
6489 new_entry->num_group_names = 0;
6491 while (dptr < end_name_loop_ptr)
6493 dptr = ReadLanguageCode(dptr, &new_entry->string_array[new_entry->num_group_names].lang_code);
6495 &new_entry->string_array[new_entry->num_group_names].name_str);
6497 #ifdef DEBUG_FREESAT_GROUP_NAME_DESC 6500 STB_SI_PRINT((
" lang_code = %c%c%c, name = \"%s\"",
6501 new_entry->string_array[new_entry->num_group_names].lang_code >> 16,
6502 new_entry->string_array[new_entry->num_group_names].lang_code >> 8,
6503 new_entry->string_array[new_entry->num_group_names].lang_code & 0xff,
6504 new_entry->string_array[new_entry->num_group_names].name_str->str_ptr));
6507 new_entry->num_group_names++;
6511 new_entry->next_group = *name_list;
6512 *name_list = new_entry;
6516 new_entry->num_group_names = 0;
6526 FUNCTION_FINISH(ParseFreesatServiceGroupNameDescriptor);
6539 static U8BIT* ParseFreesatInteractiveRestrictionDescriptor(U8BIT *dptr, U16BIT **int_res_array,
6540 U8BIT *num_entries, BOOLEAN db_print)
6546 FUNCTION_START(ParseFreesatInteractiveRestrictionDescriptor);
6548 USE_UNWANTED_PARAM(db_print);
6552 end_ptr = dptr + dlen;
6555 *int_res_array =
STB_GetMemory(((dlen / 2) *
sizeof(U16BIT)));
6556 if (*int_res_array != NULL)
6558 while (dptr < end_ptr)
6560 (*int_res_array)[count] = ((dptr[0] << 8) | dptr[1]);
6566 *num_entries = count;
6568 FUNCTION_FINISH(ParseFreesatInteractiveRestrictionDescriptor);
6582 U16BIT *num_entries, BOOLEAN db_print)
6591 FUNCTION_START(ParseFreesatServiceGroupDescriptor);
6593 USE_UNWANTED_PARAM(db_print);
6597 end_ptr = dptr + dlen;
6599 while (dptr < end_ptr)
6601 group_id = ((dptr[0] & 0x07) << 8) | dptr[1];
6604 for (entry_ptr = *serv_array; entry_ptr != NULL; entry_ptr = entry_ptr->next_group)
6606 if (entry_ptr->group_id == group_id)
6613 if (entry_ptr == NULL)
6617 if (entry_ptr != NULL)
6619 memset(entry_ptr, 0,
sizeof(*entry_ptr));
6620 entry_ptr->next_group = *serv_array;
6621 *serv_array = entry_ptr;
6626 if (entry_ptr != NULL)
6628 entry_ptr->non_destructive_flag = ((dptr[0] & 0x80) >> 7);
6629 entry_ptr->return_channel_access_flag = ((dptr[0] & 0x40) >> 6);
6630 entry_ptr->g2_extension_flag = ((dptr[0] & 0x20) >> 5);
6631 entry_ptr->group_id = group_id;
6633 group_size = dptr[2] / 2;
6636 if (group_size != 0)
6639 if (entry_ptr->freesat_id == NULL)
6642 entry_ptr->freesat_id = (U16BIT *)
STB_GetMemory(group_size *
sizeof(U16BIT));
6649 (entry_ptr->num_services + group_size) *
sizeof(U16BIT));
6650 index = entry_ptr->num_services;
6653 if (entry_ptr->freesat_id != NULL)
6656 entry_ptr->num_services += group_size;
6658 for (; group_size > 0; group_size--, index++)
6660 entry_ptr->freesat_id[index] = ((dptr[0] & 0x7F) << 8) | dptr[1];
6666 if (entry_ptr->g2_extension_flag != 0)
6668 entry_ptr->g2_flags = *dptr;
6678 FUNCTION_FINISH(ParseFreesatServiceGroupDescriptor);
6697 static U8BIT* ParseServiceMoveDescriptor(U8BIT *dptr,
SI_SERVICE_MOVE_DESC **desc_ptr, BOOLEAN db_print)
6702 FUNCTION_START(ParseServiceMoveDescriptor);
6706 end_ptr = dptr + dlen;
6710 if ((*desc_ptr == NULL) && (dlen == 6))
6713 if (*desc_ptr != NULL)
6715 (*desc_ptr)->onet_id = (dptr[0] << 8) | dptr[1];
6716 (*desc_ptr)->ts_id = (dptr[2] << 8) | dptr[3];
6717 (*desc_ptr)->service_id = (dptr[4] << 8) | dptr[5];
6719 #ifdef DEBUG_SERVICE_MOVE_DESC 6720 if (db_print == TRUE)
6722 STB_SI_PRINT((
" service move desc: onet=0x%04x, ts=0x%04x, service=0x%04x",
6723 (*desc_ptr)->onet_id, (*desc_ptr)->ts_id, (*desc_ptr)->service_id));
6726 USE_UNWANTED_PARAM(db_print);
6731 FUNCTION_FINISH(ParseServiceMoveDescriptor);
6745 static U8BIT* ParseRctLinkInfo(U8BIT *dptr,
SI_RCT_LINK_INFO *link_info, BOOLEAN db_print)
6754 FUNCTION_START(ParseRctLinkInfo);
6756 #ifndef DEBUG_RCT_LINK_INFO 6757 USE_UNWANTED_PARAM(db_print);
6760 dlen = ((dptr[0] & 0x0f) << 8) | dptr[1];
6762 end_ptr = dptr + dlen;
6768 link_info->link_type = dptr[0] >> 4;
6770 #ifdef DEBUG_RCT_LINK_INFO 6773 STB_SI_PRINT((
" RCT link_info: link_type=0x%x", link_info->link_type));
6778 if (link_info->link_type == RCT_LINK_TYPE_URI)
6780 link_info->how_related = ((dptr[0] & 0x03) << 4) | (dptr[1] >> 4);
6781 link_info->term_id = ((dptr[1] & 0x0f) << 8) | dptr[2];
6782 link_info->group_id = dptr[3] >> 4;
6783 link_info->precedence = dptr[3] & 0x0f;
6785 #ifdef DEBUG_RCT_LINK_INFO 6788 STB_SI_PRINT((
" how_related=0x%02x, term_id=%u, group_id=0x%02x, precedence=%u",
6789 link_info->how_related, link_info->term_id, link_info->group_id, link_info->precedence));
6797 link_info->uri_string = (U8BIT *)
STB_GetMemory(text_len + 1);
6798 if (link_info->uri_string != NULL)
6800 memcpy(link_info->uri_string, dptr, text_len);
6801 link_info->uri_string[text_len] =
'\0';
6802 #ifdef DEBUG_RCT_LINK_INFO 6805 STB_SI_PRINT((
" len=%u, URI=\"%s\"", text_len, link_info->uri_string));
6814 link_info->num_items = dptr[0] & 0x3f;
6817 #ifdef DEBUG_RCT_LINK_INFO 6820 STB_SI_PRINT((
" num promo items=%u", link_info->num_items));
6824 if (link_info->num_items > 0)
6826 link_info->promo_text_array =
6828 if (link_info->promo_text_array != NULL)
6830 for (i = 0; i < link_info->num_items; i++)
6834 dptr = ReadLanguageCode(dptr, &link_info->promo_text_array[i].lang_code);
6835 dptr =
STB_SIReadString(dptr[0], dptr + 1, &link_info->promo_text_array[i].string);
6837 #ifdef DEBUG_RCT_LINK_INFO 6840 STB_SI_PRINT((
" lang=%c%c%c, promo text len=%u bytes",
6841 link_info->promo_text_array[i].lang_code >> 16,
6842 link_info->promo_text_array[i].lang_code >> 8,
6843 link_info->promo_text_array[i].lang_code & 0xff,
6844 link_info->promo_text_array[i].string->nbytes));
6846 if ((*link_info->promo_text_array[i].string->str_ptr >= 0x20) &&
6847 (*link_info->promo_text_array[i].string->str_ptr < 0x7f))
6849 STB_SI_PRINT((
" \"%s\"", link_info->promo_text_array[i].string->str_ptr));
6857 link_info->num_items = 0;
6861 if ((dptr[0] & 0x80) != 0)
6863 link_info->can_use_default_icon = TRUE;
6867 link_info->can_use_default_icon = FALSE;
6870 link_info->icon_id = (dptr[0] & 0x70) >> 4;
6872 #ifdef DEBUG_RCT_LINK_INFO 6875 STB_SI_PRINT((
" default_icon_flag=%u, icon_id=%u", link_info->can_use_default_icon,
6876 link_info->icon_id));
6881 dloop_len = ((dptr[0] & 0x0f) << 8) | dptr[1];
6884 dloop_end = dptr + dloop_len;
6885 while (dptr < dloop_end)
6892 case SHORT_EVENT_DTAG:
6895 dptr = ParseShortEventDescriptor(dptr, &text_len, &link_info->event_desc, DEBUG_RCT_LINK_INFO_VALUE);
6904 case IMAGE_ICON_DTAG:
6906 dptr = ParseImageIconDesc(dptr, &link_info->num_icons, &link_info->icon_array, DEBUG_RCT_LINK_INFO_VALUE);
6912 dptr = SkipDescriptor(dptr, dtag, DEBUG_RCT_LINK_INFO_VALUE);
6921 dptr = SkipDescriptor(dptr, dtag, DEBUG_RCT_LINK_INFO_VALUE);
6928 #ifdef DEBUG_RCT_LINK_INFO 6931 STB_SI_PRINT((
" Invalid RCT link_info, len=%u, descriptor skipped", dlen));
6935 FUNCTION_FINISH(ParseRctLinkInfo);
6948 static U8BIT* ParseImageIconDesc(U8BIT *dptr, U8BIT *num_icons,
SI_IMAGE_ICON_DESC **icon_array, BOOLEAN db_print)
6953 U8BIT desc_num, last_desc_num;
6958 FUNCTION_START(ParseImageIconDesc);
6960 #ifndef DEBUG_IMAGE_ICON_DESC 6961 USE_UNWANTED_PARAM(db_print);
6969 end_ptr = dptr + (dlen - 1);
6973 desc_num = dptr[0] >> 4;
6974 last_desc_num = dptr[0] & 0x0f;
6975 icon_id = dptr[1] & 0x07;
6977 #ifdef DEBUG_IMAGE_ICON_DESC 6980 STB_SI_PRINT((
" Image icon: desc_num=%u, last_desc_num=%u, icon_id=%u", desc_num,
6981 last_desc_num, icon_id));
6991 if (*icon_array != NULL)
6993 icon = &(*icon_array)[*num_icons];
6999 #ifdef DEBUG_IMAGE_ICON_DESC 7002 STB_SI_PRINT((
"Failed to allocate memory for new image icon!"));
7018 icon->desc_num = desc_num;
7019 icon->last_desc_num = last_desc_num;
7020 icon->icon_id = icon_id;
7022 icon->transport_mode = dptr[2] >> 6;
7024 #ifdef DEBUG_IMAGE_ICON_DESC 7027 STB_SI_PRINT((
" transport_mode=%u", icon->transport_mode));
7031 if ((dptr[2] & 0x20) != 0)
7033 icon->position_defined = TRUE;
7034 icon->coord_system = (dptr[2] >> 2) & 0x07;
7035 icon->x_pos = (dptr[3] << 4) | (dptr[4] >> 4);
7036 icon->y_pos = ((dptr[4] & 0x0f) << 8) | dptr[5];
7038 #ifdef DEBUG_IMAGE_ICON_DESC 7041 STB_SI_PRINT((
" coord system=%u, pos=%u,%u", icon->coord_system, icon->x_pos, icon->y_pos));
7047 icon->position_defined = FALSE;
7057 memcpy(icon->icon_type, dptr, data_len);
7058 icon->icon_type[data_len] =
'\0';
7060 #ifdef DEBUG_IMAGE_ICON_DESC 7063 STB_SI_PRINT((
" icon_type=\"%s\"", icon->icon_type));
7068 if (icon->transport_mode == ICON_TRANS_LOCAL)
7070 icon->data_len = dptr[0];
7072 #ifdef DEBUG_IMAGE_ICON_DESC 7075 STB_SI_PRINT((
" %u icon data bytes", icon->data_len));
7078 if (icon->data_len > 0)
7081 if (icon->icon_data != NULL)
7083 memcpy(icon->icon_data, &dptr[1], icon->data_len);
7091 else if (icon->transport_mode == ICON_TRANS_URL)
7093 icon->data_len = dptr[0];
7095 if (icon->data_len > 0)
7101 if (icon->icon_data != NULL)
7103 memcpy(icon->icon_data, &dptr[1], icon->data_len - 1);
7104 icon->icon_data[icon->data_len - 1] =
'\0';
7105 #ifdef DEBUG_IMAGE_ICON_DESC 7108 STB_SI_PRINT((
" icon url=\"%s\"", icon->icon_data));
7123 for (i = 0; i < *num_icons; i++)
7125 if ((*icon_array)[i].icon_id == icon_id)
7127 icon = &(*icon_array)[i];
7130 if ((desc_num == icon->desc_num + 1) && (desc_num <= icon->last_desc_num))
7133 icon->desc_num = desc_num;
7137 #ifdef DEBUG_IMAGE_ICON_DESC 7140 STB_SI_PRINT((
" %u icon data bytes", data_len));
7146 icon->icon_data = (U8BIT *)
STB_ResizeMemory(icon->icon_data, data_len + icon->data_len);
7147 if (icon->icon_data != NULL)
7150 memcpy(icon->icon_data + icon->data_len, &dptr[3], data_len);
7151 icon->data_len += data_len;
7164 #ifdef DEBUG_IMAGE_ICON_DESC 7169 STB_SI_PRINT((
" Image icon: invalid desc len %u", dlen));
7174 FUNCTION_FINISH(ParseImageIconDesc);
7187 static U8BIT* ParseURILinkageDesc(U8BIT *dptr,
SI_URI_LINKAGE_DESC **desc_list, U32BIT private_data_code,
7194 FUNCTION_START(ParseURILinkageDesc);
7196 #ifndef DEBUG_URI_LINKAGE_DESC 7197 USE_UNWANTED_PARAM(db_print);
7202 end_ptr = dptr + dlen;
7215 entry->private_data_code = private_data_code;
7216 entry->uri_linkage_type = *dptr;
7228 if ((entry->uri_linkage_type == 0x00) || (entry->uri_linkage_type == 0x01))
7232 entry->min_polling_interval = (dptr[0] << 8) | dptr[1];
7247 if (entry->private_data != NULL)
7249 entry->private_data_length = dlen;
7250 memcpy(entry->private_data, dptr, dlen);
7256 #ifdef DEBUG_URI_LINKAGE_DESC 7259 STB_SI_PRINT((
" URI linkage desc: type=0x%02x (private_data_specifier 0x%02x)",
7260 entry->uri_linkage_type, entry->private_data_code));
7261 if (entry->uri != NULL)
7263 STB_SI_PRINT((
" URI=\"%s\"", entry->uri->str_ptr));
7265 if ((entry->uri_linkage_type == 0x00) || (entry->uri_linkage_type == 0x01))
7267 STB_SI_PRINT((
" min_polling_interval=%u", entry->min_polling_interval));
7269 STB_SI_PRINT((
" %u bytes of private data", entry->private_data_length));
7274 entry->next = *desc_list;
7279 FUNCTION_FINISH(ParseURILinkageDesc);
7291 static U8BIT* ParseNordigContentProtectionDesc(U8BIT *dptr, U8BIT *protection_level, BOOLEAN db_print)
7296 FUNCTION_START(ParseNordigContentProtectionDesc);
7298 #ifndef DEBUG_NORDIG_CONTENT_PROTECTION_DESC 7299 USE_UNWANTED_PARAM(db_print);
7304 end_ptr = dptr + dlen;
7309 *protection_level = *dptr;
7310 #ifdef DEBUG_NORDIG_CONTENT_PROTECTION_DESC 7313 STB_SI_PRINT((
" Nordig content protection desc: level=0x%02x", *protection_level));
7317 #ifdef DEBUG_NORDIG_CONTENT_PROTECTION_DESC 7320 STB_SI_PRINT((
" Nordig content protection desc: wrong length %u, expected 1", dlen));
7324 FUNCTION_FINISH(ParseNordigContentProtectionDesc);
7337 static U8BIT* SaveCIProtectionDescriptor(U8BIT *dptr, U8BIT **desc, BOOLEAN db_print)
7342 FUNCTION_START(SaveCIProtectionDescriptor);
7344 #ifndef DEBUG_SI_SDT_CONTENT 7345 USE_UNWANTED_PARAM(db_print);
7350 end_ptr = dptr + dlen;
7358 memcpy(*desc, dptr - 2, dlen + 2);
7360 #ifdef DEBUG_SI_SDT_CONTENT 7363 STB_SI_PRINT((
" Failed to allocate %u bytes for CI protection desc", dlen));
7367 #ifdef DEBUG_SI_SDT_CONTENT 7370 STB_SI_PRINT((
" CI protection desc found but service already has one!"));
7374 FUNCTION_FINISH(SaveCIProtectionDescriptor);
7388 static U8BIT* ParseCIPlusServiceDescriptor(U8BIT *dptr, U16BIT *num_services,
7395 FUNCTION_START(ParseCIPlusServiceDescriptor);
7397 #ifndef DEBUG_SI_NIT_CONTENT 7398 USE_UNWANTED_PARAM(db_print);
7403 end_ptr = dptr + dlen;
7411 new_serv->id = (*dptr << 8) + *(dptr + 1);
7414 new_serv->type = *dptr;
7417 if ((*dptr & 0x80) != 0)
7419 new_serv->visible = TRUE;
7422 if ((*dptr & 0x40) != 0)
7424 new_serv->selectable = TRUE;
7427 new_serv->lcn = ((*dptr & 0x3f) << 8) + *(dptr + 1);
7433 #ifdef DEBUG_SI_NIT_CONTENT 7436 STB_SI_PRINT((
" CI+ service: id=%u, type=%u, visible=%u, selectable=%u, lcn=%u",
7437 new_serv->id, new_serv->type, new_serv->visible, new_serv->selectable, new_serv->lcn));
7438 if (new_serv->name_str != NULL)
7440 STB_SI_PRINT((
" Name=\"%s\"", new_serv->name_str->str_ptr));
7442 if (new_serv->provider_str != NULL)
7444 STB_SI_PRINT((
" Provider=\"%s\"", new_serv->provider_str->str_ptr));
7450 if (*num_services == 0)
7452 *service_list = new_serv;
7456 (*last_service)->next = new_serv;
7459 *last_service = new_serv;
7462 #ifdef DEBUG_SI_NIT_CONTENT 7465 STB_SI_PRINT((
" CI+ service: Failed to allocate %u bytes",
sizeof(
SI_CIPLUS_SERVICE)));
7469 #ifdef DEBUG_SI_NIT_CONTENT 7472 STB_SI_PRINT((
" CI+ service: Expected a minimum of 7 bytes, but desc is %u bytes", dlen));
7476 USE_UNWANTED_PARAM(dptr);
7477 FUNCTION_FINISH(ParseCIPlusServiceDescriptor);
7489 static U8BIT* ParseCIPlusVirtualChannelDescriptor(U8BIT *dptr,
7496 FUNCTION_START(ParseCIPlusVirtualChannelDescriptor);
7498 #ifndef DEBUG_SI_NIT_CONTENT 7499 USE_UNWANTED_PARAM(db_print);
7504 end_ptr = dptr + dlen;
7512 v_chan->lcn = ((*dptr & 0x3f) << 8) + *(dptr + 1);
7520 v_chan->event_info = (U8BIT *)
STB_GetMemory(dlen *
sizeof(U8BIT));
7521 if (v_chan->event_info != NULL)
7523 memcpy(v_chan->event_info, dptr, dlen);
7524 v_chan->event_info_len = dlen;
7530 v_chan->app_domain_id = (U8BIT *)
STB_GetMemory((dlen+1) *
sizeof(U8BIT));
7531 if (v_chan->app_domain_id != NULL)
7533 memcpy(v_chan->app_domain_id, dptr, dlen);
7534 v_chan->app_domain_id[dlen] = 0;
7535 v_chan->app_domain_len = dlen;
7538 #ifdef DEBUG_SI_NIT_CONTENT 7541 STB_SI_PRINT((
" CI+ virtual: lcn=%u", v_chan->lcn));
7542 if (v_chan->name_str != NULL)
7544 STB_SI_PRINT((
" Name=\"%s\"", v_chan->name_str->str_ptr));
7546 if (v_chan->provider_str != NULL)
7548 STB_SI_PRINT((
" Provider=\"%s\"", v_chan->provider_str->str_ptr));
7550 if (v_chan->event_info != NULL)
7552 STB_SI_PRINT((
" Event Info=\"%s\"", v_chan->event_info));
7554 if (v_chan->app_domain_id != NULL)
7556 STB_SI_PRINT((
" AppDomainId=\"%s\"", v_chan->app_domain_id));
7561 *virtual_chan = v_chan;
7563 #ifdef DEBUG_SI_NIT_CONTENT 7570 #ifdef DEBUG_SI_NIT_CONTENT 7573 STB_SI_PRINT((
" CI+ virtual: Expected a minimum of 6 bytes, but desc is %u bytes", dlen));
7577 FUNCTION_FINISH(ParseCIPlusVirtualChannelDescriptor);
7595 static float BCDToFloat(U8BIT *data_ptr, U8BIT len, U8BIT point)
7601 FUNCTION_START(BCDToFloat);
7603 ASSERT(data_ptr != NULL);
7605 for (i = 0; i < point; i++)
7608 for (i = 0; i < len; i++)
7611 ival = (data_ptr[i / 2] & 0x0f);
7613 ival = ((data_ptr[i / 2] >> 4) & 0x0f);
7614 fval += ((float)ival * mult);
7618 FUNCTION_FINISH(BCDToFloat);
7634 country_private_data_specifier_code = code;
7635 STB_SI_PRINT((
"Set country private data specifier 0x%08x", code));
7646 FUNCTION_START(STB_SISetPrivateDataSpecifier);
7648 freesat_private_data_specifier = mode;
7650 FUNCTION_FINISH(STB_SISetPrivateDataSpecifier);
7659 FUNCTION_START(STB_SISetPrivateDataSpecifier);
7661 ciplus_private_data_specifier = mode;
7663 FUNCTION_FINISH(STB_SISetPrivateDataSpecifier);
7672 FUNCTION_START(STB_SISetPrivateDataSpecifier);
7674 eacem_private_data_specifier = mode;
7676 FUNCTION_FINISH(STB_SISetPrivateDataSpecifier);
7685 FUNCTION_START(STB_SISetPrivateDataSpecifier);
7687 nzsat_private_data_specifier = mode;
7689 FUNCTION_FINISH(STB_SISetPrivateDataSpecifier);
7700 nordig_private_data_specifier = mode;
7721 if ((FIRST_USER_DEFINED_DTAG <= dtag) && (dtag <= LAST_USER_DEFINED_DTAG))
7723 user_defined_dtag_function[dtag - FIRST_USER_DEFINED_DTAG] = func;
7729 case USER_DEF_DESCRIP_NOT_USED: {func_str = (U8BIT *)
"not used";
break; }
7730 case USER_DEF_DESCRIP_LOGICAL_CHAN_NUM: {func_str = (U8BIT *)
"logical chan num";
break; }
7731 case USER_DEF_DESCRIP_PREF_NAME_LIST: {func_str = (U8BIT *)
"pref name list";
break; }
7732 case USER_DEF_DESCRIP_PREF_NAME_ID: {func_str = (U8BIT *)
"pref name id";
break; }
7733 default: {func_str = (U8BIT *)
"INVALID";
break; }
7735 STB_SI_PRINT((
"Set user defined descriptor: 0x%02x = %s", dtag, func_str));
7751 for (index = FIRST_USER_DEFINED_DTAG; index <= LAST_USER_DEFINED_DTAG; index++)
7753 user_defined_dtag_function[index - FIRST_USER_DEFINED_DTAG] = USER_DEF_DESCRIP_NOT_USED;
7774 void (*callback)(
void *, U32BIT,
SI_TABLE_RECORD *), U32BIT ret_param)
7780 #ifdef DEBUG_SI_PAT_REQUEST 7781 STB_SI_PRINT((
"STB_SIRequestPat: path %d", path));
7785 SI_XTID_MATCH_DONT_CARE, SI_XTID_MASK_DONT_CARE, req_type,
7786 SI_BUFFER_4K, TRUE, FALSE, callback, ret_param);
7789 return((
void *)filter_ptr);
7811 U16BIT sid_match, U16BIT sid_mask, U16BIT table_count,
7812 void (*callback)(
void *, U32BIT,
SI_TABLE_RECORD *), U32BIT ret_param)
7818 #ifdef DEBUG_SI_PMT_REQUEST 7819 STB_SI_PRINT((
"STB_SIRequestPmt: path %d pid 0x%04x sid 0x%04x[0x%04x]",
7820 path, pmt_pid, sid_match, sid_mask));
7822 filter_ptr =
STB_SIRequestTable(path, pmt_pid, SI_PMT_TID, 0xff, MULTI_SECT, table_count,
7823 sid_match, sid_mask, req_type, SI_BUFFER_4K, TRUE, FALSE,
7824 callback, ret_param);
7827 return((
void *)filter_ptr);
7848 #ifdef DEBUG_SI_PMT_REQUEST 7849 STB_SI_PRINT((
"STB_SIModifyPmtRequest: sid 0x%04x[0x%04x]", sid_match, sid_mask));
7871 void (*callback)(
void *, U32BIT,
SI_TABLE_RECORD *), U32BIT ret_param)
7877 #ifdef DEBUG_SI_NIT_REQUEST 7878 STB_SI_PRINT((
"STB_SIRequestNit: path %d pid 0x%04x", path, SI_NIT_PID));
7881 filter_ptr =
STB_SIRequestTable(path, SI_NIT_PID, SI_NIT_ACTUAL_TID, 0xff, MULTI_SECT, 1,
7882 SI_XTID_MATCH_DONT_CARE, SI_XTID_MASK_DONT_CARE, req_type,
7883 SI_BUFFER_4K, TRUE, FALSE, callback, ret_param);
7886 return((
void *)filter_ptr);
7900 void (*callback)(
void *, U32BIT,
SI_TABLE_RECORD *), U32BIT ret_param)
7907 #ifdef DEBUG_SI_NIT_REQUEST 7908 STB_SI_PRINT((
"STB_SIRequestNit: path %d pid 0x%04x", path, pid));
7913 tid = SI_NIT_ACTUAL_TID;
7917 tid = SI_NIT_OTHER_TID;
7921 SI_XTID_MATCH_DONT_CARE, SI_XTID_MASK_DONT_CARE, req_type,
7922 SI_BUFFER_4K, TRUE, FALSE, callback, ret_param);
7939 void (*callback)(
void *, U32BIT,
SI_TABLE_RECORD *), U32BIT ret_param)
7945 #ifdef DEBUG_SI_NIT_REQUEST 7946 STB_SI_PRINT((
"STB_SIRequestNitWithId: path %d pid 0x%04x", path, SI_NIT_PID));
7949 filter_ptr =
STB_SIRequestTable(path, SI_NIT_PID, SI_NIT_ACTUAL_TID, 0xfe, MULTI_SECT, 1,
7950 network_id, 0xffff, req_type, SI_BUFFER_4K, TRUE, FALSE, callback, ret_param);
7954 return((
void *)filter_ptr);
7977 BOOLEAN inc_sdt_actual, BOOLEAN inc_sdt_other,
7978 U16BIT tran_id_match, U16BIT tran_id_mask, U16BIT table_count,
7979 void (*callback)(
void *, U32BIT,
SI_TABLE_RECORD *), U32BIT ret_param)
7988 tid_match = SI_SDT_ACTUAL_TID;
7991 if (inc_sdt_other == TRUE)
7993 tid_match = SI_SDT_OTHER_TID;
7994 if (inc_sdt_actual == TRUE)
7996 tid_mask = (U8BIT)(~(SI_SDT_ACTUAL_TID ^ SI_SDT_OTHER_TID));
8000 #ifdef DEBUG_SI_SDT_REQUEST 8001 STB_SI_PRINT((
"STB_SIRequestSdt: path %d pid 0x%04x tid 0x%02x[0x%02x] tran_id 0x%04x[0x%04x]",
8002 path, SI_SDT_PID, tid_match, tid_mask, tran_id_match, tran_id_mask));
8005 filter_ptr =
STB_SIRequestTable(path, SI_SDT_PID, tid_match, tid_mask, MULTI_SECT, table_count,
8006 tran_id_match, tran_id_mask, req_type, SI_BUFFER_4K,
8007 TRUE, FALSE, callback, ret_param);
8010 return((
void *)filter_ptr);
8034 BOOLEAN inc_sdt_actual, BOOLEAN inc_sdt_other,
8035 U16BIT tran_id_match, U16BIT tran_id_mask, U16BIT table_count,
8036 void (*callback)(
void *, U32BIT,
SI_TABLE_RECORD *), U32BIT ret_param)
8045 tid_match = SI_SDT_ACTUAL_TID;
8048 if (inc_sdt_other == TRUE)
8050 tid_match = SI_SDT_OTHER_TID;
8051 if (inc_sdt_actual == TRUE)
8053 tid_mask = (U8BIT)(~(SI_SDT_ACTUAL_TID ^ SI_SDT_OTHER_TID));
8057 #ifdef DEBUG_SI_SDT_REQUEST 8058 STB_SI_PRINT((
"STB_SIRequestSdt: path %d pid 0x%04x tid 0x%02x[0x%02x] tran_id 0x%04x[0x%04x]",
8059 path, pid, tid_match, tid_mask, tran_id_match, tran_id_mask));
8062 filter_ptr =
STB_SIRequestTable(path, pid, tid_match, tid_mask, MULTI_SECT, table_count,
8063 tran_id_match, tran_id_mask, req_type, SI_BUFFER_4K,
8064 TRUE, FALSE, callback, ret_param);
8067 return((
void *)filter_ptr);
8087 U16BIT tran_id_match, U16BIT tran_id_mask, U16BIT table_count)
8094 tid_match = SI_SDT_ACTUAL_TID;
8097 if (inc_sdt_other == TRUE)
8099 tid_match = SI_SDT_OTHER_TID;
8100 if (inc_sdt_actual == TRUE)
8102 tid_mask = (U8BIT)(~(SI_SDT_ACTUAL_TID ^ SI_SDT_OTHER_TID));
8106 #ifdef DEBUG_SI_SDT_REQUEST 8107 STB_SI_PRINT((
"STB_SIModifySdtRequest: tid 0x%02x[0x%02x] tran_id 0x%04x[0x%04x]",
8108 tid_match, tid_mask, tran_id_match, tran_id_mask));
8134 U16BIT bouquet_id_mask, U16BIT table_count,
void (*callback)(
void *, U32BIT,
SI_TABLE_RECORD *),
8141 #ifdef DEBUG_SI_BAT_REQUEST 8142 STB_SI_PRINT((
"STB_SIRequestBat: path %d pid 0x%04x tid 0x%02x[0xff] tran_id 0x%04x[0x%04x]",
8143 path, SI_BAT_PID, SI_BAT_TID, bouquet_id_match, bouquet_id_mask));
8146 filter_ptr =
STB_SIRequestTable(path, SI_BAT_PID, SI_BAT_TID, 0xff, MULTI_SECT, table_count,
8147 bouquet_id_match, bouquet_id_mask, req_type, SI_BUFFER_4K,
8148 TRUE, FALSE, callback, ret_param);
8151 return((
void *)filter_ptr);
8173 U16BIT bouquet_id_match, U16BIT bouquet_id_mask, U16BIT table_count,
8174 void (*callback)(
void *, U32BIT,
SI_TABLE_RECORD *), U32BIT ret_param)
8181 tid_match = SI_BAT_TID;
8183 #ifdef DEBUG_SI_BAT_REQUEST 8184 STB_SI_PRINT((
"STB_SIRequestBat: path %d pid 0x%04x tid 0x%02x[0xff] tran_id 0x%04x[0x%04x]",
8185 path, pid, tid_match, bouquet_id_match, bouquet_id_mask));
8189 bouquet_id_match, bouquet_id_mask, req_type, SI_BUFFER_4K,
8190 TRUE, FALSE, callback, ret_param);
8193 return((
void *)filter_ptr);
8214 void*
STB_SIRequestEit(U8BIT path, E_SI_REQUEST_TYPE req_type, E_SI_EIT_TABLE_REQ reqd_eit_tables,
8215 U16BIT sid_match, U16BIT sid_mask, U16BIT table_count,
8216 void (*callback)(
void *, U32BIT,
SI_TABLE_RECORD *), U32BIT ret_param)
8222 #ifdef DEBUG_SI_EIT_REQUEST 8223 STB_SI_PRINT((
"STB_SIRequestEit: path %d pid 0x%04x tid 0x%02x[0x%02x] tran_id 0x%04x[0x%04x]",
8224 path, SI_EIT_PID, eit_tid_match[reqd_eit_tables], eit_tid_mask[reqd_eit_tables],
8225 sid_match, sid_mask));
8229 eit_tid_mask[reqd_eit_tables], MULTI_SECT, table_count,
8230 sid_match, sid_mask, req_type, SI_BUFFER_8K, TRUE, TRUE,
8231 callback, ret_param);
8234 return((
void *)filter_ptr);
8257 U16BIT sid_match, U16BIT sid_mask, U16BIT table_count,
8258 void (*callback)(
void *, U32BIT,
SI_TABLE_RECORD *), U32BIT ret_param)
8264 #ifdef DEBUG_SI_EIT_REQUEST 8265 STB_SI_PRINT((
"STB_SIRequestEit: path %d pid 0x%04x tid 0x%02x[0x%02x] tran_id 0x%04x[0x%04x]",
8266 path, pid, eit_tid_match[reqd_eit_tables], eit_tid_mask[reqd_eit_tables],
8267 sid_match, sid_mask));
8271 eit_tid_mask[reqd_eit_tables], MULTI_SECT, table_count,
8272 sid_match, sid_mask, req_type, SI_BUFFER_8K, TRUE, TRUE,
8273 callback, ret_param);
8276 return((
void *)filter_ptr);
8295 U16BIT sid_match, U16BIT sid_mask, U16BIT table_count)
8299 #ifdef DEBUG_SI_EIT_REQUEST 8300 STB_SI_PRINT((
"STB_SIModifyEitRequest: tid 0x%02x[0x%02x] tran_id 0x%04x[0x%04x]",
8301 eit_tid_match[reqd_eit_tables], eit_tid_mask[reqd_eit_tables],
8302 sid_match, sid_mask));
8306 sid_match, sid_mask, table_count);
8330 U16BIT sid_match, U16BIT sid_mask, U16BIT table_count,
8331 void (*callback)(
void *, U32BIT,
SI_TABLE_RECORD *), U32BIT ret_param)
8337 #ifdef DEBUG_SI_EIT_REQUEST 8338 STB_SI_PRINT((
"STB_SIRequestSched: path %d tid 0x%02x[0x%02x] tran_id 0x%04x[0x%04x]",
8339 path, sched_tid_match[reqd_eit_tables], sched_tid_mask[reqd_eit_tables],
8340 sid_match, sid_mask));
8344 sched_tid_mask[reqd_eit_tables], MULTI_SECT, table_count,
8345 sid_match, sid_mask, req_type, SI_BUFFER_32K, TRUE, TRUE,
8346 callback, ret_param);
8349 return((
void *)filter_ptr);
8372 U16BIT sid_match, U16BIT sid_mask, U16BIT table_count,
8373 void (*callback)(
void *, U32BIT,
SI_TABLE_RECORD *), U32BIT ret_param)
8379 #ifdef DEBUG_SI_EIT_REQUEST 8380 STB_SI_PRINT((
"STB_SIRequestSched: path %d tid 0x%02x[0x%02x] tran_id 0x%04x[0x%04x]",
8381 path, sched_tid_match[reqd_eit_tables], sched_tid_mask[reqd_eit_tables],
8382 sid_match, sid_mask));
8386 sched_tid_mask[reqd_eit_tables], MULTI_SECT, table_count,
8387 sid_match, sid_mask, req_type, SI_BUFFER_64K, TRUE, TRUE,
8388 callback, ret_param);
8391 return((
void *)filter_ptr);
8409 void (*callback)(
void *, U32BIT,
SI_TABLE_RECORD *), U32BIT ret_param)
8415 #ifdef DEBUG_SI_TDT_REQUEST 8416 STB_SI_PRINT((
"STB_SIRequestTdt: path %d pid 0x%04x", path, SI_TDT_PID));
8420 SI_XTID_MATCH_DONT_CARE, SI_XTID_MASK_DONT_CARE, req_type,
8421 SI_BUFFER_1K, FALSE, FALSE, callback, ret_param);
8424 return((
void *)filter_ptr);
8443 void (*callback)(
void *, U32BIT,
SI_TABLE_RECORD *), U32BIT ret_param)
8449 #ifdef DEBUG_SI_TDT_REQUEST 8450 STB_SI_PRINT((
"STB_SIRequestTdt: path %d pid 0x%04x", path, pid));
8454 SI_XTID_MATCH_DONT_CARE, SI_XTID_MASK_DONT_CARE, req_type,
8455 SI_BUFFER_1K, FALSE, FALSE, callback, ret_param);
8458 return((
void *)filter_ptr);
8476 void (*callback)(
void *, U32BIT,
SI_TABLE_RECORD *), U32BIT ret_param)
8482 #ifdef DEBUG_SI_TOT_REQUEST 8483 STB_SI_PRINT((
"STB_SIRequestTot: path %d pid 0x%04x", path, SI_TOT_PID));
8487 SI_XTID_MATCH_DONT_CARE, SI_XTID_MASK_DONT_CARE, req_type,
8488 SI_BUFFER_1K, TRUE, FALSE, callback, ret_param);
8491 return((
void *)filter_ptr);
8509 void (*callback)(
void *, U32BIT,
SI_TABLE_RECORD *), U32BIT ret_param)
8515 #ifdef DEBUG_SI_TOT_REQUEST 8516 STB_SI_PRINT((
"STB_SIRequestTot: path %d pid 0x%04x", path, pid));
8520 SI_XTID_MATCH_DONT_CARE, SI_XTID_MASK_DONT_CARE, req_type,
8521 SI_BUFFER_1K, TRUE, FALSE, callback, ret_param);
8524 return((
void *)filter_ptr);
8542 void (*callback)(
void *, U32BIT,
SI_TABLE_RECORD *), U32BIT ret_param)
8548 #ifdef DEBUG_SI_CAT_REQUEST 8549 STB_SI_PRINT((
"STB_SIRequestCat: path %d pid 0x%04x", path, SI_CAT_PID));
8553 SI_XTID_MATCH_DONT_CARE, SI_XTID_MASK_DONT_CARE, req_type,
8554 SI_BUFFER_4K, TRUE, FALSE, callback, ret_param);
8557 return((
void *)filter_ptr);
8576 void (*callback)(
void *, U32BIT,
SI_TABLE_RECORD *), U32BIT ret_param)
8582 #ifdef DEBUG_SI_RCT_REQUEST 8583 STB_SI_PRINT((
"STB_SIRequestRct: path %d pid 0x%04x", path, rct_pid));
8586 SI_XTID_MATCH_DONT_CARE, SI_XTID_MASK_DONT_CARE, req_type,
8587 SI_BUFFER_4K, TRUE, FALSE, callback, ret_param);
8591 return((
void *)filter_ptr);
8623 ASSERT(table_rec != NULL);
8626 if (table_rec != NULL)
8628 if (table_rec->tid == SI_PAT_TID)
8630 #ifdef DEBUG_SI_PAT_SUMMARY 8631 STB_SI_PRINT((
"STB_SIParsePatTable: tid 0x%02x/0x%04x, v%d, nsect %d",
8632 table_rec->tid, table_rec->xtid, table_rec->version,
8633 table_rec->num_sect));
8638 if (pat_table != NULL)
8642 pat_table->version = table_rec->version;
8643 pat_table->tran_id = table_rec->xtid;
8645 section_rec = table_rec->section_list;
8646 while (section_rec != NULL)
8648 #ifdef DEBUG_SI_PAT_CONTENT 8649 STB_SI_PRINT((
" section %d", section_rec->sect_num));
8653 data_ptr = &(section_rec->data_start);
8654 data_end = data_ptr + section_rec->data_len - 4;
8659 while (data_ptr < data_end)
8663 prog_no = (data_ptr[0] << 8) | data_ptr[1];
8664 pmt_pid = ((data_ptr[2] & 0x1f) << 8) | data_ptr[3];
8670 serv_entry = pat_table->service_list;
8671 while (serv_entry != NULL)
8673 if ((serv_entry->serv_id == prog_no) && (serv_entry->pmt_pid == pmt_pid))
8675 #ifdef DEBUG_SI_PAT_CONTENT 8676 STB_SI_PRINT((
" sid=0x%04x, pmt=0x%04x - duplicated", prog_no,
8681 serv_entry = serv_entry->next;
8683 if (serv_entry == NULL)
8687 if (serv_entry != NULL)
8689 serv_entry->next = NULL;
8690 serv_entry->serv_id = prog_no;
8691 serv_entry->pmt_pid = pmt_pid;
8694 if (pat_table->last_service_entry == NULL)
8697 pat_table->service_list = serv_entry;
8702 pat_table->last_service_entry->next = serv_entry;
8704 pat_table->last_service_entry = serv_entry;
8705 pat_table->num_services++;
8707 #ifdef DEBUG_SI_PAT_CONTENT 8708 STB_SI_PRINT((
" sid=0x%04x, pmt=0x%04x", prog_no, pmt_pid));
8715 section_rec = section_rec->next;
8748 U32BIT priv_data_code;
8752 ASSERT(table_rec != NULL);
8755 if (table_rec != NULL)
8757 if (table_rec->tid == SI_PMT_TID)
8759 #ifdef DEBUG_SI_PMT_SUMMARY 8760 STB_SI_PRINT((
"STB_SIParsePmtTable: tid 0x%02x/0x%04x, v%d, nsect %d",
8761 table_rec->tid, table_rec->xtid, table_rec->version,
8762 table_rec->num_sect));
8766 if (pmt_table != NULL)
8770 pmt_table->version = table_rec->version;
8771 pmt_table->serv_id = table_rec->xtid;
8773 section_rec = table_rec->section_list;
8774 while (section_rec != NULL)
8776 #ifdef DEBUG_SI_PMT_CONTENT 8777 STB_SI_PRINT((
" section %d", section_rec->sect_num));
8781 data_ptr = &(section_rec->data_start);
8782 data_end = data_ptr + section_rec->data_len - 4;
8788 pmt_table->pcr_pid = ((data_ptr[0] & 0x1f) << 8) | data_ptr[1];
8789 dloop_len = ((data_ptr[2] & 0x0f) << 8) | data_ptr[3];
8792 #ifdef DEBUG_SI_PMT_CONTENT 8793 STB_SI_PRINT((
" pcr pid=0x%04x (first loop len %d)", pmt_table->pcr_pid,
8795 STB_SI_PRINT((
" {"));
8801 pmt_table->content_protection_level = 0x01;
8805 dloop_end = data_ptr + dloop_len;
8806 while (data_ptr < dloop_end)
8810 #ifdef DEBUG_SI_PMT_CONTENT 8813 STB_SI_PRINT((
" tag %02x len %04x", dtag, *data_ptr));
8821 data_ptr = ParseCaDescriptor(data_ptr, &pmt_table->num_ca_entries,
8822 &pmt_table->ca_desc_array, DEBUG_SI_PMT_CONTENT_VALUE);
8826 case PRIV_DATA_INDICATOR_DTAG:
8830 data_ptr = SkipDescriptor(data_ptr, dtag, DEBUG_SI_PMT_CONTENT_VALUE);
8835 case PRIV_DATA_SPEC_DTAG:
8837 data_ptr = ParsePrivateDataSpecifierDescriptor(data_ptr, &priv_data_code, DEBUG_SI_PMT_CONTENT_VALUE);
8841 case FREESAT_TUNNELLED_DTAG:
8843 if ((priv_data_code == FREESAT_PRIVATE_DATA_SPECIFIER) &&
8844 (freesat_private_data_specifier == TRUE))
8846 data_ptr = ParseFreesatTunnelledDataDescriptor(data_ptr,
8847 &pmt_table->num_tunnelled_entries,
8848 &pmt_table->tunnelled_desc_array,
8849 FALSE, DEBUG_SI_PMT_CONTENT_VALUE);
8853 data_ptr = SkipDescriptor(data_ptr, dtag, DEBUG_SI_PMT_CONTENT_VALUE);
8858 case USER_DEFINED_DTAG_0xA0:
8860 if (nordig_private_data_specifier)
8863 data_ptr = ParseNordigContentProtectionDesc(data_ptr,
8864 &pmt_table->content_protection_level, DEBUG_SI_PMT_CONTENT_VALUE);
8868 data_ptr = SkipDescriptor(data_ptr, dtag, DEBUG_SI_PMT_CONTENT_VALUE);
8875 data_ptr = SkipDescriptor(data_ptr, dtag, DEBUG_SI_PMT_CONTENT_VALUE);
8880 #ifdef DEBUG_SI_PMT_CONTENT 8881 STB_SI_PRINT((
" }"));
8885 while (data_ptr < data_end)
8888 if (stream_entry != NULL)
8894 if (pmt_table->last_stream_entry == NULL)
8897 pmt_table->stream_list = stream_entry;
8902 pmt_table->last_stream_entry->next = stream_entry;
8904 pmt_table->last_stream_entry = stream_entry;
8905 pmt_table->num_streams++;
8908 stream_entry->type = data_ptr[0];
8909 stream_entry->pid = ((data_ptr[1] & 0x1f) << 8) | data_ptr[2];
8910 dloop_len = ((data_ptr[3] & 0x0f) << 8) | data_ptr[4];
8913 stream_entry->carousel_id = DVB_INVALID_CAROUSEL_ID;
8915 #ifdef DEBUG_SI_PMT_CONTENT 8916 STB_SI_PRINT((
" type=0x%02x, pid=0x%02x (desc loop len %d)",
8917 stream_entry->type, stream_entry->pid, dloop_len));
8918 STB_SI_PRINT((
" {"));
8923 dloop_end = data_ptr + dloop_len;
8924 while ((data_ptr < dloop_end) && (data_ptr < data_end))
8928 #ifdef DEBUG_SI_PMT_CONTENT 8931 STB_SI_PRINT((
" tag %02x len %04x", dtag, *data_ptr));
8937 case CAROUSEL_ID_DTAG:
8939 if ((stream_entry->type == SI_STREAM_TYPE_DATA_B) ||
8940 (stream_entry->type == SI_STREAM_TYPE_DATA_C) ||
8941 (stream_entry->type == SI_STREAM_TYPE_DATA_D))
8943 data_ptr = ParseCarouselIdDescriptor(data_ptr,
8944 &stream_entry->carousel_id, DEBUG_SI_PMT_CONTENT_VALUE);
8948 data_ptr = SkipDescriptor(data_ptr, dtag, DEBUG_SI_PMT_CONTENT_VALUE);
8955 data_ptr = ParseCaDescriptor(data_ptr, &stream_entry->num_ca_entries,
8956 &stream_entry->ca_desc_array, DEBUG_SI_PMT_CONTENT_VALUE);
8962 data_ptr = ParseIsoLangDescriptor(data_ptr,
8963 &stream_entry->num_iso_lang_entries,
8964 &stream_entry->iso_lang_desc_array, DEBUG_SI_PMT_CONTENT_VALUE);
8968 case STREAM_ID_DTAG:
8970 data_ptr = ParseStreamIdDescriptor(data_ptr, &stream_entry->tag_array_ptr,
8971 &stream_entry->num_tag_entries, DEBUG_SI_PMT_CONTENT_VALUE);
8977 data_ptr = ParseSubtitleDescriptor(data_ptr,
8978 &stream_entry->num_subtitle_entries,
8979 &stream_entry->subtitle_desc_array, DEBUG_SI_PMT_CONTENT_VALUE);
8985 data_ptr = ParseTeletextDescriptor(data_ptr,
8986 &stream_entry->num_teletext_entries,
8987 &stream_entry->teletext_desc_array, DEBUG_SI_PMT_CONTENT_VALUE);
8991 case PRIV_DATA_INDICATOR_DTAG:
8995 data_ptr = SkipDescriptor(data_ptr, dtag, DEBUG_SI_PMT_CONTENT_VALUE);
9000 case PRIV_DATA_SPEC_DTAG:
9002 data_ptr = ParsePrivateDataSpecifierDescriptor(data_ptr,
9003 &priv_data_code, DEBUG_SI_PMT_CONTENT_VALUE);
9010 stream_entry->tag_array_ptr = (U8BIT *)
STB_GetMemory(
sizeof(U8BIT));
9011 stream_entry->tag_array_ptr[0] = dtag;
9012 stream_entry->num_tag_entries = 1;
9013 data_ptr = ParseAC3Descriptor(data_ptr, dtag,
9014 &stream_entry->ac3_descriptor, DEBUG_SI_PMT_CONTENT_VALUE);
9020 data_ptr = ParseAACDescriptor(data_ptr,
9021 &stream_entry->aac_descriptor, DEBUG_SI_PMT_CONTENT_VALUE);
9028 switch (data_ptr[1])
9030 case SUPPLEMENTARY_AUDIO_DTAG:
9031 data_ptr = ParseSupplementaryAudioDescriptor(data_ptr,
9032 &stream_entry->audio_desc, DEBUG_SI_PMT_CONTENT_VALUE);
9036 data_ptr = SkipDescriptor(data_ptr, dtag, DEBUG_SI_PMT_CONTENT_VALUE);
9042 case FREESAT_ALT_TUNNELLED_DTAG:
9044 if ((priv_data_code == FREESAT_PRIVATE_DATA_SPECIFIER) &&
9045 (freesat_private_data_specifier == TRUE) &&
9046 ((stream_entry->type == SI_STREAM_TYPE_PRIVATE) ||
9047 (stream_entry->type == SI_STREAM_TYPE_DATA_B)))
9049 data_ptr = ParseFreesatTunnelledDataDescriptor(data_ptr,
9050 &stream_entry->num_tunnelled_entries,
9051 &stream_entry->tunnelled_desc_array,
9052 TRUE, DEBUG_SI_PMT_CONTENT_VALUE);
9056 data_ptr = SkipDescriptor(data_ptr, dtag, DEBUG_SI_PMT_CONTENT_VALUE);
9062 case SERVICE_MOVE_DTAG:
9064 data_ptr = ParseServiceMoveDescriptor(data_ptr,
9065 &stream_entry->service_move, DEBUG_SI_PMT_CONTENT_VALUE);
9074 if (stream_entry->type == SI_STREAM_TYPE_PRIVATE)
9078 stream_entry->has_ait = TRUE;
9080 data_ptr = ParseAppSignallingDescriptor(data_ptr,
9081 &stream_entry->num_app_sig_entries, &stream_entry->app_sig_desc_array, DEBUG_SI_PMT_CONTENT_VALUE);
9086 data_ptr = SkipDescriptor(data_ptr, dtag, DEBUG_SI_PMT_CONTENT_VALUE);
9091 case RELATED_CONTENT_DTAG:
9095 if (stream_entry->type == SI_STREAM_TYPE_PRIVATE)
9099 stream_entry->has_rct = TRUE;
9103 data_ptr = SkipDescriptor(data_ptr, dtag, FALSE);
9109 #ifdef DEBUG_SI_PMT_CONTENT 9112 U8BIT *dptr = data_ptr + 1;
9115 STB_SI_PRINT((
" loop2: dtag 0x%02x, len %u\n", dtag, *data_ptr));
9116 for (len = 0; len < *data_ptr; dptr++, len++)
9118 STB_SI_PRINT((
" %02x", *dptr));
9122 data_ptr = SkipDescriptor(data_ptr, dtag, DEBUG_SI_PMT_CONTENT_VALUE);
9127 #ifdef DEBUG_SI_PMT_CONTENT 9128 STB_SI_PRINT((
" }"));
9133 section_rec = section_rec->next;
9164 U32BIT priv_data_code;
9169 ASSERT(table_rec != NULL);
9172 if (table_rec != NULL)
9174 if ((table_rec->tid == SI_NIT_ACTUAL_TID) || (table_rec->tid == SI_NIT_OTHER_TID))
9176 #ifdef DEBUG_SI_NIT_SUMMARY 9177 STB_SI_PRINT((
"STB_SIParseNitTable: tid 0x%02x/0x%04x, v%d, nsect %d",
9178 table_rec->tid, table_rec->xtid, table_rec->version, table_rec->num_sect));
9182 if (nit_table != NULL)
9186 nit_table->version = table_rec->version;
9187 nit_table->net_id = table_rec->xtid;
9189 section_rec = table_rec->section_list;
9190 while (section_rec != NULL)
9192 #ifdef DEBUG_SI_NIT_CONTENT 9193 STB_SI_PRINT((
" section %d", section_rec->sect_num));
9197 data_ptr = &(section_rec->data_start);
9198 data_end = data_ptr + section_rec->data_len - 4;
9204 dloop_len = ((data_ptr[0] & 0x0f) << 8) | data_ptr[1];
9207 #ifdef DEBUG_SI_NIT_CONTENT 9208 STB_SI_PRINT((
" (first loop len %d)", dloop_len));
9213 dloop_end = data_ptr + dloop_len;
9214 while (data_ptr < dloop_end)
9218 #ifdef DEBUG_SI_NIT_CONTENT 9219 STB_SI_PRINT((
" dtag=0x%02x", (
int)dtag));
9227 data_ptr = ParseNetNameDescriptor(data_ptr, &nit_table->name_str, DEBUG_SI_NIT_CONTENT_VALUE);
9231 case MULTILING_NET_NAME_DTAG:
9233 data_ptr = ParseMultilingNetNameDescriptor(data_ptr,
9234 &nit_table->num_multiling_net_names,
9235 &nit_table->multiling_net_name_desc_array, DEBUG_SI_NIT_CONTENT_VALUE);
9241 data_ptr = ParseLinkageDescriptor(data_ptr,
9242 &nit_table->num_linkage_entries,
9243 &nit_table->linkage_desc_list,
9244 &nit_table->last_linkage_entry, priv_data_code,
9245 DEBUG_SI_NIT_CONTENT_VALUE);
9249 case PRIV_DATA_SPEC_DTAG:
9251 data_ptr = ParsePrivateDataSpecifierDescriptor(data_ptr, &priv_data_code, DEBUG_SI_NIT_CONTENT_VALUE);
9257 data_ptr = ParseDefaultAuthorityDescriptor(data_ptr, &nit_table->def_authority, DEBUG_SI_NIT_CONTENT_VALUE);
9261 case FTA_CONTENT_DTAG:
9263 data_ptr = ParseFTAContentDescriptor(data_ptr, &nit_table->fta_content_desc, DEBUG_SI_NIT_CONTENT_VALUE);
9267 case FREESAT_LINK_DTAG:
9269 if ((priv_data_code == FREESAT_PRIVATE_DATA_SPECIFIER) &&
9270 (freesat_private_data_specifier == TRUE))
9272 data_ptr = ParseFreesatLinkageDescriptor(data_ptr,
9273 &nit_table->freesat_linkage_desc, DEBUG_SI_NIT_CONTENT_VALUE);
9275 else if ((priv_data_code == CIPLUS_PRIVATE_DATA_SPECIFIER) &&
9276 (ciplus_private_data_specifier == TRUE))
9278 data_ptr = ParseCIPlusVirtualChannelDescriptor(data_ptr,
9279 &nit_table->ciplus_virtual_channel, DEBUG_SI_NIT_CONTENT_VALUE);
9283 data_ptr = SkipDescriptor(data_ptr, dtag, DEBUG_SI_NIT_CONTENT_VALUE);
9288 case FREESAT_PREFIX_DTAG:
9290 if ((priv_data_code == FREESAT_PRIVATE_DATA_SPECIFIER) &&
9291 (freesat_private_data_specifier == TRUE))
9293 data_ptr = ParseFreesatPrefixDescriptor(data_ptr,
9294 &nit_table->freesat_prefix_list, DEBUG_SI_NIT_CONTENT_VALUE);
9298 data_ptr = SkipDescriptor(data_ptr, dtag, DEBUG_SI_NIT_CONTENT_VALUE);
9306 switch (data_ptr[1])
9308 case NETWORK_CHANGE_NOTIFY_DTAG:
9309 data_ptr = ParseNetworkChangeNotifyDescriptor(data_ptr,
9310 &nit_table->num_change_notifies,
9311 &nit_table->change_notify_array, DEBUG_SI_NIT_CONTENT_VALUE);
9315 data_ptr = ParseMessageDescriptor(data_ptr,
9316 &nit_table->num_messages,
9317 &nit_table->message_array, DEBUG_SI_NIT_CONTENT_VALUE);
9320 case TARGET_REGION_NAME_DTAG:
9321 data_ptr = ParseTargetRegionNameDescriptor(data_ptr,
9322 &nit_table->target_region_name_list, DEBUG_SI_NIT_CONTENT_VALUE);
9325 case TARGET_REGION_DTAG:
9326 data_ptr = ParseTargetRegionDescriptor(data_ptr,
9327 &nit_table->target_region_list, DEBUG_SI_NIT_CONTENT_VALUE);
9330 case URI_LINKAGE_DTAG:
9331 data_ptr = ParseURILinkageDesc(data_ptr,
9332 &nit_table->uri_linkage_list, priv_data_code, DEBUG_SI_NIT_CONTENT_VALUE);
9336 data_ptr = SkipDescriptor(data_ptr, dtag, DEBUG_SI_NIT_CONTENT_VALUE);
9344 data_ptr = SkipDescriptor(data_ptr, dtag, DEBUG_SI_NIT_CONTENT_VALUE);
9355 while (data_ptr < data_end)
9358 if (trans_entry != NULL)
9364 if (nit_table->last_transport_entry == NULL)
9367 nit_table->transport_list = trans_entry;
9372 nit_table->last_transport_entry->next = trans_entry;
9374 nit_table->last_transport_entry = trans_entry;
9375 nit_table->num_transports++;
9378 trans_entry->tran_id = (data_ptr[0] << 8) | data_ptr[1];
9379 trans_entry->orig_net_id = (data_ptr[2] << 8) | data_ptr[3];
9380 dloop_len = ((data_ptr[4] & 0x0f) << 8) | data_ptr[5];
9383 #ifdef DEBUG_SI_NIT_CONTENT 9384 STB_SI_PRINT((
" tid=0x%04x, onid=0x%04x (desc loop len %d)",
9385 trans_entry->tran_id, trans_entry->orig_net_id, dloop_len));
9390 dloop_end = data_ptr + dloop_len;
9391 while (data_ptr < dloop_end)
9395 #ifdef DEBUG_SI_NIT_CONTENT 9396 STB_SI_PRINT((
" dtag=0x%02x", (
int)dtag));
9402 case FREQ_LIST_DTAG:
9404 data_ptr = ParseFrequencyListDescriptor(data_ptr,
9405 &trans_entry->freq_list, DEBUG_SI_NIT_CONTENT_VALUE);
9409 case SERV_LIST_DTAG:
9411 data_ptr = ParseServiceListDescriptor(data_ptr,
9412 &trans_entry->num_serv_list_entries,
9413 &trans_entry->serv_list_desc_array, DEBUG_SI_NIT_CONTENT_VALUE);
9417 case TERR_DEL_SYS_DTAG:
9419 trans_entry->del_sys_desc_type = SI_DEL_SYS_DESC_TYPE_TERR;
9421 data_ptr = ParseTerrestrialDeliverySysDescriptor(data_ptr,
9422 &trans_entry->del_sys_desc, DEBUG_SI_NIT_CONTENT_VALUE);
9426 case SAT_DEL_SYS_DTAG:
9428 trans_entry->del_sys_desc_type = SI_DEL_SYS_DESC_TYPE_SAT;
9430 data_ptr = ParseSatelliteDeliverySysDescriptor(data_ptr,
9431 &trans_entry->del_sys_desc, DEBUG_SI_NIT_CONTENT_VALUE);
9435 case CABLE_DEL_SYS_DTAG:
9437 trans_entry->del_sys_desc_type = SI_DEL_SYS_DESC_TYPE_CABLE;
9439 data_ptr = ParseCableDeliverySysDescriptor(data_ptr,
9440 &trans_entry->del_sys_desc, DEBUG_SI_NIT_CONTENT_VALUE);
9444 case PRIV_DATA_SPEC_DTAG:
9446 data_ptr = ParsePrivateDataSpecifierDescriptor(data_ptr,
9447 &priv_data_code, DEBUG_SI_NIT_CONTENT_VALUE);
9453 data_ptr = ParseDefaultAuthorityDescriptor(data_ptr,
9454 &trans_entry->def_authority, DEBUG_SI_NIT_CONTENT_VALUE);
9458 case FTA_CONTENT_DTAG:
9460 data_ptr = ParseFTAContentDescriptor(data_ptr, &trans_entry->fta_content_desc, DEBUG_SI_NIT_CONTENT_VALUE);
9467 switch (data_ptr[1])
9469 case T2_DELIVERY_SYS_DTAG:
9470 trans_entry->del_sys_desc_type = SI_DEL_SYS_DESC_TYPE_TERR;
9471 data_ptr = ParseT2DeliverySysDescriptor(data_ptr,
9472 &trans_entry->del_sys_desc, DEBUG_SI_NIT_CONTENT_VALUE);
9475 case TARGET_REGION_DTAG:
9476 data_ptr = ParseTargetRegionDescriptor(data_ptr,
9477 &trans_entry->target_region_list, DEBUG_SI_NIT_CONTENT_VALUE);
9481 data_ptr = SkipDescriptor(data_ptr, dtag, DEBUG_SI_NIT_CONTENT_VALUE);
9487 case USER_DEFINED_DTAG_0x83:
9497 if (((priv_data_code == UK_DTT_PRIVATE_DATA_SPECIFIER) &&
9498 (priv_data_code == country_private_data_specifier_code)) ||
9499 ((priv_data_code == ZAF_DTT_PRIVATE_DATA_SPECIFIER) &&
9500 (priv_data_code == country_private_data_specifier_code)) ||
9501 ((priv_data_code == NORDIG_PRIVATE_DATA_SPECIFIER) &&
9502 (nordig_private_data_specifier == TRUE)) ||
9503 (GetUserDefinedDescriptorFunction(dtag) == USER_DEF_DESCRIP_LOGICAL_CHAN_NUM))
9505 data_ptr = ParseLogicalChannelDescriptor(data_ptr, dtag,
9506 &trans_entry->num_lcn_entries,
9507 &trans_entry->lcn_desc_array, DEBUG_SI_NIT_CONTENT_VALUE);
9511 data_ptr = SkipDescriptor(data_ptr, dtag, DEBUG_SI_NIT_CONTENT_VALUE);
9516 case USER_DEFINED_DTAG_0x86:
9518 if (((priv_data_code == UK_DTT_PRIVATE_DATA_SPECIFIER) &&
9519 (priv_data_code == country_private_data_specifier_code)) ||
9520 ((priv_data_code == ZAF_DTT_PRIVATE_DATA_SPECIFIER) &&
9521 (priv_data_code == country_private_data_specifier_code)))
9523 data_ptr = ParseServiceAttributeDescriptor(data_ptr,
9524 &trans_entry->num_serv_attr_entries,
9525 &trans_entry->serv_attr_array, DEBUG_SI_NIT_CONTENT_VALUE);
9529 data_ptr = SkipDescriptor(data_ptr, dtag, DEBUG_SI_NIT_CONTENT_VALUE);
9534 case USER_DEFINED_DTAG_0x87:
9536 if(((priv_data_code == NORDIG_PRIVATE_DATA_SPECIFIER) &&
9537 (nordig_private_data_specifier == TRUE)) ||
9538 (priv_data_code == country_private_data_specifier_code) ||
9539 ((priv_data_code == NZ_SAT_PRIVATE_DATA_SPECIFIER) &&
9540 (nzsat_private_data_specifier == TRUE)))
9543 data_ptr = ParseNordigLCN2Descriptor(data_ptr,
9544 &trans_entry->num_nordig_lcn_entries,
9545 &trans_entry->nordig_lcn_desc_array, DEBUG_SI_NIT_CONTENT_VALUE);
9549 data_ptr = SkipDescriptor(data_ptr, dtag, DEBUG_SI_NIT_CONTENT_VALUE);
9554 case USER_DEFINED_DTAG_0x88:
9558 if (((priv_data_code == UK_DTT_PRIVATE_DATA_SPECIFIER) &&
9559 (priv_data_code == country_private_data_specifier_code)) ||
9560 ((priv_data_code == EACEM_PRIVATE_DATA_SPECIFIER) &&
9561 (eacem_private_data_specifier == TRUE)))
9563 data_ptr = ParseLogicalChannelDescriptor(data_ptr, dtag,
9564 &trans_entry->num_hd_lcn_entries,
9565 &trans_entry->hd_lcn_desc_array, DEBUG_SI_NIT_CONTENT_VALUE);
9569 data_ptr = SkipDescriptor(data_ptr, dtag, DEBUG_SI_NIT_CONTENT_VALUE);
9574 case CIPLUS_SERVICE_DTAG:
9576 if ((priv_data_code == CIPLUS_PRIVATE_DATA_SPECIFIER) &&
9577 (ciplus_private_data_specifier == TRUE))
9579 data_ptr = ParseCIPlusServiceDescriptor(data_ptr,
9580 &trans_entry->num_ciplus_services,
9581 &trans_entry->ciplus_service_list,
9582 &trans_entry->last_ciplus_service, DEBUG_SI_NIT_CONTENT_VALUE);
9586 data_ptr = SkipDescriptor(data_ptr, dtag, DEBUG_SI_NIT_CONTENT_VALUE);
9593 data_ptr = SkipDescriptor(data_ptr, dtag, DEBUG_SI_NIT_CONTENT_VALUE);
9601 section_rec = section_rec->next;
9633 U32BIT priv_data_code;
9638 ASSERT(table_rec != NULL);
9641 if (table_rec != NULL)
9643 if ((table_rec->tid == SI_SDT_ACTUAL_TID) || (table_rec->tid == SI_SDT_OTHER_TID))
9645 #ifdef DEBUG_SI_SDT_SUMMARY 9646 STB_SI_PRINT((
"STB_SIParseSdtTable: tid 0x%02x/0x%04x, v%d, nsect %d",
9647 table_rec->tid, table_rec->xtid, table_rec->version, table_rec->num_sect));
9652 if (sdt_table != NULL)
9656 sdt_table->version = table_rec->version;
9657 sdt_table->tran_id = table_rec->xtid;
9659 section_rec = table_rec->section_list;
9660 while (section_rec != NULL)
9663 data_ptr = &(section_rec->data_start);
9664 data_end = data_ptr + section_rec->data_len - 4;
9672 sdt_table->orig_net_id = (data_ptr[0] << 8) | data_ptr[1];
9675 #ifdef DEBUG_SI_SDT_CONTENT 9676 STB_SI_PRINT((
" section %d, onid=0x%04x",
9677 section_rec->sect_num, sdt_table->orig_net_id));
9681 while (data_ptr < data_end)
9684 if (serv_entry != NULL)
9690 if (sdt_table->last_service_entry == NULL)
9693 sdt_table->service_list = serv_entry;
9698 sdt_table->last_service_entry->next = serv_entry;
9700 sdt_table->last_service_entry = serv_entry;
9701 sdt_table->num_services++;
9704 serv_entry->serv_id = (data_ptr[0] << 8) | data_ptr[1];
9705 serv_entry->eit_sched_avail = (((data_ptr[2] >> 1) & 0x01) == 0x01);
9706 serv_entry->eit_now_next_avail = ((data_ptr[2] & 0x01) == 0x01);
9707 serv_entry->running_status = data_ptr[3] >> 5;
9708 serv_entry->all_streams_free = (((data_ptr[3] >> 4) & 0x01) == 0x00);
9710 dloop_len = ((data_ptr[3] & 0x0f) << 8) | data_ptr[4];
9713 #ifdef DEBUG_SI_SDT_CONTENT 9714 STB_SI_PRINT((
" sid=0x%04x, eis=%d, eit=%d, rs=%d, free=%d (desc loop len %d)",
9715 serv_entry->serv_id, serv_entry->eit_sched_avail,
9716 serv_entry->eit_now_next_avail, serv_entry->running_status,
9717 serv_entry->all_streams_free, dloop_len));
9722 dloop_end = data_ptr + dloop_len;
9723 while (data_ptr < dloop_end)
9731 data_ptr = ParseCaIdentifierDescriptor(data_ptr,
9732 &serv_entry->num_ca_id_entries,
9733 &serv_entry->ca_id_desc_array, DEBUG_SI_SDT_CONTENT_VALUE);
9739 data_ptr = ParseLinkageDescriptor(data_ptr,
9740 &serv_entry->num_linkage_entries,
9741 &serv_entry->linkage_desc_list,
9742 &serv_entry->last_linkage_entry, priv_data_code,
9743 DEBUG_SI_SDT_CONTENT_VALUE);
9747 case MULTILING_SERV_NAME_DTAG:
9749 data_ptr = ParseMultilingServNameDescriptor(data_ptr,
9750 &serv_entry->num_multiling_names,
9751 &serv_entry->multiling_name_desc_array, DEBUG_SI_SDT_CONTENT_VALUE);
9757 data_ptr = ParseServiceDescriptor(data_ptr, &serv_entry->serv_type,
9758 &serv_entry->provider_str,
9759 &serv_entry->name_str, DEBUG_SI_SDT_CONTENT_VALUE);
9763 case PRIV_DATA_SPEC_DTAG:
9765 data_ptr = ParsePrivateDataSpecifierDescriptor(data_ptr,
9766 &priv_data_code, DEBUG_SI_SDT_CONTENT_VALUE);
9770 case FTA_CONTENT_DTAG:
9772 data_ptr = ParseFTAContentDescriptor(data_ptr, &serv_entry->fta_content_desc, DEBUG_SI_SDT_CONTENT_VALUE);
9776 case FREESAT_CONTENT_MANAGE_DTAG:
9778 if ((priv_data_code == FREESAT_PRIVATE_DATA_SPECIFIER) &&
9779 (freesat_private_data_specifier == TRUE))
9781 data_ptr = ParseFTAContentDescriptor(data_ptr, &serv_entry->fta_content_desc, DEBUG_SI_SDT_CONTENT_VALUE);
9785 data_ptr = SkipDescriptor(data_ptr, dtag, DEBUG_SI_SDT_CONTENT_VALUE);
9790 case USER_DEFINED_DTAG_0x84:
9797 if (((priv_data_code == UK_DTT_PRIVATE_DATA_SPECIFIER) &&
9798 (priv_data_code == country_private_data_specifier_code)) ||
9799 (GetUserDefinedDescriptorFunction(dtag) == USER_DEF_DESCRIP_PREF_NAME_LIST))
9801 data_ptr = ParsePreferredNameListDescriptor(data_ptr,
9802 &serv_entry->num_preferred_names,
9803 &serv_entry->preferred_name_desc_array, DEBUG_SI_SDT_CONTENT_VALUE);
9807 data_ptr = SkipDescriptor(data_ptr, dtag, DEBUG_SI_SDT_CONTENT_VALUE);
9812 case USER_DEFINED_DTAG_0x87:
9815 if (((priv_data_code == UK_DTT_PRIVATE_DATA_SPECIFIER) &&
9816 (priv_data_code == country_private_data_specifier_code)))
9818 data_ptr = ParseShortServiceNameDescriptor(data_ptr,
9819 &serv_entry->short_name_str, DEBUG_SI_SDT_CONTENT_VALUE);
9823 data_ptr = SkipDescriptor(data_ptr, dtag, DEBUG_SI_SDT_CONTENT_VALUE);
9830 data_ptr = ParseDefaultAuthorityDescriptor(data_ptr,
9831 &serv_entry->def_authority, DEBUG_SI_SDT_CONTENT_VALUE);
9835 case USER_DEFINED_DTAG_0x89:
9836 case FREESAT_GUIDANCE_DTAG:
9838 if (((priv_data_code == UK_DTT_PRIVATE_DATA_SPECIFIER) &&
9839 (priv_data_code == country_private_data_specifier_code) &&
9840 (freesat_private_data_specifier == FALSE)) ||
9841 ((priv_data_code == ZAF_DTT_PRIVATE_DATA_SPECIFIER) &&
9842 (priv_data_code == country_private_data_specifier_code) &&
9843 (freesat_private_data_specifier == FALSE)) ||
9844 ((priv_data_code == FREESAT_PRIVATE_DATA_SPECIFIER) &&
9845 (freesat_private_data_specifier == TRUE)))
9849 data_ptr = ParseGuidanceDescriptor(data_ptr, &serv_entry->guidance, DEBUG_SI_SDT_CONTENT_VALUE);
9853 data_ptr = SkipDescriptor(data_ptr, dtag, DEBUG_SI_SDT_CONTENT_VALUE);
9858 case FREESAT_SERV_NAME_DTAG:
9860 if ((priv_data_code == FREESAT_PRIVATE_DATA_SPECIFIER) &&
9861 (freesat_private_data_specifier == TRUE))
9864 data_ptr = ParseFreesatShortServiceNameDescriptor(data_ptr,
9865 &serv_entry->num_multiling_short_names,
9866 &serv_entry->multiling_short_name_array, DEBUG_SI_SDT_CONTENT_VALUE);
9870 data_ptr = SkipDescriptor(data_ptr, dtag, DEBUG_SI_SDT_CONTENT_VALUE);
9877 switch (data_ptr[1])
9879 case TARGET_REGION_DTAG:
9880 data_ptr = ParseTargetRegionDescriptor(data_ptr,
9881 &serv_entry->target_region_list, DEBUG_SI_SDT_CONTENT_VALUE);
9884 case URI_LINKAGE_DTAG:
9885 data_ptr = ParseURILinkageDesc(data_ptr,
9886 &serv_entry->uri_linkage_list, priv_data_code,
9887 DEBUG_SI_SDT_CONTENT_VALUE);
9891 data_ptr = SkipDescriptor(data_ptr, dtag, DEBUG_SI_SDT_CONTENT_VALUE);
9897 case CIPLUS_PROTECTION_DTAG:
9900 if ((table_rec->tid == SI_SDT_ACTUAL_TID) &&
9901 ((priv_data_code == CIPLUS_PRIVATE_DATA_SPECIFIER) &&
9902 (ciplus_private_data_specifier == TRUE)))
9904 data_ptr = SaveCIProtectionDescriptor(data_ptr,
9905 &serv_entry->ci_protection_desc, DEBUG_SI_SDT_CONTENT_VALUE);
9909 data_ptr = SkipDescriptor(data_ptr, dtag, DEBUG_SI_SDT_CONTENT_VALUE);
9914 case SERV_AVAIL_DESC_DTAG:
9916 data_ptr = ParseServiceAvailabilityDescriptor(data_ptr,
9917 &serv_entry->serv_avail_desc_list, DEBUG_SI_SDT_CONTENT_VALUE);
9921 case FREESAT_PREFIX_DTAG:
9923 if ((priv_data_code == FREESAT_PRIVATE_DATA_SPECIFIER) &&
9924 (freesat_private_data_specifier == TRUE))
9926 data_ptr = ParseFreesatPrefixDescriptor(data_ptr,
9927 &serv_entry->freesat_prefix_list, DEBUG_SI_SDT_CONTENT_VALUE);
9931 data_ptr = SkipDescriptor(data_ptr, dtag, DEBUG_SI_SDT_CONTENT_VALUE);
9938 data_ptr = SkipDescriptor(data_ptr, dtag, DEBUG_SI_SDT_CONTENT_VALUE);
9946 section_rec = section_rec->next;
9974 U8BIT *tran_dloop_end;
9975 U16BIT tran_dloop_len;
9979 U32BIT priv_data_code;
9984 ASSERT(table_rec != NULL);
9987 if (table_rec != NULL)
9989 if (table_rec->tid == SI_BAT_TID)
9991 #ifdef DEBUG_SI_BAT_SUMMARY 9992 STB_SI_PRINT((
"STB_SIParseBatTable: tid 0x%02x/0x%04x, v%d, nsect %d",
9993 table_rec->tid, table_rec->xtid, table_rec->version, table_rec->num_sect));
9997 if (bat_table != NULL)
10001 bat_table->version = table_rec->version;
10002 bat_table->bouquet_id = table_rec->xtid;
10004 section_rec = table_rec->section_list;
10005 while (section_rec != NULL)
10008 data_ptr = &(section_rec->data_start);
10012 priv_data_code = 0;
10014 dloop_len = (((data_ptr[0] & 0x0F) << 8) | (data_ptr[1]));
10018 dloop_end = data_ptr + dloop_len;
10019 while (data_ptr < dloop_end)
10021 dtag = data_ptr[0];
10024 #ifdef DEBUG_SI_BAT_CONTENT 10025 STB_SI_PRINT((
" dtag=0x%02x", (
int)dtag));
10030 case PRIV_DATA_SPEC_DTAG:
10032 data_ptr = ParsePrivateDataSpecifierDescriptor(data_ptr,
10033 &priv_data_code, DEBUG_SI_BAT_CONTENT_VALUE);
10039 data_ptr = ParseLinkageDescriptor(data_ptr,
10040 &bat_table->num_linkage_entries,
10041 &bat_table->linkage_desc_list,
10042 &bat_table->last_linkage_entry, priv_data_code,
10043 DEBUG_SI_BAT_CONTENT_VALUE);
10047 case DEF_AUTH_DTAG:
10049 data_ptr = ParseDefaultAuthorityDescriptor(data_ptr, &bat_table->def_authority, DEBUG_SI_BAT_CONTENT_VALUE);
10053 case FREESAT_SERV_GROUP_NAME_DTAG:
10055 if ((priv_data_code == FREESAT_PRIVATE_DATA_SPECIFIER) &&
10056 (freesat_private_data_specifier == TRUE))
10058 data_ptr = ParseFreesatServiceGroupNameDescriptor(data_ptr,
10059 &bat_table->group_name_list, DEBUG_SI_BAT_CONTENT_VALUE);
10063 data_ptr = SkipDescriptor(data_ptr, dtag, DEBUG_SI_BAT_CONTENT_VALUE);
10068 case FREESAT_SERV_GROUP_DTAG:
10070 if ((priv_data_code == FREESAT_PRIVATE_DATA_SPECIFIER) &&
10071 (freesat_private_data_specifier == TRUE))
10073 data_ptr = ParseFreesatServiceGroupDescriptor(data_ptr, &bat_table->serv_group_array,
10074 &bat_table->num_serv_groups, DEBUG_SI_BAT_CONTENT_VALUE);
10078 data_ptr = SkipDescriptor(data_ptr, dtag, DEBUG_SI_BAT_CONTENT_VALUE);
10083 case FREESAT_IACTIVE_STORAGE_DTAG:
10085 if ((priv_data_code == FREESAT_PRIVATE_DATA_SPECIFIER) &&
10086 (freesat_private_data_specifier == TRUE))
10088 data_ptr = ParseIActiveStorageDescriptor(data_ptr,
10089 &bat_table->iactive_storage_desc_list, DEBUG_SI_BAT_CONTENT_VALUE);
10093 data_ptr = SkipDescriptor(data_ptr, dtag, DEBUG_SI_BAT_CONTENT_VALUE);
10098 case FREESAT_INFO_LOCATION_DTAG:
10100 if ((priv_data_code == FREESAT_PRIVATE_DATA_SPECIFIER) &&
10101 (freesat_private_data_specifier == TRUE))
10103 data_ptr = ParseFreesatInfoLocationDescriptor(data_ptr,
10104 &bat_table->info_location_list, DEBUG_SI_BAT_CONTENT_VALUE);
10108 data_ptr = SkipDescriptor(data_ptr, dtag, DEBUG_SI_BAT_CONTENT_VALUE);
10113 case FREESAT_REGION_NAME_DTAG:
10115 if ((priv_data_code == FREESAT_PRIVATE_DATA_SPECIFIER) &&
10116 (freesat_private_data_specifier == TRUE))
10118 data_ptr = ParseRegionNameDescriptor(data_ptr, &bat_table->region_list, DEBUG_SI_BAT_CONTENT_VALUE);
10122 data_ptr = SkipDescriptor(data_ptr, dtag, DEBUG_SI_BAT_CONTENT_VALUE);
10127 case BOUQUET_NAME_DTAG:
10129 data_ptr = ParseNetNameDescriptor(data_ptr, &bat_table->bouquet_name, DEBUG_SI_BAT_CONTENT_VALUE);
10133 case FREESAT_CONTENT_MANAGE_DTAG:
10135 if ((priv_data_code == FREESAT_PRIVATE_DATA_SPECIFIER) &&
10136 (freesat_private_data_specifier == TRUE))
10138 data_ptr = ParseFTAContentDescriptor(data_ptr, &bat_table->fta_content_desc, DEBUG_SI_BAT_CONTENT_VALUE);
10142 data_ptr = SkipDescriptor(data_ptr, dtag, DEBUG_SI_BAT_CONTENT_VALUE);
10147 case FREESAT_PREFIX_DTAG:
10149 if ((priv_data_code == FREESAT_PRIVATE_DATA_SPECIFIER) &&
10150 (freesat_private_data_specifier == TRUE))
10152 data_ptr = ParseFreesatPrefixDescriptor(data_ptr,
10153 &bat_table->freesat_prefix_list, DEBUG_SI_BAT_CONTENT_VALUE);
10157 data_ptr = SkipDescriptor(data_ptr, dtag, DEBUG_SI_BAT_CONTENT_VALUE);
10165 switch (data_ptr[1])
10167 case URI_LINKAGE_DTAG:
10168 data_ptr = ParseURILinkageDesc(data_ptr,
10169 &bat_table->uri_linkage_list, priv_data_code, DEBUG_SI_BAT_CONTENT_VALUE);
10173 data_ptr = SkipDescriptor(data_ptr, dtag, DEBUG_SI_BAT_CONTENT_VALUE);
10181 data_ptr = SkipDescriptor(data_ptr, dtag, DEBUG_SI_BAT_CONTENT_VALUE);
10187 dloop_len = (((data_ptr[0] & 0x0F) << 8) | (data_ptr[1]));
10191 dloop_end = data_ptr + dloop_len;
10192 while (data_ptr < dloop_end)
10195 if (trans_entry != NULL)
10201 if (bat_table->last_transport_entry == NULL)
10204 bat_table->transport_list = trans_entry;
10209 bat_table->last_transport_entry->next = trans_entry;
10212 bat_table->last_transport_entry = trans_entry;
10213 bat_table->num_transports++;
10215 trans_entry->tran_id = ((data_ptr[0]) << 8 | (data_ptr[1]));
10217 trans_entry->orig_net_id = ((data_ptr[0] << 8) | (data_ptr[1]));
10219 tran_dloop_len = (((data_ptr[0] & 0x0F) << 8) | (data_ptr[1]));
10222 #ifdef DEBUG_SI_BAT_CONTENT 10223 STB_SI_PRINT((
" tid 0x%04x, onet 0x%04x", trans_entry->tran_id, trans_entry->orig_net_id));
10227 priv_data_code = 0;
10228 tran_dloop_end = data_ptr + tran_dloop_len;
10229 while (data_ptr < tran_dloop_end)
10231 dtag = data_ptr[0];
10234 #ifdef DEBUG_SI_BAT_CONTENT 10235 STB_SI_PRINT((
" dtag=0x%02x", (
int)dtag));
10240 case PRIV_DATA_SPEC_DTAG:
10242 data_ptr = ParsePrivateDataSpecifierDescriptor(data_ptr,
10243 &priv_data_code, DEBUG_SI_BAT_CONTENT_VALUE);
10247 case SERV_LIST_DTAG:
10249 data_ptr = ParseServiceListDescriptor(data_ptr,
10250 &trans_entry->num_serv_list_entries,
10251 &trans_entry->serv_list_desc_array, DEBUG_SI_BAT_CONTENT_VALUE);
10255 case LOGICAL_CHANNEL_DTAG:
10258 if ((priv_data_code == NZ_SAT_PRIVATE_DATA_SPECIFIER) &&
10259 (nzsat_private_data_specifier == TRUE))
10261 data_ptr = ParseLogicalChannelDescriptor(data_ptr, dtag,
10262 &trans_entry->num_lcn_entries,
10263 &trans_entry->lcn_desc_array, DEBUG_SI_BAT_CONTENT_VALUE);
10267 data_ptr = SkipDescriptor(data_ptr, dtag, DEBUG_SI_BAT_CONTENT_VALUE);
10272 case DEF_AUTH_DTAG:
10274 data_ptr = ParseDefaultAuthorityDescriptor(data_ptr, &trans_entry->def_authority, DEBUG_SI_BAT_CONTENT_VALUE);
10278 case FREESAT_REGION_LCN_DTAG:
10280 if ((priv_data_code == FREESAT_PRIVATE_DATA_SPECIFIER) &&
10281 (freesat_private_data_specifier == TRUE))
10283 data_ptr = ParseRegionLcnDescriptor(data_ptr, &trans_entry->lcn_region_list, DEBUG_SI_BAT_CONTENT_VALUE);
10287 data_ptr = SkipDescriptor(data_ptr, dtag, DEBUG_SI_BAT_CONTENT_VALUE);
10292 case FREESAT_CONTENT_MANAGE_DTAG:
10294 if ((priv_data_code == FREESAT_PRIVATE_DATA_SPECIFIER) &&
10295 (freesat_private_data_specifier == TRUE))
10297 data_ptr = ParseFTAContentDescriptor(data_ptr, &trans_entry->fta_content_desc, DEBUG_SI_BAT_CONTENT_VALUE);
10301 data_ptr = SkipDescriptor(data_ptr, dtag, DEBUG_SI_BAT_CONTENT_VALUE);
10306 case FREESAT_IACTIVE_RESTRICT_DTAG:
10308 if ((priv_data_code == FREESAT_PRIVATE_DATA_SPECIFIER) &&
10309 (freesat_private_data_specifier == TRUE))
10311 data_ptr = ParseFreesatInteractiveRestrictionDescriptor(data_ptr,
10312 &trans_entry->int_rest_serv_array,
10313 &trans_entry->num_int_rest_serv, DEBUG_SI_BAT_CONTENT_VALUE);
10317 data_ptr = SkipDescriptor(data_ptr, dtag, DEBUG_SI_BAT_CONTENT_VALUE);
10324 data_ptr = SkipDescriptor(data_ptr, dtag, DEBUG_SI_BAT_CONTENT_VALUE);
10332 section_rec = section_rec->next;
10366 U32BIT priv_data_code;
10371 ASSERT(table_rec != NULL);
10376 if (table_rec != NULL)
10378 tid = table_rec->tid;
10379 if ((tid == SI_EITPF_ACTUAL_TID) || (tid == SI_EITPF_OTHER_TID) ||
10380 ((tid & 0xf0) == SI_EITSC_ACTUAL_TID) || ((tid & 0xf0) == SI_EITSC_OTHER_TID))
10382 #ifdef DEBUG_SI_EIT_SUMMARY 10383 STB_SI_PRINT((
"STB_SIParseEitTable: tid 0x%02x/0x%04x, v%d, nsect %d",
10384 table_rec->tid, table_rec->xtid, table_rec->version, table_rec->num_sect));
10388 if (eit_table != NULL)
10392 eit_table->version = table_rec->version;
10393 eit_table->table_id = table_rec->tid;
10394 eit_table->serv_id = table_rec->xtid;
10397 section_rec = table_rec->section_list;
10398 while ((section_rec != NULL) && !abort)
10401 data_ptr = &(section_rec->data_start);
10402 data_end = data_ptr + section_rec->data_len - 4;
10410 eit_table->tran_id = (data_ptr[0] << 8) | data_ptr[1];
10411 eit_table->orig_net_id = (data_ptr[2] << 8) | data_ptr[3];
10412 eit_table->last_table_id = data_ptr[5];
10415 #ifdef DEBUG_SI_EIT_CONTENT 10416 STB_SI_PRINT((
" section %d, tranid=0x%04x, onid=0x%04x, last tid=0x%02x",
10417 section_rec->sect_num, eit_table->tran_id, eit_table->orig_net_id,
10418 eit_table->last_table_id));
10422 while ((data_ptr < data_end) && !abort)
10425 if (event_entry != NULL)
10431 if (eit_table->last_event_entry == NULL)
10434 eit_table->event_list = event_entry;
10439 eit_table->last_event_entry->next = event_entry;
10441 eit_table->last_event_entry = event_entry;
10442 eit_table->num_events++;
10445 event_entry->sect_num = section_rec->sect_num;
10446 event_entry->event_id = (data_ptr[0] << 8) | data_ptr[1];
10447 event_entry->start_date = (data_ptr[2] << 8) | data_ptr[3];
10448 event_entry->start_hrs = ((data_ptr[4] >> 4) * 10) + (data_ptr[4] & 0x0f);
10449 event_entry->start_mins = ((data_ptr[5] >> 4) * 10) + (data_ptr[5] & 0x0f);
10450 event_entry->start_secs = ((data_ptr[6] >> 4) * 10) + (data_ptr[6] & 0x0f);
10451 event_entry->duration_hrs = ((data_ptr[7] >> 4) * 10) + (data_ptr[7] & 0x0f);
10452 event_entry->duration_mins = ((data_ptr[8] >> 4) * 10) + (data_ptr[8] & 0x0f);
10453 event_entry->duration_secs = ((data_ptr[9] >> 4) * 10) + (data_ptr[9] & 0x0f);
10454 event_entry->running_status = data_ptr[10] >> 5;
10455 event_entry->all_streams_free = (((data_ptr[10] >> 4) & 0x01) == 0x00);
10456 dloop_len = ((data_ptr[10] & 0x0f) << 8) | data_ptr[11];
10459 #ifdef DEBUG_SI_EIT_CONTENT 10460 STB_SI_PRINT((
" eid=0x%04x on %d @ %02d:%02d:%02d for %02d:%02d:%02d, rs=%d, free=%d (desc loop len %d)",
10461 event_entry->event_id, event_entry->start_date,
10462 event_entry->start_hrs, event_entry->start_mins,
10463 event_entry->start_secs, event_entry->duration_hrs,
10464 event_entry->duration_mins, event_entry->duration_secs,
10465 event_entry->running_status, event_entry->all_streams_free,
10470 priv_data_code = 0;
10471 dloop_end = data_ptr + dloop_len;
10472 while (data_ptr < dloop_end)
10474 dtag = data_ptr[0];
10480 data_ptr = ParseCaIdentifierDescriptor(data_ptr,
10481 &event_entry->num_ca_id_entries,
10482 &event_entry->ca_id_desc_array, DEBUG_SI_EIT_CONTENT_VALUE);
10486 case COMPONENT_DTAG:
10488 data_ptr = ParseComponentDescriptor(data_ptr,
10489 &event_entry->num_component_entries,
10490 &event_entry->component_desc_array, DEBUG_SI_EIT_CONTENT_VALUE);
10496 data_ptr = ParseContentDescriptor(data_ptr,
10497 &event_entry->num_content_entries,
10498 &event_entry->content_desc_array, DEBUG_SI_EIT_CONTENT_VALUE);
10502 case PARENTAL_RATING_DTAG:
10504 data_ptr = ParseParentalRatingDescriptor(data_ptr,
10505 &event_entry->num_parental_rating_entries,
10506 &event_entry->parental_rating_desc_array, DEBUG_SI_EIT_CONTENT_VALUE);
10510 case MULTILING_COMPONENT_DTAG:
10512 data_ptr = ParseMultilingComponentDescriptor(data_ptr,
10513 &event_entry->num_multiling_component_entries,
10514 &event_entry->multiling_component_desc_array, DEBUG_SI_EIT_CONTENT_VALUE);
10518 case SHORT_EVENT_DTAG:
10520 data_ptr = ParseShortEventDescriptor(data_ptr,
10521 &event_entry->num_short_event_entries,
10522 &event_entry->short_event_desc_array, DEBUG_SI_EIT_CONTENT_VALUE);
10526 case EXTENDED_EVENT_DTAG:
10528 data_ptr = ParseExtendedEventDescriptor(data_ptr,
10529 &event_entry->num_extended_event_entries,
10530 &event_entry->extended_event_desc_array, DEBUG_SI_EIT_CONTENT_VALUE);
10534 case PRIV_DATA_SPEC_DTAG:
10536 data_ptr = ParsePrivateDataSpecifierDescriptor(data_ptr,
10537 &priv_data_code, DEBUG_SI_EIT_CONTENT_VALUE);
10541 case USER_DEFINED_DTAG_0x85:
10548 if (((priv_data_code == UK_DTT_PRIVATE_DATA_SPECIFIER) &&
10549 (priv_data_code == country_private_data_specifier_code)) ||
10550 (GetUserDefinedDescriptorFunction(dtag) == USER_DEF_DESCRIP_PREF_NAME_ID))
10552 data_ptr = ParsePreferredNameIdDescriptor(data_ptr,
10553 &event_entry->preferred_name_id, DEBUG_SI_EIT_CONTENT_VALUE);
10557 data_ptr = SkipDescriptor(data_ptr, dtag, DEBUG_SI_EIT_CONTENT_VALUE);
10564 data_ptr = ParseContentIdentifierDescriptor(data_ptr, &event_entry->num_crids,
10565 &event_entry->crid_list, &event_entry->last_crid_entry, DEBUG_SI_EIT_CONTENT_VALUE);
10569 case USER_DEFINED_DTAG_0x89:
10570 case FREESAT_GUIDANCE_DTAG:
10572 if (((priv_data_code == UK_DTT_PRIVATE_DATA_SPECIFIER) &&
10573 (priv_data_code == country_private_data_specifier_code) &&
10574 (freesat_private_data_specifier == FALSE)) ||
10575 ((priv_data_code == ZAF_DTT_PRIVATE_DATA_SPECIFIER) &&
10576 (priv_data_code == country_private_data_specifier_code) &&
10577 (freesat_private_data_specifier == FALSE)) ||
10578 ((priv_data_code == FREESAT_PRIVATE_DATA_SPECIFIER) &&
10579 (freesat_private_data_specifier == TRUE)))
10583 data_ptr = ParseGuidanceDescriptor(data_ptr, &event_entry->guidance, DEBUG_SI_EIT_CONTENT_VALUE);
10587 data_ptr = SkipDescriptor(data_ptr, dtag, DEBUG_SI_EIT_CONTENT_VALUE);
10594 data_ptr = SkipDescriptor(data_ptr, dtag, DEBUG_SI_EIT_CONTENT_VALUE);
10608 section_rec = section_rec->next;
10642 ASSERT(table_rec != NULL);
10645 if (table_rec != NULL)
10647 if ((table_rec->tid == SI_TDT_TID) || (table_rec->tid == SI_TOT_TID))
10649 #ifdef DEBUG_SI_TDT_TOT_SUMMARY 10650 STB_SI_PRINT((
"STB_SIParseTimeTable: tid 0x%02x", table_rec->tid));
10654 if (time_table != NULL)
10659 section_rec = table_rec->section_list;
10660 data_ptr = &(section_rec->data_start);
10664 time_table->date = (data_ptr[0] << 8) | data_ptr[1];
10665 time_table->hrs = ((data_ptr[2] >> 4) * 10) + (data_ptr[2] & 0x0f);
10666 time_table->mins = ((data_ptr[3] >> 4) * 10) + (data_ptr[3] & 0x0f);
10667 time_table->secs = ((data_ptr[4] >> 4) * 10) + (data_ptr[4] & 0x0f);
10670 #ifdef DEBUG_SI_TDT_TOT_CONTENT 10671 STB_SI_PRINT((
" %d %02d:%02d:%02d", time_table->date, time_table->hrs,
10672 time_table->mins, time_table->secs));
10675 if (table_rec->tid == SI_TOT_TID)
10678 dloop_len = ((data_ptr[0] & 0x0f) << 8) | data_ptr[1];
10680 dloop_end = data_ptr + dloop_len;
10681 #ifdef DEBUG_SI_TDT_TOT_CONTENT 10682 STB_SI_PRINT((
" Tot desc loop (len %d)", dloop_len));
10684 while (data_ptr < dloop_end)
10686 dtag = data_ptr[0];
10691 case LOCAL_TIME_OFFSET_DTAG:
10693 data_ptr = ParseLocalTimeOffsetDescriptor(data_ptr,
10694 &time_table->num_lto_entries,
10695 &time_table->lto_desc_array, DEBUG_SI_TDT_TOT_CONTENT_VALUE);
10701 data_ptr = SkipDescriptor(data_ptr, dtag, DEBUG_SI_TDT_TOT_CONTENT_VALUE);
10712 return(time_table);
10737 ASSERT(table_rec != NULL);
10741 if (table_rec != NULL)
10743 if (table_rec->tid == SI_RCT_TID)
10745 #ifdef DEBUG_SI_RCT_SUMMARY 10746 STB_SI_PRINT((
"STB_SIParseRctTable: tid 0x%02x/0x%04x, v%d, nsect %d",
10747 table_rec->tid, table_rec->xtid, table_rec->version, table_rec->num_sect));
10751 if (rct_table != NULL)
10755 section_rec = table_rec->section_list;
10756 while (section_rec != NULL)
10759 data_ptr = &(section_rec->data_start);
10762 if ((data_ptr[1] & 0x40) == 0)
10764 service_id = table_rec->xtid;
10771 #ifdef DEBUG_SI_RCT_CONTENT 10772 STB_SI_PRINT((
" service_id=0x%04x", service_id));
10779 for (subtable = rct_table->subtables; subtable != NULL; subtable = subtable->next)
10781 if ((subtable->version == table_rec->version) && (subtable->service_id == service_id))
10788 if (subtable == NULL)
10792 if (subtable != NULL)
10796 subtable->version = table_rec->version;
10797 subtable->service_id = service_id;
10800 if (rct_table->subtables == NULL)
10802 rct_table->subtables = subtable;
10807 for (sub_ptr = rct_table->subtables; sub_ptr->next != NULL; sub_ptr = sub_ptr->next)
10810 sub_ptr->next = subtable;
10815 if (subtable != NULL)
10819 if (sub_data != NULL)
10824 if (subtable->data == NULL)
10826 subtable->data = sub_data;
10830 for (next_data = subtable->data; next_data->next != NULL; next_data = next_data->next)
10833 next_data->next = sub_data;
10837 sub_data->year_offset = (data_ptr[0] << 8) | data_ptr[1];
10840 sub_data->link_count = data_ptr[2];
10843 #ifdef DEBUG_SI_RCT_CONTENT 10844 STB_SI_PRINT((
" year_offset=%u", sub_data->year_offset));
10845 STB_SI_PRINT((
" link_count=%u", sub_data->link_count));
10848 if (sub_data->link_count > 0)
10852 if (sub_data->link_array != NULL)
10854 for (i = 0; i < sub_data->link_count; i++)
10856 #ifdef DEBUG_SI_RCT_CONTENT 10857 STB_SI_PRINT((
" link=%u:", i));
10860 data_ptr = ParseRctLinkInfo(data_ptr, &sub_data->link_array[i], DEBUG_SI_RCT_CONTENT_VALUE);
10865 sub_data->link_count = 0;
10870 dloop_len = ((data_ptr[0] & 0x0f) << 8) | data_ptr[1];
10873 dloop_end = data_ptr + dloop_len;
10874 while (data_ptr < dloop_end)
10876 dtag = data_ptr[0];
10883 switch (data_ptr[1])
10885 case IMAGE_ICON_DTAG:
10887 data_ptr = ParseImageIconDesc(data_ptr, &sub_data->num_icons, &sub_data->icon_array, DEBUG_SI_RCT_CONTENT_VALUE);
10893 data_ptr = SkipDescriptor(data_ptr, dtag, DEBUG_SI_RCT_CONTENT_VALUE);
10900 case SHORT_EVENT_DTAG:
10902 data_ptr = ParseShortEventDescriptor(data_ptr,
10903 &event_entry->num_short_event_entries,
10904 &event_entry->short_event_desc_array, DEBUG_SI_RCT_CONTENT_VALUE);
10911 data_ptr = SkipDescriptor(data_ptr, dtag, DEBUG_SI_RCT_CONTENT_VALUE);
10920 section_rec = section_rec->next;
10960 end_ptr = dptr + nbytes;
10963 if (str_desc != NULL)
10965 num_bytes = nbytes;
10968 str_desc->str_ptr = tmp_ptr;
10975 if ((byte_val >= 0x01) && (byte_val <= 0x0b))
10978 *tmp_ptr = byte_val;
10984 else if (byte_val == 0x10)
10987 memcpy(tmp_ptr, dptr, 3);
10993 else if ((byte_val == 0x11) || (byte_val == 0x14))
10996 *tmp_ptr = byte_val;
11003 else if (byte_val == 0x1f)
11006 memcpy(tmp_ptr, dptr, num_bytes);
11007 tmp_ptr += num_bytes;
11009 byte_count += num_bytes;
11015 while (num_bytes > 0)
11017 if (unicode == TRUE)
11020 if ((dptr[0] != 0) || (dptr[1] != 0))
11023 tmp_ptr[0] = dptr[0];
11024 tmp_ptr[1] = dptr[1];
11037 tmp_ptr[0] = dptr[0];
11052 str_desc->nbytes = byte_count;
11055 *str_ptr = str_desc;
11081 case TERR_DEL_SYS_DTAG:
11082 *type = SI_DEL_SYS_DESC_TYPE_TERR;
11083 ParseTerrestrialDeliverySysDescriptor(&data[1], desc, DEBUG_TERR_DEL_SYS_DESC_VALUE);
11090 case SAT_DEL_SYS_DTAG:
11091 *type = SI_DEL_SYS_DESC_TYPE_SAT;
11092 ParseSatelliteDeliverySysDescriptor(&data[1], desc, DEBUG_SAT_DEL_SYS_DESC_VALUE);
11099 case CABLE_DEL_SYS_DTAG:
11100 *type = SI_DEL_SYS_DESC_TYPE_CABLE;
11101 ParseCableDeliverySysDescriptor(&data[1], desc, DEBUG_CABLE_DEL_SYS_DESC_VALUE);
11113 case T2_DELIVERY_SYS_DTAG:
11114 *type = SI_DEL_SYS_DESC_TYPE_TERR;
11115 ParseT2DeliverySysDescriptor(&data[1], desc, DEBUG_TERR_DEL_SYS_DESC_VALUE);
11155 if (data[0] == SERVICE_DTAG)
11160 ParseServiceDescriptor(&data[1], type, provider, name, DEBUG_SERVICE_DESC_VALUE);
11189 if (data[0] == SHORT_EVENT_DTAG)
11192 *event_desc = NULL;
11194 ParseShortEventDescriptor(&data[1], &num, event_desc, DEBUG_SHORT_EVENT_DESC_VALUE);
11195 if ((num == 1) && (*event_desc != NULL))
11229 ASSERT(pat_table != NULL);
11232 if (pat_table != NULL)
11234 serv_entry = pat_table->service_list;
11235 while (serv_entry != NULL)
11237 next_entry = serv_entry->next;
11239 serv_entry = next_entry;
11265 ASSERT(pmt_table != NULL);
11268 if (pmt_table != NULL)
11270 stream_entry = pmt_table->stream_list;
11271 while (stream_entry != NULL)
11273 next_entry = stream_entry->next;
11275 stream_entry = next_entry;
11278 if (pmt_table->tunnelled_desc_array != NULL)
11307 ASSERT(nit_table != NULL);
11310 if (nit_table != NULL)
11312 trans_entry = nit_table->transport_list;
11313 while (trans_entry != NULL)
11315 next_entry = trans_entry->next;
11317 trans_entry = next_entry;
11323 nit_table->num_multiling_net_names);
11326 if (nit_table->change_notify_array != NULL)
11328 for (i = 0; i < nit_table->num_change_notifies; i++)
11330 if (nit_table->change_notify_array[i].change_array != NULL)
11339 if ((nit_table->num_messages > 0) && (nit_table->message_array != NULL))
11341 for (i = 0; i < nit_table->num_messages; i++)
11343 if (nit_table->message_array[i].message != NULL)
11352 if (nit_table->fta_content_desc != NULL)
11357 if (nit_table->ciplus_virtual_channel != NULL)
11362 STB_FreeMemory(nit_table->ciplus_virtual_channel->app_domain_id);
11398 ASSERT(sdt_table != NULL);
11401 if (sdt_table != NULL)
11403 serv_entry = sdt_table->service_list;
11404 while (serv_entry != NULL)
11406 next_entry = serv_entry->next;
11408 serv_entry = next_entry;
11443 ASSERT(bat_table != NULL);
11446 if (bat_table != NULL)
11448 trans_entry = bat_table->transport_list;
11449 while (trans_entry != NULL)
11451 next_entry = trans_entry->next;
11453 trans_entry = next_entry;
11459 while (bat_table->region_list != NULL)
11461 region_ptr = bat_table->region_list;
11462 if (region_ptr->region_name != NULL)
11467 bat_table->region_list = region_ptr->next;
11473 name_entry = bat_table->group_name_list;
11474 while (name_entry != NULL)
11476 next_name_entry = name_entry->next_group;
11477 for (i = 0; i < name_entry->num_group_names; i++)
11483 name_entry = next_name_entry;
11487 serv_entry = bat_table->serv_group_array;
11488 while (serv_entry != NULL)
11490 next_serv_entry = serv_entry->next_group;
11496 serv_entry = next_serv_entry;
11500 iactive_storage_desc = bat_table->iactive_storage_desc_list;
11501 while (iactive_storage_desc != NULL)
11504 next_desc = iactive_storage_desc->next_desc;
11506 iactive_storage_desc = next_desc;
11510 location_desc = bat_table->info_location_list;
11511 while (location_desc != NULL)
11513 bat_table->info_location_list = location_desc->next;
11515 location_desc = bat_table->info_location_list;
11546 ASSERT(eit_table != NULL);
11549 if (eit_table != NULL)
11551 event_entry = eit_table->event_list;
11552 while (event_entry != NULL)
11554 next_entry = event_entry->next;
11556 event_entry = next_entry;
11580 ASSERT(time_table != NULL);
11582 if (time_table != NULL)
11603 ASSERT(rct_table != NULL);
11605 if (rct_table != NULL)
11607 sub_ptr = rct_table->subtables;
11608 while (sub_ptr != NULL)
11610 next_subtable = sub_ptr->next;
11612 sub_ptr = next_subtable;
11665 entry_ptr->num_iso_lang_entries);
11668 entry_ptr->num_subtitle_entries);
11670 entry_ptr->num_teletext_entries);
11672 if (entry_ptr->ac3_descriptor != NULL)
11677 if (entry_ptr->aac_descriptor != NULL)
11682 if (entry_ptr->app_sig_desc_array != NULL)
11687 if (entry_ptr->tag_array_ptr != NULL)
11692 if (entry_ptr->audio_desc != NULL)
11698 if (entry_ptr->service_move != NULL)
11704 if (entry_ptr->tunnelled_desc_array != NULL)
11732 entry_ptr->num_serv_list_entries);
11738 if (entry_ptr->serv_attr_array != NULL)
11743 if (entry_ptr->fta_content_desc != NULL)
11776 lcn_entry = entry_ptr->lcn_region_list;
11777 while (lcn_entry != NULL)
11779 next_entry = lcn_entry->next;
11781 lcn_entry = next_entry;
11809 freesat_lcn = entry_ptr->freesat_lcn_list;
11810 while (freesat_lcn != NULL)
11812 next_entry = freesat_lcn->next;
11814 freesat_lcn = next_entry;
11841 entry_ptr->num_multiling_names);
11843 entry_ptr->num_preferred_names);
11847 STB_SIReleaseMultilingShortNameArray(entry_ptr->multiling_short_name_array,
11848 entry_ptr->num_multiling_short_names);
11851 if (entry_ptr->fta_content_desc != NULL)
11858 if (entry_ptr->ci_protection_desc != NULL)
11888 entry_ptr->num_component_entries);
11890 entry_ptr->num_multiling_component_entries);
11894 entry_ptr->num_parental_rating_entries);
11896 entry_ptr->num_short_event_entries);
11898 entry_ptr->num_extended_event_entries);
11902 if (entry_ptr->fta_content_desc != NULL)
11923 if (sub_ptr != NULL)
11925 data_ptr = sub_ptr->data;
11926 while (data_ptr != NULL)
11928 next_data_ptr = data_ptr->next;
11930 data_ptr = next_data_ptr;
11949 if (data_ptr != NULL)
11951 if ((data_ptr->link_count > 0) && (data_ptr->link_array != NULL))
11953 for (i = 0; i < data_ptr->link_count; i++)
11997 case SI_DEL_SYS_DESC_TYPE_SAT:
12001 case SI_DEL_SYS_DESC_TYPE_CABLE:
12005 case SI_DEL_SYS_DESC_TYPE_TERR:
12007 if (desc->terr.is_t2)
12009 if ((desc->terr.u.t2.num_cells > 0) && (desc->terr.u.t2.cell != NULL))
12018 STB_SI_PRINT((
"SI_DELIVERY_SYS_DESC_TYPE release not supported!"));
12068 USE_UNWANTED_PARAM(num_entries);
12070 if (desc_array != NULL)
12094 USE_UNWANTED_PARAM(num_entries);
12096 if (desc_array != NULL)
12122 if (desc_array != NULL)
12124 comp_desc_ptr = desc_array;
12125 for (i = 0; i < num_entries; i++, comp_desc_ptr++)
12150 USE_UNWANTED_PARAM(num_entries);
12152 if (desc_array != NULL)
12169 if (freq_list != NULL)
12171 for ( ; freq_list != NULL; freq_list = next)
12173 next = freq_list->next;
12174 if (freq_list->frequency_array != NULL)
12203 if (desc_ptr != NULL)
12205 if (desc_ptr->strings != NULL)
12207 for (index = 0; index < desc_ptr->num_langs; index++)
12209 if (desc_ptr->strings[index] != NULL)
12218 if (desc_ptr->lang_codes != NULL)
12238 FUNCTION_START(STB_SIReleaseImageIconDesc);
12240 if (icon_array != NULL)
12242 for (i = 0; i < num_icons; i++)
12244 if (icon_array[i].icon_type != NULL)
12249 if (icon_array[i].icon_data != NULL)
12258 FUNCTION_FINISH(STB_SIReleaseImageIconDesc);
12277 USE_UNWANTED_PARAM(num_entries);
12279 if (desc_array != NULL)
12303 FUNCTION_START(STB_SIReleaseLinkageDescArray);
12305 USE_UNWANTED_PARAM(num_entries);
12307 desc_ptr = list_ptr;
12308 while (desc_ptr != NULL)
12310 tmp_ptr = desc_ptr->next;
12312 desc_ptr = tmp_ptr;
12314 FUNCTION_FINISH(STB_SIReleaseLinkageDescArray);
12333 USE_UNWANTED_PARAM(num_entries);
12335 if (desc_array != NULL)
12362 if (desc_array != NULL)
12364 ml_comp_desc_ptr = desc_array;
12365 for (i = 0; i < num_entries; i++, ml_comp_desc_ptr++)
12388 U16BIT num_entries)
12395 if (desc_array != NULL)
12397 mlnn_desc_ptr = desc_array;
12398 for (i = 0; i < num_entries; i++, mlnn_desc_ptr++)
12421 U16BIT num_entries)
12428 if (desc_array != NULL)
12430 ml_name_desc_ptr = desc_array;
12431 for (i = 0; i < num_entries; i++, ml_name_desc_ptr++)
12443 U16BIT num_entries)
12448 FUNCTION_START(STB_SIReleaseMultilingShortNameArray);
12450 if (desc_array != NULL)
12452 name_desc_ptr = desc_array;
12453 for (i = 0; i < num_entries; i++, name_desc_ptr++)
12460 FUNCTION_FINISH(STB_SIReleaseMultilingShortNameArray);
12479 USE_UNWANTED_PARAM(num_entries);
12481 if (desc_array != NULL)
12504 USE_UNWANTED_PARAM(num_entries);
12506 if (desc_array != NULL)
12532 if (desc_array != NULL)
12534 sevnt_desc_ptr = desc_array;
12535 for (i = 0; i < num_entries; i++, sevnt_desc_ptr++)
12565 if (desc_array != NULL)
12567 evnt_desc_ptr = desc_array;
12568 for (i = 0; i < num_entries; i++, evnt_desc_ptr++)
12570 for (j = 0; j < evnt_desc_ptr->num_items; j++)
12576 if (evnt_desc_ptr->item_desc_array != NULL)
12580 if (evnt_desc_ptr->item_text_array != NULL)
12610 USE_UNWANTED_PARAM(num_entries);
12612 if (desc_array != NULL)
12638 for (ptr = desc_list; ptr != NULL; ptr = next)
12642 if (ptr->name_array != NULL)
12644 for (i = 0; i < ptr->num_names; i++)
12678 for (cptr = desc_list; cptr != NULL; cptr = cnext)
12680 cnext = cptr->next;
12682 for (rptr = cptr->region_list; rptr != NULL; rptr = rnext)
12684 rnext = rptr->next;
12711 while (desc != NULL)
12713 if (desc->cell_ids != NULL)
12715 #ifdef DEBUG_SERV_AVAIL_DESC 12716 STB_SI_PRINT((
"STB_SIReleaseSdtServiceEntry: Freeing cell_ids"));
12721 #ifdef DEBUG_SERV_AVAIL_DESC 12722 STB_SI_PRINT((
"STB_SIReleaseSdtServiceEntry: Freeing serv_avail_desc"));
12745 USE_UNWANTED_PARAM(num_entries);
12747 if (desc_array != NULL)
12770 USE_UNWANTED_PARAM(num_entries);
12772 if (desc_array != NULL)
12797 if (desc_array != NULL)
12799 for (i = 0; i < num_entries; i++)
12803 if (desc_array[i].serv_array != NULL)
12833 if (desc_array != NULL)
12835 pref_name_desc_ptr = desc_array;
12836 for (i = 0; i < num_entries; i++, pref_name_desc_ptr++)
12862 while (crid_list != NULL)
12865 next_crid_ptr = crid_list->next;
12867 crid_list = next_crid_ptr;
12883 if (link_info != NULL)
12885 if (link_info->uri_string != NULL)
12890 if ((link_info->num_items > 0) && (link_info->promo_text_array != NULL))
12892 for (i = 0; i < link_info->num_items; i++)
12900 if (link_info->event_desc != NULL)
12921 while (desc != NULL)
12925 if (desc->data_types != NULL)
12948 while (list != NULL)
12952 if (list->uri_prefix != NULL)
12975 while (service_list != NULL)
12977 next_service = service_list->next;
12979 if (service_list->provider_str != NULL)
12984 if (service_list->name_str != NULL)
12990 service_list = next_service;
13006 while (list != NULL)
13010 if (list->uri != NULL)
13015 if (list->private_data != NULL)
13046 U16BIT i, num_ca_entries;
13052 data_ptr = pmt_data;
13053 sec_len = (((data_ptr[1] & 0x0f) << 8) | data_ptr[2]) + 3;
13054 data_end = data_ptr + sec_len - 4;
13060 dloop_len = ((data_ptr[2] & 0x0f) << 8) | data_ptr[3];
13063 num_ca_entries = 0;
13064 ca_desc_array = NULL;
13067 dloop_end = data_ptr + dloop_len;
13068 while (data_ptr < dloop_end)
13070 dtag = data_ptr[0];
13077 data_ptr = ParseCaDescriptor(data_ptr, &num_ca_entries, &ca_desc_array, FALSE);
13084 data_ptr += (*data_ptr + 1);
13091 while (data_ptr < data_end)
13093 dloop_len = ((data_ptr[3] & 0x0f) << 8) | data_ptr[4];
13097 dloop_end = data_ptr + dloop_len;
13098 while ((data_ptr < dloop_end) && (data_ptr < data_end))
13100 dtag = data_ptr[0];
13107 data_ptr = ParseCaDescriptor(data_ptr, &num_ca_entries, &ca_desc_array, FALSE);
13114 data_ptr += (*data_ptr + 1);
13121 if (num_ca_entries > 0)
13124 *pmt_ca_ids = (U16BIT *)
STB_GetMemory(num_ca_entries *
sizeof(U16BIT));
13125 if (*pmt_ca_ids != NULL)
13127 for (i = 0; i < num_ca_entries; i++)
13129 (*pmt_ca_ids)[i] = ca_desc_array[i].ca_id;
13134 num_ca_entries = 0;
13141 *pmt_ca_ids = NULL;
13146 return(num_ca_entries);
13159 void (*callback)(
void *, U32BIT,
SI_TABLE_RECORD *), U32BIT ret_param)
13165 #ifdef DEBUG_SI_RCT_REQUEST 13166 STB_SI_PRINT((
"STB_SIRequestRct: path %d pid 0x%04x", path, rct_pid));
13169 SI_XTID_MATCH_DONT_CARE, SI_XTID_MASK_DONT_CARE, req_type,
13170 SI_BUFFER_4K, TRUE, FALSE, callback, ret_param);
13174 return((
void *)filter_ptr);
void STB_SIReleaseComponentDescArray(SI_COMPONENT_DESC *desc_array, U8BIT num_entries)
Frees the memory used by the descriptor array specified.
void STB_SIModifyTableRequest(void *filter_handle, U8BIT tid_match, U8BIT tid_mask, U16BIT xtid_match, U16BIT xtid_mask, U16BIT expected_tables)
modifies the section filtering on an existing filter
void * STB_SIRequestTot(U8BIT path, E_SI_REQUEST_TYPE req_type, void(*callback)(void *, U32BIT, SI_TABLE_RECORD *), U32BIT ret_param)
Generates request for TOT.
void STB_SIReleasePatStreamEntry(SI_PAT_SERVICE_ENTRY *entry_ptr)
Frees the memory used by the table entry specified.
void STB_SIReleaseCRIDList(SI_CRID_DESC *crid_list)
Frees the memory used by the descriptor list specified.
void * STB_SIRequestNitFromPid(U8BIT path, U16BIT pid, BOOLEAN actual, E_SI_REQUEST_TYPE req_type, void(*callback)(void *, U32BIT, SI_TABLE_RECORD *), U32BIT ret_param)
Create an SI filter for an NIT table.
void STB_SIReleasePmtStreamEntry(SI_PMT_STREAM_ENTRY *entry_ptr)
Frees the memory used by the table entry specified.
void * STB_GetMemory(U32BIT bytes)
Attempts to allocate memory from the heap.
void STB_SIReleaseCaIdDescArray(U16BIT *desc_array, U8BIT num_entries)
Frees the memory used by the descriptor array specified.
void STB_SIReleasePmtTable(SI_PMT_TABLE *pmt_table)
Frees the memory used by the pmt table.
void * STB_SIRequestPmt(U8BIT path, E_SI_REQUEST_TYPE req_type, U16BIT pmt_pid, U16BIT sid_match, U16BIT sid_mask, U16BIT table_count, void(*callback)(void *, U32BIT, SI_TABLE_RECORD *), U32BIT ret_param)
Generates request for PMT.
void STB_SIReleaseIsoLangDescArray(SI_ISO_LANG_DESC *desc_array, U16BIT num_entries)
Frees the memory used by the descriptor array specified.
void STB_SIReleaseRctTable(SI_RCT_TABLE *rct_table)
Frees memory used by an RCT table.
void STB_SIReleaseServListDescArray(SI_SERV_LIST_DESC *desc_array, U16BIT num_entries)
Frees the memory used by the descriptor array specified.
Function prototypes for HW control.
void * STB_SIRequestSched(U8BIT path, E_SI_REQUEST_TYPE req_type, E_SI_SCHED_TABLE_REQ reqd_eit_tables, U16BIT sid_match, U16BIT sid_mask, U16BIT table_count, void(*callback)(void *, U32BIT, SI_TABLE_RECORD *), U32BIT ret_param)
Generates request for EIT schedule table.
void STB_SIReleaseBatTable(SI_BAT_TABLE *bat_table)
Frees the memory used by the bat table.
SI_EIT_TABLE * STB_SIParseEitTable(SI_TABLE_RECORD *table_rec)
Parses the Eit table supplied in TABLE_RECORD format to create a EIT_TABLE structure. Returns a pointer to the table. Application must call STB_SIReleaseEitTable to free the data.
void STB_SIReleaseRctSubtableData(SI_RCT_SUBTABLE_DATA *data_ptr)
Frees memory used by an SI_RCT_SUBTABLE_DATA structure.
void STB_SIReleaseURILinkageList(SI_URI_LINKAGE_DESC *list)
Frees a list of URI linkage descriptors.
Header file - macros and function prototypes for public use.
void * STB_SIRequestTdt(U8BIT path, E_SI_REQUEST_TYPE req_type, void(*callback)(void *, U32BIT, SI_TABLE_RECORD *), U32BIT ret_param)
Generates request for TDT.
void STB_SISetUserDefinedDescriptorFunction(U8BIT dtag, STB_SI_USER_DEF_DESCRIP_FUNCTION func)
Sets the function allocated to the user defined descriptor.
void STB_SIReleaseBatTransportEntry(SI_BAT_TRANSPORT_ENTRY *entry_ptr)
Frees the memory used by the table entry specified.
void * STB_SIRequestNitWithId(U8BIT path, U16BIT network_id, E_SI_REQUEST_TYPE req_type, void(*callback)(void *, U32BIT, SI_TABLE_RECORD *), U32BIT ret_param)
Generates request for NITactual and NITother for the given network ID.
void STB_SIReleaseSubtitleDescArray(SI_SUBTITLE_DESC *desc_array, U16BIT num_entries)
Frees the memory used by the descriptor array specified.
void STB_SIReleaseDelSysDesc(SI_DELIVERY_SYS_DESC *desc, SI_DELIVERY_SYS_DESC_TYPE type)
Frees the memory used by the descriptor specified.
void STB_SIReleaseLinkageDescList(SI_LINKAGE_DESC_ENTRY *list_ptr, U16BIT num_entries)
Frees the memory used by the descriptor array specified.
void STB_SIReleaseLcnDescArray(SI_LCN_DESC *desc_array, U16BIT num_entries)
Frees the memory used by the descriptor array specified.
void STB_SIReleaseShortEventDescArray(SI_SHORT_EVENT_DESC *desc_array, U8BIT num_entries)
Frees the memory used by the descriptor array specified.
void STB_SIReleaseMultilingNetNameDescArray(SI_MULTILING_NET_NAME_DESC *desc_array, U16BIT num_entries)
Frees the memory used by the descriptor array specified.
void STB_SISetCiplusPrivateDataSpecifierMode(BOOLEAN mode)
Enables or disables use of the CI+ private data specifier when parsing SI tables. ...
SI_NIT_TABLE * STB_SIParseNitTable(SI_TABLE_RECORD *table_rec)
Parses the Nit table supplied in TABLE_RECORD format to create a NIT_TABLE structure. Returns a pointer to the table. Application must call STB_SIReleaseNitTable to free the data.
void STB_SIReleaseNordigLcn2DescArray(SI_NORDIG_LCN_DESC *desc_array, U16BIT num_entries)
Frees the memory used by the descriptor array specified.
void STB_SIReleaseMultilingComponentDescArray(SI_MULTILING_COMPONENT_DESC *desc_array, U8BIT num_entries)
Frees the memory used by the descriptor array specified.
void STB_SIReleaseTeletextDescArray(SI_TELETEXT_DESC *desc_array, U16BIT num_entries)
Frees the memory used by the descriptor array specified.
void * STB_SIRequestPat(U8BIT path, E_SI_REQUEST_TYPE req_type, void(*callback)(void *, U32BIT, SI_TABLE_RECORD *), U32BIT ret_param)
Generates request for PAT.
void STB_SIReleaseRctLinkInfo(SI_RCT_LINK_INFO *link_info)
Frees memory used by an SI_RCT_LINK_INFO structure.
void * STB_SIRequestEitFromPid(U8BIT path, U16BIT pid, E_SI_REQUEST_TYPE req_type, E_SI_EIT_TABLE_REQ reqd_eit_tables, U16BIT sid_match, U16BIT sid_mask, U16BIT table_count, void(*callback)(void *, U32BIT, SI_TABLE_RECORD *), U32BIT ret_param)
Generates request for EIT.
void * STB_ResizeMemory(void *ptr, U32BIT new_num_bytes)
Re-allocates a given memory area to the new size, ensuring data contained within the original memory ...
void * STB_SIRequestCat(U8BIT path, E_SI_REQUEST_TYPE req_type, void(*callback)(void *, U32BIT, SI_TABLE_RECORD *), U32BIT ret_param)
Generates request for CAT.
void STB_SIReleaseTargetRegionList(SI_TARGET_REGION_DESC *desc_list)
Frees the memory used by the descriptor list specified.
void STB_SISetNordigPrivateDataSpecifierMode(BOOLEAN mode)
Enables or disables use of the Nordig private data specifier when parsing SI tables.
SI_PMT_TABLE * STB_SIParsePmtTable(SI_TABLE_RECORD *table_rec)
Parses the Pmt table supplied in TABLE_RECORD format to create a PMT_TABLE structure. Returns a pointer to the table. Application must call STB_SIReleasePmtTable to free the data.
void STB_SIReleasePrefNameDescArray(SI_PREFERRED_NAME_DESC *desc_array, U16BIT num_entries)
Frees the memory used by the descriptor array specified.
void STB_SIReleaseFreqListDescArray(SI_NIT_FREQUENCY_LIST_DESC *freq_list)
Frees the memory used by the frequency list descriptor.
BOOLEAN STB_SIParseServiceDescriptor(U8BIT *data, U8BIT *type, SI_STRING_DESC **provider, SI_STRING_DESC **name)
Parses a service descriptor, tag 0x48, allocating SI strings that must be freed using STB_SIReleaseSt...
void STB_SIReleaseStringDesc(SI_STRING_DESC *desc)
Frees the memory used by the descriptor specified.
void STB_SIReleaseTimeTable(SI_TIME_TABLE *time_table)
Frees the memory used by the time table (tdt or tot)
void * STB_SIRequestEit(U8BIT path, E_SI_REQUEST_TYPE req_type, E_SI_EIT_TABLE_REQ reqd_eit_tables, U16BIT sid_match, U16BIT sid_mask, U16BIT table_count, void(*callback)(void *, U32BIT, SI_TABLE_RECORD *), U32BIT ret_param)
Generates request for EIT.
void STB_SIReleaseExtendedEventDescArray(SI_EXTENDED_EVENT_DESC *desc_array, U8BIT num_entries)
Frees the memory used by the descriptor array specified.
SI_SDT_TABLE * STB_SIParseSdtTable(SI_TABLE_RECORD *table_rec)
Parses the Sdt table supplied in TABLE_RECORD format to create a SDT_TABLE structure. Returns a pointer to the table. Application must call STB_SIReleaseSdtTable to free the data.
void STB_SIReleaseCIPlusServiceList(SI_CIPLUS_SERVICE *service_list)
Frees a CI+ service list.
void STB_FreeMemory(void *addr)
Releases previously allocated heap memory.
void STB_SISetEacemPrivateDataSpecifierMode(BOOLEAN mode)
Enables or disables use of the EACEM private data specifier when parsing SI tables.
void STB_SIReleaseEitTable(SI_EIT_TABLE *eit_table)
Frees the memory used by the eit table.
SI_RCT_TABLE * STB_SIParseRctTable(SI_TABLE_RECORD *table_rec)
Parses the related content table (RCT) to create an SI_RCT_TABLE structure.
void STB_SPDebugWrite(const char *format,...)
Write debug string to serial/debug port. <CR><LF> characters will be automatically added to the end o...
Debug functions header file.
Header file - macros and function prototypes for public use.
void STB_SIReleaseSdtTable(SI_SDT_TABLE *sdt_table)
Frees the memory used by the sdt table.
SI_PAT_TABLE * STB_SIParsePatTable(SI_TABLE_RECORD *table_rec)
Parses the Pat table supplied in TABLE_RECORD format to create a PAT_TABLE structure. Returns a pointer to the table. Application must call STB_SIReleasePatTable to free the data.
void STB_SIReleaseLtoDescArray(SI_LTO_DESC *desc_array, U16BIT num_entries)
Frees the memory used by the descriptor array specified.
SI_BAT_TABLE * STB_SIParseBatTable(SI_TABLE_RECORD *table_rec)
Parses the BAT table supplied in TABLE_RECORD format to create a SI_BAT_TABLE structure. Returns a pointer to the table. Application must call STB_SIReleaseBatTable to free the data.
void STB_SIReleaseMultilingServNameDescArray(SI_MULTILING_SERV_NAME_DESC *desc_array, U16BIT num_entries)
Frees the memory used by the descriptor array specified.
BOOLEAN STB_SIParseShortEventDescriptor(U8BIT *data, SI_SHORT_EVENT_DESC **event_desc)
Parses a short event descriptor, tag 0x4d, that must be released by calling STB_SIReleaseShortEventDe...
void STB_SIReleaseAvailabilityDescriptorList(SI_SERV_AVAIL_DESC *desc_list)
Frees the memory used by the descriptor list specified.
Header for STB unicode string handling routines.
void STB_SIReleaseEitEventEntry(SI_EIT_EVENT_ENTRY *entry_ptr)
Frees the memory used by the table entry specified.
U16BIT STB_SIGetPmtCaIdDescArray(U8BIT *pmt_data, U16BIT **pmt_ca_ids)
Parses the given PMT to produce an array of the CA system IDs required by the service or streams on t...
void STB_SIReleaseCaDescArray(SI_CA_DESC *desc_array, U16BIT num_entries)
Frees the memory used by the descriptor array specified.
void STB_SIReleaseRctSubtable(SI_RCT_SUBTABLE *sub_ptr)
Frees memory used by an RCT subtable.
void STB_SIModifyPmtRequest(void *fhandle, U16BIT sid_match, U16BIT sid_mask, U16BIT table_count)
Modifies request for PMT to look for different service on SAME PID.
System Wide Global Technical Data Type Definitions.
void * STB_SIRequestTotFromPid(U8BIT path, U16BIT pid, E_SI_REQUEST_TYPE req_type, void(*callback)(void *, U32BIT, SI_TABLE_RECORD *), U32BIT ret_param)
Generates request for TOT.
void STB_SIReleaseBatLcnEntry(SI_BAT_FREESAT_REGION_LCN_ENTRY *entry_ptr)
Frees the memory used by the table entry specified.
void STB_SIClearUserDefinedDescriptorFunctions(void)
Clear all entries in the user defined SI descriptor table.
BOOLEAN STB_SIParseDelSysDesc(U8BIT *data, SI_DELIVERY_SYS_DESC_TYPE *type, SI_DELIVERY_SYS_DESC **desc)
Parses and allocates a system delivery descriptor which should be freed by calling STB_SIReleaseDelSy...
void * STB_SIRequestNit(U8BIT path, E_SI_REQUEST_TYPE req_type, void(*callback)(void *, U32BIT, SI_TABLE_RECORD *), U32BIT ret_param)
Generates request for NIT(actual)
void * STB_SIRequestBat(U8BIT path, E_SI_REQUEST_TYPE req_type, U16BIT bouquet_id_match, U16BIT bouquet_id_mask, U16BIT table_count, void(*callback)(void *, U32BIT, SI_TABLE_RECORD *), U32BIT ret_param)
Generates request for Bat.
void STB_SIModifySdtRequest(void *fhandle, BOOLEAN inc_sdt_actual, BOOLEAN inc_sdt_other, U16BIT tran_id_match, U16BIT tran_id_mask, U16BIT table_count)
Modifies request for SDT to look for different transport on SAME PID.
SI_TIME_TABLE * STB_SIParseTimeTable(SI_TABLE_RECORD *table_rec)
Parses the tdt or tot table supplied in TABLE_RECORD format to create a TIME_TABLE structure...
void STB_SIReleaseFreesatPrefixList(SI_FREESAT_PREFIX_DESC *list)
Frees memory used by an SI_FREESAT_PREFIX_DESC structure.
void STB_SIReleaseFreesatLinkageDesc(SI_FREESAT_LINKAGE_DESC *desc)
Frees memory used by an SI_FREESAT_LINKAGE_DESC structure.
void STB_SIReleaseContentDescArray(SI_CONTENT_DESC *desc_array, U8BIT num_entries)
Frees the memory used by the descriptor array specified.
void STB_SIReleasePatTable(SI_PAT_TABLE *pat_table)
Frees the memory used by the pat table.
void * STB_SIRequestTable(U8BIT path, U16BIT pid, U8BIT tid_match, U8BIT tid_mask, E_SI_TABLE_FORMAT_TYPE format, U16BIT expected_tables, U16BIT xtid_match, U16BIT xtid_mask, E_SI_REQUEST_TYPE req_type, U16BIT buff_size, BOOLEAN crc, BOOLEAN low_priority, void(*callback)(void *, U32BIT, SI_TABLE_RECORD *), U32BIT ret_param)
Sets up filter for SI table.
void STB_SIModifyEitRequest(void *fhandle, E_SI_EIT_TABLE_REQ reqd_eit_tables, U16BIT sid_match, U16BIT sid_mask, U16BIT table_count)
Modifies request for SDT to look for different transport on SAME PID.
Header file - Function prototypes for heap memory.
void STB_SIReleaseNitTransportEntry(SI_NIT_TRANSPORT_ENTRY *entry_ptr)
Frees the memory used by the table entry specified.
void STB_SISetCountryPrivateDataSpecifier(U32BIT code)
Sets the country specific private data specifier code that will be used when parsing SI tables...
void STB_SIReleaseNitTable(SI_NIT_TABLE *nit_table)
Frees the memory used by the nit table.
void STB_SPDebugNoCnWrite(const char *format,...)
Writes debug string to the serial port without <CR><LF>
void STB_SIReleaseSdtServiceEntry(SI_SDT_SERVICE_ENTRY *entry_ptr)
Frees the memory used by the table entry specified.
void STB_SIReleaseParentalRatingDescArray(SI_PARENTAL_RATING_DESC *desc_array, U8BIT num_entries)
Frees the memory used by the descriptor array specified.
void STB_SISetNZSatPrivateDataSpecifierMode(BOOLEAN mode)
Enables or disables use of the New Zealand satellite private data specifier when parsing SI tables...
void STB_SISetFreesatPrivateDataSpecifierMode(BOOLEAN mode)
Enables or disables use of the Freesat private data specifier when parsing SI tables.
void * STB_SIRequestTdtFromPid(U8BIT path, U16BIT pid, E_SI_REQUEST_TYPE req_type, void(*callback)(void *, U32BIT, SI_TABLE_RECORD *), U32BIT ret_param)
Generates request for TDT.
void * STB_SIRequestBatFromPid(U8BIT path, U16BIT pid, E_SI_REQUEST_TYPE req_type, U16BIT bouquet_id_match, U16BIT bouquet_id_mask, U16BIT table_count, void(*callback)(void *, U32BIT, SI_TABLE_RECORD *), U32BIT ret_param)
Generates request for Bat.
void * STB_SIRequestSdt(U8BIT path, E_SI_REQUEST_TYPE req_type, BOOLEAN inc_sdt_actual, BOOLEAN inc_sdt_other, U16BIT tran_id_match, U16BIT tran_id_mask, U16BIT table_count, void(*callback)(void *, U32BIT, SI_TABLE_RECORD *), U32BIT ret_param)
Generates request for SDT.
void * STB_SIRequestAit(U8BIT path, E_SI_REQUEST_TYPE req_type, U16BIT ait_pid, void(*callback)(void *, U32BIT, SI_TABLE_RECORD *), U32BIT ret_param)
Generates request for AIT on given PID.
void * STB_SIRequestRct(U8BIT path, E_SI_REQUEST_TYPE req_type, U16BIT rct_pid, void(*callback)(void *, U32BIT, SI_TABLE_RECORD *), U32BIT ret_param)
Generates request for RCT on given PID.
void STB_SIReleaseTargetRegionNameList(SI_NIT_TARGET_REGION_NAME_DESC *desc_list)
Frees the memory used by the descriptor list specified.
void STB_SIReleaseGuidanceDesc(SI_GUIDANCE_DESC *desc_ptr)
Frees the memory used by the descriptor specified.
void * STB_SIRequestSdtFromPid(U8BIT path, U16BIT pid, E_SI_REQUEST_TYPE req_type, BOOLEAN inc_sdt_actual, BOOLEAN inc_sdt_other, U16BIT tran_id_match, U16BIT tran_id_mask, U16BIT table_count, void(*callback)(void *, U32BIT, SI_TABLE_RECORD *), U32BIT ret_param)
Generates request for SDT.
void * STB_SIRequestSchedFromPid(U8BIT path, U16BIT pid, E_SI_REQUEST_TYPE req_type, E_SI_SCHED_TABLE_REQ reqd_eit_tables, U16BIT sid_match, U16BIT sid_mask, U16BIT table_count, void(*callback)(void *, U32BIT, SI_TABLE_RECORD *), U32BIT ret_param)
Generates request for EIT schedule table.
void STB_SIReleaseImageIconDescArray(SI_IMAGE_ICON_DESC *icon_array, U8BIT num_icons)
Frees an array of image icons, including the memory used by each one.
U8BIT * STB_SIReadString(U8BIT nbytes, U8BIT *dptr, SI_STRING_DESC **str_ptr)
Copies a string from a descriptor for the specified length. Converts the number of bytes specified in...
Header file - macros and function prototypes for public use.