vdr/libsi/descriptor.h
Klaus Schmidinger 5076cfb2ed Version 2.1.1
VDR developer version 2.1.1 is now available at

       ftp://ftp.tvdr.de/vdr/Developer/vdr-2.1.1.tar.bz2

A 'diff' against the previous version is available at

       ftp://ftp.tvdr.de/vdr/Developer/vdr-2.0.0-2.1.1.diff

MD5 checksums:

b17f9838bb8ddee9620f838fea7a171d  vdr-2.1.1.tar.bz2
8b8ca593885c380cd370e6d19a5b16a1  vdr-2.0.0-2.1.1.diff

WARNING:
========

This is a *developer* version. Even though *I* use it in my productive
environment, I strongly recommend that you only use it under controlled
conditions and for testing and debugging.

The main focus of this version is on adding basic support for positioners
to control steerable satellite dishes. Manually controlling the dish position
and storing individual positions will follow later.

The fixes contained in this version will be released in a stable version 2.0.3
later, if there are no problems.

From the HISTORY file:
- Fixed initializing cDevice::keepTracks.
- Fixed an endless loop in cTextWrapper::Set() in case the given Width is smaller than
  one character (reported by Stefan Braun).
- Removed all "modified since version 1.6" markers from PLUGINS.html.
- Added definitions for older DVB API versions, back until 5.0 (based on a patch from
  Udo Richter).
- Changed cThread::SetIOPriority() from "best effort class" to "idle class" in order to
  improve overall performance when an editing process is running (thanks to Jochen
  Dolze).
- Fixed handling '/' and '~' in recording file names in case DirectoryEncoding is
  used (thanks to Lars Hanisch).
- Changed the sign of the satellite position value in cSource to reflect the standard
  of western values being negative. The new member function cSource::Position() can be
  used to retrieve the orbital position of a satellite.
