vdr  2.4.1
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 4.3 2017/05/01 08:48:34 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;
30  bool WantsPid(int Pid);
31 protected:
32  cDevice *Device(void) { return device; }
33  void Detach(void);
34  virtual void Activate(bool On) {}
39  virtual void Receive(const uchar *Data, int Length) = 0;
46 public:
47  cReceiver(const cChannel *Channel = NULL, int Priority = MINPRIORITY);
56  virtual ~cReceiver();
57  int Priority(void) { return priority; }
58  void SetPriority(int Priority);
59  bool AddPid(int Pid);
61  bool AddPids(const int *Pids);
64  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);
66  bool SetPids(const cChannel *Channel);
75  void DelPid(int Pid);
77  void DelPids(const int *Pids);
80  tChannelID ChannelID(void) { return channelID; }
81  int NumPids(void) const { return numPids; }
82  bool IsAttached(void) { return device != NULL; }
88  };
89 
90 #endif //__RECEIVER_H
MINPRIORITY
#define MINPRIORITY
Definition: config.h:40
cReceiver::channelID
tChannelID channelID
Definition: receiver.h:21
cReceiver::SetPriority
void SetPriority(int Priority)
Definition: receiver.c:37
cReceiver::Priority
int Priority(void)
Definition: receiver.h:57
cReceiver::priority
int priority
Definition: receiver.h:22
cReceiver::~cReceiver
virtual ~cReceiver()
Definition: receiver.c:27
cReceiver::DelPids
void DelPids(const int *Pids)
Deletes the given zero terminated list of Pids from the list of PIDs of this receiver.
Definition: receiver.c:106
cReceiver
Definition: receiver.h:17
cReceiver::AddPids
bool AddPids(const int *Pids)
Adds the given zero terminated list of Pids to the list of PIDs of this receiver.
Definition: receiver.c:60
cReceiver::cReceiver
cReceiver(const cChannel *Channel=NULL, int Priority=MINPRIORITY)
Creates a new receiver for the given Channel with the given Priority.
Definition: receiver.c:14
cReceiver::startEitInjection
time_t startEitInjection
Definition: receiver.h:28
cReceiver::NumPids
int NumPids(void) const
Definition: receiver.h:81
tChannelID
Definition: channels.h:49
device.h
cReceiver::scramblingTimeout
int scramblingTimeout
Definition: receiver.h:27
cReceiver::Device
cDevice * Device(void)
Definition: receiver.h:32
cReceiver::device
cDevice * device
Definition: receiver.h:20
cReceiver::lastEitInjection
time_t lastEitInjection
Definition: receiver.h:29
cDevice
Definition: device.h:117
uchar
unsigned char uchar
Definition: tools.h:31
cReceiver::WantsPid
bool WantsPid(int Pid)
Definition: receiver.c:114
cReceiver::AddPid
bool AddPid(int Pid)
Adds the given Pid to the list of PIDs of this receiver.
Definition: receiver.c:42
cReceiver::startScrambleDetection
time_t startScrambleDetection
Definition: receiver.h:26
cReceiver::ChannelID
tChannelID ChannelID(void)
Definition: receiver.h:80
cReceiver::numPids
int numPids
Definition: receiver.h:24
cChannel
Definition: channels.h:89
cReceiver::Detach
void Detach(void)
Definition: receiver.c:125
MAXRECEIVEPIDS
#define MAXRECEIVEPIDS
Definition: receiver.h:15
cReceiver::DelPid
void DelPid(int Pid)
Deletes the given Pid from the list of PIDs of this receiver.
Definition: receiver.c:90
cReceiver::Receive
virtual void Receive(const uchar *Data, int Length)=0
This function is called from the cDevice we are attached to, and delivers one TS packet from the set ...
cReceiver::SetPids
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:76
cReceiver::pids
int pids[MAXRECEIVEPIDS]
Definition: receiver.h:23
cReceiver::lastScrambledPacket
time_t lastScrambledPacket
Definition: receiver.h:25