From 293ed4027ed3c3c8fd6ef1e8bdd79bfe69193957 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Mon, 17 Apr 2006 18:00:00 +0200 Subject: =?UTF-8?q?Version=201.3.47=20-=20Updated=20the=20Finnish=20OSD=20?= =?UTF-8?q?texts=20(thanks=20to=20Rolf=20Ahrenberg).=20-=20Fixed=20a=20cra?= =?UTF-8?q?sh=20when=20setting=20the=20time=20transponder=20in=20the=20Set?= =?UTF-8?q?up=20menu,=20caused=20by=20the=20=20=20new=20'noneString'=20in?= =?UTF-8?q?=20cMenuEditChanItem=20(reported=20by=20Thomas=20G=C3=BCnther).?= =?UTF-8?q?=20-=20Added=20NULL=20checks=20to=20some=20strdup()=20calls=20i?= =?UTF-8?q?n=20menuitems.c=20(suggested=20by=20Darren=20=20=20Salt).=20-?= =?UTF-8?q?=20Removed=20the=20unnecessary=20'value'=20member=20from=20cMen?= =?UTF-8?q?uEditItem.=20-=20Fixed=20the=20initial=20setting=20of=20the=20t?= =?UTF-8?q?ime=20transponder=20setup=20parameter=20(reported=20=20=20by=20?= =?UTF-8?q?Thomas=20G=C3=BCnther).=20-=20Fixed=20unnecessary=20Set()=20cal?= =?UTF-8?q?ls=20in=20cMenuEditIntItem::ProcessKey().=20-=20Allowing=20a=20?= =?UTF-8?q?tolerance=20for=20symbol=20rate=20values=20that=20are=20off=20b?= =?UTF-8?q?y=20one=20(thanks=20to=20=20=20Richard=20Lithvall).=20-=20Added?= =?UTF-8?q?=20VBITeletextDescriptorTag,=20TeletextDescriptorTag,=20LocalTi?= =?UTF-8?q?meOffsetDescriptorTag=20=20=20and=20PremiereContentTransmission?= =?UTF-8?q?Descriptor=20to=20'libsi'=20(thanks=20to=20Marco=20Schl=C3=BC?= =?UTF-8?q?=C3=9Fler).=20-=20Using=20geteuid()=20to=20check=20whether=20VD?= =?UTF-8?q?R=20is=20running=20as=20user=20'root'=20(suggested=20by=20=20?= =?UTF-8?q?=20Tobias=20Grimm).=20-=20Added=20a=20missing=20"Key$"=20in=20s?= =?UTF-8?q?kincurses.c=20(reported=20by=20Darren=20Salt).=20-=20Reintroduc?= =?UTF-8?q?ed=20the=20log=20message=20"deleting=20plugin:=20..."=20when=20?= =?UTF-8?q?shutting=20down=20VDR=20(upon=20=20=20request=20by=20Ville=20Sk?= =?UTF-8?q?ytt=C3=A4,=20as=20in=20the=20initial=20patch=20from=20Christoph?= =?UTF-8?q?=20Haubrich).=20-=20Fixed=20the=20vdr.1=20man=20page=20(a=20sin?= =?UTF-8?q?gle=20DVB=20card=20can=20record=20and=20do=20live=20tv).=20-=20?= =?UTF-8?q?The=20preferred=20audio=20language=20is=20now=20automatically?= =?UTF-8?q?=20selected=20when=20starting=20replay.=20-=20Updated=20the=20D?= =?UTF-8?q?anish=20OSD=20texts=20(thanks=20to=20Mogens=20Elneff).=20-=20Th?= =?UTF-8?q?e=20new=20function=20cPlugin::Active()=20can=20be=20used=20by?= =?UTF-8?q?=20a=20plugin=20to=20indicate=20that=20it=20=20=20is=20still=20?= =?UTF-8?q?busy=20and=20the=20system=20should=20not=20shut=20down=20or=20r?= =?UTF-8?q?estart=20(based=20on=20a=20patch=20=20=20from=20Sascha=20Volken?= =?UTF-8?q?andt).=20See=20PLUGINS.html=20for=20details.=20-=20Fixed=20sett?= =?UTF-8?q?ing=20the=20'Delta'=20parameter=20when=20calling=20the=20shutdo?= =?UTF-8?q?wn=20script=20with=20=20=20no=20active=20timer=20(reported=20by?= =?UTF-8?q?=20Helge=20Lenz).=20-=20In=20order=20to=20make=20sure=20that=20?= =?UTF-8?q?plugins=20are=20compiled=20with=20the=20same=20DVB=20driver=20h?= =?UTF-8?q?eader=20=20=20files=20as=20VDR=20itself,=20the=20definition=20o?= =?UTF-8?q?f=20DVBDIR=20has=20been=20removed=20from=20the=20VDR=20=20=20Ma?= =?UTF-8?q?kefile.=20If=20you=20are=20using=20a=20driver=20version=20that?= =?UTF-8?q?=20has=20its=20header=20files=20at=20a=20location=20=20=20other?= =?UTF-8?q?=20than=20/usr/include/linux/dvb,=20you=20can=20define=20DVBDIR?= =?UTF-8?q?=20in=20the=20Make.config=20=20=20file=20(see=20also=20INSTALL)?= =?UTF-8?q?.=20Note=20that=20if=20you=20already=20have=20a=20Make.config?= =?UTF-8?q?=20file=20of=20your=20=20=20own,=20you=20should=20add=20the=20l?= =?UTF-8?q?ines?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ifdef DVBDIR INCLUDES += -I$(DVBDIR)/include endif to its end, as in the new Make.config.template. Any reference to DVBDIR should be removed from all plugins' Makefiles, like this: ------------------------------------------------------------ --- PLUGINS/src/hello/Makefile 2005/11/11 13:20:14 1.10 +++ PLUGINS/src/hello/Makefile 2006/04/15 11:58:46 1.11 @@ -20,7 +20,6 @@ ### The directory environment: -DVBDIR = ../../../../DVB VDRDIR = ../../.. LIBDIR = ../../lib TMPDIR = /tmp @@ -40,7 +39,7 @@ ### Includes and Defines (add further entries here): -INCLUDES += -I$(VDRDIR)/include -I$(DVBDIR)/include +INCLUDES += -I$(VDRDIR)/include DEFINES += -D_GNU_SOURCE -DPLUGIN_NAME_I18N='"$(PLUGIN)"' ------------------------------------------------------------ Thanks to Marco Schlüßler for pointing out this problem. - Implemented kNext and kPrev keys (based on a patch from Peter Juszack). See MANUAL for details. - Implemented kChanPrev (from a patch from Darren Salt). - The "Update channels" parameter in the "Setup/DVB" menu has been extended to allow updating only the PIDs (see MANUAL for details). When updating to this version of VDR, please verify that the setting is as you want it to be, because the values have been shifted. - The new APIVERSION (see config.h) now allows existing compiled plugins to be used with newer versions of VDR, as long as there have been no changes to the VDR header files since the last APIVERSION. Existing plugins' Makefiles should have all references to VDRVERSION changed to APIVERSION, like this: ------------------------------------------------------------ --- PLUGINS/src/hello/Makefile 2006/04/15 11:58:46 1.11 +++ PLUGINS/src/hello/Makefile 2006/04/16 09:03:50 1.12 @@ -28,9 +28,9 @@ -include $(VDRDIR)/Make.config -### The version number of VDR (taken from VDR's "config.h"): +### The version number of VDR's plugin API (taken from VDR's "config.h"): -VDRVERSION = $(shell grep 'define VDRVERSION ' $(VDRDIR)/config.h | awk '{ print $$3 }' | sed -e 's/"//g') +APIVERSION = $(shell sed -ne '/define APIVERSION/s/^.*"\(.*\)".*$$/\1/p' $(VDRDIR)/config.h) ### The name of the distribution archive: @@ -67,7 +67,7 @@ libvdr-$(PLUGIN).so: $(OBJS) $(CXX) $(CXXFLAGS) -shared $(OBJS) -o $@ - @cp $@ $(LIBDIR)/$@.$(VDRVERSION) + @cp $@ $(LIBDIR)/$@.$(APIVERSION) dist: clean @-rm -rf $(TMPDIR)/$(ARCHIVE) ------------------------------------------------------------ - If a timer is newly created from within the "Schedule" menu, and its event is already running or has its start time within the next two minutes, it now goes directly into the "Edit timer" menu in order to allow the user to make further changes to timer parameters before the actual recording starts (inspired by Christian Wieninger's "epgsearch" plugin). - Added format check to syslog_with_tid(). - Updated the INSTALL file's section about non-VDR files in the video directory (since version 1.3.38 disk access is done in a separate thread, so the watchdog timer won't hit). - Changed the behaviour of the "Use small font" setup option to *always* use the small font if set to '2' - even if it would have been a fixed font (suggested by Ronny Kornexl). - No longer using characters 0x01 and 0x02 for mapping single quote and slash in recording names (thanks to Patrick Fischer for reporting that this was a problem with XML). The single quote is not mapped at all, and the slash is interchanged with the tilde. Existing recordings will be handled like before, so there is no need to actually rename them. - The cRemote::CallPlugin() function now has a boolean return value that tells the caller whether initiating the plugin call was successful (suggested by Reinhard Nissl). If it returns false, another plugin call is currently pending and the caller should try again later. This also means that the SVDRP command PLUG can now return an error code is the call fails. - The new function cPlugin::MainThreadHook() can be used by plugins to perform actions in the context of the main program thread. Use this function with great care and only of you absolutely have to! See also PLUGINS.html. --- libsi/descriptor.c | 125 +++++++++++++++++++++++++++++++++++++++++++++++++++-- libsi/descriptor.h | 90 +++++++++++++++++++++++++++++++++++++- libsi/headers.h | 101 ++++++++++++++++++++++++++++++++++++++++++- libsi/section.c | 18 +++++++- libsi/section.h | 17 +++++++- libsi/si.c | 41 +++++++++++++++--- libsi/si.h | 15 +++++-- 7 files changed, 390 insertions(+), 17 deletions(-) (limited to 'libsi') diff --git a/libsi/descriptor.c b/libsi/descriptor.c index b84e2c4..57a9248 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.18 2006/02/25 10:06:05 kls Exp $ + * $Id: descriptor.c 1.20 2006/04/17 12:19:15 kls Exp $ * * ***************************************************************************/ @@ -318,6 +318,31 @@ void ParentalRatingDescriptor::Rating::Parse() { languageCode[3]=0; } +void TeletextDescriptor::Parse() { + //this descriptor is only a header and a loop + teletextLoop.setData(data+sizeof(descr_teletext), getLength()-sizeof(descr_teletext)); +} + +void TeletextDescriptor::Teletext::Parse() { + s=data.getData(); + languageCode[0]=s->lang_code1; + languageCode[1]=s->lang_code2; + languageCode[2]=s->lang_code3; + languageCode[3]=0; +} + +int TeletextDescriptor::Teletext::getTeletextType() const { + return s->type; +} + +int TeletextDescriptor::Teletext::getTeletextMagazineNumber() const { + return s->magazine_number; +} + +int TeletextDescriptor::Teletext::getTeletextPageNumber() const { + return s->page_number; +} + int CaDescriptor::getCaType() const { return HILO(s->CA_type); } @@ -536,6 +561,14 @@ void ComponentDescriptor::Parse() { description.setData(data+offset, getLength()-offset); } +void PrivateDataSpecifierDescriptor::Parse() { + s=data.getData(); +} + +int PrivateDataSpecifierDescriptor::getPrivateDataSpecifier() const { + return (HILO(s->private_data_specifier_hi) << 16) | HILO(s->private_data_specifier_lo); +} + void SubtitlingDescriptor::Parse() { subtitlingLoop.setData(data+sizeof(descr_subtitling), getLength()-sizeof(descr_subtitling)); } @@ -633,11 +666,47 @@ void MultilingualServiceNameDescriptor::Name::Parse() { name.setData(data+offset, mid->service_name_length); } +void LocalTimeOffsetDescriptor::Parse() { + localTimeOffsetLoop.setData(data+sizeof(descr_local_time_offset), getLength()-sizeof(descr_local_time_offset)); +} + +int LocalTimeOffsetDescriptor::LocalTimeOffset::getCountryId() const { + return s->country_region_id; +} + +int LocalTimeOffsetDescriptor::LocalTimeOffset::getLocalTimeOffsetPolarity() const { + return s->local_time_offset_polarity; +} + +int LocalTimeOffsetDescriptor::LocalTimeOffset::getLocalTimeOffset() const { + return (s->local_time_offset_h << 8) | s->local_time_offset_m; +} + +time_t LocalTimeOffsetDescriptor::LocalTimeOffset::getTimeOfChange() const { + return DVBTime::getTime(s->time_of_change_mjd_hi, s->time_of_change_mjd_lo, s->time_of_change_time_h, s->time_of_change_time_m, s->time_of_change_time_s); +} + +int LocalTimeOffsetDescriptor::LocalTimeOffset::getNextTimeOffset() const { + return (s->next_time_offset_h << 8) | s->next_time_offset_m; +} + +void LocalTimeOffsetDescriptor::LocalTimeOffset::Parse() { + s=data.getData(); + countryCode[0]=s->country_code1; + countryCode[1]=s->country_code2; + countryCode[2]=s->country_code3; + countryCode[3]=0; +} + void LinkageDescriptor::Parse() { int offset=0; + s1 = NULL; data.setPointerAndOffset(s, offset); - if (checkSize(getLength()-offset)) + if (checkSize(getLength()-offset)) { + if (getLinkageType() == LinkageTypeMobileHandover) + data.setPointerAndOffset(s1, offset); privateData.assign(data.getData(offset), getLength()-offset); + } } int LinkageDescriptor::getTransportStreamId() const { @@ -656,9 +725,21 @@ LinkageType LinkageDescriptor::getLinkageType() const { return (LinkageType)s->linkage_type; } +int LinkageDescriptor::getHandOverType() const { + return s1 == NULL ? 0 : s1->hand_over_type; +} + +int LinkageDescriptor::getOriginType() const { + return s1 == NULL ? 0 : s1->origin_type; +} + +int LinkageDescriptor::getId() const { + return s1 == NULL ? 0 : HILO(s1->id); +} + void ISO639LanguageDescriptor::Parse() { languageLoop.setData(data+sizeof(descr_iso_639_language), getLength()-sizeof(descr_iso_639_language)); - + //all this is for backwards compatibility only Loop::Iterator it; Language first; @@ -704,6 +785,44 @@ int PDCDescriptor::getMinute() const { return s->pil2 & 0x3F; } +void AncillaryDataDescriptor::Parse() { + int offset=0; + data.setPointerAndOffset(s, offset); +} + +int AncillaryDataDescriptor::getAncillaryDataIdentifier() const { + return s->ancillary_data_identifier; +} + +int PremiereContentTransmissionDescriptor::getOriginalNetworkId() const { + return HILO(s->original_network_id); +} + +int PremiereContentTransmissionDescriptor::getTransportStreamId() const { + return HILO(s->transport_stream_id); +} + +int PremiereContentTransmissionDescriptor::getServiceId() const { + return HILO(s->service_id); +} + +int PremiereContentTransmissionDescriptor::getMJD() const { + return HILO(s->mjd); +} + +void PremiereContentTransmissionDescriptor::Parse() { + s=data.getData(); + startTimeLoop.setData(data+sizeof(descr_premiere_content_transmission), getLength()-sizeof(descr_premiere_content_transmission)); +} + +time_t PremiereContentTransmissionDescriptor::StartTimeEntry::getStartTime(int mjd) const { + return DVBTime::getTime(mjd >> 8, mjd & 0xff, s->start_time_h, s->start_time_m, s->start_time_s); +} + +void PremiereContentTransmissionDescriptor::StartTimeEntry::Parse() { + s=data.getData(); +} + 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 476da3f..338a1fd 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.13 2005/09/03 15:17:35 kls Exp $ + * $Id: descriptor.h 1.14 2006/04/14 10:53:44 kls Exp $ * * ***************************************************************************/ @@ -121,6 +121,25 @@ protected: virtual void Parse(); }; +class TeletextDescriptor : public Descriptor { +public: + class Teletext : public LoopElement { + public: + char languageCode[4]; + int getTeletextType() const; + int getTeletextMagazineNumber() const; + int getTeletextPageNumber() const; + virtual int getLength() { return sizeof(item_teletext); } + protected: + virtual void Parse(); + private: + const item_teletext *s; + }; + StructureLoop teletextLoop; +protected: + virtual void Parse(); +}; + class CaDescriptor : public Descriptor { public: int getCaType() const; @@ -281,6 +300,15 @@ private: const descr_component *s; }; +class PrivateDataSpecifierDescriptor : public Descriptor { +public: + int getPrivateDataSpecifier() const; +protected: + virtual void Parse(); +private: + const descr_private_data_specifier *s; +}; + class SubtitlingDescriptor : public Descriptor { public: class Subtitling : public LoopElement { @@ -377,17 +405,42 @@ protected: virtual void Parse(); }; +class LocalTimeOffsetDescriptor : public Descriptor { +public: + class LocalTimeOffset : public LoopElement { + public: + char countryCode[4]; + virtual int getLength() { return sizeof(local_time_offset_entry); } + int getCountryId() const; + int getLocalTimeOffsetPolarity() const; + int getLocalTimeOffset() const; + time_t getTimeOfChange() const; + int getNextTimeOffset() const; + protected: + virtual void Parse(); + private: + const local_time_offset_entry *s; + }; + StructureLoop localTimeOffsetLoop; +protected: + virtual void Parse(); +}; + class LinkageDescriptor : public Descriptor { public: int getTransportStreamId() const; int getOriginalNetworkId() const; int getServiceId() const; LinkageType getLinkageType() const; + int getHandOverType() const; + int getOriginType() const; + int getId() const; CharArray privateData; protected: virtual void Parse(); private: const descr_linkage *s; + const descr_linkage_8 *s1; }; class ISO639LanguageDescriptor : public Descriptor { @@ -422,6 +475,41 @@ private: const descr_pdc *s; }; +class AncillaryDataDescriptor : public Descriptor { +public: + int getAncillaryDataIdentifier() const; +protected: + virtual void Parse(); +private: + const descr_ancillary_data *s; +}; + +// Private DVB Descriptor Premiere.de +// 0xF2 Content Transmission Descriptor +// http://dvbsnoop.sourceforge.net/examples/example-private-section.html + +class PremiereContentTransmissionDescriptor : public Descriptor { +public: + class StartTimeEntry : public LoopElement { + public: + virtual int getLength() { return sizeof(item_premiere_content_transmission_reference); } + time_t getStartTime(int mjd) const; //UTC + protected: + virtual void Parse(); + private: + const item_premiere_content_transmission_reference *s; + }; + StructureLoop startTimeLoop; + int getOriginalNetworkId() const; + int getTransportStreamId() const; + int getServiceId() const; + int getMJD() const; +protected: + virtual void Parse(); +private: + const descr_premiere_content_transmission *s; +}; + //a descriptor currently unimplemented in this library class UnimplementedDescriptor : public Descriptor { protected: diff --git a/libsi/headers.h b/libsi/headers.h index 69350cd..a238ca6 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.5 2005/09/03 15:18:16 kls Exp $ + * $Id: headers.h 1.6 2006/04/14 10:53:44 kls Exp $ * * ***************************************************************************/ @@ -769,6 +769,57 @@ struct ait_app { /* descriptors */ }; +/* Premiere Content Information Table */ + +#define PCIT_LEN 17 + +struct pcit { + 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; + + u_char contentId_hi_hi :8; + u_char contentId_hi_lo :8; + u_char contentId_lo_hi :8; + u_char contentId_lo_lo :8; + + u_char duration_h :8; + u_char duration_m :8; + u_char duration_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; +}; + /* * * The following describes the different descriptors that can be used within @@ -1010,6 +1061,21 @@ struct descr_linkage { u_char linkage_type :8; }; +#define DESCR_LINKAGE_8_LEN 3 +struct descr_linkage_8 { +#if BYTE_ORDER == BIG_ENDIAN + u_char hand_over_type :4; + u_char reserved :3; + u_char origin_type :1; +#else + u_char origin_type :1; + u_char reserved :3; + u_char hand_over_type :4; +#endif + u_char id_hi :8; + u_char id_lo :8; +}; + /* 0x4B nvod_reference_descriptor */ #define DESCR_NVOD_REFERENCE_LEN 2 @@ -1364,7 +1430,10 @@ struct descr_multilingual_component { struct descr_private_data_specifier { u_char descriptor_tag :8; u_char descriptor_length :8; - /* TBD */ + u_char private_data_specifier_hi_hi :8; + u_char private_data_specifier_hi_lo :8; + u_char private_data_specifier_lo_hi :8; + u_char private_data_specifier_lo_lo :8; }; /* 0x60 service_move_descriptor */ @@ -1717,6 +1786,34 @@ struct descr_application_icons_descriptor_end { u_char icon_flags_lo :8; }; +// Private DVB Descriptor Premiere.de +// 0xF2 Content Transmission Descriptor +// http://dvbsnoop.sourceforge.net/examples/example-private-section.html + +#define DESCR_PREMIERE_CONTENT_TRANSMISSION_LEN 11 + +struct descr_premiere_content_transmission { + u_char descriptor_tag :8; + u_char descriptor_length :8; + u_char transport_stream_id_hi :8; + u_char transport_stream_id_lo :8; + u_char original_network_id_hi :8; + u_char original_network_id_lo :8; + u_char service_id_hi :8; + u_char service_id_lo :8; + u_char mjd_hi :8; + u_char mjd_lo :8; + u_char start_time_loop :8; +}; + +#define ITEM_PREMIERE_CONTENT_TRANSMISSION_LEN 3 + +struct item_premiere_content_transmission_reference { + u_char start_time_h :8; + u_char start_time_m :8; + u_char start_time_s :8; +}; + } //end of namespace #endif //LIBSI_HEADERS_H diff --git a/libsi/section.c b/libsi/section.c index 68af991..6dd43df 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.4 2006/02/18 10:38:20 kls Exp $ + * $Id: section.c 1.5 2006/04/14 10:53:44 kls Exp $ * * ***************************************************************************/ @@ -341,4 +341,20 @@ void AIT::Application::Parse() { applicationDescriptors.setData(data+offset, HILO(s->application_descriptors_length)); } +/******************* PremiereCIT *******************/ + +void PremiereCIT::Parse() { + int offset=0; + data.setPointerAndOffset(s, offset); + eventDescriptors.setData(data+offset, HILO(s->descriptors_loop_length)); +} + +int PremiereCIT::getContentId() const { + return (HILO(s->contentId_hi) << 16) | HILO(s->contentId_lo); +} + +time_t PremiereCIT::getDuration() const { + return DVBTime::getDuration(s->duration_h, s->duration_m, s->duration_s); +} + } //end of namespace diff --git a/libsi/section.h b/libsi/section.h index 5b43f05..29af7f4 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.3 2004/02/20 13:45:45 kls Exp $ + * $Id: section.h 1.4 2006/04/14 10:53:44 kls Exp $ * * ***************************************************************************/ @@ -260,6 +260,21 @@ protected: virtual void Parse(); }; +/* Premiere Content Information Table */ + +class PremiereCIT : public NumberedSection { +public: + PremiereCIT(const unsigned char *data, bool doCopy=true) : NumberedSection(data, doCopy) {} + PremiereCIT() {} + int getContentId() const; + time_t getDuration() const; + PCIT_DescriptorLoop eventDescriptors; +protected: + virtual void Parse(); +private: + const pcit *s; +}; + } //end of namespace #endif //LIBSI_TABLE_H diff --git a/libsi/si.c b/libsi/si.c index bbd3f1a..c7f23e8 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.15 2006/02/18 10:38:20 kls Exp $ + * $Id: si.c 1.16 2006/04/14 10:53:44 kls Exp $ * * ***************************************************************************/ @@ -373,6 +373,9 @@ Descriptor *Descriptor::getDescriptor(CharArray da, DescriptorTagDomain domain, case MultilingualComponentDescriptorTag: d=new MultilingualComponentDescriptor(); break; + case PrivateDataSpecifierDescriptorTag: + d=new PrivateDataSpecifierDescriptor(); + break; case ServiceMoveDescriptorTag: d=new ServiceMoveDescriptor(); break; @@ -400,9 +403,16 @@ Descriptor *Descriptor::getDescriptor(CharArray da, DescriptorTagDomain domain, case ParentalRatingDescriptorTag: d=new ParentalRatingDescriptor(); break; + case TeletextDescriptorTag: + case VBITeletextDescriptorTag: + d=new TeletextDescriptor(); + break; case ApplicationSignallingDescriptorTag: d=new ApplicationSignallingDescriptor(); break; + case LocalTimeOffsetDescriptorTag: + d=new LocalTimeOffsetDescriptor(); + break; case LinkageDescriptorTag: d=new LinkageDescriptor(); break; @@ -412,6 +422,9 @@ Descriptor *Descriptor::getDescriptor(CharArray da, DescriptorTagDomain domain, case PDCDescriptorTag: d=new PDCDescriptor(); break; + case AncillaryDataDescriptorTag: + d=new AncillaryDataDescriptor(); + break; //note that it is no problem to implement one //of the unimplemented descriptors. @@ -436,13 +449,9 @@ Descriptor *Descriptor::getDescriptor(CharArray da, DescriptorTagDomain domain, //defined in ETSI EN 300 468 case StuffingDescriptorTag: case VBIDataDescriptorTag: - case VBITeletextDescriptorTag: case CountryAvailabilityDescriptorTag: case MocaicDescriptorTag: - case TeletextDescriptorTag: case TelephoneDescriptorTag: - case LocalTimeOffsetDescriptorTag: - case PrivateDataSpecifierDescriptorTag: case CellListDescriptorTag: case CellFrequencyLinkDescriptorTag: case ServiceAvailabilityDescriptorTag: @@ -453,7 +462,6 @@ Descriptor *Descriptor::getDescriptor(CharArray da, DescriptorTagDomain domain, case CaSystemDescriptorTag: case AC3DescriptorTag: case DSNGDescriptorTag: - case AncillaryDataDescriptorTag: case AnnouncementSupportDescriptorTag: case AdaptationFieldDataDescriptorTag: case TransportStreamDescriptorTag: @@ -500,6 +508,27 @@ Descriptor *Descriptor::getDescriptor(CharArray da, DescriptorTagDomain domain, break; } break; + case PCIT: + switch ((DescriptorTag)da.getData()->descriptor_tag) { + case ContentDescriptorTag: + d=new ContentDescriptor(); + break; + case ShortEventDescriptorTag: + d=new ShortEventDescriptor(); + break; + case ExtendedEventDescriptorTag: + d=new ExtendedEventDescriptor(); + break; + case PremiereContentTransmissionDescriptorTag: + d=new PremiereContentTransmissionDescriptor(); + break; + default: + if (!returnUnimplemetedDescriptor) + return 0; + d=new UnimplementedDescriptor(); + break; + } + break; } d->setData(da); return d; diff --git a/libsi/si.h b/libsi/si.h index c8910ff..6922cdc 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.13 2006/02/18 10:38:20 kls Exp $ + * $Id: si.h 1.14 2006/04/14 10:53:44 kls Exp $ * * ***************************************************************************/ @@ -43,7 +43,8 @@ enum TableId { TableIdPAT = 0x00, //program association section TableIdTOT = 0x73, //time offset section TableIdDIT = 0x7E, //discontinuity information section TableIdSIT = 0x7F, //service information section - TableIdAIT = 0x74 //application information section + TableIdAIT = 0x74, //application information section + TableIdPremiereCIT = 0xA0 //premiere content information section }; @@ -139,13 +140,15 @@ enum DescriptorTag { MHP_PrefetchDescriptorTag = 0x0C, MHP_DelegatedApplicationDescriptorTag = 0x0E, MHP_ApplicationStorageDescriptorTag = 0x10, + // Premiere private Descriptor Tags + PremiereContentTransmissionDescriptorTag = 0xF2, //a descriptor currently unimplemented in this library //the actual value 0xFF is "forbidden" according to the spec. UnimplementedDescriptorTag = 0xFF }; -enum DescriptorTagDomain { SI, MHP }; +enum DescriptorTagDomain { SI, MHP, PCIT }; enum RunningStatus { RunningStatusUndefined = 0, RunningStatusNotRunning = 1, @@ -411,6 +414,12 @@ public: MHP_DescriptorLoop() { domain=MHP; } }; +//Premiere Content Information Table +class PCIT_DescriptorLoop : public DescriptorLoop { +public: + PCIT_DescriptorLoop() { domain=PCIT; } +}; + //The content of the ExtendedEventDescriptor may be split over several //descriptors if the text is longer than 256 bytes. //The following classes provide base functionality to handle this case. -- cgit v1.2.3