- Fixed multiple occurrences of the same directory in the recordings list in case there
  are directories that only differ in non-alphanumeric characters (was broken by
  "Fixed selecting the last replayed recording in the Recordings menu in case there
  are folders and plain recordings with names that differ only in non-alphanumeric
  characters" in version 1.7.36).
- Fixed displaying the frame number when setting an editing mark (thanks to Thomas
  Günther).
- Fixed no longer generating any editing marks if the edited recording results in just
  one single sequence (reported by Halim Sahin).
- Fixed an error message when parsing SCR values in diseqc.conf.
- Fixed an unexpected RCS version tag in the newplugin script.
- Fixed an endless loop in the DrawEllipse() functions for very small ellipses (reported
  by Stefan Braun).
- Fixed a crash in the LCARS skin's main menu in case there is no current channel
  (reported by Dominique Dumont).
- Added basic support for positioners to control steerable satellite dishes (based on
  a patch from Seppo Ingalsuo and Ales Jurik).
  + Supports GotoN (aka "DiSEqC 1.2") and GotoX (aka "USALS").
  + The new DiSEqC command code 'P' can be used to instruct a positioner to move the
    dish to the required satellite position. When a 'P' code is processed, further
    execution of the remaining DiSEqC sequence (if any) is postponed until the positioner
    has reached the new satellite position.
  + The new special source value of "S360E" can be used in diseqc.conf to indicate that
    an entry using a positioner can move the dish to any requested position within its
    range. Think of it as "full circle".
  + The devices a particular cDiseqc or cScr applies to are now stored directly in each
    cDiseqc or cScr, respectively.
  + A plugin can implement a custom positioner control (see PLUGINS.html, section "Positioners").
  + The new function cSkinDisplayChannel::SetPositioner() can be implemented by skins to
    show the user a progress display when the dish is being moved. The default implementation
    calls SetMessage() with a string indicating the new position the dish is being moved to.
    The LCARS skin shows a progress bar indicating the movement of the dish.
  + The new parameters "Site latitude", "Site longitude", "Positioner speed", and
    "Positioner swing" in the "Setup/LNB" menu can be used to configure the necessary
    values for a steerable dish.
  + The cDvbTuner now has a new status tsPositioning, in which it waits until a steerable
    dish has reached its target position. Parsing SI data is paused until the target
    position has been reached.
- The LCARS skin now shows the source value of the current channel in its channel display.
- Fixed asserting free disk space in the cutter.
- No longer trying to delete old recordings in AssertFreeDiskSpace() if the given
  Priority is less than 1.
- Fixed handling LIRC events in case repeated events are lost.
- Fixed a possible crash when shutting down VDR while subtitles are being displayed
  (reported by Ville Skyttä).
- cDevice::IsPrimaryDevice() now also checks whether the primary device actually has
  a decoder and returns false otherwise. This should improve device allocation on
  systems that are only used as a receiver and don't actually display anything.
- Increased the value of MAXRETRIES to 20 to reduce the probability of disturbances
  in transfer mode.
- All bonded devices (except for the master) now turn off their LNB power completely
  to avoid problems when receiving vertically polarized transponders (suggested by
  Manfred Völkel and Oliver Endriss).
- Reverted the change from version 1.5.7 that made all logging go to LOG_ERR (thanks
  to Christopher Reimer).
- Added Begin/EndSegmentTransfer() to the EPG handler interface (thanks to Jörg Wendel).
- The code for distributing recordings over several video directories is now
  deprecated and disabled by default.
  You can re-enable this feature by removing the comment sign ('//') from the beginning
  of the line
  //#define DEPRECATED_DISTRIBUTED_VIDEODIR // Code enclosed with this macro is ...
  in the file videodir.c. Note, though, that this can only be a temporary workaround.
  This feature will be completely removed in one of the next developer versions.
  Distributing the video directory over several disks was a useful feature in times
  when disks were still relatively small, but it also caused serious problems in case
  one of the disks failed. Nowadays hard disks come in sizes measured in terabytes,
  and tools like "mhddfs" can be used to combine several disks to form one large volume.
  A recommended method for a relatively safe disk setup in a VDR system is to use two
  1TB (or larger) disks and use them as a RAID-1 (mirrored). That way, if one disk
  fails, you can replace it without data loss.
2013-08-25 18:40:45 +02:00

741 lines
20 KiB
C++

/***************************************************************************
* Copyright (c) 2003 by Marcel Wiesweg *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* $Id: descriptor.h 3.0 2012/01/11 11:35:17 kls Exp $
* *
***************************************************************************/
#ifndef LIBSI_DESCRIPTOR_H
#define LIBSI_DESCRIPTOR_H
#include "si.h"
#include "headers.h"
namespace SI {
class ShortEventDescriptor : public Descriptor {
public:
char languageCode[4];
String name; //name of the event
String text; //short description
protected:
virtual void Parse();
};
class ExtendedEventDescriptor : public GroupDescriptor {
public:
class Item : public LoopElement {
public:
virtual int getLength() { return sizeof(item_extended_event)+sizeof(item_extended_event_mid)+item.getLength()+itemDescription.getLength(); }
String item;
String itemDescription;
protected:
virtual void Parse();
};
char languageCode[4];
int getDescriptorNumber();
int getLastDescriptorNumber();
StructureLoop<Item> itemLoop;
String text;
protected:
virtual void Parse();
private:
const descr_extended_event *s;
};
class ExtendedEventDescriptors : public DescriptorGroup {
public:
int getMaximumTextLength(const char *separation1="\t", const char *separation2="\n");
//Returns a concatenated version of first the non-itemized and then the itemized text
//same semantics as with SI::String
char *getText(const char *separation1="\t", const char *separation2="\n");
//buffer must at least be getTextLength(), getMaximumTextLength() is a good choice
char *getText(char *buffer, int size, const char *separation1="\t", const char *separation2="\n");
//these only return the non-itemized text fields in concatenated form
int getMaximumTextPlainLength();
char *getTextPlain();
char *getTextPlain(char *buffer, int size);
//these only return the itemized text fields in concatenated form.
//Between the description and the text the separation1 character is used,
//separation2 used between two pairs. Example:
//Director\tSteven Spielberg\nActor\tMichael Mendl\n
int getMaximumTextItemizedLength(const char *separation1="\t", const char *separation2="\n");
char *getTextItemized(const char *separation1="\t", const char *separation2="\n");
char *getTextItemized(char *buffer, int size, const char *separation1="\t", const char *separation2="\n");
//returns the itemized text pair by pair. Maximum length for buffers is 256.
//Return value is false if and only if the end of the list is reached.
//The argument valid indicates whether the buffers contain valid content.
bool getTextItemized(Loop::Iterator &it, bool &valid, char *itemDescription, char *itemText, int sizeItemDescription, int sizeItemText);
};
class TimeShiftedEventDescriptor : public Descriptor {
public:
int getReferenceServiceId() const;
int getReferenceEventId() const;
protected:
virtual void Parse();
private:
const descr_time_shifted_event *s;
};
class ContentDescriptor : public Descriptor {
public:
class Nibble : public LoopElement {
public:
virtual int getLength() { return sizeof(nibble_content); }
int getContentNibbleLevel1() const;
int getContentNibbleLevel2() const;
int getUserNibble1() const;
int getUserNibble2() const;
protected:
virtual void Parse();
private:
const nibble_content *s;
};
StructureLoop<Nibble> nibbleLoop;
protected:
virtual void Parse();
};
class ParentalRatingDescriptor : public Descriptor {
public:
class Rating : public LoopElement {
public:
char languageCode[4];
int getRating() const;
virtual int getLength() { return sizeof(parental_rating); }
protected:
virtual void Parse();
private:
const parental_rating *s;
};
StructureLoop<Rating> ratingLoop;
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<Teletext> teletextLoop;
protected:
virtual void Parse();
};
class CaDescriptor : public Descriptor {
public:
int getCaType() const;
int getCaPid() const;
CharArray privateData;
protected:
virtual void Parse();
private:
const descr_ca *s;
};
class StreamIdentifierDescriptor : public Descriptor {
public:
int getComponentTag() const;
protected:
virtual void Parse();
private:
const descr_stream_identifier *s;
};
class NetworkNameDescriptor : public Descriptor {
public:
String name;
protected:
virtual void Parse();
};
class CaIdentifierDescriptor : public Descriptor {
public:
TypeLoop<SixteenBit> identifiers;
protected:
virtual void Parse();
};
class CarouselIdentifierDescriptor : public Descriptor {
public:
int getCarouselId() const;
int getFormatId() const;
protected:
virtual void Parse();
private:
const descr_carousel_identifier *s;
};
class BouquetNameDescriptor : public NetworkNameDescriptor {
};
class ServiceListDescriptor : public Descriptor {
public:
class Service : public LoopElement {
public:
int getServiceId() const;
int getServiceType() const;
virtual int getLength() { return sizeof(descr_service_list_loop); }
protected:
virtual void Parse();
private:
const descr_service_list_loop *s;
};
StructureLoop<Service> serviceLoop;
protected:
virtual void Parse();
};
class SatelliteDeliverySystemDescriptor : public Descriptor {
public:
int getFrequency() const;
int getOrbitalPosition() const;
int getWestEastFlag() const;
int getPolarization() const;
int getModulationSystem() const;
int getModulationType() const;
int getRollOff() const;
int getSymbolRate() const;
int getFecInner() const;
protected:
virtual void Parse();
private:
const descr_satellite_delivery_system *s;
};
class CableDeliverySystemDescriptor : public Descriptor {
public:
int getFrequency() const;
int getFecOuter() const;
int getModulation() const;
int getSymbolRate() const;
int getFecInner() const;
protected:
virtual void Parse();
private:
const descr_cable_delivery_system *s;
};
class TerrestrialDeliverySystemDescriptor : public Descriptor {
public:
int getFrequency() const;
int getBandwidth() const;
int getPriority() const;
int getTimeSlicingIndicator() const;
int getMpeFecIndicator() const;
int getConstellation() const;
int getHierarchy() const;
int getCodeRateHP() const;
int getCodeRateLP() const;
int getGuardInterval() const;
int getTransmissionMode() const;
bool getOtherFrequency() const;
protected:
virtual void Parse();
private:
const descr_terrestrial_delivery *s;
};
class ServiceDescriptor : public Descriptor {
public:
int getServiceType() const;
String serviceName;
String providerName;
protected:
virtual void Parse();
private:
const descr_service *s;
};
class NVODReferenceDescriptor : public Descriptor {
public:
class Service : public LoopElement {
public:
int getTransportStream() const;
int getOriginalNetworkId() const;
int getServiceId() const;
virtual int getLength() { return sizeof(item_nvod_reference); }
protected:
virtual void Parse();
private:
const item_nvod_reference *s;
};
StructureLoop<Service> serviceLoop;
protected:
virtual void Parse();
};
class TimeShiftedServiceDescriptor : public Descriptor {
public:
int getReferenceServiceId() const;
protected:
virtual void Parse();
private:
const descr_time_shifted_service *s;
};
class ComponentDescriptor : public Descriptor {
public:
int getStreamContent() const;
int getComponentType() const;
int getComponentTag() const;
char languageCode[4];
String description;
protected:
virtual void Parse();
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 {
public:
char languageCode[4];
int getSubtitlingType() const;
int getCompositionPageId() const;
int getAncillaryPageId() const;
virtual int getLength() { return sizeof(item_subtitling); }
protected:
virtual void Parse();
private:
const item_subtitling *s;
};
StructureLoop<Subtitling> subtitlingLoop;
protected:
virtual void Parse();
};
class ServiceMoveDescriptor : public Descriptor {
public:
int getNewOriginalNetworkId() const;
int getNewTransportStreamId() const;
int getNewServiceId() const;
protected:
virtual void Parse();
private:
const descr_service_move *s;
};
class FrequencyListDescriptor : public Descriptor {
public:
int getCodingType() const;
TypeLoop<ThirtyTwoBit> frequencies;
protected:
virtual void Parse();
private:
const descr_frequency_list *s;
};
class ServiceIdentifierDescriptor : public Descriptor {
public:
String textualServiceIdentifier;
protected:
virtual void Parse();
};
class ContentIdentifierDescriptor : public Descriptor {
public:
class Identifier : public LoopElement {
public:
String identifier;
int getCridType() const;
int getCridLocation() const;
virtual int getLength() { return sizeof(content_identifier_entry)+identifier.getLength(); }
protected:
virtual void Parse();
private:
const content_identifier_entry *s;
};
StructureLoop<Identifier> identifierLoop;
protected:
virtual void Parse();
};
class DefaultAuthorityDescriptor : public Descriptor {
public:
String DefaultAuthority; //ID
protected:
virtual void Parse();
};
//abstract base class
class MultilingualNameDescriptor : public Descriptor {
public:
class Name : public LoopElement {
public:
char languageCode[4];
String name;
virtual int getLength() { return sizeof(entry_multilingual_name)+name.getLength(); }
protected:
virtual void Parse();
};
StructureLoop<Name> nameLoop;
protected:
virtual void Parse();
};
class MultilingualNetworkNameDescriptor : public MultilingualNameDescriptor {
//inherits nameLoop from MultilingualNameDescriptor
};
class MultilingualBouquetNameDescriptor : public MultilingualNameDescriptor {
//inherits nameLoop from MultilingualNameDescriptor
};
class MultilingualComponentDescriptor : public MultilingualNameDescriptor {
public:
int getComponentTag() const;
//inherits nameLoop from MultilingualNameDescriptor
protected:
virtual void Parse();
private:
const descr_multilingual_component *s;
};
class MultilingualServiceNameDescriptor : public Descriptor {
public:
class Name : public MultilingualNameDescriptor::Name {
public:
virtual int getLength() { return sizeof(entry_multilingual_name)+providerName.getLength()+sizeof(entry_multilingual_service_name_mid)+name.getLength(); }
String providerName;
//inherits name, meaning: service name;
protected:
virtual void Parse();
};
StructureLoop<Name> nameLoop;
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<LocalTimeOffset> 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 {
public:
char languageCode[4]; //for backwards compatibility
class Language : public LoopElement {
public:
virtual int getLength() { return sizeof(descr_iso_639_language_loop); }
char languageCode[4];
AudioType getAudioType();
protected:
virtual void Parse();
private:
const descr_iso_639_language_loop *s;
};
StructureLoop<Language> languageLoop;
protected:
virtual void Parse();
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;
};
class AncillaryDataDescriptor : public Descriptor {
public:
int getAncillaryDataIdentifier() const;
protected:
virtual void Parse();
private:
const descr_ancillary_data *s;
};
class S2SatelliteDeliverySystemDescriptor : public Descriptor {
public:
int getScramblingSequenceSelector() const;
int getMultipleInputStreamFlag() const;
int getBackwardsCompatibilityIndicator() const;
int getScramblingSequenceIndex() const;
int getInputStreamIdentifier() const { return input_stream_identifier; }
protected:
virtual void Parse();
private:
const descr_s2_satellite_delivery_system *s;
const descr_scrambling_sequence_selector *sss;
int input_stream_identifier;
};
class ExtensionDescriptor : public Descriptor {
public:
int getExtensionDescriptorTag() const;
protected:
virtual void Parse();
private:
const descr_extension *s;
};
class T2DeliverySystemDescriptor : public Descriptor {
public:
int getExtendedDataFlag() const;
int getExtensionDescriptorTag() const;
int getPlpId() const;
int getT2SystemId() const;
int getSisoMiso() const;
int getBandwidth() const;
int getGuardInterval() const;
int getTransmissionMode() const;
int getOtherFrequencyFlag() const;
int getTfsFlag() const;
protected:
virtual void Parse();
private:
const descr_t2_delivery_system *s;
int extended_data_flag;
};
// Private DVB Descriptor Premiere.de
// 0xF2 Content Transmission Descriptor
// http://dvbsnoop.sourceforge.net/examples/example-private-section.html
class PremiereContentTransmissionDescriptor : public Descriptor {
public:
class StartDayEntry : public LoopElement {
public:
class StartTimeEntry : public LoopElement {
public:
virtual int getLength() { return sizeof(item_premiere_content_transmission_time); }
time_t getStartTime(int mjd) const; //UTC
protected:
virtual void Parse();
private:
const item_premiere_content_transmission_time *s;
};
StructureLoop<StartTimeEntry> startTimeLoop;
virtual int getLength();
int getMJD() const;
int getLoopLength() const;
protected:
virtual void Parse();
private:
const item_premiere_content_transmission_day *s;
};
StructureLoop<StartDayEntry> startDayLoop;
int getOriginalNetworkId() const;
int getTransportStreamId() const;
int getServiceId() const;
protected:
virtual void Parse();
private:
const descr_premiere_content_transmission *s;
};
//a descriptor currently unimplemented in this library
class UnimplementedDescriptor : public Descriptor {
protected:
virtual void Parse() {}
};
class ApplicationSignallingDescriptor : public Descriptor {
public:
class ApplicationEntryDescriptor : public LoopElement {
public:
virtual int getLength() { return sizeof(application_signalling_entry); }
int getApplicationType() const;
int getAITVersionNumber() const;
protected:
virtual void Parse();
private:
const application_signalling_entry *s;
};
StructureLoop<ApplicationEntryDescriptor> entryLoop;
protected:
virtual void Parse();
};
class MHP_ApplicationDescriptor : public Descriptor {
public:
class Profile : public LoopElement {
public:
virtual int getLength() { return sizeof(application_profile_entry); }
int getApplicationProfile() const;
int getVersionMajor() const;
int getVersionMinor() const;
int getVersionMicro() const;
private:
const application_profile_entry *s;
protected:
virtual void Parse();
};
StructureLoop<Profile> profileLoop;
bool isServiceBound() const;
int getVisibility() const;
int getApplicationPriority() const;
TypeLoop<EightBit> transportProtocolLabels;
private:
const descr_application_end *s;
protected:
virtual void Parse();
};
class MHP_ApplicationNameDescriptor : public Descriptor {
public:
class NameEntry : public LoopElement {
public:
virtual int getLength() { return sizeof(descr_application_name_entry)+name.getLength(); }
char languageCode[4];
String name;
protected:
virtual void Parse();
};
StructureLoop<NameEntry> nameLoop;
protected:
virtual void Parse();
};
class MHP_TransportProtocolDescriptor : public Descriptor {
public:
class UrlExtensionEntry : public LoopElement {
public:
virtual int getLength() { return sizeof(descr_url_extension_entry)+UrlExtension.getLength(); }
String UrlExtension;
protected:
virtual void Parse();
};
enum Protocol { ObjectCarousel = 0x01, IPviaDVB = 0x02, HTTPoverInteractionChannel = 0x03 };
int getProtocolId() const;
int getProtocolLabel() const;
bool isRemote() const;
int getComponentTag() const;
char *getUrlBase(char *buffer, int size);
StructureLoop<UrlExtensionEntry> UrlExtensionLoop;
protected:
virtual void Parse();
private:
const descr_transport_protocol *s;
bool remote;
int componentTag;
String UrlBase;
};
class MHP_DVBJApplicationDescriptor : public Descriptor {
public:
class ApplicationEntry : public LoopElement {
public:
virtual int getLength() { return sizeof(descr_dvbj_application_entry)+parameter.getLength(); }
String parameter;
protected:
virtual void Parse();
};
StructureLoop<ApplicationEntry> applicationLoop;
protected:
virtual void Parse();
};
class MHP_DVBJApplicationLocationDescriptor : public Descriptor {
public:
String baseDirectory;
String classPath;
String initialClass;
protected:
virtual void Parse();
};
class MHP_ApplicationIconsDescriptor : public Descriptor {
public:
String iconLocator;
int getIconFlags() const;
protected:
virtual void Parse();
private:
const descr_application_icons_descriptor_end *s;
};
class MHP_SimpleApplicationLocationDescriptor : public Descriptor {
public:
char *getLocation(char *buffer, int size);
protected:
virtual void Parse();
private:
String location;
};
class RegistrationDescriptor : public Descriptor {
public:
int getFormatIdentifier() const;
CharArray privateData;
protected:
virtual void Parse();
private:
const descr_registration *s;
};
} //end of namespace
#endif //LIBSI_TABLE_H