2003-12-22 13:29:24 +01:00
|
|
|
/*
|
|
|
|
* eit.h: EIT section filter
|
|
|
|
*
|
|
|
|
* See the main source file 'vdr.c' for copyright information and
|
|
|
|
* how to reach the author.
|
|
|
|
*
|
2021-04-04 11:06:30 +02:00
|
|
|
* $Id: eit.h 5.2 2021/04/04 11:06:30 kls Exp $
|
2003-12-22 13:29:24 +01:00
|
|
|
*/
|
2000-09-03 11:40:00 +02:00
|
|
|
|
|
|
|
#ifndef __EIT_H
|
|
|
|
#define __EIT_H
|
|
|
|
|
2003-12-22 13:29:24 +01:00
|
|
|
#include "filter.h"
|
2015-09-01 11:14:27 +02:00
|
|
|
#include "tools.h"
|
|
|
|
|
2021-03-16 15:10:54 +01:00
|
|
|
#define NUM_EIT_TABLES 17
|
2015-09-01 11:14:27 +02:00
|
|
|
|
2021-03-16 15:10:54 +01:00
|
|
|
// Event information (or EPG) is broadcast in tables 0x4E and 0x4F for "present/following" events on
|
|
|
|
// "this transponder" (0x4E) and "other transponders" (0x4F), as well as 0x50-0x5F ("all events on this
|
2021-04-04 11:06:30 +02:00
|
|
|
// transponder") and 0x60-0x6F ("all events on other transponders"). Since it's either "this" or "other",
|
2021-03-16 15:10:54 +01:00
|
|
|
// we only use one section syncer for 0x4E/0x4F and 16 syncers for either 0x5X or 0x6X.
|
|
|
|
|
|
|
|
class cEitTables : public cListObject {
|
|
|
|
private:
|
|
|
|
cSectionSyncerRandom sectionSyncer[NUM_EIT_TABLES]; // for tables 0x4E/0x4F and 0x50-0x5F/0x60-0x6F
|
2021-04-04 11:06:30 +02:00
|
|
|
time_t tableStart; // only used for table 0x4E
|
|
|
|
time_t tableEnd;
|
2021-03-16 15:10:54 +01:00
|
|
|
bool complete;
|
|
|
|
int Index(uchar TableId) { return (TableId < 0x50) ? 0 : (TableId & 0x0F) + 1; }
|
|
|
|
public:
|
2021-04-04 11:06:30 +02:00
|
|
|
cEitTables(void);
|
|
|
|
void SetTableStart(time_t t) { tableStart = t; }
|
|
|
|
void SetTableEnd(time_t t) { tableEnd = t; }
|
|
|
|
time_t TableStart(void) { return tableStart; }
|
|
|
|
time_t TableEnd(void) { return tableEnd; }
|
2021-03-16 15:10:54 +01:00
|
|
|
bool Check(uchar TableId, uchar Version, int SectionNumber);
|
|
|
|
bool Processed(uchar TableId, uchar LastTableId, int SectionNumber, int LastSectionNumber, int SegmentLastSectionNumber = -1);
|
2021-04-04 11:06:30 +02:00
|
|
|
///< Returns true if all sections of the table with the given TableId have been processed.
|
2021-03-16 15:10:54 +01:00
|
|
|
bool Complete(void) { return complete; }
|
2021-04-04 11:06:30 +02:00
|
|
|
///< Returns true if all sections of all tables have been processed.
|
2021-03-16 15:10:54 +01:00
|
|
|
};
|
|
|
|
|
2021-04-04 11:06:30 +02:00
|
|
|
class cEitTablesHash : public cHash<cEitTables> {
|
2017-05-09 08:33:37 +02:00
|
|
|
public:
|
2021-04-04 11:06:30 +02:00
|
|
|
cEitTablesHash(void) : cHash(HASHSIZE, true) {};
|
2017-05-09 08:33:37 +02:00
|
|
|
};
|
2000-09-03 11:40:00 +02:00
|
|
|
|
2003-12-22 13:29:24 +01:00
|
|
|
class cEitFilter : public cFilter {
|
2010-01-03 15:45:23 +01:00
|
|
|
private:
|
2015-09-01 11:14:27 +02:00
|
|
|
cMutex mutex;
|
2021-04-04 11:06:30 +02:00
|
|
|
cEitTablesHash eitTablesHash;
|
2010-01-03 15:45:23 +01:00
|
|
|
static time_t disableUntil;
|
2000-10-29 13:17:22 +01:00
|
|
|
protected:
|
2003-12-22 13:29:24 +01:00
|
|
|
virtual void Process(u_short Pid, u_char Tid, const u_char *Data, int Length);
|
2001-03-31 15:04:37 +02:00
|
|
|
public:
|
2003-12-22 13:29:24 +01:00
|
|
|
cEitFilter(void);
|
2015-09-01 11:14:27 +02:00
|
|
|
virtual void SetStatus(bool On);
|
2010-01-03 15:45:23 +01:00
|
|
|
static void SetDisableUntil(time_t Time);
|
2000-10-29 13:17:22 +01:00
|
|
|
};
|
2000-09-03 11:40:00 +02:00
|
|
|
|
2003-12-22 13:29:24 +01:00
|
|
|
#endif //__EIT_H
|