vdr
1.7.27
|
00001 /* 00002 * filter.h: Section filter 00003 * 00004 * See the main source file 'vdr.c' for copyright information and 00005 * how to reach the author. 00006 * 00007 * $Id: filter.h 2.0 2004/01/11 13:31:59 kls Exp $ 00008 */ 00009 00010 #ifndef __FILTER_H 00011 #define __FILTER_H 00012 00013 #include <sys/types.h> 00014 #include "tools.h" 00015 00016 class cSectionSyncer { 00017 private: 00018 int lastVersion; 00019 bool synced; 00020 public: 00021 cSectionSyncer(void); 00022 void Reset(void); 00023 bool Sync(uchar Version, int Number, int LastNumber); 00024 }; 00025 00026 class cFilterData : public cListObject { 00027 public: 00028 u_short pid; 00029 u_char tid; 00030 u_char mask; 00031 bool sticky; 00032 cFilterData(void); 00033 cFilterData(u_short Pid, u_char Tid, u_char Mask, bool Sticky); 00034 bool Is(u_short Pid, u_char Tid, u_char Mask); 00035 bool Matches(u_short Pid, u_char Tid); 00036 }; 00037 00038 class cChannel; 00039 class cSectionHandler; 00040 00041 class cFilter : public cListObject { 00042 friend class cSectionHandler; 00043 private: 00044 cSectionHandler *sectionHandler; 00045 cList<cFilterData> data; 00046 bool on; 00047 protected: 00048 cFilter(void); 00049 cFilter(u_short Pid, u_char Tid, u_char Mask = 0xFF); 00050 virtual ~cFilter(); 00051 virtual void SetStatus(bool On); 00058 virtual void Process(u_short Pid, u_char Tid, const u_char *Data, int Length) = 0; 00069 int Source(void); 00071 int Transponder(void); 00073 const cChannel *Channel(void); 00075 bool Matches(u_short Pid, u_char Tid); 00077 void Set(u_short Pid, u_char Tid, u_char Mask = 0xFF); 00079 void Add(u_short Pid, u_char Tid, u_char Mask = 0xFF, bool Sticky = false); 00083 void Del(u_short Pid, u_char Tid, u_char Mask = 0xFF); 00085 }; 00086 00087 #endif //__FILTER_H