From: leslie Date: Sat, 9 Jan 2010 12:02:08 +0000 (+0100) Subject: experimental, budget-only support for VDR 1.7.11 X-Git-Tag: upstream/620~114 X-Git-Url: http://www.vanbest.org/gitweb/?a=commitdiff_plain;h=b79d3f9d80f46e57bd5779015c202c24d6eacd78;p=sasc-ng.git experimental, budget-only support for VDR 1.7.11 FF cards are NOT supported yet. You can use a FF card if you load the dvbsdevice plugin BEFORE sc plugin, but sc won't work on the FF card. --- diff --git a/cam.c b/cam.c index f0e4c27..f5715f5 100644 --- a/cam.c +++ b/cam.c @@ -2994,14 +2994,30 @@ uchar *cDeCsaTSBuffer::Get(void) #endif //SASC +// --- cScDvbDeviceProbe ------------------------------------------------------- + +#if APIVERSNUM >= 10711 +bool cScDvbDeviceProbe::Probe(int Adapter, int Frontend) +{ + int cafd=open(cString::sprintf("%s%d/%s%d",DEV_DVB_ADAPTER,Adapter,DEV_DVB_CA,Frontend),O_RDWR); + new cScDvbDevice(Adapter,Frontend,cafd); + return true; +} +#endif + // -- cScDvbDevice ------------------------------------------------------------- int cScDvbDevice::budget=0; #ifndef SASC +#if APIVERSNUM >= 10711 +cScDvbDevice::cScDvbDevice(int Adapter, int Frontend, int cafd) +:cDvbDevice(Adapter,Frontend) +#else cScDvbDevice::cScDvbDevice(int n, int cafd) :cDvbDevice(n) +#endif { decsa=0; tsBuffer=0; cam=0; fullts=false; #if APIVERSNUM >= 10500 @@ -3098,10 +3114,15 @@ bool cScDvbDevice::ForceBudget(int n) return budget && (budget&(1<= 10711 + new cScDvbDeviceProbe; +#else /* This is an extremly ugly hack to access VDRs device scan parameters, which are protected in this context. Heavily dependant on the actual symbol names @@ -3119,10 +3140,14 @@ void cScDvbDevice::Capture(void) vdr_ud =(int *)dlsym(RTLD_DEFAULT,"_7cDevice.useDevice"); #endif if(vdr_nci && vdr_ud) { vdr_save_ud=*vdr_ud; *vdr_ud=1<<30; } +#endif } bool cScDvbDevice::Initialize(void) { +#if APIVERSNUM >= 10711 + return true; +#else if(!vdr_nci || !vdr_ud) { PRINTF(L_GEN_ERROR,"Failed to locate VDR symbols. Plugin not operable"); return false; @@ -3163,6 +3188,7 @@ bool cScDvbDevice::Initialize(void) if(found>0) PRINTF(L_GEN_INFO,"captured %d video device%s",found,found>1 ? "s" : ""); else PRINTF(L_GEN_INFO,"no DVB device captured"); return found>0; +#endif } #if APIVERSNUM >= 10501 diff --git a/cam.h b/cam.h index 1586332..519d49b 100644 --- a/cam.h +++ b/cam.h @@ -170,6 +170,15 @@ void LogStatsDown(void); // ---------------------------------------------------------------- +#if APIVERSNUM >= 10711 +class cScDvbDeviceProbe : public cDvbDeviceProbe { +public: + virtual bool Probe(int Adapter, int Frontend); + }; +#endif + +// ---------------------------------------------------------------- + class cScDvbDevice : public cDvbDevice { private: cDeCSA *decsa; @@ -218,7 +227,11 @@ protected: virtual bool GetTSPacket(uchar *&Data); #endif //SASC public: +#if APIVERSNUM >= 10711 + cScDvbDevice(int Adapter, int Frontend, int cafd); +#else cScDvbDevice(int n, int cafd); +#endif ~cScDvbDevice(); #ifndef SASC #if APIVERSNUM >= 10501