vdr  2.2.0
receiver.h
Go to the documentation of this file.
1 /*
2  * receiver.h: The basic receiver interface
3  *
4  * See the main source file 'vdr.c' for copyright information and
5  * how to reach the author.
6  *
7  * $Id: receiver.h 3.3 2015/01/12 14:03:22 kls Exp $
8  */
9 
10 #ifndef __RECEIVER_H
11 #define __RECEIVER_H
12 
13 #include "device.h"
14 
15 #define MAXRECEIVEPIDS 64 // the maximum number of PIDs per receiver
16 
17 class cReceiver {
18  friend class cDevice;
19 private:
22  int priority;
24  int numPids;
25  bool WantsPid(int Pid);
26 protected:
27  cDevice *Device(void) { return device; }
28  void Detach(void);
29  virtual void Activate(bool On) {}
34  virtual void Receive(uchar *Data, int Length) = 0;
41 public:
42  cReceiver(const cChannel *Channel = NULL, int Priority = MINPRIORITY);
51  virtual ~cReceiver();
52  int Priority(void) { return priority; }
53  void SetPriority(int Priority);
54  bool AddPid(int Pid);
56  bool AddPids(const int *Pids);
59  bool AddPids(int Pid1, int Pid2, int Pid3 = 0, int Pid4 = 0, int Pid5 = 0, int Pid6 = 0, int Pid7 = 0, int Pid8 = 0, int Pid9 = 0);
61  bool SetPids(const cChannel *Channel);
70  void DelPid(int Pid);
72  void DelPids(const int *Pids);
75  tChannelID ChannelID(void) { return channelID; }
76  int NumPids(void) const { return numPids; }
77  bool IsAttached(void) { return device != NULL; }
83  };
84 
85 #endif //__RECEIVER_H
#define MAXRECEIVEPIDS
Definition: receiver.h:15
unsigned char uchar
Definition: tools.h:30
cReceiver(const cChannel *Channel=NULL, int Priority=MINPRIORITY)
Creates a new receiver for the given Channel with the given Priority.
Definition: receiver.c:14
virtual ~cReceiver()
Definition: receiver.c:22
bool AddPids(const int *Pids)
Adds the given zero terminated list of Pids to the list of PIDs of this receiver. ...
Definition: receiver.c:50
cDevice * Device(void)
Definition: receiver.h:27
cDevice * device
Definition: receiver.h:20
#define MINPRIORITY
Definition: config.h:40
int numPids
Definition: receiver.h:24
int NumPids(void) const
Definition: receiver.h:76
int Priority(void)
Definition: receiver.h:52
tChannelID ChannelID(void)
Definition: receiver.h:75
void DelPids(const int *Pids)
Deletes the given zero terminated list of Pids from the list of PIDs of this receiver.
Definition: receiver.c:95
bool IsAttached(void)
Returns true if this receiver is (still) attached to a device.
Definition: receiver.h:77
bool SetPids(const cChannel *Channel)
Sets the PIDs of this receiver to those of the given Channel, replacing any previously stored PIDs...
Definition: receiver.c:66
virtual void Receive(uchar *Data, int Length)=0
This function is called from the cDevice we are attached to, and delivers one TS packet from the set ...
bool AddPid(int Pid)
Adds the given Pid to the list of PIDs of this receiver.
Definition: receiver.c:37
int pids[MAXRECEIVEPIDS]
Definition: receiver.h:23
void DelPid(int Pid)
Deletes the given Pid from the list of PIDs of this receiver.
Definition: receiver.c:81
tChannelID channelID
Definition: receiver.h:21
int priority
Definition: receiver.h:22
bool WantsPid(int Pid)
Definition: receiver.c:103
void SetPriority(int Priority)
Definition: receiver.c:32
void Detach(void)
Definition: receiver.c:114
The cDevice class is the base from which actual devices can be derived.
Definition: device.h:109
virtual void Activate(bool On)
This function is called just before the cReceiver gets attached to (On == true) and right after it ge...
Definition: receiver.h:29