vdr  2.7.6
epg.h
Go to the documentation of this file.
1 /*
2  * epg.h: Electronic Program Guide
3  *
4  * See the main source file 'vdr.c' for copyright information and
5  * how to reach the author.
6  *
7  * Original version (as used in VDR before 1.3.0) written by
8  * Robert Schneider <Robert.Schneider@web.de> and Rolf Hakenes <hakenes@hippomi.de>.
9  *
10  * $Id: epg.h 5.10 2025/03/04 15:54:07 kls Exp $
11  */
12 
13 #ifndef __EPG_H
14 #define __EPG_H
15 
16 #include "channels.h"
17 #include "libsi/section.h"
18 #include "thread.h"
19 #include "tools.h"
20 
21 #define MAXEPGBUGFIXLEVEL 3
22 
23 #define EPG_LINGER_TIME (max(Setup.EPGLinger, 180) * 60) // seconds to keep old EPG data (internal, must be at least Setup.EPGLinger)
24 
25 enum { MaxEventContents = 4 };
26 
28  ecgMovieDrama = 0x10,
30  ecgShow = 0x30,
31  ecgSports = 0x40,
38  ecgSpecial = 0xB0,
39  ecgUserDefined = 0xF0
40  };
41 
43 
44 struct tComponent {
48  char *description;
49  cString ToString(void);
50  bool FromString(const char *s);
51  };
52 
53 class cComponents {
54 private:
57  bool Realloc(int Index);
58 public:
59  cComponents(void);
60  ~cComponents(void);
61  int NumComponents(void) const { return numComponents; }
62  void SetComponent(int Index, const char *s);
63  void SetComponent(int Index, uchar Stream, uchar Type, const char *Language, const char *Description);
64  tComponent *Component(int Index) const { return (Index < numComponents) ? &components[Index] : NULL; }
65  tComponent *GetComponent(int Index, uchar Stream, uchar Type); // Gets the Index'th component of Stream and Type, skipping other components
66  // In case of an audio stream the 'type' check actually just distinguishes between "normal" and "Dolby Digital"
67  };
68 
69 class cSchedule;
70 
71 typedef u_int32_t tEventID;
72 
73 class cEvent : public cListObject {
74  friend class cSchedule;
75 private:
76  static cMutex numTimersMutex; // Protects numTimers, because it might be accessed from parallel read locks
77  // The sequence of these parameters is optimized for minimal memory waste!
78  cSchedule *schedule; // The Schedule this event belongs to
79  mutable u_int16_t numTimers;// The number of timers that use this event
80  tEventID eventID; // Event ID of this event
81  uchar tableID; // Table ID this event came from
82  uchar version; // Version number of section this event came from
83  uchar runningStatus; // 0=undefined, 1=not running, 2=starts in a few seconds, 3=pausing, 4=running
84  uchar parentalRating; // Parental rating of this event
85  char *title; // Title of this event
86  char *shortText; // Short description of this event (typically the episode name in case of a series)
87  char *description; // Description of this event
88  cComponents *components; // The stream components of this event
89  time_t startTime; // Start time of this event
90  int duration; // Duration of this event in seconds
91  uchar contents[MaxEventContents]; // Contents of this event
92  time_t vps; // Video Programming Service timestamp (VPS, aka "Programme Identification Label", PIL)
93  time_t seen; // When this event was last seen in the data stream
94  char *aux; // Auxiliary data, for use with plugins
95 public:
97  ~cEvent();
98  virtual int Compare(const cListObject &ListObject) const override;
99  tChannelID ChannelID(void) const;
100  const cSchedule *Schedule(void) const { return schedule; }
101  tEventID EventID(void) const { return eventID; }
102  uchar TableID(void) const { return tableID; }
103  uchar Version(void) const { return version; }
104  int RunningStatus(void) const { return runningStatus; }
105  const char *Title(void) const { return title ? title : ""; }
106  const char *ShortText(void) const { return shortText; }
107  const char *Description(void) const { return description; }
108  const cComponents *Components(void) const { return components; }
109  uchar Contents(int i = 0) const { return (0 <= i && i < MaxEventContents) ? contents[i] : uchar(0); }
110  int ParentalRating(void) const { return parentalRating; }
111  time_t StartTime(void) const { return startTime; }
112  time_t EndTime(void) const { return startTime + duration; }
113  int Duration(void) const { return duration; }
114  time_t Vps(void) const { return vps; }
115  time_t Seen(void) const { return seen; }
116  bool SeenWithin(int Seconds) const { return time(NULL) - seen < Seconds; }
117  const char *Aux(void) const { return aux; }
118  void IncNumTimers(void) const;
119  void DecNumTimers(void) const;
120  bool HasTimer(void) const { return numTimers > 0; }
121  bool IsRunning(bool OrAboutToStart = false) const;
122  static const char *ContentToString(uchar Content);
123  cString GetParentalRatingString(void) const;
124  cString GetDateString(void) const;
125  cString GetTimeString(void) const;
126  cString GetEndTimeString(void) const;
127  cString GetVpsString(void) const;
129  void SetTableID(uchar TableID);
130  void SetVersion(uchar Version);
131  void SetRunningStatus(int RunningStatus, const cChannel *Channel = NULL);
132  void SetTitle(const char *Title);
133  void SetShortText(const char *ShortText);
134  void SetDescription(const char *Description);
135  void SetComponents(cComponents *Components); // Will take ownership of Components!
136  void SetContents(uchar *Contents);
138  void SetStartTime(time_t StartTime);
139  void SetDuration(int Duration);
140  void SetVps(time_t Vps);
141  void SetSeen(void);
142  void SetAux(const char *Aux);
143  cString ToDescr(void) const;
144  void Dump(FILE *f, const char *Prefix = "", bool InfoOnly = false) const;
145  bool Parse(char *s);
146  static bool Read(FILE *f, cSchedule *Schedule, int &Line);
147  void FixEpgBugs(void);
148  };
149 
150 class cSchedules;
151 
152 class cSchedule : public cListObject {
153 private:
154  static cMutex numTimersMutex; // Protects numTimers, because it might be accessed from parallel read locks
159  mutable u_int16_t numTimers;// The number of timers that use this schedule
161  int modified;
162  time_t presentSeen;
163 public:
165  tChannelID ChannelID(void) const { return channelID; }
166  bool Modified(int &State) const { bool Result = State != modified; State = modified; return Result; }
167  bool OnActualTp(uchar TableId);
168  time_t PresentSeen(void) const { return presentSeen; }
169  bool PresentSeenWithin(int Seconds) const { return time(NULL) - presentSeen < Seconds; }
170  void SetModified(void) { modified++; }
171  void SetPresentSeen(void) { presentSeen = time(NULL); }
172  void SetRunningStatus(cEvent *Event, int RunningStatus, const cChannel *Channel = NULL);
173  void ClrRunningStatus(cChannel *Channel = NULL);
174  void ResetVersions(void);
175  void Sort(void);
176  void DropOutdated(time_t SegmentStart, time_t SegmentEnd, uchar TableID, uchar Version);
177  void Cleanup(time_t Time);
178  void Cleanup(void);
179  void IncNumTimers(void) const;
180  void DecNumTimers(void) const;
181  bool HasTimer(void) const { return numTimers > 0; }
182  cEvent *AddEvent(cEvent *Event);
183  void DelEvent(cEvent *Event);
184  void HashEvent(cEvent *Event);
185  void UnhashEvent(cEvent *Event);
186  const cList<cEvent> *Events(void) const { return &events; }
187  const cEvent *GetPresentEvent(void) const;
188  const cEvent *GetFollowingEvent(void) const;
189  const cEvent *GetEventById(tEventID EventID) const;
190  const cEvent *GetEventByTime(time_t StartTime) const;
191  const cEvent *GetEventAround(time_t Time) const;
192  void Dump(const cChannels *Channels, FILE *f, const char *Prefix = "", eDumpMode DumpMode = dmAll, time_t AtTime = 0) const;
193  static bool Read(FILE *f, cSchedules *Schedules);
194  };
195 
196 class cSchedules : public cList<cSchedule> {
197  friend class cSchedule;
198 private:
200  static char *epgDataFileName;
201  static time_t lastDump;
202 public:
203  cSchedules(void);
204  static const cSchedules *GetSchedulesRead(cStateKey &StateKey, int TimeoutMs = 0);
207  static cSchedules *GetSchedulesWrite(cStateKey &StateKey, int TimeoutMs = 0);
210  static void SetEpgDataFileName(const char *FileName);
211  static void Cleanup(bool Force = false);
212  static void ResetVersions(void);
213  static bool Dump(FILE *f = NULL, const char *Prefix = "", eDumpMode DumpMode = dmAll, time_t AtTime = 0);
214  static bool Read(FILE *f = NULL);
217  const cSchedule *GetSchedule(const cChannel *Channel, bool AddIfMissing = false) const;
218  };
219 
220 // Provide lock controlled access to the list:
221 
222 DEF_LIST_LOCK(Schedules);
223 
224 // These macros provide a convenient way of locking the global schedules list
225 // and making sure the lock is released as soon as the current scope is left
226 // (note that these macros wait forever to obtain the lock!):
227 
228 #define LOCK_SCHEDULES_READ USE_LIST_LOCK_READ(Schedules);
229 #define LOCK_SCHEDULES_WRITE USE_LIST_LOCK_WRITE(Schedules);
230 
231 class cEpgDataReader : public cThread {
232 public:
233  cEpgDataReader(void);
234  virtual void Action(void) override;
235  };
236 
237 void ReportEpgBugFixStats(bool Force = false);
238 
239 class cEpgHandler : public cListObject {
240 public:
241  cEpgHandler(void);
250  virtual ~cEpgHandler() override;
251  virtual bool IgnoreChannel(const cChannel *Channel) { return false; }
256  virtual bool HandleEitEvent(cSchedule *Schedule, const SI::EIT::Event *EitEvent, uchar TableID, uchar Version) { return false; }
261  virtual bool HandledExternally(const cChannel *Channel) { return false; }
267  virtual bool IsUpdate(tEventID EventID, time_t StartTime, uchar TableID, uchar Version) { return false; }
271  virtual bool SetEventID(cEvent *Event, tEventID EventID) { return false; }
273  virtual bool SetTitle(cEvent *Event, const char *Title) { return false; }
274  virtual bool SetShortText(cEvent *Event, const char *ShortText) { return false; }
275  virtual bool SetDescription(cEvent *Event, const char *Description) { return false; }
276  virtual bool SetContents(cEvent *Event, uchar *Contents) { return false; }
277  virtual bool SetParentalRating(cEvent *Event, int ParentalRating) { return false; }
278  virtual bool SetStartTime(cEvent *Event, time_t StartTime) { return false; }
279  virtual bool SetDuration(cEvent *Event, int Duration) { return false; }
280  virtual bool SetVps(cEvent *Event, time_t Vps) { return false; }
281  virtual bool SetComponents(cEvent *Event, cComponents *Components) { return false; }
282  virtual bool FixEpgBugs(cEvent *Event) { return false; }
284  virtual bool HandleEvent(cEvent *Event) { return false; }
287  virtual bool SortSchedule(cSchedule *Schedule) { return false; }
289  virtual bool DropOutdated(cSchedule *Schedule, time_t SegmentStart, time_t SegmentEnd, uchar TableID, uchar Version) { return false; }
292  virtual bool BeginSegmentTransfer(const cChannel *Channel, bool Dummy) { return true; } // TODO remove obsolete Dummy
299  virtual bool EndSegmentTransfer(bool Modified, bool Dummy) { return false; } // TODO remove obsolete Dummy
303  };
304 
305 class cEpgHandlers : public cList<cEpgHandler> {
306 public:
307  bool IgnoreChannel(const cChannel *Channel);
308  bool HandleEitEvent(cSchedule *Schedule, const SI::EIT::Event *EitEvent, uchar TableID, uchar Version);
309  bool HandledExternally(const cChannel *Channel);
310  bool IsUpdate(tEventID EventID, time_t StartTime, uchar TableID, uchar Version);
311  void SetEventID(cEvent *Event, tEventID EventID);
312  void SetTitle(cEvent *Event, const char *Title);
313  void SetShortText(cEvent *Event, const char *ShortText);
314  void SetDescription(cEvent *Event, const char *Description);
315  void SetContents(cEvent *Event, uchar *Contents);
316  void SetParentalRating(cEvent *Event, int ParentalRating);
317  void SetStartTime(cEvent *Event, time_t StartTime);
318  void SetDuration(cEvent *Event, int Duration);
319  void SetVps(cEvent *Event, time_t Vps);
320  void SetComponents(cEvent *Event, cComponents *Components);
321  void FixEpgBugs(cEvent *Event);
322  void HandleEvent(cEvent *Event);
323  void SortSchedule(cSchedule *Schedule);
324  void DropOutdated(cSchedule *Schedule, time_t SegmentStart, time_t SegmentEnd, uchar TableID, uchar Version);
325  bool BeginSegmentTransfer(const cChannel *Channel);
326  void EndSegmentTransfer(bool Modified);
327  };
328 
330 
331 #endif //__EPG_H
#define MAXLANGCODE2
Definition: channels.h:37
tComponent * Component(int Index) const
Definition: epg.h:64
tComponent * GetComponent(int Index, uchar Stream, uchar Type)
Definition: epg.c:97
int numComponents
Definition: epg.h:55
cComponents(void)
Definition: epg.c:46
bool Realloc(int Index)
Definition: epg.c:59
~cComponents(void)
Definition: epg.c:52
int NumComponents(void) const
Definition: epg.h:61
tComponent * components
Definition: epg.h:56
void SetComponent(int Index, const char *s)
Definition: epg.c:77
cEpgDataReader(void)
Definition: epg.c:1412
virtual void Action(void) override
A derived cThread class must implement the code it wants to execute as a separate thread in this func...
Definition: epg.c:1417
virtual ~cEpgHandler() override
Definition: epg.c:1433
virtual bool SetTitle(cEvent *Event, const char *Title)
Definition: epg.h:273
virtual bool SetVps(cEvent *Event, time_t Vps)
Definition: epg.h:280
virtual bool FixEpgBugs(cEvent *Event)
Fixes some known problems with EPG data.
Definition: epg.h:282
virtual bool IsUpdate(tEventID EventID, time_t StartTime, uchar TableID, uchar Version)
VDR can't perform the update check (version, tid) for externally handled events, therefore the EPG ha...
Definition: epg.h:267
virtual bool SetParentalRating(cEvent *Event, int ParentalRating)
Definition: epg.h:277
virtual bool HandleEitEvent(cSchedule *Schedule, const SI::EIT::Event *EitEvent, uchar TableID, uchar Version)
Before the raw EitEvent for the given Schedule is processed, the EPG handlers are queried to see if a...
Definition: epg.h:256
virtual bool BeginSegmentTransfer(const cChannel *Channel, bool Dummy)
Definition: epg.h:292
virtual bool SetEventID(cEvent *Event, tEventID EventID)
Important note: if you want VPS to work, do not mess with the event ids!
Definition: epg.h:271
virtual bool SetComponents(cEvent *Event, cComponents *Components)
Definition: epg.h:281
virtual bool IgnoreChannel(const cChannel *Channel)
Before any EIT data for the given Channel is processed, the EPG handlers are asked whether this Chann...
Definition: epg.h:251
cEpgHandler(void)
Constructs a new EPG handler and adds it to the list of EPG handlers.
Definition: epg.c:1426
virtual bool EndSegmentTransfer(bool Modified, bool Dummy)
< Called directly after IgnoreChannel() before any other handler method is called.
Definition: epg.h:299
virtual bool HandleEvent(cEvent *Event)
After all modifications of the Event have been done, the EPG handler can take a final look at it.
Definition: epg.h:284
virtual bool SetContents(cEvent *Event, uchar *Contents)
Definition: epg.h:276
virtual bool SetDescription(cEvent *Event, const char *Description)
Definition: epg.h:275
virtual bool SortSchedule(cSchedule *Schedule)
Sorts the Schedule after the complete table has been processed.
Definition: epg.h:287
virtual bool SetStartTime(cEvent *Event, time_t StartTime)
Definition: epg.h:278
virtual bool DropOutdated(cSchedule *Schedule, time_t SegmentStart, time_t SegmentEnd, uchar TableID, uchar Version)
Takes a look at all EPG events between SegmentStart and SegmentEnd and drops outdated events.
Definition: epg.h:289
virtual bool SetDuration(cEvent *Event, int Duration)
Definition: epg.h:279
virtual bool HandledExternally(const cChannel *Channel)
If any EPG handler returns true in this function, it is assumed that the EPG for the given Channel is...
Definition: epg.h:261
virtual bool SetShortText(cEvent *Event, const char *ShortText)
Definition: epg.h:274
void SortSchedule(cSchedule *Schedule)
Definition: epg.c:1587
void EndSegmentTransfer(bool Modified)
Definition: epg.c:1614
bool IgnoreChannel(const cChannel *Channel)
Definition: epg.c:1444
bool HandleEitEvent(cSchedule *Schedule, const SI::EIT::Event *EitEvent, uchar TableID, uchar Version)
Definition: epg.c:1453
void SetStartTime(cEvent *Event, time_t StartTime)
Definition: epg.c:1534
void SetTitle(cEvent *Event, const char *Title)
Definition: epg.c:1489
void DropOutdated(cSchedule *Schedule, time_t SegmentStart, time_t SegmentEnd, uchar TableID, uchar Version)
Definition: epg.c:1596
bool IsUpdate(tEventID EventID, time_t StartTime, uchar TableID, uchar Version)
Definition: epg.c:1471
void FixEpgBugs(cEvent *Event)
Definition: epg.c:1570
void HandleEvent(cEvent *Event)
Definition: epg.c:1579
void SetComponents(cEvent *Event, cComponents *Components)
Definition: epg.c:1561
void SetVps(cEvent *Event, time_t Vps)
Definition: epg.c:1552
void SetParentalRating(cEvent *Event, int ParentalRating)
Definition: epg.c:1525
bool BeginSegmentTransfer(const cChannel *Channel)
Definition: epg.c:1605
bool HandledExternally(const cChannel *Channel)
Definition: epg.c:1462
void SetContents(cEvent *Event, uchar *Contents)
Definition: epg.c:1516
void SetShortText(cEvent *Event, const char *ShortText)
Definition: epg.c:1498
void SetDuration(cEvent *Event, int Duration)
Definition: epg.c:1543
void SetDescription(cEvent *Event, const char *Description)
Definition: epg.c:1507
void SetEventID(cEvent *Event, tEventID EventID)
Definition: epg.c:1480
Definition: epg.h:73
char * shortText
Definition: epg.h:86
cString ToDescr(void) const
Definition: epg.c:251
~cEvent()
Definition: epg.c:136
time_t Vps(void) const
Definition: epg.h:114
time_t vps
Definition: epg.h:92
static const char * ContentToString(uchar Content)
Definition: epg.c:282
void SetSeen(void)
Definition: epg.c:240
uchar TableID(void) const
Definition: epg.h:102
void SetAux(const char *Aux)
Definition: epg.c:245
const char * Aux(void) const
Definition: epg.h:117
time_t EndTime(void) const
Definition: epg.h:112
static cMutex numTimersMutex
Definition: epg.h:76
uchar parentalRating
Definition: epg.h:84
cString GetDateString(void) const
Definition: epg.c:431
int RunningStatus(void) const
Definition: epg.h:104
uchar Contents(int i=0) const
Definition: epg.h:109
bool IsRunning(bool OrAboutToStart=false) const
Definition: epg.c:277
cEvent(tEventID EventID)
Definition: epg.c:115
void SetRunningStatus(int RunningStatus, const cChannel *Channel=NULL)
Definition: epg.c:180
void IncNumTimers(void) const
Definition: epg.c:259
int ParentalRating(void) const
Definition: epg.h:110
time_t StartTime(void) const
Definition: epg.h:111
tChannelID ChannelID(void) const
Definition: epg.c:154
void SetVps(time_t Vps)
Definition: epg.c:235
bool SeenWithin(int Seconds) const
Definition: epg.h:116
bool Parse(char *s)
Definition: epg.c:493
char * title
Definition: epg.h:85
static bool Read(FILE *f, cSchedule *Schedule, int &Line)
Definition: epg.c:535
time_t seen
Definition: epg.h:93
char * description
Definition: epg.h:87
tEventID eventID
Definition: epg.h:80
void SetShortText(const char *ShortText)
Definition: epg.c:192
u_int16_t numTimers
Definition: epg.h:79
cString GetTimeString(void) const
Definition: epg.c:436
const cComponents * Components(void) const
Definition: epg.h:108
void DecNumTimers(void) const
Definition: epg.c:268
tEventID EventID(void) const
Definition: epg.h:101
cComponents * components
Definition: epg.h:88
void SetStartTime(time_t StartTime)
Definition: epg.c:219
bool HasTimer(void) const
Definition: epg.h:120
const char * Title(void) const
Definition: epg.h:105
void SetComponents(cComponents *Components)
Definition: epg.c:202
int duration
Definition: epg.h:90
void SetEventID(tEventID EventID)
Definition: epg.c:159
const cSchedule * Schedule(void) const
Definition: epg.h:100
cString GetEndTimeString(void) const
Definition: epg.c:441
int Duration(void) const
Definition: epg.h:113
cString GetVpsString(void) const
Definition: epg.c:446
void SetVersion(uchar Version)
Definition: epg.c:175
uchar tableID
Definition: epg.h:81
void Dump(FILE *f, const char *Prefix="", bool InfoOnly=false) const
Definition: epg.c:454
void SetDuration(int Duration)
Definition: epg.c:230
void SetContents(uchar *Contents)
Definition: epg.c:208
cSchedule * schedule
Definition: epg.h:78
uchar Version(void) const
Definition: epg.h:103
const char * ShortText(void) const
Definition: epg.h:106
uchar runningStatus
Definition: epg.h:83
void SetTitle(const char *Title)
Definition: epg.c:187
time_t Seen(void) const
Definition: epg.h:115
char * aux
Definition: epg.h:94
uchar version
Definition: epg.h:82
void SetTableID(uchar TableID)
Definition: epg.c:170
uchar contents[MaxEventContents]
Definition: epg.h:91
cString GetParentalRatingString(void) const
Definition: epg.c:424
void FixEpgBugs(void)
Definition: epg.c:693
void SetDescription(const char *Description)
Definition: epg.c:197
const char * Description(void) const
Definition: epg.h:107
time_t startTime
Definition: epg.h:89
void SetParentalRating(int ParentalRating)
Definition: epg.c:214
virtual int Compare(const cListObject &ListObject) const override
Must return 0 if this object is equal to ListObject, a positive value if it is "greater",...
Definition: epg.c:145
Definition: thread.h:67
Definition: epg.h:152
const cEvent * GetPresentEvent(void) const
Definition: epg.c:1003
cHash< cEvent > eventsHashID
Definition: epg.h:157
bool Modified(int &State) const
Definition: epg.h:166
bool HasTimer(void) const
Definition: epg.h:181
void SetRunningStatus(cEvent *Event, int RunningStatus, const cChannel *Channel=NULL)
Definition: epg.c:1059
void UnhashEvent(cEvent *Event)
Definition: epg.c:996
const cEvent * GetEventAround(time_t Time) const
Definition: epg.c:1045
const cEvent * GetEventByTime(time_t StartTime) const
Definition: epg.c:1038
void DecNumTimers(void) const
Definition: epg.c:946
const cList< cEvent > * Events(void) const
Definition: epg.h:186
bool OnActualTp(uchar TableId)
Definition: epg.c:953
void DropOutdated(time_t SegmentStart, time_t SegmentEnd, uchar TableID, uchar Version)
Definition: epg.c:1097
static bool Read(FILE *f, cSchedules *Schedules)
Definition: epg.c:1184
cSchedule(tChannelID ChannelID)
Definition: epg.c:929
void SetPresentSeen(void)
Definition: epg.h:171
static cMutex numTimersMutex
Definition: epg.h:154
bool PresentSeenWithin(int Seconds) const
Definition: epg.h:169
void ClrRunningStatus(cChannel *Channel=NULL)
Definition: epg.c:1074
void ResetVersions(void)
Definition: epg.c:1085
cList< cEvent > events
Definition: epg.h:156
void Cleanup(void)
Definition: epg.c:1136
tChannelID channelID
Definition: epg.h:155
time_t PresentSeen(void) const
Definition: epg.h:168
const cEvent * GetEventById(tEventID EventID) const
Definition: epg.c:1033
void DelEvent(cEvent *Event)
Definition: epg.c:968
void HashEvent(cEvent *Event)
Definition: epg.c:984
u_int16_t numTimers
Definition: epg.h:159
tChannelID ChannelID(void) const
Definition: epg.h:165
void SetModified(void)
Definition: epg.h:170
int modified
Definition: epg.h:161
void Sort(void)
Definition: epg.c:1091
bool onActualTp
Definition: epg.h:160
cHash< cEvent > eventsHashStartTime
Definition: epg.h:158
void IncNumTimers(void) const
Definition: epg.c:939
time_t presentSeen
Definition: epg.h:162
cEvent * AddEvent(cEvent *Event)
Definition: epg.c:960
void Dump(const cChannels *Channels, FILE *f, const char *Prefix="", eDumpMode DumpMode=dmAll, time_t AtTime=0) const
Definition: epg.c:1152
const cEvent * GetFollowingEvent(void) const
Definition: epg.c:1018
cSchedules(void)
Definition: epg.c:1271
static cSchedules * GetSchedulesWrite(cStateKey &StateKey, int TimeoutMs=0)
Gets the list of schedules for write access.
Definition: epg.c:1281
const cSchedule * GetSchedule(tChannelID ChannelID) const
Definition: epg.c:1381
static const cSchedules * GetSchedulesRead(cStateKey &StateKey, int TimeoutMs=0)
Gets the list of schedules for read access.
Definition: epg.c:1276
static bool Dump(FILE *f=NULL, const char *Prefix="", eDumpMode DumpMode=dmAll, time_t AtTime=0)
Definition: epg.c:1314
static void SetEpgDataFileName(const char *FileName)
Definition: epg.c:1286
static void Cleanup(bool Force=false)
Definition: epg.c:1293
static time_t lastDump
Definition: epg.h:201
static char * epgDataFileName
Definition: epg.h:200
static void ResetVersions(void)
Definition: epg.c:1307
cSchedule * AddSchedule(tChannelID ChannelID)
Definition: epg.c:1370
static bool Read(FILE *f=NULL)
Definition: epg.c:1338
static cSchedules schedules
Definition: epg.h:199
Definition: tools.h:178
Definition: thread.h:79
@ MaxEventContents
Definition: epg.h:25
cEpgHandlers EpgHandlers
Definition: epg.c:1442
u_int32_t tEventID
Definition: epg.h:69
DEF_LIST_LOCK(Schedules)
void ReportEpgBugFixStats(bool Force=false)
Definition: epg.c:614
eDumpMode
Definition: epg.h:42
@ dmAtTime
Definition: epg.h:42
@ dmPresent
Definition: epg.h:42
@ dmFollowing
Definition: epg.h:42
@ dmAll
Definition: epg.h:42
eEventContentGroup
Definition: epg.h:27
@ ecgSocialPoliticalEconomics
Definition: epg.h:35
@ ecgNewsCurrentAffairs
Definition: epg.h:29
@ ecgEducationalScience
Definition: epg.h:36
@ ecgMovieDrama
Definition: epg.h:28
@ ecgArtsCulture
Definition: epg.h:34
@ ecgShow
Definition: epg.h:30
@ ecgSports
Definition: epg.h:31
@ ecgLeisureHobbies
Definition: epg.h:37
@ ecgMusicBalletDance
Definition: epg.h:33
@ ecgSpecial
Definition: epg.h:38
@ ecgUserDefined
Definition: epg.h:39
@ ecgChildrenYouth
Definition: epg.h:32
RunningStatus
Definition: si.h:196
TableId
Definition: si.h:23
Definition: epg.h:44
bool FromString(const char *s)
Definition: epg.c:31
char language[MAXLANGCODE2]
Definition: epg.h:47
uchar stream
Definition: epg.h:45
cString ToString(void)
Definition: epg.c:24
uchar type
Definition: epg.h:46
char * description
Definition: epg.h:48
unsigned char uchar
Definition: tools.h:31