SASC-NG
DVBSoftCAM

device.h

Go to the documentation of this file.
00001 /*
00002  * Softcam plugin to VDR (C++)
00003  *
00004  * This code is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU General Public License
00006  * as published by the Free Software Foundation; either version 2
00007  * of the License, or (at your option) any later version.
00008  *
00009  * This code is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00017  * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
00018  */
00019 
00020 #ifndef ___DEVICE_H
00021 #define ___DEVICE_H
00022 
00023 #include <linux/dvb/ca.h>
00024 #include <vdr/dvbdevice.h>
00025 #include <vdr/thread.h>
00026 #include "misc.h"
00027 
00028 class cDeCSA;
00029 
00030 // ----------------------------------------------------------------
00031 
00032 #define DEV_DVB_ADAPTER  "/dev/dvb/adapter"
00033 #define DEV_DVB_FRONTEND "frontend"
00034 #define DEV_DVB_DVR      "dvr"
00035 #define DEV_DVB_DEMUX    "demux"
00036 #define DEV_DVB_CA       "ca"
00037 #define DEV_DVB_OSD      "osd"
00038 
00039 #if APIVERSNUM >= 10711
00040 #define DVB_DEV_SPEC adapter,frontend
00041 #else
00042 #define DVB_DEV_SPEC CardIndex(),0
00043 #endif
00044 
00045 // ----------------------------------------------------------------
00046 
00047 #ifndef SASC
00048 class cDeCsaTSBuffer : public cThread {
00049 private:
00050   int f;
00051   int cardIndex, size;
00052   bool delivered;
00053   cRingBufferLinear *ringBuffer;
00054   //
00055   cDeCSA *decsa;
00056   bool scActive;
00057   //
00058   virtual void Action(void);
00059 public:
00060   cDeCsaTSBuffer(int File, int Size, int CardIndex, cDeCSA *DeCsa, bool ScActive);
00061   ~cDeCsaTSBuffer();
00062   uchar *Get(void);
00063   void SetActive(bool ScActive);
00064   };
00065 #endif
00066 
00067 // ----------------------------------------------------------------
00068 
00069 class cScDevices : public cDvbDevice {
00070 private:
00071   static int budget;
00072 public:
00073 #if APIVERSNUM >= 10711 // make compiler happy. These are never used!
00074   cScDevices(void):cDvbDevice(0,0) {}
00075 #else
00076   cScDevices(void):cDvbDevice(0) {}
00077 #endif
00078   static void OnPluginLoad(void);
00079   static void OnPluginUnload(void);
00080   static bool Initialize(void);
00081   static void Startup(void);
00082   static void Shutdown(void);
00083   static void SetForceBudget(int n);
00084   static bool ForceBudget(int n);
00085   static void DvbName(const char *Name, int a, int f, char *buffer, int len);
00086   static int DvbOpen(const char *Name, int a, int f, int Mode, bool ReportError=false);
00087   };
00088 
00089 // ----------------------------------------------------------------
00090 
00091 class cScDevicePlugin : public cSimpleItem {
00092 public:
00093   cScDevicePlugin(void);
00094   virtual ~cScDevicePlugin();
00095   virtual cDevice *Probe(int Adapter, int Frontend, uint32_t SubSystemId)=0;
00096   virtual bool LateInit(cDevice *dev)=0;
00097   virtual bool EarlyShutdown(cDevice *dev)=0;
00098   virtual bool SetCaDescr(cDevice *dev, ca_descr_t *ca_descr, bool initial) { return false; }
00099   virtual bool SetCaPid(cDevice *dev, ca_pid_t *ca_pid) { return false; }
00100   virtual bool DumpAV(cDevice *dev) { return false; }
00101   };
00102 
00103 #endif // ___DEVICE_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines