vdr  2.2.0
pat.h
Go to the documentation of this file.
1 /*
2  * pat.h: PAT section filter
3  *
4  * See the main source file 'vdr.c' for copyright information and
5  * how to reach the author.
6  *
7  * $Id: pat.h 3.4 2015/01/04 13:17:22 kls Exp $
8  */
9 
10 #ifndef __PAT_H
11 #define __PAT_H
12 
13 #include <stdint.h>
14 #include "filter.h"
15 #include "thread.h"
16 
17 #define MAXPMTENTRIES 64
18 
19 class cPatFilter : public cFilter {
20 private:
24  int pmtIndex;
28  int sid;
29  int GetPmtPid(int Index) { return pmtId[Index] & 0x0000FFFF; }
30  int MakePmtId(int PmtPid, int Sid) { return PmtPid | (Sid << 16); }
31  bool PmtVersionChanged(int PmtPid, int Sid, int Version, bool SetNewVersion = false);
32  void SwitchToNextPmtPid(void);
33 protected:
34  virtual void Process(u_short Pid, u_char Tid, const u_char *Data, int Length);
35 public:
36  cPatFilter(void);
37  virtual void SetStatus(bool On);
38  void Trigger(int Sid = -1);
39  };
40 
41 int GetCaDescriptors(int Source, int Transponder, int ServiceId, const int *CaSystemIds, int BufSize, uchar *Data, int EsPid);
49 
50 int GetCaPids(int Source, int Transponder, int ServiceId, const int *CaSystemIds, int BufSize, int *Pids);
58 
59 int GetPmtPid(int Source, int Transponder, int ServiceId);
61 
62 #endif //__PAT_H
unsigned char uchar
Definition: tools.h:30
int GetPmtPid(int Index)
Definition: pat.h:29
int GetCaDescriptors(int Source, int Transponder, int ServiceId, const int *CaSystemIds, int BufSize, uchar *Data, int EsPid)
Gets all CA descriptors for a given channel.
Definition: pat.c:278
int Index(void) const
Definition: tools.c:1989
virtual void Process(u_short Pid, u_char Tid, const u_char *Data, int Length)
Processes the data delivered to this filter.
Definition: pat.c:355
cTimeMs timer
Definition: pat.h:22
cPatFilter(void)
Definition: pat.c:302
int pmtIndex
Definition: pat.h:24
int pmtId[MAXPMTENTRIES]
Definition: pat.h:25
Definition: filter.h:41
void Trigger(int Sid=-1)
Definition: pat.c:316
#define MAXPMTENTRIES
Definition: pat.h:17
int numPmtEntries
Definition: pat.h:27
int Source(void)
Returns the source of the data delivered to this filter.
Definition: filter.c:89
void SwitchToNextPmtPid(void)
Definition: pat.c:346
cMutex mutex
Definition: pat.h:21
int MakePmtId(int PmtPid, int Sid)
Definition: pat.h:30
Definition: thread.h:63
virtual void SetStatus(bool On)
Turns this filter on or off, depending on the value of On.
Definition: pat.c:308
int patVersion
Definition: pat.h:23
Definition: pat.h:19
int sid
Definition: pat.h:28
unsigned char u_char
Definition: headers.h:24
Definition: tools.h:333
int Transponder(void)
Returns the transponder of the data delivered to this filter.
Definition: filter.c:94
int GetCaPids(int Source, int Transponder, int ServiceId, const int *CaSystemIds, int BufSize, int *Pids)
Gets all CA pids for a given channel.
Definition: pat.c:283
int pmtVersion[MAXPMTENTRIES]
Definition: pat.h:26
bool PmtVersionChanged(int PmtPid, int Sid, int Version, bool SetNewVersion=false)
Definition: pat.c:328