From 5a4eb3f1041b8a53826cebe570f9d201f3d35826 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sun, 29 Feb 2004 18:00:00 +0100 Subject: =?UTF-8?q?Version=201.3.5=20-=20Fixed=20reading=20the=20EPG=20pre?= =?UTF-8?q?ferred=20language=20parameter=20from=20'setup.conf'.=20-=20Fixe?= =?UTF-8?q?d=20switching=20to=20a=20visible=20programme=20in=20case=20the?= =?UTF-8?q?=20current=20channel=20has=20neither=20=20=20a=20video=20nor=20?= =?UTF-8?q?an=20audio=20PID.=20-=20Fixed=20editing=20channels=20(SID=20now?= =?UTF-8?q?=20range=20checked)=20and=20creating=20new=20channels=20(NID,?= =?UTF-8?q?=20=20=20TID=20and=20RID=20are=20now=20set=20to=200).=20-=20Fix?= =?UTF-8?q?ed=20transponder=20handling=20to=20make=20it=20work=20with=20sa?= =?UTF-8?q?tellites=20that=20provide=20two=20=20=20transponders=20on=20the?= =?UTF-8?q?=20same=20frequency,=20with=20different=20polarization,=20like?= =?UTF-8?q?=20Hispasat=20=20=20at=20S30.0W=20(thanks=20to=20Thomas=20Bergw?= =?UTF-8?q?inkl=20for=20pointing=20this=20out).=20See=20man=20vdr(5)=20=20?= =?UTF-8?q?=20for=20details=20about=20the=20enhanced=20channel=20ID=20form?= =?UTF-8?q?at.=20-=20Since=20there=20appears=20to=20be=20no=20general=20so?= =?UTF-8?q?lution=20for=20the=20UPT=20error=20yet,=20a=20recording=20=20?= =?UTF-8?q?=20now=20initiates=20an=20"emergency=20exit"=20if=20the=20numbe?= =?UTF-8?q?r=20of=20UPT=20errors=20during=20one=20=20=20recording=20exceed?= =?UTF-8?q?s=2010=20(suggested=20by=20Gregoire=20Favre).=20Since=20the=20U?= =?UTF-8?q?PT=20error=20doesn't=20=20=20happen=20on=20my=20system,=20this?= =?UTF-8?q?=20has=20not=20been=20explicitly=20tested.=20=20=20The=20"preli?= =?UTF-8?q?minary=20fix"=20for=20the=20UPT=20error=20in=20VDR/dvbdevice.c?= =?UTF-8?q?=20has=20been=20disabled=20=20=20by=20default,=20since=20it=20m?= =?UTF-8?q?akes=20channel=20switching=20unpleasently=20slow.=20If=20you=20?= =?UTF-8?q?want=20=20=20to=20have=20that=20workaround=20back,=20you=20can?= =?UTF-8?q?=20uncomment=20the=20line=20=20=20//#define=20WAIT=5FFOR=5FLOCK?= =?UTF-8?q?=5FAFTER=5FTUNING=201=20=20=20in=20VDR/dvbdevice.c.=20-=20Adapt?= =?UTF-8?q?ed=20the=20'sky'=20plugin=20to=20use=20the=20actual=20channel?= =?UTF-8?q?=20IDs,=20and=20to=20fetch=20EPG=20data=20=20=20from=20www.bleb?= =?UTF-8?q?.org.=20-=20Limited=20automatic=20retuning=20to=20devices=20tha?= =?UTF-8?q?t=20actually=20provide=20the=20transponder=20=20=20(necessary?= =?UTF-8?q?=20for=20the=20'sky'=20plugin).=20-=20Fixed=20handling=20receiv?= =?UTF-8?q?ers=20in=20the=20'sky'=20plugin,=20so=20that=20a=20recording=20?= =?UTF-8?q?on=20the=20same=20=20=20channel=20won't=20interrupt=20an=20ongo?= =?UTF-8?q?ing=20Transfer=20Mode.=20-=20Added=20subtable=20ID=20and=20TSDT?= =?UTF-8?q?=20handling=20to=20'libsi'=20(thanks=20to=20Marcel=20Wiesweg).?= =?UTF-8?q?=20-=20Fixed=20some=20Russian=20OSD=20texts=20(thanks=20to=20Vy?= =?UTF-8?q?acheslav=20Dikonov).=20-=20Added=20the=20'running=20status'=20t?= =?UTF-8?q?o=20the=20EPG=20events.=20This=20is=20necessary=20for=20impleme?= =?UTF-8?q?nting=20=20=20the=20VPS=20function=20for=20recording.=20-=20Rem?= =?UTF-8?q?oved=20the=20obsolete=20'present'=20and=20'following'=20handlin?= =?UTF-8?q?g=20from=20the=20EPG=20data.=20-=20The=20EPG=20data=20is=20now?= =?UTF-8?q?=20always=20kept=20sorted=20chronologically=20in=20the=20intern?= =?UTF-8?q?al=20data=20=20=20structures.=20This=20also=20means=20that=20an?= =?UTF-8?q?y=20EPG=20data=20retrieved=20through=20the=20SVRDP=20=20=20comm?= =?UTF-8?q?and=20LSTE=20is=20guaranteed=20to=20be=20sorted=20by=20start=20?= =?UTF-8?q?time.=20-=20Now=20using=20the=20'running=20status'=20in=20the?= =?UTF-8?q?=20channel=20display,=20so=20that=20a=20programme=20=20=20that?= =?UTF-8?q?=20has=20an=20end=20time=20that=20is=20before=20the=20current?= =?UTF-8?q?=20time,=20but=20is=20still=20running,=20=20=20will=20still=20b?= =?UTF-8?q?e=20shown=20in=20the=20display=20(provided=20the=20broadcasters?= =?UTF-8?q?=20handle=20the=20=20=20'running=20status'=20flag=20correctly).?= =?UTF-8?q?=20This=20also=20applies=20to=20programmes=20that=20have=20=20?= =?UTF-8?q?=20a=20start=20time=20that=20is=20in=20the=20future,=20but=20ar?= =?UTF-8?q?e=20already=20running.=20-=20Implemented=20an=20"EPG=20linger?= =?UTF-8?q?=20time",=20which=20can=20be=20set=20to=20have=20older=20EPG=20?= =?UTF-8?q?information=20=20=20still=20displayed=20in=20the=20"Schedule"?= =?UTF-8?q?=20menu=20(thanks=20to=20Jaakko=20Hyv=C3=A4tti).=20-=20Added=20?= =?UTF-8?q?PDCDescriptor=20handling=20to=20'libsi'.=20-=20Implemented=20ha?= =?UTF-8?q?ndling=20the=20VPS=20timestamps=20(aka=20"Programme=20Identific?= =?UTF-8?q?ation=20Label")=20=20=20for=20full=20VPS=20support=20for=20time?= =?UTF-8?q?rs=20(provided=20the=20tv=20stations=20actually=20broadcast=20?= =?UTF-8?q?=20=20this=20information).=20The=20VPS=20time=20is=20displayed?= =?UTF-8?q?=20in=20the=20event=20info=20page=20if=20it=20exists=20=20=20an?= =?UTF-8?q?d=20is=20different=20than=20the=20event's=20start=20time.=20-?= =?UTF-8?q?=20Extended=20the=20SVDRP=20command=20LSTE=20to=20allow=20limit?= =?UTF-8?q?ing=20the=20listed=20data=20to=20a=20given=20=20=20channel,=20t?= =?UTF-8?q?he=20present=20or=20following=20events,=20or=20events=20at=20a?= =?UTF-8?q?=20given=20time=20(thanks=20to=20=20=20Thomas=20Heiligenmann).?= =?UTF-8?q?=20-=20Fixed=20a=20typo=20in=20libsi/si.h=20(thanks=20to=20St?= =?UTF-8?q?=C3=A9phane=20Est=C3=A9-Gracias).=20-=20Timers=20can=20now=20be?= =?UTF-8?q?=20set=20to=20use=20the=20VPS=20information=20to=20control=20re?= =?UTF-8?q?cording=20a=20programme.=20=20=20The=20new=20setup=20options=20?= =?UTF-8?q?"Recording/Use=20VPS"=20and=20"Recording/VPS=20margin",=20as=20?= =?UTF-8?q?well=20as=20=20=20the=20"VPS"=20option=20in=20the=20individual?= =?UTF-8?q?=20timers,=20can=20be=20used=20to=20control=20this=20feature=20?= =?UTF-8?q?=20=20(see=20MANUAL=20for=20details).=20=20=20Note=20that=20thi?= =?UTF-8?q?s=20feature=20will=20certainly=20need=20a=20lot=20of=20testing?= =?UTF-8?q?=20before=20it=20can=20be=20=20=20called=20"safe"!=20-=20The=20?= =?UTF-8?q?"Schedule"=20and=20"What's=20on=20now/next=3F"=20menus=20now=20?= =?UTF-8?q?have=20an=20additional=20column=20=20=20which=20displays=20info?= =?UTF-8?q?rmation=20on=20whether=20there=20is=20a=20timer=20defined=20for?= =?UTF-8?q?=20an=20event,=20=20=20whether=20an=20event=20has=20a=20VPS=20t?= =?UTF-8?q?ime=20that's=20different=20than=20its=20start=20time,=20and=20?= =?UTF-8?q?=20=20whether=20an=20event=20is=20currently=20running=20(see=20?= =?UTF-8?q?MANUAL=20under=20"The=20"Schedule"=20Menu"=20=20=20for=20detail?= =?UTF-8?q?s).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libsi/descriptor.c | 23 ++++++++++++++++++++- libsi/descriptor.h | 14 ++++++++++++- libsi/headers.h | 59 +++++++++++++++++++++++++++++++++++++++++++++++++----- libsi/section.c | 18 ++++++++++++++++- libsi/section.h | 15 +++++++++++++- libsi/si.c | 14 +++++++++++-- libsi/si.h | 7 +++++-- 7 files changed, 137 insertions(+), 13 deletions(-) (limited to 'libsi') diff --git a/libsi/descriptor.c b/libsi/descriptor.c index 55a6a9c..0b0019f 100644 --- a/libsi/descriptor.c +++ b/libsi/descriptor.c @@ -6,7 +6,7 @@ * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * - * $Id: descriptor.c 1.5 2004/01/24 14:52:41 kls Exp $ + * $Id: descriptor.c 1.6 2004/02/22 11:11:36 kls Exp $ * * ***************************************************************************/ @@ -529,6 +529,27 @@ void ISO639LanguageDescriptor::Parse() { languageCode[3]=0; } +void PDCDescriptor::Parse() { + unsigned int offset=0; + data.setPointerAndOffset(s, offset); +} + +int PDCDescriptor::getDay() const { + return ((s->pil0 & 0x0F) << 1) | ((s->pil1 & 0x80) >> 7); +} + +int PDCDescriptor::getMonth() const { + return (s->pil1 >> 3) & 0x0F; +} + +int PDCDescriptor::getHour() const { + return ((s->pil1 & 0x07) << 2) | ((s->pil2 & 0xC0) >> 6); +} + +int PDCDescriptor::getMinute() const { + return s->pil2 & 0x3F; +} + void ApplicationSignallingDescriptor::Parse() { entryLoop.setData(data+sizeof(descr_application_signalling), getLength()-sizeof(descr_application_signalling)); } diff --git a/libsi/descriptor.h b/libsi/descriptor.h index 5541cc4..17c81eb 100644 --- a/libsi/descriptor.h +++ b/libsi/descriptor.h @@ -6,7 +6,7 @@ * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * - * $Id: descriptor.h 1.5 2004/01/24 14:52:05 kls Exp $ + * $Id: descriptor.h 1.6 2004/02/22 10:16:47 kls Exp $ * * ***************************************************************************/ @@ -383,6 +383,18 @@ private: const descr_iso_639_language *s; }; +class PDCDescriptor : public Descriptor { +public: + int getDay() const; + int getMonth() const; + int getHour() const; + int getMinute() const; +protected: + virtual void Parse(); +private: + const descr_pdc *s; +}; + //a descriptor currently unimplemented in this library class UnimplementedDescriptor : public Descriptor { protected: diff --git a/libsi/headers.h b/libsi/headers.h index d5c1199..ff3e0f9 100644 --- a/libsi/headers.h +++ b/libsi/headers.h @@ -10,7 +10,7 @@ * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * - * $Id: headers.h 1.2 2003/12/13 10:43:26 kls Exp $ + * $Id: headers.h 1.4 2004/02/22 11:12:46 kls Exp $ * * ***************************************************************************/ @@ -257,7 +257,48 @@ struct pmt_info { /* * - * 4) Network Information Table (NIT): + * 4) Transport Stream Description Table (TSDT): + * + * - The TSDT carries a loop of descriptors that apply to + * the whole transport stream. The syntax and semantics + * of the TSDT are defined in newer versions of ISO/IEC 13818-1. + * + */ + +#define TSDT_LEN 8 + +struct tsdt { + 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 :8; + u_char :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; +}; + +/* + * + * 5) Network Information Table (NIT): * * - the NIT is intended to provide information about the physical * network. The syntax and semantics of the NIT are defined in @@ -468,7 +509,7 @@ struct eit { u_char original_network_id_hi :8; u_char original_network_id_lo :8; u_char segment_last_section_number :8; - u_char segment_last_table_id :8; + u_char last_table_id :8; }; #define EIT_EVENT_LEN 12 @@ -1416,11 +1457,19 @@ struct descr_dsng { /* 0x69 pdc_descriptor */ -#define DESCR_PDC_LEN XX +#define DESCR_PDC_LEN 5 struct descr_pdc { u_char descriptor_tag :8; u_char descriptor_length :8; - /* TBD */ +#if BYTE_ORDER == BIG_ENDIAN + u_char pil2 :8; + u_char pil1 :8; + u_char pil0 :8; +#else + u_char pil0 :8; + u_char pil1 :8; + u_char pil2 :8; +#endif }; /* 0x6A ac3_descriptor */ diff --git a/libsi/section.c b/libsi/section.c index 0de2a57..2cac809 100644 --- a/libsi/section.c +++ b/libsi/section.c @@ -6,7 +6,7 @@ * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * - * $Id: section.c 1.2 2003/12/13 10:42:14 kls Exp $ + * $Id: section.c 1.3 2004/02/20 13:44:59 kls Exp $ * * ***************************************************************************/ @@ -76,6 +76,14 @@ void PMT::Stream::Parse() { streamDescriptors.setData(data+offset, HILO(s->ES_info_length)); } +/*********************** TSDT ***********************/ + +void TSDT::Parse() { + unsigned int offset=0; + data.setPointerAndOffset(s, offset); + transportStreamDescriptors.setDataAndOffset(data+offset, getLength()-offset-4, offset); +} + /*********************** NIT ***********************/ int NIT::getNetworkId() const { @@ -161,6 +169,14 @@ int EIT::getOriginalNetworkId() const { return HILO(s->original_network_id); } +int EIT::getSegmentLastSectionNumber() const { + return s->segment_last_section_number; +} + +int EIT::getLastTableId() const { + return s->last_table_id; +} + bool EIT::isPresentFollowing() const { return getTableId() == TableIdEIT_presentFollowing || getTableId() == TableIdEIT_presentFollowing_other; } diff --git a/libsi/section.h b/libsi/section.h index efca9bb..5b43f05 100644 --- a/libsi/section.h +++ b/libsi/section.h @@ -6,7 +6,7 @@ * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * - * $Id: section.h 1.2 2003/12/13 10:42:15 kls Exp $ + * $Id: section.h 1.3 2004/02/20 13:45:45 kls Exp $ * * ***************************************************************************/ @@ -77,6 +77,17 @@ private: const pmt *s; }; +class TSDT : public NumberedSection { +public: + TSDT(const unsigned char *data, bool doCopy=true) : NumberedSection(data, doCopy) {} + TSDT() {} + DescriptorLoop transportStreamDescriptors; +protected: + virtual void Parse(); +private: + const tsdt *s; +}; + class NIT : public NumberedSection { public: NIT(const unsigned char *data, bool doCopy=true) : NumberedSection(data, doCopy) {} @@ -166,6 +177,8 @@ public: int getServiceId() const; int getTransportStreamId() const; int getOriginalNetworkId() const; + int getSegmentLastSectionNumber() const; + int getLastTableId() const; StructureLoop eventLoop; //true if table conveys present/following information, false if it conveys schedule information diff --git a/libsi/si.c b/libsi/si.c index 4264feb..ee64802 100644 --- a/libsi/si.c +++ b/libsi/si.c @@ -6,7 +6,7 @@ * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * - * $Id: si.c 1.6 2004/01/23 14:27:45 kls Exp $ + * $Id: si.c 1.8 2004/02/22 10:14:12 kls Exp $ * * ***************************************************************************/ @@ -61,6 +61,14 @@ bool CRCSection::CheckCRCAndParse() { return true; } +int NumberedSection::getTableIdExtension() const { + return getTableIdExtension(data.getData()); +} + +int NumberedSection::getTableIdExtension(const unsigned char *d) { + return HILO(((const ExtendedSectionHeader *)d)->table_id_extension); +} + bool NumberedSection::getCurrentNextIndicator() const { return data.getData()->current_next_indicator; } @@ -326,6 +334,9 @@ Descriptor *Descriptor::getDescriptor(CharArray da, DescriptorTagDomain domain) case ISO639LanguageDescriptorTag: d=new ISO639LanguageDescriptor(); break; + case PDCDescriptorTag: + d=new PDCDescriptor(); + break; //note that it is no problem to implement one //of the unimplemented descriptors. @@ -367,7 +378,6 @@ Descriptor *Descriptor::getDescriptor(CharArray da, DescriptorTagDomain domain) case CaSystemDescriptorTag: case AC3DescriptorTag: case DSNGDescriptorTag: - case PDCDescriptorTag: case AncillaryDataDescriptorTag: case AnnouncementSupportDescriptorTag: case AdaptationFieldDataDescriptorTag: diff --git a/libsi/si.h b/libsi/si.h index 4666c2d..befff85 100644 --- a/libsi/si.h +++ b/libsi/si.h @@ -6,7 +6,7 @@ * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * - * $Id: si.h 1.6 2004/01/12 16:19:11 kls Exp $ + * $Id: si.h 1.8 2004/02/23 17:02:33 kls Exp $ * * ***************************************************************************/ @@ -36,7 +36,7 @@ enum TableId { TableIdPAT = 0x00, //program association section TableIdEIT_schedule_last = 0x5F, //range from 0x60 to 0x6F TableIdEIT_schedule_Other_first = 0x60, - TableIdEIT_schedule_Other_fast = 0x6F, + TableIdEIT_schedule_Other_last = 0x6F, TableIdTDT = 0x70, //time date section TableIdRST = 0x71, //running status section TableIdST = 0x72, //stuffing section @@ -216,11 +216,14 @@ class NumberedSection : public CRCSection { public: NumberedSection(const unsigned char *data, bool doCopy=true) : CRCSection(data, doCopy) {} NumberedSection() {} + int getTableIdExtension() const; bool getCurrentNextIndicator() const; int getVersionNumber() const; int getSectionNumber() const; int getLastSectionNumber() const; bool moreThanOneSection() const { return getLastSectionNumber()>0; } + + static int getTableIdExtension(const unsigned char *d); }; class VariableLengthPart : public Object { -- cgit v1.2.3