Added cDevice::ReadFilter()

This commit is contained in:
Klaus Schmidinger 2012-08-26 13:09:01 +02:00
parent 021778d370
commit 4986f76b0a
6 changed files with 18 additions and 4 deletions

View File

@ -87,6 +87,8 @@ Deti Fliegl <deti@fliegl.de>
for fixing setting the OSD size in the 'Confirm' interface call for fixing setting the OSD size in the 'Confirm' interface call
for fixing handling improper buffer lengths in the EIT parser for fixing handling improper buffer lengths in the EIT parser
for a patch that was used to implement StopSectionHandler() for a patch that was used to implement StopSectionHandler()
for adding cDevice::ReadFilter() to allow devices to implement their own way of
retrieving section filter data
Dave Chapman <dave@dchapman.com> Dave Chapman <dave@dchapman.com>
for implementing support for the teletext PID for implementing support for the teletext PID

View File

@ -7206,3 +7206,5 @@ Video Disk Recorder Revision History
- Fixed detecting transfer mode on full featured DVB cards (thanks to Stefan Huelswitt - Fixed detecting transfer mode on full featured DVB cards (thanks to Stefan Huelswitt
for reporting a problem with updating CA descriptors in such cases). for reporting a problem with updating CA descriptors in such cases).
- Fixed a race condition when zapping in transfer mode (reported by Reinhard Nissl). - Fixed a race condition when zapping in transfer mode (reported by Reinhard Nissl).
- The new function cDevice::ReadFilter() can be used by devices to implement their
own way of retrieving section filter data (thanks to Deti Fliegl).

View File

@ -1888,6 +1888,7 @@ the functions
<p><table><tr><td class="code"><pre> <p><table><tr><td class="code"><pre>
virtual int OpenFilter(u_short Pid, u_char Tid, u_char Mask); virtual int OpenFilter(u_short Pid, u_char Tid, u_char Mask);
<modified>virtual int ReadFilter(int Handle, void *Buffer, size_t Length);</modified>
virtual void CloseFilter(int Handle); virtual void CloseFilter(int Handle);
</pre></td></tr></table><p> </pre></td></tr></table><p>

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: device.c 2.63 2012/08/25 11:56:08 kls Exp $ * $Id: device.c 2.64 2012/08/26 12:53:39 kls Exp $
*/ */
#include "device.h" #include "device.h"
@ -593,6 +593,11 @@ int cDevice::OpenFilter(u_short Pid, u_char Tid, u_char Mask)
return -1; return -1;
} }
int cDevice::ReadFilter(int Handle, void *Buffer, size_t Length)
{
return safe_read(Handle, Buffer, Length);
}
void cDevice::CloseFilter(int Handle) void cDevice::CloseFilter(int Handle)
{ {
close(Handle); close(Handle);

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: device.h 2.39 2012/04/04 09:48:21 kls Exp $ * $Id: device.h 2.40 2012/08/26 12:56:14 kls Exp $
*/ */
#ifndef __DEVICE_H #ifndef __DEVICE_H
@ -393,6 +393,10 @@ public:
///< Opens a file handle for the given filter data. ///< Opens a file handle for the given filter data.
///< A derived device that provides section data must ///< A derived device that provides section data must
///< implement this function. ///< implement this function.
virtual int ReadFilter(int Handle, void *Buffer, size_t Length);
///< Reads data from a handle for the given filter.
///< A derived class need not implement this function, because this
///< is done by the default implementation.
virtual void CloseFilter(int Handle); virtual void CloseFilter(int Handle);
///< Closes a file handle that has previously been opened ///< Closes a file handle that has previously been opened
///< by OpenFilter(). If this is as simple as calling close(Handle), ///< by OpenFilter(). If this is as simple as calling close(Handle),

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: sections.c 1.15 2007/10/14 12:52:07 kls Exp $ * $Id: sections.c 2.1 2012/08/26 12:53:39 kls Exp $
*/ */
#include "sections.h" #include "sections.h"
@ -198,7 +198,7 @@ void cSectionHandler::Action(void)
if (fh) { if (fh) {
// Read section data: // Read section data:
unsigned char buf[4096]; // max. allowed size for any EIT section unsigned char buf[4096]; // max. allowed size for any EIT section
int r = safe_read(fh->handle, buf, sizeof(buf)); int r = device->ReadFilter(fh->handle, buf, sizeof(buf));
if (!DeviceHasLock) if (!DeviceHasLock)
continue; // we do the read anyway, to flush any data that might have come from a different transponder continue; // we do the read anyway, to flush any data that might have come from a different transponder
if (r > 3) { // minimum number of bytes necessary to get section length if (r > 3) { // minimum number of bytes necessary to get section length