{
device=Device; devplugin=DevPlugin; adapter=Adapter; frontend=Frontend; devId=DevId;
softcsa=SoftCSA; fullts=FullTS;
- decsa=0; tcid=0; rebuildcaids=false;
+ tcid=0; rebuildcaids=false;
memset(version,0,sizeof(version));
#ifndef SASC
memset(slots,0,sizeof(slots));
}
else PRINTF(L_GEN_ERROR,"failed to create ringbuffer for SC-CI adapter %s.",devId);
- if(softcsa) decsa=new cDeCSA(devId);
+ decsa=softcsa ? new cDeCSA(devId) : 0;
#endif //!SASC
source=transponder=-1; liveVpid=liveApid=0; logger=0; hookman=0;
#include "sasccam.h"
#include "scsetup.h"
-// -- cScDevice -------------------------------------------------------------
+// -- cScSascDevice ------------------------------------------------------------
-#define SCDEVICE cScDevice
+#define SCDEVICE cScSascDevice
#define DVBDEVICE cDvbDevice
+#define OWN_SETCA
#include "device-tmpl.c"
#undef SCDEVICE
#undef DVBDEVICE
+#undef OWN_SETCA
-// -- cSascDvbDevice -------------------------------------------------------------
+extern void _SetCaDescr(int adapter, ca_descr_t *ca_descr);
+extern void _SetCaPid(int adapter, ca_pid_t *ca_pid);
-class cSascDvbDevice : public cScDevice {
-private:
- int cardidx;
+bool cScSascDevice::SetCaDescr(ca_descr_t *ca_descr, bool initial)
+{
+ printf("Called cScSascDevice::SetCaDescr\n");
+ _SetCaDescr(cardIndex,ca_descr);
+ return true;
+}
+
+bool cScSascDevice::SetCaPid(ca_pid_t *ca_pid)
+{
+ printf("Called cScSascDevice::SetCaPid\n");
+ _SetCaPid(cardIndex,ca_pid);
+ return true;
+}
+
+// -- cScSascDevicePlugin ------------------------------------------------------
+
+class cScSascDevicePlugin : public cScDevicePlugin {
public:
- cSascDvbDevice(int n, int cafd) :cScDevice(n, 0, cafd) {cardidx = n;}
- ~cSascDvbDevice() {};
- bool SetCaDescr(ca_descr_t *ca_descr, bool initial);
- bool SetCaPid(ca_pid_t *ca_pid);
+ virtual cDevice *Probe(int Adapter, int Frontend, uint32_t SubSystemId);
+ virtual bool LateInit(cDevice *dev);
+ virtual bool EarlyShutdown(cDevice *dev);
+ virtual bool SetCaDescr(cDevice *dev, ca_descr_t *ca_descr, bool initial);
+ virtual bool SetCaPid(cDevice *dev, ca_pid_t *ca_pid);
};
-extern void _SetCaDescr(int adapter, ca_descr_t *ca_descr);
-bool cSascDvbDevice::SetCaDescr(ca_descr_t *ca_descr, bool initial)
+cDevice *cScSascDevicePlugin::Probe(int Adapter, int Frontend, uint32_t SubSystemId)
{
- printf("Called cSascDvbDevice::SetCaDescr\n");
- _SetCaDescr(cardidx, ca_descr);
- return true;
+ return 0;
}
-extern void _SetCaPid(int adapter, ca_pid_t *ca_pid);
-bool cSascDvbDevice::SetCaPid(ca_pid_t *ca_pid)
+bool cScSascDevicePlugin::LateInit(cDevice *dev)
{
- printf("Called cSascDvbDevice::SetCaPid\n");
- _SetCaPid(cardidx, ca_pid);
- return true;
+ return false;
+}
+
+bool cScSascDevicePlugin::EarlyShutdown(cDevice *dev)
+{
+ return false;
+}
+
+bool cScSascDevicePlugin::SetCaDescr(cDevice *dev, ca_descr_t *ca_descr, bool initial)
+{
+ cScSascDevice *d=dynamic_cast<cScSascDevice *>(dev);
+ if(d) return d->SetCaDescr(ca_descr,initial);
+ return false;
+}
+
+bool cScSascDevicePlugin::SetCaPid(cDevice *dev, ca_pid_t *ca_pid)
+{
+ cScSascDevice *d=dynamic_cast<cScSascDevice *>(dev);
+ if(d) return d->SetCaPid(ca_pid);
+ return false;
}
+// -----------------------------------------------------------------------------
+
//Functions to communicate with the cam from the outside world
//Initialize the cam
sascCam::sascCam(int devnum)
{
- dev = new cSascDvbDevice(devnum, -1);
+ dev = new cScSascDevice(new cScSascDevicePlugin,devnum,0,-1);
cam = dev->Cam();
ScSetup.ConcurrentFF=8;
}
}
cam->AddPrg(prg);
}
-