forked from aiolos/sasc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcam.h
100 lines (88 loc) · 2.69 KB
/
cam.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
/*
* Softcam plugin to VDR (C++)
*
* This code is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This code is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* Or, point your browser to http://www.gnu.org/copyleft/gpl.html
*/
#ifndef ___CAM_H
#define ___CAM_H
#include <vdr/thread.h>
#include "data.h"
#include "misc.h"
class cChannel;
class cEcmHandler;
class cEcmData;
class cLogger;
class cHookManager;
class cLogHook;
class cScDevice;
class cPrg;
// ----------------------------------------------------------------
class cEcmCache : public cStructListPlain<cEcmData> {
private:
cEcmData *Exists(cEcmInfo *e);
protected:
virtual bool ParseLinePlain(const char *line);
public:
cEcmCache(void);
void New(cEcmInfo *e);
int GetCached(cSimpleList<cEcmInfo> *list, int sid, int Source, int Transponder);
void Delete(cEcmInfo *e);
void Flush(void);
};
extern cEcmCache ecmcache;
// ----------------------------------------------------------------
#define MAX_CW_IDX 16
#define MAX_SPLIT_SID 16
class cCam : private cMutex {
private:
int cardNum;
cScDevice *device;
cSimpleList<cEcmHandler> handlerList;
cLogger *logger;
cHookManager *hookman;
int source, transponder, liveVpid, liveApid;
int splitSid[MAX_SPLIT_SID+1];
unsigned char indexMap[MAX_CW_IDX], lastCW[MAX_CW_IDX][2*8];
//
cEcmHandler *GetHandler(int sid, bool needZero, bool noshift);
void RemHandler(cEcmHandler *handler);
int GetFreeIndex(void);
void LogStartup(void);
public:
cCam(cScDevice *dev, int CardNum);
virtual ~cCam();
// EcmHandler API
void WriteCW(int index, unsigned char *cw, bool force);
void SetCWIndex(int pid, int index);
void DumpAV7110(void);
void LogEcmStatus(const cEcmInfo *ecm, bool on);
void AddHook(cLogHook *hook);
bool TriggerHook(int id);
// Plugin API
bool Active(bool log);
void HouseKeeping(void);
void Tune(const cChannel *channel);
void PostTune(void);
void SetPid(int type, int pid, bool on);
void Stop(void);
void AddPrg(cPrg *prg);
bool HasPrg(int prg);
char *CurrentKeyStr(int num);
//
bool IsSoftCSA(bool live);
};
void LogStatsDown(void);
#endif // ___CAM_H