From 9f919801465f49be6b2118f54bd54df846e2f865 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sun, 13 Apr 2003 18:00:00 +0200 Subject: =?UTF-8?q?Version=201.1.27=20-=20The=20CAM=20is=20now=20accessed?= =?UTF-8?q?=20only=20if=20the=20current=20channel=20actually=20has=20a=20n?= =?UTF-8?q?on-zero=20Ca=20=20=20value,=20and=20CAM=20access=20is=20complet?= =?UTF-8?q?ely=20suppressed=20during=20replay,=20which=20avoids=20=20=20pr?= =?UTF-8?q?oblems=20in=20case=20the=20CAM=20is=20attached=20to=20the=20pri?= =?UTF-8?q?mary=20DVB=20device.=20-=20The=20"Left"=20and=20"Right"=20butto?= =?UTF-8?q?ns=20now=20set=20the=20cursor=20to=20the=20first=20or=20last=20?= =?UTF-8?q?list=20item=20=20=20even=20if=20the=20list=20consist=20only=20o?= =?UTF-8?q?f=20a=20single=20page,=20like,=20for=20instance,=20the=20Main?= =?UTF-8?q?=20menu=20=20=20(thanks=20to=20Oliver=20Endriss).=20-=20Made=20?= =?UTF-8?q?the=20log=20message=20"OSD=20window=20width=20must=20be=20a=20m?= =?UTF-8?q?ultiple=20of=204..."=20a=20debug=20message=20=20=20instead=20of?= =?UTF-8?q?=20an=20error=20message,=20so=20it=20can=20be=20avoided=20by=20?= =?UTF-8?q?using=20a=20log=20level=20less=20than=203.=20-=20Updated=20Gree?= =?UTF-8?q?k=20language=20texts=20(thanks=20to=20Dimitrios=20Dimitrakos).?= =?UTF-8?q?=20-=20Fixed=20faulty=20behaviour=20of=20the=20"Mute"=20key=20i?= =?UTF-8?q?n=20case=20the=20channel=20display=20is=20visible=20=20=20(than?= =?UTF-8?q?ks=20to=20Florian=20Bartels=20for=20reporting=20this=20one=20an?= =?UTF-8?q?d=20Sascha=20Volkenandt=20for=20=20=20helping=20to=20fix=20it).?= =?UTF-8?q?=20-=20Modified=20LOF=20handling=20to=20allow=20for=20C-band=20?= =?UTF-8?q?reception=20(thanks=20to=20Malcolm=20Caldwell).=20-=20Added=20s?= =?UTF-8?q?ome=20missing=20cAudio=20handling=20calls=20(thanks=20to=20Wern?= =?UTF-8?q?er=20Fink).=20-=20Replaced=20the=20'for'=20loops=20in=20StripAu?= =?UTF-8?q?dioPackets()=20with=20memset()=20calls=20(thanks=20to=20=20=20W?= =?UTF-8?q?erner=20Fink).=20-=20Further=20increased=20the=20timeout=20unti?= =?UTF-8?q?l=20an=20index=20file=20is=20considerd=20no=20longer=20to=20be?= =?UTF-8?q?=20=20=20written.=20-=20Fixed=20a=20crash=20in=20case=20the=20i?= =?UTF-8?q?ndex=20file=20can't=20be=20accessed=20any=20more=20during=20rep?= =?UTF-8?q?lay=20=20=20(thanks=20to=20Stefan=20Huelswitt=20for=20reporting?= =?UTF-8?q?=20this=20one).=20-=20Fixed=20displaying=20messages=20in=20the?= =?UTF-8?q?=20status=20line=20in=20case=20they=20exceed=20the=20OSD=20widt?= =?UTF-8?q?h=20=20=20(thanks=20to=20Gerhard=20Steiner=20for=20reporting=20?= =?UTF-8?q?this=20one).=20-=20Avoiding=20high=20CPU=20load=20in=20case=20t?= =?UTF-8?q?he=20connection=20to=20LIRC=20gets=20lost=20(thanks=20to=20=20?= =?UTF-8?q?=20Ludwig=20Nussel).=20-=20Fixed=20handling=20repeat=20function?= =?UTF-8?q?=20with=20LIRC=20(thanks=20to=20Ludwig=20Nussel).=20-=20Fixed?= =?UTF-8?q?=20handling=20min/max=20borders=20when=20entering=20integer=20v?= =?UTF-8?q?alues=20(thanks=20to=20Andy=20=20=20Grobb=20for=20reporting=20t?= =?UTF-8?q?his=20one).=20-=20Implemented=20a=20"resume=20ID"=20which=20all?= =?UTF-8?q?ows=20several=20users=20to=20each=20have=20their=20own=20=20=20?= =?UTF-8?q?resume.vdr=20files=20(thanks=20to=20Martin=20Hammerschmid).=20T?= =?UTF-8?q?his=20parameter=20can=20be=20set=20in=20=20=20the=20"Setup/Repl?= =?UTF-8?q?ay"=20menu=20(see=20MANUAL=20for=20details).=20-=20Now=20using?= =?UTF-8?q?=20'libdtv'=20version=200.0.5=20(thanks=20to=20Rolf=20Hakenes?= =?UTF-8?q?=20for=20the=20new=20version=20=20=20and=20Stefan=20Huelswitt?= =?UTF-8?q?=20for=20adapting=20VDR=20to=20it).=20-=20If=20no=20device=20wi?= =?UTF-8?q?th=20an=20MPEG=20decoder=20can=20be=20found=20at=20startup,=20t?= =?UTF-8?q?he=20first=20device=20=20=20is=20now=20used=20as=20primary=20de?= =?UTF-8?q?vice=20(just=20to=20have=20some=20device).=20-=20Adjusted=20som?= =?UTF-8?q?e=20Premiere=20channels=20in=20'channels.conf'=20(thanks=20to?= =?UTF-8?q?=20Thomas=20Koch).=20-=20Updated=20'channels.conf.cable'=20(tha?= =?UTF-8?q?nks=20to=20Stefan=20Hu=C3=9Ffeldt).=20-=20The=20'epg.data'=20fi?= =?UTF-8?q?le=20is=20now=20read=20after=20all=20plugins=20have=20been=20st?= =?UTF-8?q?arted=20(thanks=20=20=20to=20Sascha=20Volkenandt).=20-=20The=20?= =?UTF-8?q?LIRC=20remote=20control=20no=20longer=20tries=20to=20learn=20ke?= =?UTF-8?q?ys=20if=20it=20can't=20connect=20to=20=20=20the=20LIRC=20daemon?= =?UTF-8?q?=20(thanks=20to=20Ludwig=20Nussel=20for=20reporting=20this=20on?= =?UTF-8?q?e).=20The=20same=20=20=20applies=20to=20the=20RCU=20remote=20co?= =?UTF-8?q?ntrol=20in=20case=20of=20errors=20during=20startup.=20-=20Fixed?= =?UTF-8?q?=20handling=20of=20Ca=20parameters=20with=20values=20<=3D=20MAX?= =?UTF-8?q?DEVICES,=20which=20don't=20indicate=20=20=20an=20actual=20encry?= =?UTF-8?q?pted=20channel=20(thanks=20to=20Stefan=20Huelswitt=20for=20repo?= =?UTF-8?q?rting=20this=20one).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libdtv/libsi/include/libsi.h | 248 ++++++++++++++++++++++++++++++++++----- libdtv/libsi/include/si_tables.h | 156 +++++++++++++++++++++--- 2 files changed, 356 insertions(+), 48 deletions(-) (limited to 'libdtv/libsi/include') diff --git a/libdtv/libsi/include/libsi.h b/libdtv/libsi/include/libsi.h index 8e9e260..715d18b 100644 --- a/libdtv/libsi/include/libsi.h +++ b/libdtv/libsi/include/libsi.h @@ -4,11 +4,13 @@ /// /// ////////////////////////////////////////////////////////////// -// $Revision: 1.6 $ -// $Date: 2002/01/30 17:04:13 $ +// $Revision: 1.7 $ +// $Date: 2003/02/04 18:45:36 $ // $Author: hakenes $ // -// (C) 2001 Rolf Hakenes , under the GNU GPL. +// (C) 2001-03 Rolf Hakenes , under the +// GNU GPL with contribution of Oleg Assovski, +// www.satmania.com // // libsi is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -38,9 +40,9 @@ /* Program Identifier */ #define PID_PAT 0x00 /* Program Association Table */ -#define PID_BAT 0x01 /* Bouquet Association Table */ #define PID_CAT 0x01 /* Conditional Access Table */ #define PID_NIT 0x10 /* Network Information Table */ +#define PID_BAT 0x11 /* Bouquet Association Table */ #define PID_SDT 0x11 /* Service Description Table */ #define PID_EIT 0x12 /* Event Information Table */ #define PID_RST 0x13 /* Running Status Table */ @@ -75,12 +77,13 @@ #define TID_TOT 0x73 /* Time Offset Section */ #define TID_CA_ECM_0 0x80 #define TID_CA_ECM_1 0x81 +#define TID_CA_EMM 0x82 -#define TID_BAT 0x01 /* Bouquet Association Section */ +#define TID_BAT 0x4A /* Bouquet Association Section */ #define TID_EIT 0x12 /* Event Information Section */ -#define TID_RST 0x13 /* Running Status Section */ -#define TID_ST 0x14 /* Stuffung Section */ +#define TID_RST 0x71 /* Running Status Section */ +#define TID_ST 0x72 /* Stuffing Section */ /* 0xFF */ /* Reserved for future use */ /* Descriptor Identifier */ @@ -160,6 +163,40 @@ #define MAX_SECTION_BUFFER 4096 +/* NetworkInfo structure (used to store NIT/BAT information) */ + +struct NetworkInfo { + struct NODE Node; + unsigned short ID; // NetworkID / BouquetID + struct LIST *Descriptors; + struct LIST *TransportStreams; +}; + +#define CreateNetworkInfo(ni, id) \ + do { \ + xCreateNode (ni, NULL); \ + (ni)->ID = id; \ + (ni)->Descriptors = xNewList(NULL); \ + (ni)->TransportStreams = NULL; \ + } while(0) + +/* TransportStream structure (NIT/BAT TS loop member) */ + +struct TransportStream { + struct NODE Node; + int TransportStreamID; + unsigned short OriginalNetworkID; + struct LIST *Descriptors; +}; + +#define CreateTransportStream(ts, tsid, onid) \ + do { \ + xCreateNode (ts, NULL); \ + (ts)->TransportStreamID = tsid; \ + (ts)->OriginalNetworkID = onid; \ + (ts)->Descriptors = xNewList(NULL); \ + } while(0) + /* Strukturen zur Aufnahme der SDT und EIT Informationen */ struct Service { @@ -305,38 +342,32 @@ struct PidInfo { #define STREAMTYPE_13818_D 13 #define STREAMTYPE_13818_AUX 14 -/* Descriptors */ - -#define DescriptorTag(x) ((struct Descriptor *)(x))->Tag -struct Descriptor { - struct NODE Node; - unsigned short Tag; +struct Tot { + time_t UTC; + time_t Bias; + struct LIST *Descriptors; }; +#define CreateTot(tot, utc) \ + do \ + { \ + xMemAlloc(sizeof(struct Tot), &tot); \ + tot->UTC = utc; \ + tot->Bias = ((utc - time(NULL) + 1800)/3600)*3600; \ + tot->Descriptors = xNewList(NULL); \ + } while (0) -/* ConditionalAccessDescriptor */ -struct ConditionalAccessDescriptor { +/* Descriptors */ + +#define DescriptorTag(x) ((struct Descriptor *)(x))->Tag + +struct Descriptor { struct NODE Node; unsigned short Tag; - unsigned short Amount; /* Data */ - unsigned char *Data; }; -#define CreateConditionalAccessDescriptor(descr, amount, data) \ - do \ - { \ - unsigned char *tmpptr; \ - \ - xMemAlloc (amount, &tmpptr); \ - memcpy (tmpptr, data, amount); \ - xCreateNode (((struct ConditionalAccessDescriptor *)descr), NULL); \ - ((struct ConditionalAccessDescriptor *)descr)->Tag = DESCR_CA; \ - ((struct ConditionalAccessDescriptor *)descr)->Amount = amount; \ - ((struct ConditionalAccessDescriptor *)descr)->Data = tmpptr; \ - } while (0) - /* Iso639LanguageDescriptor */ @@ -434,19 +465,23 @@ struct AncillaryDataDescriptor { /* BouquetNameDescriptor */ +/* + the same used instead of NetworkNameDescriptor because their structures + are identical. We pass 'tag' parameter to distinguish between them later +*/ struct BouquetNameDescriptor { struct NODE Node; /* Node enthält Namen */ unsigned short Tag; }; -#define CreateBouquetNameDescriptor(descr, text) \ +#define CreateBouquetNameDescriptor(descr, text, tag) \ do \ { \ xCreateNode (((struct BouquetNameDescriptor *)descr), NULL); \ ((struct NODE *)descr)->Name = text; \ ((struct NODE *)descr)->HashKey = xHashKey (text); \ - ((struct BouquetNameDescriptor *)descr)->Tag = DESCR_BOUQUET_NAME; \ + ((struct BouquetNameDescriptor *)descr)->Tag = tag; \ } while (0) @@ -514,6 +549,33 @@ struct CaIdentifierDescriptor { ((struct CaIdentifierDescriptor *)descr)->SystemID[num] = id #define GetCaIdentifierID(descr, num) (((struct CaIdentifierDescriptor *)descr)->SystemID[num]) +/* CaDescriptor */ + +struct CaDescriptor { + struct NODE Node; + unsigned short Tag; + unsigned short CA_type; + unsigned short CA_PID; + unsigned int ProviderID; + unsigned short DataLength; + unsigned char *Data; +}; + +#define CreateCaDescriptor(descr, typ, capid, len) \ + do \ + { \ + xCreateNode (((struct CaDescriptor *)descr), NULL); \ + ((struct CaDescriptor *)descr)->Tag = DESCR_CA; \ + ((struct CaDescriptor *)descr)->CA_type = typ; \ + ((struct CaDescriptor *)descr)->CA_PID = capid; \ + ((struct CaDescriptor *)descr)->ProviderID = 0; \ + ((struct CaDescriptor *)descr)->DataLength = len; \ + xMemAlloc (len+1, &((struct CaDescriptor *)descr)->Data); \ + } while (0) + +#define SetCaData(descr, num, id) \ + ((struct CaDescriptor *)descr)->Data[num] = id +#define GetCaData(descr, num) (((struct CaDescriptor *)descr)->Data[num]) /* StreamIdentifierDescriptor */ @@ -968,6 +1030,122 @@ struct SubtitlingItem { xAddTail (((struct SubtitlingDescriptor *)desc)->Items, item); \ } while (0) +/* SatelliteDeliverySystemDescriptor */ + +struct SatelliteDeliverySystemDescriptor { + struct NODE Node; + unsigned short Tag; + long Frequency; + short OrbitalPosition; + char Polarization; + long SymbolRate; + char FEC; +}; + +#define CreateSatelliteDeliverySystemDescriptor(descr, freq, orb, polar, sr, fec) \ + do \ + { \ + xCreateNode (((struct SatelliteDeliverySystemDescriptor *)descr), NULL); \ + ((struct SatelliteDeliverySystemDescriptor *)descr)->Tag = DESCR_SAT_DEL_SYS; \ + ((struct SatelliteDeliverySystemDescriptor *)descr)->Frequency = freq; \ + ((struct SatelliteDeliverySystemDescriptor *)descr)->OrbitalPosition = orb; \ + ((struct SatelliteDeliverySystemDescriptor *)descr)->Polarization = polar; \ + ((struct SatelliteDeliverySystemDescriptor *)descr)->SymbolRate = sr; \ + ((struct SatelliteDeliverySystemDescriptor *)descr)->FEC = fec; \ + } while (0) + +/* ServiceListDescriptor */ + +struct ServiceListDescriptor { + struct NODE Node; + unsigned short Tag; + struct LIST *ServiceList; +}; + +#define CreateServiceListDescriptor(descr) \ + do \ + { \ + xCreateNode (((struct ServiceListDescriptor *)descr), NULL); \ + ((struct ServiceListDescriptor *)descr)->Tag = DESCR_SERVICE_LIST; \ + ((struct ServiceListDescriptor *)descr)->ServiceList = xNewList(NULL); \ + } while (0) + +struct ServiceListEntry { + struct NODE Node; + int ServiceID; + unsigned short ServiceType; +}; + +#define AddServiceListEntry(descr, id, typ) \ + do \ + { \ + struct ServiceListEntry *newent; \ + \ + xCreateNode (newent, NULL); \ + newent->ServiceID = id; \ + newent->ServiceType = typ; \ + xAddTail (((struct ServiceListDescriptor *)descr)->ServiceList, newent); \ + } while (0) + +/* LocalTimeOffsetDescriptor */ + +struct LocalTimeOffsetDescriptor { + struct NODE Node; + unsigned short Tag; + struct LIST *LocalTimeOffsets; +}; + +#define CreateLocalTimeOffsetDescriptor(descr) \ + do \ + { \ + xCreateNode (((struct LocalTimeOffsetDescriptor *)descr), NULL); \ + ((struct LocalTimeOffsetDescriptor *)descr)->Tag = DESCR_LOCAL_TIME_OFF; \ + ((struct LocalTimeOffsetDescriptor *)descr)->LocalTimeOffsets = xNewList(NULL); \ + } while (0) + +struct LocalTimeOffsetEntry { + struct NODE Node; + char CountryCode[4]; + char RegionID; + time_t CurrentOffset; + time_t ChangeTime; + time_t NextOffset; +}; + +#define CreateLocalTimeOffsetEntry(newent, code1, code2, code3, reg, co, ct, no) \ + do \ + { \ + xCreateNode (newent, NULL); \ + newent->CountryCode[0] = code1; \ + newent->CountryCode[1] = code2; \ + newent->CountryCode[2] = code3; \ + newent->CountryCode[3] = '\0'; \ + newent->RegionID = reg; \ + newent->CurrentOffset = co; \ + newent->ChangeTime = ct; \ + newent->NextOffset = no; \ + } while (0) + +#define AddLocalTimeOffsetEntry(descr, code1, code2, code3, reg, co, ct, no) \ + do \ + { \ + struct LocalTimeOffsetEntry *newent; \ + \ + xCreateNode (newent, NULL); \ + newent->CountryCode[0] = code1; \ + newent->CountryCode[1] = code2; \ + newent->CountryCode[2] = code3; \ + newent->CountryCode[3] = '\0'; \ + newent->RegionID = reg; \ + newent->CurrentOffset = co; \ + newent->ChangeTime = ct; \ + newent->NextOffset = no; \ + xAddTail (((struct LocalTimeOffsetDescriptor *)descr)->LocalTimeOffsets, newent); \ + } while (0) + +#define timezonecmp(ptoe,cod,reg) \ + (strncmp(ptoe->CountryCode, cod, 3) || (ptoe->RegionID != reg)) + /* Prototypes */ @@ -979,13 +1157,17 @@ extern "C" { /* si_parser.c */ struct LIST *siParsePAT (u_char *); +struct LIST *siParseCAT (u_char *); struct Pid *siParsePMT (u_char *); struct LIST *siParseSDT (u_char *); +struct LIST *siParseNIT (u_char *); struct LIST *siParseEIT (u_char *); time_t siParseTDT (u_char *); +struct Tot *siParseTOT (u_char *); void siParseDescriptors (struct LIST *, u_char *, int, u_char); void siParseDescriptor (struct LIST *, u_char *); char *siGetDescriptorText (u_char *, int); +char *siGetDescriptorName (u_char *, int); u_long crc32 (char *data, int len); /* si_debug_services.c */ @@ -999,6 +1181,8 @@ void siDebugPids (char *, struct LIST *); void siDebugDescriptors (char *, struct LIST *); void siDebugEitServices (struct LIST *); void siDebugEitEvents (char *, struct LIST *); +void siDumpDescriptor (void *); +void siDumpSection (void *); #ifdef __cplusplus } diff --git a/libdtv/libsi/include/si_tables.h b/libdtv/libsi/include/si_tables.h index dfda3bf..b7cfea2 100644 --- a/libdtv/libsi/include/si_tables.h +++ b/libdtv/libsi/include/si_tables.h @@ -5,11 +5,13 @@ /// /// ////////////////////////////////////////////////////////////// -// $Revision: 1.3 $ -// $Date: 2001/10/07 10:24:46 $ +// $Revision: 1.4 $ +// $Date: 2003/02/04 18:45:36 $ // $Author: hakenes $ // -// (C) 2001 Rolf Hakenes , under the GNU GPL. +// (C) 2001-03 Rolf Hakenes , under the +// GNU GPL with contribution of Oleg Assovski, +// www.satmania.com // // libsi is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -32,12 +34,22 @@ #define BcdTimeToSeconds(x) ((3600 * ((10*((x##_h & 0xF0)>>4)) + (x##_h & 0xF))) + \ (60 * ((10*((x##_m & 0xF0)>>4)) + (x##_m & 0xF))) + \ ((10*((x##_s & 0xF0)>>4)) + (x##_s & 0xF))) +#define BcdTimeToMinutes(x) ((60 * ((10*((x##_h & 0xF0)>>4)) + (x##_h & 0xF))) + \ + (((10*((x##_m & 0xF0)>>4)) + (x##_m & 0xF)))) +#define BcdCharToInt(x) (10*((x & 0xF0)>>4) + (x & 0xF)) +#define CheckBcdChar(x) ((((x & 0xF0)>>4) <= 9) && \ + ((x & 0x0F) <= 9)) +#define CheckBcdSignedChar(x) ((((x & 0xF0)>>4) >= 0) && (((x & 0xF0)>>4) <= 9) && \ + ((x & 0x0F) >= 0) && ((x & 0x0F) <= 9)) #define TableHasMoreSections(x) (((pat_t *)(x))->last_section_number > ((pat_t *)(x))->section_number) #define GetTableId(x) ((pat_t *)(x))->table_id #define GetSectionNumber(x) ((pat_t *)(x))->section_number #define GetLastSectionNumber(x) ((pat_t *)(x))->last_section_number #define GetServiceId(x) (((eit_t *)(x))->service_id_hi << 8) | ((eit_t *)(x))->service_id_lo +#define GetSegmentLastSectionNumber(x) ((eit_t *)(x))->segment_last_section_number +#define GetLastTableId(x) ((eit_t *)(x))->segment_last_table_id +#define GetSectionLength(x) HILO(((pat_t *)(x))->section_length) /* * @@ -113,7 +125,37 @@ typedef struct { * applicable. * */ - /* TO BE DONE */ +#define CAT_LEN 8 + +typedef struct { + u_char table_id :8; +#if BYTE_ORDER == BIG_ENDIAN + u_char section_syntax_indicator :1; + u_char dummy :1; // has to be 0 + u_char :2; + u_char section_length_hi :4; +#else + u_char section_length_hi :4; + u_char :2; + u_char dummy :1; // has to be 0 + u_char section_syntax_indicator :1; +#endif + u_char section_length_lo :8; + u_char reserved_1 :8; + u_char reserved_2 :8; +#if BYTE_ORDER == BIG_ENDIAN + u_char :2; + u_char version_number :5; + u_char current_next_indicator :1; +#else + u_char current_next_indicator :1; + u_char version_number :5; + u_char :2; +#endif + u_char section_number :8; + u_char last_section_number :8; +} cat_t; + /* * * 3) Program Map Table (PMT): @@ -297,7 +339,7 @@ typedef struct { * bouquet. * */ - /* TO BE DONE */ +/* SEE NIT (It has the same structure but has different allowed descriptors) */ /* * * 2) Service Description Table (SDT): @@ -339,6 +381,9 @@ typedef struct { u_char :8; } sdt_t; +#define GetSDTTransportStreamId(x) (HILO(((sdt_t *) x)->transport_stream_id)) +#define GetSDTOriginalNetworkId(x) (HILO(((sdt_t *) x)->original_network_id)) + #define SDT_DESCR_LEN 5 typedef struct { @@ -483,7 +528,36 @@ typedef struct { * to the frequent updating of the time information. * */ - /* TO BE DONE */ +#define TOT_LEN 10 + +typedef struct { + u_char table_id :8; +#if BYTE_ORDER == BIG_ENDIAN + u_char section_syntax_indicator :1; + u_char :3; + u_char section_length_hi :4; +#else + u_char section_length_hi :4; + u_char :3; + u_char section_syntax_indicator :1; +#endif + u_char section_length_lo :8; + u_char utc_mjd_hi :8; + u_char utc_mjd_lo :8; + u_char utc_time_h :8; + u_char utc_time_m :8; + u_char utc_time_s :8; +#if BYTE_ORDER == BIG_ENDIAN + u_char :4; + u_char descriptors_loop_length_hi :4; +#else + u_char descriptors_loop_length_hi :4; + u_char :4; +#endif + u_char descriptors_loop_length_lo :8; +} tot_t; + + /* * * 7) Stuffing Table (ST): @@ -545,6 +619,25 @@ typedef struct descr_gen_struct { #define GetDescriptorLength(x) (((descr_gen_t *) x)->descriptor_length+DESCR_GEN_LEN) +/* 0x09 ca_descriptor */ + +#define DESCR_CA_LEN 6 +typedef struct descr_ca_struct { + u_char descriptor_tag :8; + u_char descriptor_length :8; + u_char CA_type_hi :8; + u_char CA_type_lo :8; +#if BYTE_ORDER == BIG_ENDIAN + u_char reserved :3; + u_char CA_PID_hi :5; +#else + u_char CA_PID_hi :5; + u_char reserved :3; +#endif + u_char CA_PID_lo :8; +} descr_ca_t; +#define CastCaDescriptor(x) ((descr_ca_t *)(x)) + /* 0x0A iso_639_language_descriptor */ #define DESCR_ISO_639_LANGUAGE_LEN 5 @@ -560,25 +653,31 @@ typedef struct descr_iso_639_language_struct { /* 0x40 network_name_descriptor */ -#define DESCR_NETWORK_NAME_LEN XX +#define DESCR_NETWORK_NAME_LEN 2 typedef struct descr_network_name_struct { u_char descriptor_tag :8; u_char descriptor_length :8; - /* TBD */ } descr_network_name_t; #define CastNetworkNameDescriptor(x) ((descr_network_name_t *)(x)) /* 0x41 service_list_descriptor */ -#define DESCR_SERVICE_LIST_LEN XX +#define DESCR_SERVICE_LIST_LEN 2 typedef struct descr_service_list_struct { u_char descriptor_tag :8; u_char descriptor_length :8; - /* TBD */ } descr_service_list_t; #define CastServiceListDescriptor(x) ((descr_service_list_t *)(x)) +#define DESCR_SERVICE_LIST_LOOP_LEN 3 +typedef struct descr_service_list_loop_struct { + u_char service_id_hi :8; + u_char service_id_lo :8; + u_char service_type :8; +} descr_service_list_loop_t; +#define CastServiceListDescriptorLoop(x) ((descr_service_list_loop_t *)(x)) + /* 0x42 stuffing_descriptor */ @@ -604,13 +703,13 @@ typedef struct descr_satellite_delivery_system_struct { u_char orbital_position1 :8; u_char orbital_position2 :8; #if BYTE_ORDER == BIG_ENDIAN - u_char modulation :5; - u_char polarization :2; - u_char west_east_flag :1; -#else u_char west_east_flag :1; u_char polarization :2; u_char modulation :5; +#else + u_char modulation :5; + u_char polarization :2; + u_char west_east_flag :1; #endif u_char symbol_rate1 :8; u_char symbol_rate2 :8; @@ -964,14 +1063,39 @@ typedef struct descr_telephone_struct { /* 0x58 local_time_offset_descriptor */ -#define DESCR_LOCAL_TIME_OFFSET_LEN XX +#define DESCR_LOCAL_TIME_OFFSET_LEN 2 typedef struct descr_local_time_offset_struct { u_char descriptor_tag :8; u_char descriptor_length :8; - /* TBD */ } descr_local_time_offset_t; #define CastLocalTimeOffsetDescriptor(x) ((descr_local_time_offset_t *)(x)) +#define LOCAL_TIME_OFFSET_ENTRY_LEN 15 +typedef struct local_time_offset_entry_struct { + u_char country_code1 :8; + u_char country_code2 :8; + u_char country_code3 :8; +#if BYTE_ORDER == BIG_ENDIAN + u_char country_region_id :6; + u_char :1; + u_char local_time_offset_polarity :1; +#else + u_char local_time_offset_polarity :1; + u_char :1; + u_char country_region_id :6; +#endif + u_char local_time_offset_h :8; + u_char local_time_offset_m :8; + u_char time_of_change_mjd_hi :8; + u_char time_of_change_mjd_lo :8; + u_char time_of_change_time_h :8; + u_char time_of_change_time_m :8; + u_char time_of_change_time_s :8; + u_char next_time_offset_h :8; + u_char next_time_offset_m :8; +} local_time_offset_entry_t ; +#define CastLocalTimeOffsetEntry(x) ((local_time_offset_entry_t *)(x)) + /* 0x59 subtitling_descriptor */ -- cgit v1.2.3