From 6b5e9f56ed5315e7c1afa17940968695fabf3ba0 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Fri, 26 Aug 2011 13:03:14 +0200 Subject: [PATCH] Implemented cDevice::ProvidesEIT() --- CONTRIBUTORS | 1 + HISTORY | 5 +++++ device.c | 7 ++++++- device.h | 6 +++++- dvbdevice.c | 7 ++++++- dvbdevice.h | 3 ++- eitscan.c | 4 ++-- 7 files changed, 27 insertions(+), 6 deletions(-) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index e229718c..b0f6406e 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -1113,6 +1113,7 @@ Rolf Ahrenberg for reporting that DELETENULL() was not thread safe for reporting a crash in subtitle display, related to cOsd::Osds for a patch that stores the subtitle PIDs in the channels.conf file + for suggesting to implement a way for devices to tell whether they can provide EIT data Ralf Klueber for reporting a bug in cutting a recording if there is only a single editing mark diff --git a/HISTORY b/HISTORY index d9d7b093..173cc9e9 100644 --- a/HISTORY +++ b/HISTORY @@ -6720,3 +6720,8 @@ Video Disk Recorder Revision History Barszus). - The subtitle PIDs are now stored in the channels.conf file as an extension to the TPID field (thanks to Rolf Ahrenberg). +- The new function cDevice::ProvidesEIT() is used to determine whether a device can + provide EIT data and will thus be used in cEITScanner::Process() to receive EIT + data from the channels it can receive (suggested by Rolf Ahrenberg). Note that by + default it is assumed that a device can't provide EIT data, and only the builtin + cDvbDevice returns true from this function. diff --git a/device.c b/device.c index 07599936..ba098d88 100644 --- a/device.c +++ b/device.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: device.c 2.41 2011/06/02 13:14:16 kls Exp $ + * $Id: device.c 2.42 2011/08/26 12:56:00 kls Exp $ */ #include "device.h" @@ -613,6 +613,11 @@ bool cDevice::ProvidesChannel(const cChannel *Channel, int Priority, bool *Needs return false; } +bool cDevice::ProvidesEIT(void) const +{ + return false; +} + int cDevice::NumProvidedSystems(void) const { return 0; diff --git a/device.h b/device.h index d937e5f0..fd587a83 100644 --- a/device.h +++ b/device.h @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: device.h 2.26 2011/06/02 13:15:31 kls Exp $ + * $Id: device.h 2.27 2011/08/26 12:52:29 kls Exp $ */ #ifndef __DEVICE_H @@ -247,6 +247,10 @@ public: ///< function itself actually returns true. ///< The default implementation always returns false, so a derived cDevice ///< class that can provide channels must implement this function. + virtual bool ProvidesEIT(void) const; + ///< Returns true if this device provides EIT data and thus wants to be tuned + ///< to the channels it can receive regularly to update the data. + ///< The default implementation returns false. virtual int NumProvidedSystems(void) const; ///< Returns the number of individual "delivery systems" this device provides. ///< The default implementation returns 0, so any derived class that can diff --git a/dvbdevice.c b/dvbdevice.c index b0750dd4..a97f2749 100644 --- a/dvbdevice.c +++ b/dvbdevice.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: dvbdevice.c 2.42 2011/06/11 14:34:24 kls Exp $ + * $Id: dvbdevice.c 2.43 2011/08/26 12:57:34 kls Exp $ */ #include "dvbdevice.h" @@ -1081,6 +1081,11 @@ bool cDvbDevice::ProvidesChannel(const cChannel *Channel, int Priority, bool *Ne return result; } +bool cDvbDevice::ProvidesEIT(void) const +{ + return dvbTuner != NULL; +} + int cDvbDevice::NumProvidedSystems(void) const { return numProvidedSystems; diff --git a/dvbdevice.h b/dvbdevice.h index 0962548c..e1842b7d 100644 --- a/dvbdevice.h +++ b/dvbdevice.h @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: dvbdevice.h 2.15 2011/06/02 13:20:05 kls Exp $ + * $Id: dvbdevice.h 2.16 2011/08/26 12:55:45 kls Exp $ */ #ifndef __DVBDEVICE_H @@ -140,6 +140,7 @@ public: virtual bool ProvidesSource(int Source) const; virtual bool ProvidesTransponder(const cChannel *Channel) const; virtual bool ProvidesChannel(const cChannel *Channel, int Priority = -1, bool *NeedsDetachReceivers = NULL) const; + virtual bool ProvidesEIT(void) const; virtual int NumProvidedSystems(void) const; virtual int SignalStrength(void) const; virtual int SignalQuality(void) const; diff --git a/eitscan.c b/eitscan.c index 25b7115c..fd4dec87 100644 --- a/eitscan.c +++ b/eitscan.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: eitscan.c 2.2 2011/08/12 14:18:04 kls Exp $ + * $Id: eitscan.c 2.3 2011/08/26 12:58:49 kls Exp $ */ #include "eitscan.h" @@ -146,7 +146,7 @@ void cEITScanner::Process(void) if (Device) { for (cScanData *ScanData = scanList->First(); ScanData; ScanData = scanList->Next(ScanData)) { const cChannel *Channel = ScanData->GetChannel(); - if (Channel) { + if (Channel && Device->ProvidesEIT()) { if (!Channel->Ca() || Channel->Ca() == Device->DeviceNumber() + 1 || Channel->Ca() >= CA_ENCRYPTED_MIN) { if (Device->ProvidesTransponder(Channel)) { if (!Device->Receiving()) {