diff options
author | Klaus Schmidinger <kls (at) cadsoft (dot) de> | 2004-01-04 18:00:00 +0100 |
---|---|---|
committer | Klaus Schmidinger <kls (at) cadsoft (dot) de> | 2004-01-04 18:00:00 +0100 |
commit | 93a94b18b540fbcb9bcdaaea9abd26cdf23d6ee6 (patch) | |
tree | bede17e6cd329d36ec02bc53dfe567b95ec835a5 /epg.h | |
parent | c432905dd60630f906ac89f58592ad835a9063ef (diff) | |
download | vdr-patch-lnbsharing-93a94b18b540fbcb9bcdaaea9abd26cdf23d6ee6.tar.gz vdr-patch-lnbsharing-93a94b18b540fbcb9bcdaaea9abd26cdf23d6ee6.tar.bz2 |
Version 1.3.0vdr-1.3.0
- Changed thread handling to make it work with NPTL ("Native Posix Thread Library").
Thanks to Jon Burgess, Andreas Schultz, Werner Fink and Stefan Huelswitt.
- The cThread class now accepts a 'Description' parameter, which is used to log
the beginning and end of the thread, together with its process and thread id.
For descriptions that need additional parameters you can use the function
cThread::SetDescription(), which accepts 'printf()' like arguments.
Existing plugins that use threads should be changed to use this functionality
instead of explicit 'dsyslog()' calls inside their Action() function in order
to support logging the thread ids.
- Added "Slovak Link" and "Czech Link" to 'ca.conf' (thanks to Emil Petersky).
However, 'ca.conf' is now pretty much obsolete due to the automatic CA handling.
- Mutexes are now created with PTHREAD_MUTEX_ERRORCHECK_NP, which makes the
'lockingTid' stuff obsolete (thanks to Stefan Huelswitt).
- Changed font handling to allow language specific character sets.
- Adopted the small font character set from the "Elchi" patch (originally
provided by Alessio Sangalli).
- Greek language texts now use iso8859-7 character set (thanks to Dimitrios
Dimitrakos).
- Rearranged section data handling, so that the actual data handling can be done
separately, even from within plugins.
- The EPG data structures have been moved from eit.[hc] to epg.[hc] and have been
adapted to the general VDR coding style. Plugins that use these data structures
may need to change some function names (which should be obvious).
The name 'subtitle' has been changed to 'shortText' to avoid clashes with actual
subtitles that are part of a movie. The name 'extendedDescription' has been
shortened to 'description'.
- Replaced 'libdtv' with 'libsi' (thanks to Marcel Wiesweg), which is thread
safe and can be used by multiple section filters simultaneously.
- Added 'cRwLock' to 'thread.[hc]'. Note that all plugin Makefiles need to
define _GNU_SOURCE for this to work (see the example plugin Makefiles and
'newplugin').
- Fixed a problem with crc32 in SI handling on 64bit systems (thanks to Pedro
Miguel Sequeira de Justo Teixeira for reporting this one).
- Fixed an alignment problem in CAM access on 64bit systems (thanks to Pedro
Miguel Sequeira de Justo Teixeira for reporting this one).
- Added 'StreamType' setting to CAM communication, which is important for
Aston/SECA CAMs (thanks to Antonino Sergi).
- Now the CA descriptors are sent to the CAM in the 'program' or 'ES level'
sections, depending on where they are found in the PMT (thanks to Hans-Peter
Raschke for reporting this one). This should make SkyCrypt CAMs work.
- Now using the 'version number' of EPG events to avoid unnecessary work.
- Channel data is now automatically derived from the DVB data stream (inspired
by the 'autopid' patch from Andreas Schultz).
- The current channel is now automatically re-tuned if the PIDs or other settings
change. If a recording is going on on a channel that has a change in its
settings, the recording will be stopped and immediately restarted to use the
new channel settings.
- EPG events now use the complete channel ID with NID, TID and SID.
- Channel names in 'channels.conf' can now have a short form, as provided
by some tv stations (see man vdr(5)). Currently channels that provide short
names in addition to long ones are listed in the OSD as "short,long name",
as in "RTL,RTL Television". The short names will be used explicitly later.
- The Ca parameter in 'channels.conf' has been extended and now contains all the
CA system ids for the given channel. When switching to a channel VDR now tests
for a device that provides one of these CA system ids. The devices automatically
get their supported ids from the CI handler.
- The values in 'ca.conf' are currently without any real meaning. Whether or not
a channel with conditional access can be received is now determined automatically
by evaluating its CA descriptors and comparing them to the CA system ids
provided by the installed CAM. Only the special values 1-16 are used to assign
a channel to a particular device.
- Increased the maximum number of possible OSD colors to 256.
- Limited the line length in the EPG bugfix report, which appears to fix a buffer
overflow that caused a crash when cleaning up the EPG data (at 05:00 in the
morning).
Diffstat (limited to 'epg.h')
-rw-r--r-- | epg.h | 134 |
1 files changed, 134 insertions, 0 deletions
@@ -0,0 +1,134 @@ +/* + * epg.h: Electronic Program Guide + * + * See the main source file 'vdr.c' for copyright information and + * how to reach the author. + * + * Original version (as used in VDR before 1.3.0) written by + * Robert Schneider <Robert.Schneider@web.de> and Rolf Hakenes <hakenes@hippomi.de>. + * + * $Id: epg.h 1.3 2004/01/03 17:00:25 kls Exp $ + */ + +#ifndef __EPG_H +#define __EPG_H + +#include "channels.h" +#include "thread.h" +#include "tools.h" + +#define MAXEPGBUGFIXLEVEL 2 + +class cSchedule; + +class cEvent : public cListObject { +private: + tChannelID channelID; // Channel ID of program for this event + u_int16_t eventID; // Event ID of this event + uchar tableID; // Table ID this event came from + uchar version; // Version number of section this event came from + //XXX present/following obsolete??? + bool isPresent; // true if this is the present event running + bool isFollowing; // true if this is the next event on this channel + char *title; // Title of this event + char *shortText; // Short description of this event (typically the episode name in case of a series) + char *description; // Description of this event + time_t startTime; // Start time of this event + int duration; // Duration of this event in seconds + //XXX find an other solution, avoiding channelNumber??? + int channelNumber; // the actual channel number from VDR's channel list (used in cMenuSchedule for sorting by channel number) +public: + cEvent(tChannelID ChannelID, u_int16_t EventID); + ~cEvent(); + tChannelID ChannelID(void) const { return channelID; } + u_int16_t EventID(void) const { return eventID; } + uchar TableID(void) const { return tableID; } + uchar Version(void) const { return version; } + bool IsPresent(void) const { return isPresent; } + bool IsFollowing(void) const { return isFollowing; } + const char *Title(void) const { return title; } + const char *ShortText(void) const { return shortText; } + const char *Description(void) const { return description; } + time_t StartTime(void) const { return startTime; } + int Duration(void) const { return duration; } + int ChannelNumber(void) const { return channelNumber; } + const char *GetDateString(void) const; + const char *GetTimeString(void) const; + const char *GetEndTimeString(void) const; + void SetEventID(u_int16_t EventID); + void SetTableID(uchar TableID); + void SetVersion(uchar Version); + void SetIsPresent(bool IsPresent); + void SetIsFollowing(bool IsFollowing); + void SetTitle(const char *Title); + void SetShortText(const char *ShortText); + void SetDescription(const char *Description); + void SetStartTime(time_t StartTime); + void SetDuration(int Duration); + void SetChannelNumber(int ChannelNumber) const { ((cEvent *)this)->channelNumber = ChannelNumber; } // doesn't modify the EIT data, so it's ok to make it 'const' //XXX + void Dump(FILE *f, const char *Prefix = "") const; + static bool Read(FILE *f, cSchedule *Schedule); + void FixEpgBugs(void); + }; + +class cSchedules; + +class cSchedule : public cListObject { +private: + tChannelID channelID; + cList<cEvent> events; + cEvent *present; + cEvent *following; +public: + cSchedule(tChannelID ChannelID); + tChannelID ChannelID(void) const { return channelID; } + bool SetPresentEvent(cEvent *Event); + bool SetFollowingEvent(cEvent *Event); + void Cleanup(time_t Time); + void Cleanup(void); + cEvent *AddEvent(cEvent *Event); + const cEvent *GetPresentEvent(void) const; + const cEvent *GetFollowingEvent(void) const; + const cEvent *GetEvent(u_int16_t EventID, time_t StartTime = 0) const; + const cEvent *GetEventAround(time_t Time) const; + const cEvent *GetEventNumber(int n) const { return events.Get(n); } + int NumEvents(void) const { return events.Count(); } + void Dump(FILE *f, const char *Prefix = "") const; + static bool Read(FILE *f, cSchedules *Schedules); + }; + +class cSchedulesLock { +private: + bool locked; +public: + cSchedulesLock(bool WriteLock = false, int TimeoutMs = 0); + ~cSchedulesLock(); + bool Locked(void) { return locked; } + }; + +class cSchedules : public cList<cSchedule> { + friend class cSchedule; + friend class cSchedulesLock; +private: + cRwLock rwlock; + static cSchedules schedules; + static const char *epgDataFileName; + static time_t lastCleanup; + static time_t lastDump; +public: + static void SetEpgDataFileName(const char *FileName); + static const cSchedules *Schedules(cSchedulesLock &SchedulesLock); + ///< Caller must provide a cSchedulesLock which has to survive the entire + ///< time the returned cSchedules is accessed. Once the cSchedules is no + ///< longer used, the cSchedulesLock must be destroyed. + static void Cleanup(bool Force = false); + static bool ClearAll(void); + static bool Dump(FILE *f, const char *Prefix = ""); + static bool Read(FILE *f = NULL); + cSchedule *AddSchedule(tChannelID ChannelID); + const cSchedule *GetSchedule(tChannelID ChannelID) const; + }; + +void ReportEpgBugFixStats(bool Reset = false); + +#endif //__EPG_H |