vdr 2.6.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
17class cReceiver {
18 friend class cDevice;
19private:
22 int priority;
24 int numPids;
28 time_t startEitInjection;
29 time_t lastEitInjection;
30 bool WantsPid(int Pid);
31protected:
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;
46public:
47 cReceiver(const cChannel *Channel = NULL, int Priority = MINPRIORITY);
56 virtual ~cReceiver();
57 int Priority(void) { return 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
void SetPriority(int Priority)
time_t lastEitInjection
bool IsAttached(void)
Returns true if this receiver is (still) attached to a device.
Definition: receiver.h:82
int Priority(void)
virtual ~cReceiver()
bool WantsPid(int Pid)
bool AddPids(const int *Pids)
Adds the given zero terminated list of Pids to the list of PIDs of this receiver.
cDevice * device
time_t startEitInjection
tChannelID ChannelID(void)
Definition: receiver.h:80
void Detach(void)
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 ...
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)
Adds the given Pids to the list of PIDs of this receiver.
int pids[MAXRECEIVEPIDS]
bool AddPid(int Pid)
Adds the given Pid to the list of PIDs of this receiver.
bool SetPids(const cChannel *Channel)
Sets the PIDs of this receiver to those of the given Channel, replacing any previously stored PIDs.
void DelPids(const int *Pids)
Deletes the given zero terminated list of Pids from the list of PIDs of this receiver.
time_t startScrambleDetection
tChannelID channelID
time_t lastScrambledPacket
int NumPids(void) const
Definition: receiver.h:81
cReceiver(const cChannel *Channel=NULL, int Priority=MINPRIORITY)
Creates a new receiver for the given Channel with the given Priority.
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:34
cDevice * Device(void)
Definition: receiver.h:32
void DelPid(int Pid)
Deletes the given Pid from the list of PIDs of this receiver.
#define MINPRIORITY
Definition: config.h:44
unsigned char uchar
#define MAXRECEIVEPIDS
Definition: receiver.h:15