vdr 2.8.4
eit.h
Go to the documentation of this file.
1/*
2 * eit.h: EIT section filter
3 *
4 * See the main source file 'vdr.c' for copyright information and
5 * how to reach the author.
6 *
7 * $Id: eit.h 5.3 2025/03/02 11:03:35 kls Exp $
8 */
9
10#ifndef __EIT_H
11#define __EIT_H
12
13#include <atomic>
14#include "filter.h"
15#include "tools.h"
16
17#define NUM_EIT_TABLES 17
18
19// Event information (or EPG) is broadcast in tables 0x4E and 0x4F for "present/following" events on
20// "this transponder" (0x4E) and "other transponders" (0x4F), as well as 0x50-0x5F ("all events on this
21// transponder") and 0x60-0x6F ("all events on other transponders"). Since it's either "this" or "other",
22// we only use one section syncer for 0x4E/0x4F and 16 syncers for either 0x5X or 0x6X.
23
24class cEitTables : public cListObject {
25private:
26 cSectionSyncerRandom sectionSyncer[NUM_EIT_TABLES]; // for tables 0x4E/0x4F and 0x50-0x5F/0x60-0x6F
27 time_t tableStart; // only used for table 0x4E
28 time_t tableEnd;
30 int Index(uchar TableId) { return (TableId < 0x50) ? 0 : (TableId & 0x0F) + 1; }
31public:
32 cEitTables(void);
33 void SetTableStart(time_t t) { tableStart = t; }
34 void SetTableEnd(time_t t) { tableEnd = t; }
35 time_t TableStart(void) { return tableStart; }
36 time_t TableEnd(void) { return tableEnd; }
37 bool Check(uchar TableId, uchar Version, int SectionNumber);
38 bool Processed(uchar TableId, uchar LastTableId, int SectionNumber, int LastSectionNumber, int SegmentLastSectionNumber = -1);
40 bool Complete(void) { return complete; }
42 };
43
44class cEitTablesHash : public cHash<cEitTables> {
45public:
46 cEitTablesHash(void) : cHash(HASHSIZE, true) {};
47 };
48
49class cEitFilter : public cFilter {
50private:
53 static std::atomic<time_t> disableUntil; // set by SVDRP CLRE, read by Process() on the section handler threads
54protected:
55 virtual void Process(u_short Pid, u_char Tid, const u_char *Data, int Length) override;
56public:
57 cEitFilter(void);
58 virtual void SetStatus(bool On) override;
59 static void SetDisableUntil(time_t Time);
60 };
61
62#endif //__EIT_H
cMutex mutex
Definition eit.h:51
virtual void Process(u_short Pid, u_char Tid, const u_char *Data, int Length) override
Processes the data delivered to this filter.
Definition eit.c:514
static std::atomic< time_t > disableUntil
Definition eit.h:53
static void SetDisableUntil(time_t Time)
Definition eit.c:509
cEitTablesHash eitTablesHash
Definition eit.h:52
cEitFilter(void)
Definition eit.c:496
virtual void SetStatus(bool On) override
Turns this filter on or off, depending on the value of On.
Definition eit.c:502
cEitTablesHash(void)
Definition eit.h:46
bool complete
Definition eit.h:29
time_t tableStart
Definition eit.h:27
void SetTableStart(time_t t)
Definition eit.h:33
bool Processed(uchar TableId, uchar LastTableId, int SectionNumber, int LastSectionNumber, int SegmentLastSectionNumber=-1)
Returns true if all sections of the table with the given TableId have been processed.
Definition eit.c:57
cEitTables(void)
Definition eit.c:44
cSectionSyncerRandom sectionSyncer[NUM_EIT_TABLES]
Definition eit.h:26
bool Complete(void)
Returns true if all sections of all tables have been processed.
Definition eit.h:40
int Index(uchar TableId)
Definition eit.h:30
void SetTableEnd(time_t t)
Definition eit.h:34
time_t TableEnd(void)
Definition eit.h:36
time_t tableEnd
Definition eit.h:28
bool Check(uchar TableId, uchar Version, int SectionNumber)
Definition eit.c:51
time_t TableStart(void)
Definition eit.h:35
cFilter(void)
Definition filter.c:115
cHash(int Size=HASHSIZE, bool OwnObjects=false)
Definition tools.h:941
cListObject(const cListObject &ListObject)
Definition tools.h:553
#define NUM_EIT_TABLES
Definition eit.h:17
#define HASHSIZE
Definition tools.h:937
unsigned char uchar
Definition tools.h:31