diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2003-05-10 09:25:14 +0200 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2003-05-10 09:25:14 +0200 |
commit | 91b51148385826769300454ad972a1623cfccb9e (patch) | |
tree | da66e65bbcc3564cea0c730684b1ee2d03c781ab | |
parent | dc8fd12f91713c2eec49ae38ab34f09fd7e73369 (diff) | |
download | vdr-91b51148385826769300454ad972a1623cfccb9e.tar.gz vdr-91b51148385826769300454ad972a1623cfccb9e.tar.bz2 |
Implemented the CableDeliverySystemDescriptor in libdtv
-rw-r--r-- | CONTRIBUTORS | 1 | ||||
-rw-r--r-- | HISTORY | 3 | ||||
-rw-r--r-- | libdtv/libsi/include/libsi.h | 22 | ||||
-rw-r--r-- | libdtv/libsi/si_debug_services.c | 16 | ||||
-rw-r--r-- | libdtv/libsi/si_parser.c | 32 |
5 files changed, 69 insertions, 5 deletions
diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 1f67aa48..e0afe087 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -409,6 +409,7 @@ Gregoire Favre <greg@ulima.unil.ch> Sven Grothklags <sven@uni-paderborn.de> for fixing the cutting mechanism to make it re-sync in case a frame is larger than the buffer + for implementing the CableDeliverySystemDescriptor in libdtv Tomas Prybil <tomas.prybil@copper.se> for translating OSD texts to the Swedish language @@ -2109,9 +2109,10 @@ Video Disk Recorder Revision History - The red ("Record") and yellow ("Pause") button in the "Main" menu are no longer available when replaying. -2003-05-09: Version 1.1.31 +2003-05-10: Version 1.1.31 - Introduced the new function cPlugin::Initialize(), in order to be able to separate the startup of a plugin into an "early" (Initialize()) and "late" (Start()) phase (suggested by Andreas Schultz). Plugin authors should please read the section about "Getting started" in PLUGINS.html and adapt their code if applicable. +- Implemented the CableDeliverySystemDescriptor in libdtv (thanks to Sven Grothklags) diff --git a/libdtv/libsi/include/libsi.h b/libdtv/libsi/include/libsi.h index cd07fc6d..a5e587b2 100644 --- a/libdtv/libsi/include/libsi.h +++ b/libdtv/libsi/include/libsi.h @@ -1054,6 +1054,28 @@ struct SatelliteDeliverySystemDescriptor { ((struct SatelliteDeliverySystemDescriptor *)descr)->FEC = fec; \ } while (0) +/* CableDeliverySystemDescriptor */ + +struct CableDeliverySystemDescriptor { + struct NODE Node; + unsigned short Tag; + long Frequency; + long SymbolRate; + char FEC; + char Modulation; +}; + +#define CreateCableDeliverySystemDescriptor(descr, freq, sr, fec, mod) \ + do \ + { \ + xCreateNode (((struct CableDeliverySystemDescriptor *)descr), NULL); \ + ((struct CableDeliverySystemDescriptor *)descr)->Tag = DESCR_CABLE_DEL_SYS; \ + ((struct CableDeliverySystemDescriptor *)descr)->Frequency = freq; \ + ((struct CableDeliverySystemDescriptor *)descr)->SymbolRate = sr; \ + ((struct CableDeliverySystemDescriptor *)descr)->FEC = fec; \ + ((struct CableDeliverySystemDescriptor *)descr)->Modulation = mod; \ + } while (0) + /* ServiceListDescriptor */ struct ServiceListDescriptor { diff --git a/libdtv/libsi/si_debug_services.c b/libdtv/libsi/si_debug_services.c index ac8de34c..9138d803 100644 --- a/libdtv/libsi/si_debug_services.c +++ b/libdtv/libsi/si_debug_services.c @@ -540,6 +540,19 @@ void siDebugDescriptors (char *Prepend, struct LIST *Descriptors) } break; + case DESCR_CABLE_DEL_SYS: + { + struct CableDeliverySystemDescriptor *cds = + (struct CableDeliverySystemDescriptor *)Descriptor; + + printf ("%sDescriptor: Cable Delivery System\n", Prepend); + printf ("%s Frequency: %ld\n", Prepend, cds->Frequency); + printf ("%s SymbolRate: %ld\n", Prepend, cds->SymbolRate); + printf ("%s FEC: %d\n", Prepend, cds->FEC); + printf ("%s Modulation: %d\n", Prepend, cds->Modulation); + } + break; + case DESCR_SERVICE_LIST: { struct ServiceListEntry *Entry; @@ -572,7 +585,6 @@ void siDebugDescriptors (char *Prepend, struct LIST *Descriptors) break; case DESCR_STUFFING: - case DESCR_CABLE_DEL_SYS: case DESCR_VBI_DATA: case DESCR_VBI_TELETEXT: case DESCR_MOSAIC: @@ -598,7 +610,7 @@ void siDebugDescriptors (char *Prepend, struct LIST *Descriptors) case DESCR_CELL_FREQ_LINK: case DESCR_ANNOUNCEMENT_SUPPORT: default: - printf ("%sDescriptor: (noch nicht unterstützt)\n", Prepend); + printf ("%sDescriptor: %02x (noch nicht unterstützt)\n", Prepend, DescriptorTag (Descriptor)); break; } } diff --git a/libdtv/libsi/si_parser.c b/libdtv/libsi/si_parser.c index e8cf8b21..1ca311be 100644 --- a/libdtv/libsi/si_parser.c +++ b/libdtv/libsi/si_parser.c @@ -1064,6 +1064,36 @@ void siParseDescriptor (struct LIST *Descriptors, u_char *Buffer) } break; + case DESCR_CABLE_DEL_SYS: +// fprintf (stderr, "got descriptor 0x%x\n", GetDescriptorTag(Buffer)); + { + descr_cable_delivery_system_t *cds; + cds = (descr_cable_delivery_system_t *) Ptr; + if (CheckBcdChar (cds->frequency1) && CheckBcdChar (cds->frequency2) && + CheckBcdChar (cds->frequency3) && CheckBcdChar (cds->frequency4) && + CheckBcdChar (cds->symbol_rate1) && CheckBcdChar (cds->symbol_rate1) && + CheckBcdChar (cds->symbol_rate3) && (cds->fec_inner != 0)) + { + CreateCableDeliverySystemDescriptor (Descriptor, + BcdCharToInt (cds->frequency1) * 100 * 1000 * 1000 + + BcdCharToInt (cds->frequency2) * 1000 * 1000 + + BcdCharToInt (cds->frequency3) * 10 * 1000 + + BcdCharToInt (cds->frequency4) * 100, + BcdCharToInt (cds->symbol_rate1) * 10 * 1000 + + BcdCharToInt (cds->symbol_rate2) * 100 + + BcdCharToInt (cds->symbol_rate3), + cds->fec_inner, + cds->modulation + ); + } + /* else + { + fprintf (stderr, "Illegal cds descriptor\n"); + siDumpDescriptor (Buffer); + } */ + } + break; + case DESCR_SERVICE_LIST: // fprintf (stderr, "got descriptor 0x%x\n", GetDescriptorTag(Buffer)); CreateServiceListDescriptor (Descriptor); @@ -1119,7 +1149,6 @@ void siParseDescriptor (struct LIST *Descriptors, u_char *Buffer) case DESCR_SMOOTHING_BUFFER: case DESCR_STD: case DESCR_IBP: - case DESCR_CABLE_DEL_SYS: case DESCR_VBI_DATA: case DESCR_VBI_TELETEXT: case DESCR_MOSAIC: @@ -1181,7 +1210,6 @@ char *siGetDescriptorTextHandler (u_char *Buffer, int Length, int type) if ((*Buffer >= ' ' && *Buffer <= '~') || (*Buffer == '\n') || (*Buffer >= 0xa0 && *Buffer <= 0xff)) *tmp++ = *Buffer; if (*Buffer == 0x8A) *tmp++ = '\n'; - if (*Buffer == 0x86 || *Buffer == 0x87) *tmp++ = ' '; if ((*Buffer == 0x86 || *Buffer == 0x87) && !(GDT_NAME_DESCRIPTOR & type)) *tmp++ = ' '; Buffer++; } |