vdr  2.0.4
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 2.9 2012/09/02 09:27:20 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  void Detach(void);
28  virtual void Activate(bool On) {}
33  virtual void Receive(uchar *Data, int Length) = 0;
40 public:
41  cReceiver(const cChannel *Channel = NULL, int Priority = MINPRIORITY);
50  virtual ~cReceiver();
51  bool AddPid(int Pid);
53  bool AddPids(const int *Pids);
56  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);
58  bool SetPids(const cChannel *Channel);
67  tChannelID ChannelID(void) { return channelID; }
68  bool IsAttached(void) { return device != NULL; }
74  };
75 
76 #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:45
cDevice * device
Definition: receiver.h:20
#define MINPRIORITY
Definition: config.h:40
int numPids
Definition: receiver.h:24
tChannelID ChannelID(void)
Definition: receiver.h:67
bool IsAttached(void)
Returns true if this receiver is (still) attached to a device.
Definition: receiver.h:68
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:61
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:32
int pids[MAXRECEIVEPIDS]
Definition: receiver.h:23
int Priority(void) const
Returns the priority of the current receiving session (-MAXPRIORITY..MAXPRIORITY), or IDLEPRIORITY if no receiver is currently active.
Definition: device.c:1556
tChannelID channelID
Definition: receiver.h:21
int priority
Definition: receiver.h:22
bool WantsPid(int Pid)
Definition: receiver.c:76
void Detach(void)
Definition: receiver.c:87
The cDevice class is the base from which actual devices can be derived.
Definition: device.h:104
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:28