Remove check legacy dvbapi version. vuplus_experimental
authorhschang <chang@dev3>
Thu, 14 Sep 2017 06:18:44 +0000 (15:18 +0900)
committerhschang <chang@dev3>
Thu, 14 Sep 2017 06:20:20 +0000 (15:20 +0900)
lib/dvb/decoder.cpp
lib/dvb/decoder.h
lib/dvb/demux.cpp
lib/dvb/dvb.cpp
lib/dvb/frontend.cpp
lib/dvb/frontend.h
lib/dvb/frontendparms.h
lib/dvb/idvb.h
lib/dvb/sec.cpp
lib/dvb/volume.cpp
m4/tuxbox.m4

index 2091114..0ce22bd 100644 (file)
@@ -1,31 +1,9 @@
 #include <lib/base/ebase.h>
 #include <lib/base/eerror.h>
 #include <lib/dvb/decoder.h>
-#if HAVE_DVB_API_VERSION < 3 
-#define audioStatus audio_status
-#define videoStatus video_status
-#define pesType pes_type
-#define playState play_state
-#define audioStreamSource_t audio_stream_source_t
-#define videoStreamSource_t video_stream_source_t
-#define streamSource stream_source
-#define dmxPesFilterParams dmx_pes_filter_params
-#define DMX_PES_VIDEO0 DMX_PES_VIDEO
-#define DMX_PES_AUDIO0 DMX_PES_AUDIO
-#define DMX_PES_PCR0 DMX_PES_PCR
-#define DMX_PES_TELETEXT0 DMX_PES_TELETEXT
-#define DMX_PES_VIDEO1 DMX_PES_VIDEO
-#define DMX_PES_AUDIO1 DMX_PES_AUDIO
-#define DMX_PES_PCR1 DMX_PES_PCR
-#define DMX_PES_TELETEXT1 DMX_PES_TELETEXT
-#include <ost/dmx.h>
-#include <ost/video.h>
-#include <ost/audio.h>
-#else
 #include <linux/dvb/audio.h>
 #include <linux/dvb/video.h>
 #include <linux/dvb/dmx.h>
-#endif
 
 #include <unistd.h>
 #include <fcntl.h>
@@ -55,21 +33,13 @@ eDVBAudio::eDVBAudio(eDVBDemux *demux, int dev)
        :m_demux(demux), m_dev(dev)
 {
        char filename[128];
-#if HAVE_DVB_API_VERSION < 3
-       sprintf(filename, "/dev/dvb/card%d/audio%d", demux->adapter, dev);
-#else
        sprintf(filename, "/dev/dvb/adapter%d/audio%d", demux ? demux->adapter : 0, dev);
-#endif
        m_fd = ::open(filename, O_RDWR);
        if (m_fd < 0)
                eWarning("%s: %m", filename);
        if (demux)
        {
-#if HAVE_DVB_API_VERSION < 3
-               sprintf(filename, "/dev/dvb/card%d/demux%d", demux->adapter, demux->demux);
-#else
                sprintf(filename, "/dev/dvb/adapter%d/demux%d", demux->adapter, demux->demux);
-#endif
                m_fd_demux = ::open(filename, O_RDWR);
                if (m_fd_demux < 0)
                        eWarning("%s: %m", filename);
@@ -85,98 +55,6 @@ eDVBAudio::eDVBAudio(eDVBDemux *demux, int dev)
        }
 }
 
-#if HAVE_DVB_API_VERSION < 3
-int eDVBAudio::setPid(int pid, int type)
-{
-       if ((m_fd < 0) || (m_fd_demux < 0))
-               return -1;
-
-       int bypass = 0;
-
-       switch (type)
-       {
-       case aMPEG:
-               bypass = 1;
-               break;
-       case aAC3:
-               bypass = 0;
-               break;
-               /*
-       case aDTS:
-               bypass = 2;
-               break;
-               */
-       }
-
-       if (::ioctl(m_fd, AUDIO_SET_BYPASS_MODE, bypass) < 0)
-               eDebug("failed (%m)");
-
-       dmx_pes_filter_params pes;
-
-       pes.pid      = pid;
-       pes.input    = DMX_IN_FRONTEND;
-       pes.output   = DMX_OUT_DECODER;
-       pes.pes_type = m_dev ? DMX_PES_AUDIO1 : DMX_PES_AUDIO0; /* FIXME */
-       pes.flags    = 0;
-       eDebugNoNewLine("DMX_SET_PES_FILTER(0x%02x) - audio - ", pid);
-       if (::ioctl(m_fd_demux, DMX_SET_PES_FILTER, &pes) < 0)
-       {
-               eDebug("failed (%m)");
-               return -errno;
-       }
-       eDebug("ok");
-
-       return 0;
-}
-
-int eDVBAudio::startPid()
-{
-       eDebugNoNewLine("DEMUX_START - audio - ");
-       if (::ioctl(m_fd_demux, DMX_START) < 0)
-       {
-               eDebug("failed (%m)");
-               return -errno;
-       }
-       eDebug("ok");
-       return 0;
-}
-
-int eDVBAudio::start()
-{
-       eDebugNoNewLine("AUDIO_PLAY - ");
-       if (::ioctl(m_fd, AUDIO_PLAY) < 0)
-       {
-               eDebug("failed (%m)");
-               return -errno;
-       }
-       eDebug("ok");
-       return 0;
-}
-
-int eDVBAudio::stopPid()
-{
-       eDebugNoNewLine("DEMUX_STOP - audio - ");
-       if (::ioctl(m_fd_demux, DMX_STOP) < 0)
-       {
-               eDebug("failed (%m)");
-               return -errno;
-       }
-       eDebug("ok");
-       return 0;
-}
-
-int eDVBAudio::setAVSync(int val)
-{
-       eDebugNoNewLine("AUDIO_SET_AV_SYNC - ");
-       if (::ioctl(m_fd, AUDIO_SET_AV_SYNC, val) < 0)
-       {
-               eDebug("failed (%m)");
-               return -errno;
-       }
-       eDebug("ok");
-       return 0;
-}
-#else
 int eDVBAudio::startPid(int pid, int type)
 {
        if (m_fd_demux >= 0)
@@ -265,7 +143,6 @@ int eDVBAudio::startPid(int pid, int type)
        }
        return 0;
 }
-#endif
 
 void eDVBAudio::stop()
 {
@@ -280,13 +157,11 @@ void eDVBAudio::stop()
 
        if (m_fd_demux >= 0)
        {
-#if HAVE_DVB_API_VERSION > 2
                eDebugNoNewLine("DEMUX_STOP - audio - ");
                if (::ioctl(m_fd_demux, DMX_STOP) < 0)
                        eDebug("failed (%m)");
                else
                        eDebug("ok");
-#endif
        }
 }
 
@@ -356,14 +231,7 @@ eDVBVideo::eDVBVideo(eDVBDemux *demux, int dev, bool fcc_enable)
        m_width(-1), m_height(-1), m_framerate(-1), m_aspect(-1), m_progressive(-1)
 {
        char filename[128];
-#if HAVE_DVB_API_VERSION < 3
-       sprintf(filename, "/dev/dvb/card%d/video%d", demux->adapter, dev);
-       m_fd_video = ::open("/dev/video", O_RDWR);
-       if (m_fd_video < 0)
-               eWarning("/dev/video: %m");
-#else
        sprintf(filename, "/dev/dvb/adapter%d/video%d", demux ? demux->adapter : 0, dev);
-#endif
        m_fd = ::open(filename, O_RDWR);
        if (m_fd < 0)
                eWarning("%s: %m", filename);
@@ -378,11 +246,7 @@ eDVBVideo::eDVBVideo(eDVBDemux *demux, int dev, bool fcc_enable)
 
        if (demux)
        {
-#if HAVE_DVB_API_VERSION < 3
-               sprintf(filename, "/dev/dvb/card%d/demux%d", demux->adapter, demux->demux);
-#else
                sprintf(filename, "/dev/dvb/adapter%d/demux%d", demux->adapter, demux->demux);
-#endif
                m_fd_demux = ::open(filename, O_RDWR);
                if (m_fd_demux < 0)
                        eWarning("%s: %m", filename);
@@ -408,64 +272,6 @@ eDVBVideo::eDVBVideo(eDVBDemux *demux, int dev, bool fcc_enable)
 #define VIDEO_STREAMTYPE_MPEG1 6
 #define VIDEO_STREAMTYPE_H265_HEVC 7
 
-#if HAVE_DVB_API_VERSION < 3
-int eDVBVideo::setPid(int pid)
-{
-       if ((m_fd < 0) || (m_fd_demux < 0))
-               return -1;
-       dmx_pes_filter_params pes;
-
-       pes.pid      = pid;
-       pes.input    = DMX_IN_FRONTEND;
-       pes.output   = DMX_OUT_DECODER;
-       pes.pes_type = m_dev ? DMX_PES_VIDEO1 : DMX_PES_VIDEO0; /* FIXME */
-       pes.flags    = 0;
-       eDebugNoNewLine("DMX_SET_PES_FILTER(0x%02x) - video - ", pid);
-       if (::ioctl(m_fd_demux, DMX_SET_PES_FILTER, &pes) < 0)
-       {
-               eDebug("failed (%m)");
-               return -errno;
-       }
-       eDebug("ok");
-       return 0;
-}
-
-int eDVBVideo::startPid()
-{
-       eDebugNoNewLine("DEMUX_START - video - ");
-       if (::ioctl(m_fd_demux, DMX_START) < 0)
-       {
-               eDebug("failed (%m)");
-               return -errno;
-       }
-       eDebug("ok");
-       return 0;
-}
-
-int eDVBVideo::start()
-{
-       eDebugNoNewLine("VIDEO_PLAY - ");
-       if (::ioctl(m_fd, VIDEO_PLAY) < 0)
-       {
-               eDebug("failed (%m)");
-               return -errno;
-       }
-       eDebug("ok");
-       return 0;
-}
-
-int eDVBVideo::stopPid()
-{
-       eDebugNoNewLine("DEMUX_STOP - video - ");
-       if (::ioctl(m_fd_demux, DMX_STOP) < 0)
-       {
-               eDebug("failed (%m)");
-               return -errno;
-       }
-       eDebug("ok");
-       return 0;
-}
-#else
 int eDVBVideo::startPid(int pid, int type)
 {
        if (m_fcc_enable)
@@ -557,7 +363,6 @@ int eDVBVideo::startPid(int pid, int type)
        }
        return 0;
 }
-#endif
 
 void eDVBVideo::stop()
 {
@@ -566,13 +371,11 @@ void eDVBVideo::stop()
 
        if (m_fd_demux >= 0)
        {
-#if HAVE_DVB_API_VERSION > 2
                eDebugNoNewLine("DEMUX_STOP - video - ");
                if (::ioctl(m_fd_demux, DMX_STOP) < 0)
                        eDebug("failed (%m)");
                else
                        eDebug("ok");
-#endif
        }
 
        if (m_fd >= 0)
@@ -636,15 +439,7 @@ int eDVBVideo::setFastForward(int skip)
 
 int eDVBVideo::getPTS(pts_t &now)
 {
-#if HAVE_DVB_API_VERSION < 3
-       #define VIDEO_GET_PTS_OLD           _IOR('o', 1, unsigned int*)
-       unsigned int pts;
-       int ret = ::ioctl(m_fd_video, VIDEO_GET_PTS_OLD, &pts);
-       now = pts;
-       now *= 2;
-#else
        int ret = ::ioctl(m_fd, VIDEO_GET_PTS, &now);
-#endif
        if (ret < 0)
                eDebug("VIDEO_GET_PTS failed(%m)");
        return ret;
@@ -656,15 +451,10 @@ eDVBVideo::~eDVBVideo()
                ::close(m_fd);
        if (m_fd_demux >= 0)
                ::close(m_fd_demux);
-#if HAVE_DVB_API_VERSION < 3
-       if (m_fd_video >= 0)
-               ::close(m_fd_video);
-#endif
 }
 
 void eDVBVideo::video_event(int)
 {
-#if HAVE_DVB_API_VERSION >= 3
        struct video_event evt;
        eDebugNoNewLine("VIDEO_GET_EVENT - ");
        if (::ioctl(m_fd, VIDEO_GET_EVENT, &evt) < 0)
@@ -698,9 +488,6 @@ void eDVBVideo::video_event(int)
                else
                        eDebug("unhandled DVBAPI Video Event %d", evt.type);
        }
-#else
-#warning "FIXMEE!! Video Events not implemented for old api"
-#endif
 }
 
 RESULT eDVBVideo::connectEvent(const Slot1<void, struct iTSMPEGDecoder::videoEvent> &event, ePtr<eConnection> &conn)
@@ -725,7 +512,6 @@ static int readMpegProc(const char *str, int decoder)
 
 static int readApiSize(int fd, int &xres, int &yres, int &aspect)
 {
-#if HAVE_DVB_API_VERSION >= 3
        video_size_t size;
        if (!::ioctl(fd, VIDEO_GET_SIZE, &size))
        {
@@ -735,13 +521,11 @@ static int readApiSize(int fd, int &xres, int &yres, int &aspect)
                return 0;
        }
 //     eDebug("VIDEO_GET_SIZE failed (%m)");
-#endif
        return -1;
 }
 
 static int readApiFrameRate(int fd, int &framerate)
 {
-#if HAVE_DVB_API_VERSION >= 3
        unsigned int frate;
        if (!::ioctl(fd, VIDEO_GET_FRAME_RATE, &frate))
        {
@@ -749,7 +533,6 @@ static int readApiFrameRate(int fd, int &framerate)
                return 0;
        }
 //     eDebug("VIDEO_GET_FRAME_RATE failed (%m)");
-#endif
        return -1;
 }
 
@@ -801,53 +584,12 @@ DEFINE_REF(eDVBPCR);
 eDVBPCR::eDVBPCR(eDVBDemux *demux, int dev): m_demux(demux), m_dev(dev)
 {
        char filename[128];
-#if HAVE_DVB_API_VERSION < 3
-       sprintf(filename, "/dev/dvb/card%d/demux%d", demux->adapter, demux->demux);
-#else
        sprintf(filename, "/dev/dvb/adapter%d/demux%d", demux->adapter, demux->demux);
-#endif
        m_fd_demux = ::open(filename, O_RDWR);
        if (m_fd_demux < 0)
                eWarning("%s: %m", filename);
 }
 
-#if HAVE_DVB_API_VERSION < 3
-int eDVBPCR::setPid(int pid)
-{
-       if (m_fd_demux < 0)
-               return -1;
-       dmx_pes_filter_params pes;
-
-       pes.pid      = pid;
-       pes.input    = DMX_IN_FRONTEND;
-       pes.output   = DMX_OUT_DECODER;
-       pes.pes_type = DMX_PES_PCR;
-       pes.flags    = 0;
-
-       eDebugNoNewLine("DMX_SET_PES_FILTER(0x%02x) - pcr - ", pid);
-       if (::ioctl(m_fd_demux, DMX_SET_PES_FILTER, &pes) < 0)
-       {
-               eDebug("failed (%m)");
-               return -errno;
-       }
-       eDebug("ok");
-       return 0;
-}
-
-int eDVBPCR::startPid()
-{
-       if (m_fd_demux < 0)
-               return -1;
-       eDebugNoNewLine("DEMUX_START - pcr - ");
-       if (::ioctl(m_fd_demux, DMX_START) < 0)
-       {
-               eDebug("failed (%m)");
-               return -errno;
-       }
-       eDebug("ok");
-       return 0;
-}
-#else
 int eDVBPCR::startPid(int pid)
 {
        if (m_fd_demux < 0)
@@ -889,7 +631,6 @@ int eDVBPCR::startPid(int pid)
        eDebug("ok");
        return 0;
 }
-#endif
 
 void eDVBPCR::stop()
 {
@@ -912,11 +653,7 @@ eDVBTText::eDVBTText(eDVBDemux *demux, int dev)
     :m_demux(demux), m_dev(dev)
 {
        char filename[128];
-#if HAVE_DVB_API_VERSION < 3
-       sprintf(filename, "/dev/dvb/card%d/demux%d", demux->adapter, demux->demux);
-#else
        sprintf(filename, "/dev/dvb/adapter%d/demux%d", demux->adapter, demux->demux);
-#endif
        m_fd_demux = ::open(filename, O_RDWR);
        if (m_fd_demux < 0)
                eWarning("%s: %m", filename);
@@ -985,77 +722,6 @@ int eTSMPEGDecoder::setState()
        eDebug("decoder state: %s, vpid=%d, apid=%d", decoder_states[m_state], m_vpid, m_apid);
 
        int changed = m_changed;
-#if HAVE_DVB_API_VERSION < 3
-       bool checkAVSync = m_changed & (changeAudio|changeVideo|changePCR);
-       if (m_changed & changeAudio && m_audio)
-               m_audio->stopPid();
-       if (m_changed & changeVideo && m_video)
-               m_video->stopPid();
-       if (m_changed & changePCR && m_pcr)
-       {
-               m_pcr->stop();
-               m_pcr=0;
-               if (!(m_pcrpid >= 0 && m_pcrpid < 0x1ff))
-                       m_changed &= ~changePCR;
-       }
-       if (m_changed & changeAudio && m_audio)
-       {
-               m_audio->stop();
-               m_audio=0;
-               if (!(m_apid >= 0 && m_apid < 0x1ff))
-                       m_changed &= ~changeAudio;
-       }
-       if (m_changed & changeVideo && m_video)
-       {
-               m_video->stop();
-               m_video=0;
-               m_video_event_conn=0;
-               if (!(m_vpid >= 0 && m_vpid < 0x1ff))
-                       m_changed &= ~changeVideo;
-       }
-       if (m_changed & changeVideo)
-       {
-               m_video = new eDVBVideo(m_demux, m_decoder);
-               m_video->connectEvent(slot(*this, &eTSMPEGDecoder::video_event), m_video_event_conn);
-               if (m_video->setPid(m_vpid))
-                       res -1;
-       }
-       if (m_changed & changePCR)
-       {
-               m_pcr = new eDVBPCR(m_demux, m_decoder);
-               if (m_pcr->setPid(m_pcrpid))
-                       res = -1;
-       }
-       if (m_changed & changeAudio)
-       {
-               m_audio = new eDVBAudio(m_demux, m_decoder);
-               if (m_audio->setPid(m_apid, m_atype))
-                       res = -1;
-       }
-       if (m_changed & changePCR)
-       {
-               if (m_pcr->startPid())
-                       res = -1;
-               m_changed &= ~changePCR;
-       }
-       else if (checkAVSync && m_audio && m_video)
-       {
-               if (m_audio->setAVSync(1))
-                       res = -1;
-       }
-       if (m_changed & changeVideo)
-       {
-               if (m_video->startPid() || m_video->start())
-                       res = -1;
-               m_changed &= ~changeVideo;
-       }
-       if (m_changed & changeAudio)
-       {
-               if (m_audio->start() || m_audio->startPid())
-                       res = -1;
-               m_changed &= ~changeAudio;
-       }
-#else
        if (m_changed & changePCR)
        {
                if (m_pcr)
@@ -1124,7 +790,6 @@ int eTSMPEGDecoder::setState()
                }
                m_changed &= ~changeText;
        }
-#endif
 
        if (changed & (changeState|changeVideo|changeAudio))
        {
index 0636516..405e363 100644 (file)
@@ -18,15 +18,7 @@ public:
        enum { aMonoLeft, aStereo, aMonoRight };
        void setChannel(int channel);
        void stop();
-#if HAVE_DVB_API_VERSION < 3
-       int setPid(int pid, int type);
-       int startPid();
-       int start();
-       int stopPid();
-       int setAVSync(int val);
-#else
        int startPid(int pid, int type);
-#endif
        void flush();
        void freeze();
        void unfreeze();
@@ -41,9 +33,6 @@ private:
        ePtr<eDVBDemux> m_demux;
        int m_fd, m_fd_demux, m_dev;
        bool m_fcc_enable;
-#if HAVE_DVB_API_VERSION < 3
-       m_fd_video;
-#endif
        int m_is_slow_motion, m_is_fast_forward, m_is_freezed;
        ePtr<eSocketNotifier> m_sn;
        void video_event(int what);
@@ -53,14 +42,7 @@ public:
        enum { MPEG2, MPEG4_H264, MPEG1, MPEG4_Part2, VC1, VC1_SM, H265_HEVC };
        eDVBVideo(eDVBDemux *demux, int dev, bool fcc_enable=false);
        void stop();
-#if HAVE_DVB_API_VERSION < 3
-       int setPid(int pid);
-       int startPid();
-       int start();
-       int stopPid();
-#else
        int startPid(int pid, int type=MPEG2);
-#endif
        void flush();
        void freeze();
        int setSlowMotion(int repeat);
@@ -84,12 +66,7 @@ private:
        int m_fd_demux, m_dev;
 public:
        eDVBPCR(eDVBDemux *demux, int dev);
-#if HAVE_DVB_API_VERSION < 3
-       int setPid(int pid);
-       int startPid();
-#else
        int startPid(int pid);
-#endif
        void stop();
        virtual ~eDVBPCR();
 };
index 1af2a10..f2b494a 100644 (file)
 #define FUZZING_PROPABILITY 100
 #endif
 
-#if HAVE_DVB_API_VERSION < 3
-#include <ost/dmx.h>
-
-#ifndef DMX_SET_NEGFILTER_MASK
-       #define DMX_SET_NEGFILTER_MASK   _IOW('o',48,uint8_t *)
-#endif
-
-#ifndef DMX_GET_STC
-       struct dmx_stc
-       {
-               unsigned int num;       /* input : which STC? O..N */
-               unsigned int base;      /* output: divisor for stc to get 90 kHz clock */
-               unsigned long long stc; /* output: src in 'base'*90 kHz units */
-       };
-       #define DMX_GET_STC             _IOR('o', 50, struct dmx_stc)
-#endif
-
-#else
 #include <linux/dvb/dmx.h>
 
-#define HAVE_ADD_PID
-
-#ifdef HAVE_ADD_PID
-
-#if HAVE_DVB_API_VERSION > 3
 #ifndef DMX_ADD_PID
 #define DMX_ADD_PID            _IOW('o', 51, __u16)
 #define DMX_REMOVE_PID         _IOW('o', 52, __u16)
 #endif
-#else
-#define DMX_ADD_PID              _IO('o', 51)
-#define DMX_REMOVE_PID           _IO('o', 52)
-
-typedef enum {
-       DMX_TAP_TS = 0,
-       DMX_TAP_PES = DMX_PES_OTHER, /* for backward binary compat. */
-} dmx_tap_type_t;
-#endif
-
-#endif
-
-#endif
 
 #include "crc32.h"
 
@@ -75,11 +39,7 @@ eDVBDemux::~eDVBDemux()
 int eDVBDemux::openDemux(void)
 {
        char filename[128];
-#if HAVE_DVB_API_VERSION < 3
-       snprintf(filename, 128, "/dev/dvb/card%d/demux%d", adapter, demux);
-#else
        snprintf(filename, 128, "/dev/dvb/adapter%d/demux%d", adapter, demux);
-#endif
        return ::open(filename, O_RDWR);
 }
 
@@ -94,7 +54,6 @@ DEFINE_REF(eDVBDemux)
 
 RESULT eDVBDemux::setSourceFrontend(int fenum)
 {
-#if HAVE_DVB_API_VERSION >= 3
        int fd = openDemux();
        if (fd < 0) return -1;
        int n = DMX_SOURCE_FRONT0 + fenum;
@@ -105,13 +64,10 @@ RESULT eDVBDemux::setSourceFrontend(int fenum)
                source = fenum;
        ::close(fd);
        return res;
-#endif
-       return 0;
 }
 
 RESULT eDVBDemux::setSourcePVR(int pvrnum)
 {
-#if HAVE_DVB_API_VERSION >= 3
        int fd = openDemux();
        if (fd < 0) return -1;
        int n = DMX_SOURCE_DVR0 + pvrnum;
@@ -119,8 +75,6 @@ RESULT eDVBDemux::setSourcePVR(int pvrnum)
        source = -1;
        ::close(fd);
        return res;
-#endif
-       return 0;
 }
 
 RESULT eDVBDemux::createSectionReader(eMainloop *context, ePtr<iDVBSectionReader> &reader)
@@ -269,18 +223,10 @@ RESULT eDVBSectionReader::start(const eDVBSectionFilterMask &mask)
                return -ENODEV;
 
        notifier->start();
-#if HAVE_DVB_API_VERSION < 3
-       dmxSctFilterParams sct;
-#else
        dmx_sct_filter_params sct;
-#endif
        sct.pid     = mask.pid;
        sct.timeout = 0;
-#if HAVE_DVB_API_VERSION < 3
-       sct.flags   = 0;
-#else
        sct.flags   = DMX_IMMEDIATE_START;
-#endif
 #if !FUZZING
        if (mask.flags & eDVBSectionFilterMask::rfCRC)
        {
@@ -292,25 +238,13 @@ RESULT eDVBSectionReader::start(const eDVBSectionFilterMask &mask)
        
        memcpy(sct.filter.filter, mask.data, DMX_FILTER_SIZE);
        memcpy(sct.filter.mask, mask.mask, DMX_FILTER_SIZE);
-#if HAVE_DVB_API_VERSION >= 3
        memcpy(sct.filter.mode, mask.mode, DMX_FILTER_SIZE);
        setBufferSize(8192*8);
-#endif
        
        res = ::ioctl(fd, DMX_SET_FILTER, &sct);
        if (!res)
        {
-#if HAVE_DVB_API_VERSION < 3
-               res = ::ioctl(fd, DMX_SET_NEGFILTER_MASK, mask.mode);
-               if (!res)
-               {
-                       res = ::ioctl(fd, DMX_START, 0);
-                       if (!res)
-                               active = 1;
-               }
-#else
                active = 1;
-#endif
        }
        return res;
 }
@@ -402,16 +336,9 @@ RESULT eDVBPESReader::start(int pid)
 
        m_notifier->start();
 
-#if HAVE_DVB_API_VERSION < 3
-       dmxPesFilterParams flt;
-       
-       flt.pesType = DMX_PES_OTHER;
-#else
        dmx_pes_filter_params flt;
        
        flt.pes_type = DMX_PES_OTHER;
-#endif
-
        flt.pid     = pid;
        flt.input   = DMX_IN_FRONTEND;
        flt.output  = DMX_OUT_TAP;
@@ -493,18 +420,12 @@ eDVBTSRecorder::eDVBTSRecorder(eDVBDemux *demux): m_demux(demux)
        m_target_fd = -1;
        m_thread = new eDVBRecordFileThread();
        CONNECT(m_thread->m_event, eDVBTSRecorder::filepushEvent);
-#ifndef HAVE_ADD_PID
-       m_demux->m_dvr_busy = 1;
-#endif
 }
 
 eDVBTSRecorder::~eDVBTSRecorder()
 {
        stop();
        delete m_thread;
-#ifndef HAVE_ADD_PID
-       m_demux->m_dvr_busy = 0;
-#endif
 }
 
 RESULT eDVBTSRecorder::start()
@@ -521,20 +442,6 @@ RESULT eDVBTSRecorder::start()
                return -3;
 
        char filename[128];
-#ifndef HAVE_ADD_PID
-#if HAVE_DVB_API_VERSION < 3
-       snprintf(filename, 128, "/dev/dvb/card%d/dvr%d", m_demux->adapter, m_demux->demux);
-#else
-       snprintf(filename, 128, "/dev/dvb/adapter%d/dvr%d", m_demux->adapter, m_demux->demux);
-#endif
-       m_source_fd = ::open(filename, O_RDONLY);
-       
-       if (m_source_fd < 0)
-       {
-               eDebug("FAILED to open dvr (%s) in ts recoder (%m)", filename);
-               return -3;
-       }
-#else
        snprintf(filename, 128, "/dev/dvb/adapter%d/demux%d", m_demux->adapter, m_demux->demux);
 
        m_source_fd = ::open(filename, O_RDONLY);
@@ -548,13 +455,8 @@ RESULT eDVBTSRecorder::start()
        setBufferSize(1024*1024);
 
        dmx_pes_filter_params flt;
-#if HAVE_DVB_API_VERSION > 3
        flt.pes_type = DMX_PES_OTHER;
        flt.output  = DMX_OUT_TSDEMUX_TAP;
-#else
-       flt.pes_type = (dmx_pes_type_t)DMX_TAP_TS;
-       flt.output  = DMX_OUT_TAP;
-#endif
        flt.pid     = i->first;
        ++i;
        flt.input   = DMX_IN_FRONTEND;
@@ -569,8 +471,6 @@ RESULT eDVBTSRecorder::start()
        }
        
        ::ioctl(m_source_fd, DMX_START);
-       
-#endif
 
        if (m_target_filename != "")
                m_thread->startSaveMetaInformation(m_target_filename);
@@ -666,7 +566,6 @@ RESULT eDVBTSRecorder::stop()
        if (!m_running)
                return -1;
 
-#if HAVE_DVB_API_VERSION >= 5
        /* workaround for record thread stop */
        if (m_source_fd >= 0)
        {
@@ -681,7 +580,6 @@ RESULT eDVBTSRecorder::stop()
                        state &= ~2;
                m_source_fd = -1;
        }
-#endif
 
        m_thread->stop();
 
@@ -719,46 +617,9 @@ RESULT eDVBTSRecorder::connectEvent(const Slot1<void,int> &event, ePtr<eConnecti
 
 RESULT eDVBTSRecorder::startPID(int pid)
 {
-#ifndef HAVE_ADD_PID
-       int fd = m_demux->openDemux();
-       if (fd < 0)
-       {
-               eDebug("FAILED to open demux in ts recoder (%m)");
-               return -1;
-       }
-
-#if HAVE_DVB_API_VERSION < 3
-       dmxPesFilterParams flt;
-       
-       flt.pesType = DMX_PES_OTHER;
-#else
-       dmx_pes_filter_params flt;
-       
-       flt.pes_type = DMX_PES_OTHER;
-#endif
-
-       flt.pid     = pid;
-       flt.input   = DMX_IN_FRONTEND;
-       flt.output  = DMX_OUT_TS_TAP;
-       
-       flt.flags   = DMX_IMMEDIATE_START;
-
-       int res = ::ioctl(fd, DMX_SET_PES_FILTER, &flt);
-       if (res < 0)
-       {
-               eDebug("set pes filter failed!");
-               ::close(fd);
-               return -1;
-       }
-       m_pids[pid] = fd;
-#else
        while(true) {
-#if HAVE_DVB_API_VERSION > 3
                __u16 p = pid;
                if (::ioctl(m_source_fd, DMX_ADD_PID, &p) < 0) {
-#else
-               if (::ioctl(m_source_fd, DMX_ADD_PID, pid) < 0) {
-#endif
                        perror("DMX_ADD_PID");
                        if (errno == EAGAIN || errno == EINTR) {
                                eDebug("retry!");
@@ -768,25 +629,16 @@ RESULT eDVBTSRecorder::startPID(int pid)
                        m_pids[pid] = 1;
                break;
        }
-#endif
        return 0;
 }
 
 void eDVBTSRecorder::stopPID(int pid)
 {
-#ifndef HAVE_ADD_PID
-       if (m_pids[pid] != -1)
-               ::close(m_pids[pid]);
-#else
        if (m_pids[pid] != -1)
        {
                while(true) {
-#if HAVE_DVB_API_VERSION > 3
                        __u16 p = pid;
                        if (::ioctl(m_source_fd, DMX_REMOVE_PID, &p) < 0) {
-#else
-                       if (::ioctl(m_source_fd, DMX_REMOVE_PID, pid) < 0) {
-#endif
                                perror("DMX_REMOVE_PID");
                                if (errno == EAGAIN || errno == EINTR) {
                                        eDebug("retry!");
@@ -796,7 +648,6 @@ void eDVBTSRecorder::stopPID(int pid)
                        break;
                }
        }
-#endif
        m_pids[pid] = -1;
 }
 
index b7b831b..852c403 100644 (file)
@@ -154,11 +154,7 @@ eDVBAdapterLinux::eDVBAdapterLinux(int nr): m_nr(nr)
        {
                struct stat s;
                char filename[128];
-#if HAVE_DVB_API_VERSION < 3
-               sprintf(filename, "/dev/dvb/card%d/frontend%d", m_nr, num_fe);
-#else
                sprintf(filename, "/dev/dvb/adapter%d/frontend%d", m_nr, num_fe);
-#endif
                if (stat(filename, &s))
                        break;
                eDVBFrontend *fe;
@@ -185,11 +181,7 @@ eDVBAdapterLinux::eDVBAdapterLinux(int nr): m_nr(nr)
        {
                struct stat s;
                char filename[128];
-#if HAVE_DVB_API_VERSION < 3
-               sprintf(filename, "/dev/dvb/card%d/demux%d", m_nr, num_demux);
-#else
                sprintf(filename, "/dev/dvb/adapter%d/demux%d", m_nr, num_demux);
-#endif
                if (stat(filename, &s))
                        break;
                ePtr<eDVBDemux> demux;
@@ -249,11 +241,7 @@ int eDVBAdapterLinux::exist(int nr)
 {
        struct stat s;
        char filename[128];
-#if HAVE_DVB_API_VERSION < 3
-       sprintf(filename, "/dev/dvb/card%d", nr);
-#else
        sprintf(filename, "/dev/dvb/adapter%d", nr);
-#endif
        if (!stat(filename, &s))
                return 1;
        return 0;
@@ -444,7 +432,7 @@ bool eDVBResourceManager::frontendIsCompatible(int index, const char *type)
                        }
                        else if (!strcmp(type, "DVB-C"))
                        {
-#if DVB_API_VERSION > 5 || DVB_API_VERSION == 5 && DVB_API_VERSION_MINOR >= 6
+#if defined SYS_DVBC_ANNEX_A
                                return i->m_frontend->supportsDeliverySystem(SYS_DVBC_ANNEX_A, false);
 #else
                                return i->m_frontend->supportsDeliverySystem(SYS_DVBC_ANNEX_AC, false);
@@ -476,7 +464,7 @@ void eDVBResourceManager::setFrontendType(int index, const char *type)
                        }
                        else if (!strcmp(type, "DVB-C"))
                        {
-#if DVB_API_VERSION > 5 || DVB_API_VERSION == 5 && DVB_API_VERSION_MINOR >= 6
+#if defined SYS_DVBC_ANNEX_A
                                whitelist.push_back(SYS_DVBC_ANNEX_A);
 #else
                                whitelist.push_back(SYS_DVBC_ANNEX_AC);
@@ -2100,14 +2088,6 @@ RESULT eDVBChannel::playSource(ePtr<iTsSource> &source, const char *streaminfo_f
        if (m_pvr_fd_dst < 0)
        {
                /* (this codepath needs to be improved anyway.) */
-#if HAVE_DVB_API_VERSION < 3
-               m_pvr_fd_dst = open("/dev/pvr", O_WRONLY);
-               if (m_pvr_fd_dst < 0)
-               {
-                       eDebug("can't open /dev/pvr - you need to buy the new(!) $$$ box! (%m)"); // or wait for the driver to be improved.
-                       return -ENODEV;
-               }
-#else
                ePtr<eDVBAllocatedDemux> &demux = m_demux ? m_demux : m_decoder_demux;
                if (demux)
                {
@@ -2123,7 +2103,6 @@ RESULT eDVBChannel::playSource(ePtr<iTsSource> &source, const char *streaminfo_f
                        eDebug("no demux allocated yet.. so its not possible to open the dvr device!!");
                        return -ENODEV;
                }
-#endif
        }
 
        m_pvr_thread = new eDVBChannelFilePush();
index 848b515..91c866c 100755 (executable)
 #define I2C_SLAVE_FORCE        0x0706
 #endif
 
-#if HAVE_DVB_API_VERSION < 3
-#include <ost/frontend.h>
-#include <ost/sec.h>
-#define QAM_AUTO                               (Modulation)6
-#define TRANSMISSION_MODE_AUTO (TransmitMode)2
-#define BANDWIDTH_AUTO                 (BandWidth)3
-#define GUARD_INTERVAL_AUTO            (GuardInterval)4
-#define HIERARCHY_AUTO                 (Hierarchy)4
-#define parm_frequency parm.Frequency
-#define parm_inversion parm.Inversion
-#define parm_u_qpsk_symbol_rate parm.u.qpsk.SymbolRate
-#define parm_u_qpsk_fec_inner parm.u.qpsk.FEC_inner
-#define parm_u_qam_symbol_rate parm.u.qam.SymbolRate
-#define parm_u_qam_fec_inner parm.u.qam.FEC_inner
-#define parm_u_qam_modulation parm.u.qam.QAM
-#define parm_u_ofdm_bandwidth parm.u.ofdm.bandWidth
-#define parm_u_ofdm_code_rate_LP parm.u.ofdm.LP_CodeRate
-#define parm_u_ofdm_code_rate_HP parm.u.ofdm.HP_CodeRate
-#define parm_u_ofdm_constellation parm.u.ofdm.Constellation
-#define parm_u_ofdm_transmission_mode parm.u.ofdm.TransmissionMode
-#define parm_u_ofdm_guard_interval parm.u.ofdm.guardInterval
-#define parm_u_ofdm_hierarchy_information parm.u.ofdm.HierarchyInformation
-#else
 #include <linux/dvb/frontend.h>
 #define parm_frequency parm.frequency
 #define parm_inversion parm.inversion
 #define parm_u_ofdm_transmission_mode parm.u.ofdm.transmission_mode
 #define parm_u_ofdm_guard_interval parm.u.ofdm.guard_interval
 #define parm_u_ofdm_hierarchy_information parm.u.ofdm.hierarchy_information
-#if HAVE_DVB_API_VERSION < 5
-       #define FEC_S2_QPSK_1_2 (fe_code_rate_t)(FEC_AUTO+1)
-       #define FEC_S2_QPSK_2_3 (fe_code_rate_t)(FEC_S2_QPSK_1_2+1)
-       #define FEC_S2_QPSK_3_4 (fe_code_rate_t)(FEC_S2_QPSK_2_3+1)
-       #define FEC_S2_QPSK_5_6 (fe_code_rate_t)(FEC_S2_QPSK_3_4+1)
-       #define FEC_S2_QPSK_7_8 (fe_code_rate_t)(FEC_S2_QPSK_5_6+1)
-       #define FEC_S2_QPSK_8_9 (fe_code_rate_t)(FEC_S2_QPSK_7_8+1)
-       #define FEC_S2_QPSK_3_5 (fe_code_rate_t)(FEC_S2_QPSK_8_9+1)
-       #define FEC_S2_QPSK_4_5 (fe_code_rate_t)(FEC_S2_QPSK_3_5+1)
-       #define FEC_S2_QPSK_9_10 (fe_code_rate_t)(FEC_S2_QPSK_4_5+1)
-       #define FEC_S2_8PSK_1_2 (fe_code_rate_t)(FEC_S2_QPSK_9_10+1)
-       #define FEC_S2_8PSK_2_3 (fe_code_rate_t)(FEC_S2_8PSK_1_2+1)
-       #define FEC_S2_8PSK_3_4 (fe_code_rate_t)(FEC_S2_8PSK_2_3+1)
-       #define FEC_S2_8PSK_5_6 (fe_code_rate_t)(FEC_S2_8PSK_3_4+1)
-       #define FEC_S2_8PSK_7_8 (fe_code_rate_t)(FEC_S2_8PSK_5_6+1)
-       #define FEC_S2_8PSK_8_9 (fe_code_rate_t)(FEC_S2_8PSK_7_8+1)
-       #define FEC_S2_8PSK_3_5 (fe_code_rate_t)(FEC_S2_8PSK_8_9+1)
-       #define FEC_S2_8PSK_4_5 (fe_code_rate_t)(FEC_S2_8PSK_3_5+1)
-       #define FEC_S2_8PSK_9_10 (fe_code_rate_t)(FEC_S2_8PSK_4_5+1)
-#else
-       #define FEC_S2_QPSK_1_2 (fe_code_rate_t)(FEC_1_2)
-       #define FEC_S2_QPSK_2_3 (fe_code_rate_t)(FEC_2_3)
-       #define FEC_S2_QPSK_3_4 (fe_code_rate_t)(FEC_3_4)
-       #define FEC_S2_QPSK_5_6 (fe_code_rate_t)(FEC_5_6)
-       #define FEC_S2_QPSK_7_8 (fe_code_rate_t)(FEC_7_8)
-       #define FEC_S2_QPSK_8_9 (fe_code_rate_t)(FEC_8_9)
-       #define FEC_S2_QPSK_3_5 (fe_code_rate_t)(FEC_3_5)
-       #define FEC_S2_QPSK_4_5 (fe_code_rate_t)(FEC_4_5)
-       #define FEC_S2_QPSK_9_10 (fe_code_rate_t)(FEC_9_10)
-#endif
-#endif
+#define FEC_S2_QPSK_1_2 (fe_code_rate_t)(FEC_1_2)
+#define FEC_S2_QPSK_2_3 (fe_code_rate_t)(FEC_2_3)
+#define FEC_S2_QPSK_3_4 (fe_code_rate_t)(FEC_3_4)
+#define FEC_S2_QPSK_5_6 (fe_code_rate_t)(FEC_5_6)
+#define FEC_S2_QPSK_7_8 (fe_code_rate_t)(FEC_7_8)
+#define FEC_S2_QPSK_8_9 (fe_code_rate_t)(FEC_8_9)
+#define FEC_S2_QPSK_3_5 (fe_code_rate_t)(FEC_3_5)
+#define FEC_S2_QPSK_4_5 (fe_code_rate_t)(FEC_4_5)
+#define FEC_S2_QPSK_9_10 (fe_code_rate_t)(FEC_9_10)
 
 #include <dvbsi++/satellite_delivery_system_descriptor.h>
 #include <dvbsi++/cable_delivery_system_descriptor.h>
@@ -503,16 +458,8 @@ eDVBFrontend::eDVBFrontend(int adap, int fe, int &ok, bool simulate, eDVBFronten
        :m_simulate(simulate), m_enabled(false), m_simulate_fe(simulate_fe), m_dvbid(fe), m_slotid(fe)
        ,m_fd(-1), m_rotor_mode(false), m_need_rotor_workaround(false)
        ,m_state(stateClosed), m_timeout(0), m_tuneTimer(0), m_fbc(false), m_is_usbtuner(false)
-#if HAVE_DVB_API_VERSION < 3
-       ,m_secfd(-1)
-#endif
 {
-#if HAVE_DVB_API_VERSION < 3
-       sprintf(m_filename, "/dev/dvb/card%d/frontend%d", adap, fe);
-       sprintf(m_sec_filename, "/dev/dvb/card%d/sec%d", adap, fe);
-#else
        sprintf(m_filename, "/dev/dvb/adapter%d/frontend%d", adap, fe);
-#endif
 
        m_timeout = eTimer::create(eApp);
        CONNECT(m_timeout->timeout, eDVBFrontend::timeout);
@@ -544,11 +491,7 @@ int eDVBFrontend::openFrontend()
        m_state=stateIdle;
        m_tuning=0;
 
-#if HAVE_DVB_API_VERSION < 3
-       FrontendInfo fe_info;
-#else
        dvb_frontend_info fe_info;
-#endif
        if (!m_simulate)
        {
                eDebug("opening frontend %d", m_dvbid);
@@ -603,7 +546,7 @@ int eDVBFrontend::openFrontend()
                                }
                                case FE_QAM:
                                {
-#if DVB_API_VERSION > 5 || DVB_API_VERSION == 5 && DVB_API_VERSION_MINOR >= 6
+#if defined SYS_DVBC_ANNEX_A
                                        m_delsys[SYS_DVBC_ANNEX_A] = true;
 #else
                                        m_delsys[SYS_DVBC_ANNEX_AC] = true;
@@ -704,15 +647,6 @@ int eDVBFrontend::closeFrontend(bool force, bool no_delayed)
                setTone(iDVBFrontend::toneOff);
                setVoltage(iDVBFrontend::voltageOff);
        }
-#if HAVE_DVB_API_VERSION < 3
-       if (m_secfd >= 0)
-       {
-               if (!::close(m_secfd))
-                       m_secfd=-1;
-               else
-                       eWarning("couldnt close sec %d", m_dvbid);
-       }
-#endif
        m_sn=0;
        m_state = stateClosed;
 
@@ -737,11 +671,7 @@ void eDVBFrontend::feEvent(int w)
        }
        while (1)
        {
-#if HAVE_DVB_API_VERSION < 3
-               FrontendEvent event;
-#else
                dvb_frontend_event event;
-#endif
                int res;
                int state;
                res = ::ioctl(m_fd, FE_GET_EVENT, &event);
@@ -752,19 +682,14 @@ void eDVBFrontend::feEvent(int w)
                if (w < 0)
                        continue;
 
-#if HAVE_DVB_API_VERSION < 3
-               if (event.type == FE_COMPLETION_EV)
-#else
                eDebug("(%d)fe event: status %x, inversion %s, m_tuning %d", m_dvbid, event.status, (event.parameters.inversion == INVERSION_ON) ? "on" : "off", m_tuning);
                if (event.status & FE_HAS_LOCK)
-#endif
                {
                        state = stateLock;
                } else
                {
                        if (m_tuning) {
                                state = stateTuning;
-#if HAVE_DVB_API_VERSION >= 3
                                if (event.status & FE_TIMEDOUT) {
                                        eDebug("FE_TIMEDOUT! ..abort");
                                        m_tuneTimer->stop();
@@ -772,10 +697,6 @@ void eDVBFrontend::feEvent(int w)
                                        return;
                                }
                                ++m_tuning;
-#else
-                               m_tuneTimer->stop();
-                               timeout();
-#endif
                        }
                        else
                        {
@@ -877,7 +798,6 @@ int eDVBFrontend::readFrontendData(int type)
                                        }
                                        snr_in_db = fval1;
                                }
-#if HAVE_DVB_API_VERSION >= 3
                                else
                                {
                                        float fval1 = SDS_SNRE / 268435456.0,
@@ -900,7 +820,6 @@ int eDVBFrontend::readFrontendData(int type)
                                                fval1 = fval4 - fval2 * log10(1.0+pow(10.0, (fval3-fval1)/fval2));
                                        snr_in_db = fval1;
                                }
-#endif
                                sat_max = 1750;
                                ret = (int)(snr_in_db * 100);
                        }
@@ -1023,11 +942,7 @@ int eDVBFrontend::readFrontendData(int type)
                }
                case locked:
                {
-#if HAVE_DVB_API_VERSION < 3
-                       FrontendStatus status=0;
-#else
                        fe_status_t status;
-#endif
                        if (!m_simulate)
                        {
                                if ( ioctl(m_fd, FE_READ_STATUS, &status) < 0 && errno != ERANGE )
@@ -1038,11 +953,7 @@ int eDVBFrontend::readFrontendData(int type)
                }
                case synced:
                {
-#if HAVE_DVB_API_VERSION < 3
-                       FrontendStatus status=0;
-#else
                        fe_status_t status;
-#endif
                        if (!m_simulate)
                        {
                                if ( ioctl(m_fd, FE_READ_STATUS, &status) < 0 && errno != ERANGE )
@@ -1144,17 +1055,25 @@ void PutCableDataToDict(ePyObject &dict, eDVBFrontendParametersCable &feparm)
        PutToDict(dict, "fec_inner", feparm.fec_inner);
 }
 
-#if HAVE_DVB_API_VERSION >= 5
-static void fillDictWithSatelliteData(ePyObject dict, const FRONTENDPARAMETERS &parm, struct dtv_property *p, long freq_offset, int orb_pos, int polarization)
+static void fillDictWithSatelliteData(ePyObject dict, struct dtv_property *p, long freq_offset, int orbital_position, int polarization)
 {
        long tmp=0;
-       int frequency = parm_frequency + freq_offset;
+       int p_system = p[0].u.data;
+       int p_frequency = p[1].u.data;
+       int p_inversion = p[2].u.data;
+       int p_modulation = p[3].u.data;
+       int p_symbolrate = p[4].u.data;
+       int p_inner_fec = p[5].u.data;
+       int p_rolloff = p[6].u.data;
+       int p_pilot = p[7].u.data;
+
+       int frequency = p_frequency + freq_offset;
        PutToDict(dict, "frequency", frequency);
-       PutToDict(dict, "symbol_rate", parm_u_qpsk_symbol_rate);
-       PutToDict(dict, "orbital_position", orb_pos);
+       PutToDict(dict, "symbol_rate", p_symbolrate);
+       PutToDict(dict, "orbital_position", orbital_position);
        PutToDict(dict, "polarization", polarization);
 
-       switch(parm_u_qpsk_fec_inner)
+       switch(p_inner_fec)
        {
        case FEC_1_2: tmp = eDVBFrontendParametersSatellite::FEC_1_2; break;
        case FEC_2_3: tmp = eDVBFrontendParametersSatellite::FEC_2_3; break;
@@ -1171,13 +1090,13 @@ static void fillDictWithSatelliteData(ePyObject dict, const FRONTENDPARAMETERS &
        }
        PutToDict(dict, "fec_inner", tmp);
 
-       switch (p[0].u.data)
+       switch (p_system)
        {
        default: eDebug("got unsupported system from frontend! report as DVBS!");
        case SYS_DVBS: tmp = eDVBFrontendParametersSatellite::System_DVB_S; break;
        case SYS_DVBS2:
        {
-               switch (p[2].u.data)
+               switch (p_rolloff)
                {
                default: eDebug("got unsupported rolloff from frontend! report as 0_20!");
                case ROLLOFF_20: tmp = eDVBFrontendParametersSatellite::RollOff_alpha_0_20; break;
@@ -1186,7 +1105,7 @@ static void fillDictWithSatelliteData(ePyObject dict, const FRONTENDPARAMETERS &
                }
                PutToDict(dict, "rolloff", tmp);
 
-               switch (p[3].u.data)
+               switch (p_pilot)
                {
                case PILOT_OFF: tmp = eDVBFrontendParametersSatellite::Pilot_Off; break;
                case PILOT_ON: tmp = eDVBFrontendParametersSatellite::Pilot_On; break;
@@ -1199,7 +1118,7 @@ static void fillDictWithSatelliteData(ePyObject dict, const FRONTENDPARAMETERS &
        }
        PutToDict(dict, "system", tmp);
 
-       switch (p[1].u.data)
+       switch (p_modulation)
        {
        default: eDebug("got unsupported modulation from frontend! report as QPSK!");
        case QPSK: tmp = eDVBFrontendParametersSatellite::Modulation_QPSK; break;
@@ -1207,7 +1126,7 @@ static void fillDictWithSatelliteData(ePyObject dict, const FRONTENDPARAMETERS &
        }
        PutToDict(dict, "modulation", tmp);
 
-       switch(parm_inversion & 3)
+       switch(p_inversion)
        {
                case INVERSION_ON: tmp = eDVBFrontendParametersSatellite::Inversion_On; break;
                case INVERSION_OFF: tmp = eDVBFrontendParametersSatellite::Inversion_Off; break;
@@ -1219,13 +1138,19 @@ static void fillDictWithSatelliteData(ePyObject dict, const FRONTENDPARAMETERS &
 static void fillDictWithCableData(ePyObject dict, struct dtv_property *p)
 {
        long tmp = 0;
+       int p_system = p[0].u.data;
+       int p_frequency = p[1].u.data;
+       int p_inversion = p[2].u.data;
+       int p_modulation = p[3].u.data;
+       int p_symbolrate = p[4].u.data;
+       int p_inner_fec = p[5].u.data;
 // frequency
-       tmp = p[1].u.data/1000;
+       tmp = p_frequency/1000;
        PutToDict(dict, "frequency", tmp);
 // sysbolrate
-       PutToDict(dict, "symbol_rate", p[2].u.data);
+       PutToDict(dict, "symbol_rate", p_inversion);
 // inner fec
-       switch (p[3].u.data)
+       switch (p_inner_fec)
        {
                case FEC_NONE: tmp = eDVBFrontendParametersCable::FEC_None; break;
                case FEC_1_2: tmp = eDVBFrontendParametersCable::FEC_1_2; break;
@@ -1239,7 +1164,7 @@ static void fillDictWithCableData(ePyObject dict, struct dtv_property *p)
        }
        PutToDict(dict, "fec_inner", tmp);
 // modulation
-       switch (p[4].u.data)
+       switch (p_modulation)
        {
                case QAM_16: tmp = eDVBFrontendParametersCable::Modulation_QAM16; break;
                case QAM_32: tmp = eDVBFrontendParametersCable::Modulation_QAM32; break;
@@ -1251,7 +1176,7 @@ static void fillDictWithCableData(ePyObject dict, struct dtv_property *p)
        }
        PutToDict(dict, "modulation", tmp);
 // inversion
-       switch (p[5].u.data)
+       switch (p_inversion)
        {
                case INVERSION_OFF: tmp = eDVBFrontendParametersTerrestrial::Inversion_Off; break;
                case INVERSION_ON: tmp = eDVBFrontendParametersTerrestrial::Inversion_On; break;
@@ -1264,15 +1189,29 @@ static void fillDictWithCableData(ePyObject dict, struct dtv_property *p)
 static void fillDictWithTerrestrialData(ePyObject dict, struct dtv_property *p)
 {
        long tmp =0;
+       int p_system = p[0].u.data;
+       int p_frequency = p[1].u.data;
+       int p_inversion = p[2].u.data;
+       int p_constellation = p[3].u.data;
+       int p_bandwidth = p[4].u.data;
+       int p_coderate_lp = p[5].u.data;
+       int p_coderate_hp = p[6].u.data;
+       int p_transmission_mode = p[7].u.data;
+       int p_guard_interval = p[8].u.data;
+       int p_hierarchy = p[9].u.data;
+#if (defined DTV_STREAM_ID) || (defined DTV_DVBT2_PLP_ID)
+       int p_plp_id = p[10].u.data;
+#endif
+
 // system
-       switch (p[0].u.data)
+       switch (p_system)
        {
                default: eDebug("got unsupported system from frontend! report as DVBT!");
                case SYS_DVBT: tmp = eDVBFrontendParametersTerrestrial::System_DVB_T; break;
                case SYS_DVBT2:
                {
-#if DVB_API_VERSION > 5 || DVB_API_VERSION == 5 && DVB_API_VERSION_MINOR >= 3
-                       tmp = p[10].u.data;
+#if (defined DTV_STREAM_ID) || (defined DTV_DVBT2_PLP_ID)
+                       tmp = p_plp_id;
                        PutToDict(dict, "plp_id", tmp);
 #endif
                        tmp = eDVBFrontendParametersTerrestrial::System_DVB_T2; break;
@@ -1280,10 +1219,10 @@ static void fillDictWithTerrestrialData(ePyObject dict, struct dtv_property *p)
        }
        PutToDict(dict, "system", tmp);
 // frequency
-       tmp = p[1].u.data;
+       tmp = p_frequency;
        PutToDict(dict, "frequency", tmp);
 // bandwidth
-       switch (p[2].u.data)
+       switch (p_bandwidth)
        {
                case 8000000: tmp = eDVBFrontendParametersTerrestrial::Bandwidth_8MHz; break;
                case 7000000: tmp = eDVBFrontendParametersTerrestrial::Bandwidth_7MHz; break;
@@ -1296,7 +1235,7 @@ static void fillDictWithTerrestrialData(ePyObject dict, struct dtv_property *p)
        }
        PutToDict(dict, "bandwidth", tmp);
 // code rate LP
-       switch (p[3].u.data)
+       switch (p_coderate_lp)
        {
                case FEC_1_2: tmp = eDVBFrontendParametersTerrestrial::FEC_1_2; break;
                case FEC_2_3: tmp = eDVBFrontendParametersTerrestrial::FEC_2_3; break;
@@ -1311,7 +1250,7 @@ static void fillDictWithTerrestrialData(ePyObject dict, struct dtv_property *p)
        }
        PutToDict(dict, "code_rate_lp", tmp);
 // code rate HP
-       switch (p[4].u.data)
+       switch (p_coderate_hp)
        {
                case FEC_1_2: tmp = eDVBFrontendParametersTerrestrial::FEC_1_2; break;
                case FEC_2_3: tmp = eDVBFrontendParametersTerrestrial::FEC_2_3; break;
@@ -1326,7 +1265,7 @@ static void fillDictWithTerrestrialData(ePyObject dict, struct dtv_property *p)
        }
        PutToDict(dict, "code_rate_hp", tmp);
 // constellation
-       switch (p[5].u.data)
+       switch (p_constellation)
        {
                case QPSK: tmp = eDVBFrontendParametersTerrestrial::Modulation_QPSK; break;
                case QAM_16: tmp = eDVBFrontendParametersTerrestrial::Modulation_QAM16; break;
@@ -1338,7 +1277,7 @@ static void fillDictWithTerrestrialData(ePyObject dict, struct dtv_property *p)
        PutToDict(dict, "constellation", tmp);
 
 // transmission
-       switch (p[6].u.data)
+       switch (p_transmission_mode)
        {
        case TRANSMISSION_MODE_1K: tmp = eDVBFrontendParametersTerrestrial::TransmissionMode_1k; break;
        case TRANSMISSION_MODE_2K: tmp = eDVBFrontendParametersTerrestrial::TransmissionMode_2k; break;
@@ -1351,7 +1290,7 @@ static void fillDictWithTerrestrialData(ePyObject dict, struct dtv_property *p)
        }
        PutToDict(dict, "transmission_mode", tmp);
 // guard interval
-       switch (p[7].u.data)
+       switch (p_guard_interval)
        {
                case GUARD_INTERVAL_19_256: tmp = eDVBFrontendParametersTerrestrial::GuardInterval_19_256; break;
                case GUARD_INTERVAL_19_128: tmp = eDVBFrontendParametersTerrestrial::GuardInterval_19_128; break;
@@ -1365,7 +1304,7 @@ static void fillDictWithTerrestrialData(ePyObject dict, struct dtv_property *p)
        }
        PutToDict(dict, "guard_interval", tmp);
 // hierarchy
-       switch (p[8].u.data)
+       switch (p_hierarchy)
        {
                case HIERARCHY_NONE: tmp = eDVBFrontendParametersTerrestrial::Hierarchy_None; break;
                case HIERARCHY_1: tmp = eDVBFrontendParametersTerrestrial::Hierarchy_1; break;
@@ -1376,7 +1315,7 @@ static void fillDictWithTerrestrialData(ePyObject dict, struct dtv_property *p)
        }
        PutToDict(dict, "hierarchy_information", tmp);
 // inversion
-       switch (p[9].u.data)
+       switch (p_inversion)
        {
                case INVERSION_OFF: tmp = eDVBFrontendParametersTerrestrial::Inversion_Off;  break;
                case INVERSION_ON: tmp = eDVBFrontendParametersTerrestrial::Inversion_On;  break;
@@ -1386,194 +1325,6 @@ static void fillDictWithTerrestrialData(ePyObject dict, struct dtv_property *p)
        PutToDict(dict, "inversion", tmp);
 }
 
-#else // #if HAVE_DVB_API_VERSION >= 5
-static void fillDictWithSatelliteData(ePyObject dict, const FRONTENDPARAMETERS &parm, long freq_offset, int orb_pos, int polarization)
-{
-       long tmp=0;
-       int frequency = parm_frequency + freq_offset;
-       PutToDict(dict, "frequency", frequency);
-       PutToDict(dict, "symbol_rate", parm_u_qpsk_symbol_rate);
-       PutToDict(dict, "orbital_position", orb_pos);
-       PutToDict(dict, "polarization", polarization);
-
-       switch((int)parm_u_qpsk_fec_inner)
-       {
-       case FEC_1_2: tmp = eDVBFrontendParametersSatellite::FEC_1_2; break;
-       case FEC_2_3: tmp = eDVBFrontendParametersSatellite::FEC_2_3; break;
-       case FEC_3_4: tmp = eDVBFrontendParametersSatellite::FEC_3_4; break;
-       case FEC_5_6: tmp = eDVBFrontendParametersSatellite::FEC_5_6; break;
-       case FEC_7_8: tmp = eDVBFrontendParametersSatellite::FEC_7_8; break;
-       case FEC_NONE: tmp = eDVBFrontendParametersSatellite::FEC_None; break;
-       default:
-       case FEC_AUTO: tmp = eDVBFrontendParametersSatellite::FEC_Auto; break;
-#if HAVE_DVB_API_VERSION >=3
-       case FEC_S2_8PSK_1_2:
-       case FEC_S2_QPSK_1_2: tmp = eDVBFrontendParametersSatellite::FEC_1_2; break;
-       case FEC_S2_8PSK_2_3:
-       case FEC_S2_QPSK_2_3: tmp = eDVBFrontendParametersSatellite::FEC_2_3; break;
-       case FEC_S2_8PSK_3_4:
-       case FEC_S2_QPSK_3_4: tmp = eDVBFrontendParametersSatellite::FEC_3_4; break;
-       case FEC_S2_8PSK_5_6:
-       case FEC_S2_QPSK_5_6: tmp = eDVBFrontendParametersSatellite::FEC_5_6; break;
-       case FEC_S2_8PSK_7_8:
-       case FEC_S2_QPSK_7_8: tmp = eDVBFrontendParametersSatellite::FEC_7_8; break;
-       case FEC_S2_8PSK_8_9:
-       case FEC_S2_QPSK_8_9: tmp = eDVBFrontendParametersSatellite::FEC_8_9; break;
-       case FEC_S2_8PSK_3_5:
-       case FEC_S2_QPSK_3_5: tmp = eDVBFrontendParametersSatellite::FEC_3_5; break;
-       case FEC_S2_8PSK_4_5:
-       case FEC_S2_QPSK_4_5: tmp = eDVBFrontendParametersSatellite::FEC_4_5; break;
-       case FEC_S2_8PSK_9_10:
-       case FEC_S2_QPSK_9_10: tmp = eDVBFrontendParametersSatellite::FEC_9_10; break;
-#endif
-       }
-       PutToDict(dict, "fec_inner", tmp);
-#if HAVE_DVB_API_VERSION >=3
-       PutToDict(dict, "modulation",
-               parm_u_qpsk_fec_inner > FEC_S2_QPSK_9_10 ?
-                       eDVBFrontendParametersSatellite::Modulation_8PSK :
-                       eDVBFrontendParametersSatellite::Modulation_QPSK );
-       if (parm_u_qpsk_fec_inner > FEC_AUTO)
-       {
-               switch(parm_inversion & 0xc)
-               {
-               default: // unknown rolloff
-               case 0: tmp = eDVBFrontendParametersSatellite::RollOff_alpha_0_35; break;
-               case 4: tmp = eDVBFrontendParametersSatellite::RollOff_alpha_0_25; break;
-               case 8: tmp = eDVBFrontendParametersSatellite::RollOff_alpha_0_20; break;
-               }
-               PutToDict(dict, "rolloff", tmp);
-               switch(parm_inversion & 0x30)
-               {
-               case 0: tmp = eDVBFrontendParametersSatellite::Pilot_Off; break;
-               case 0x10: tmp = eDVBFrontendParametersSatellite::Pilot_On; break;
-               case 0x20: tmp = eDVBFrontendParametersSatellite::Pilot_Unknown; break;
-               }
-               PutToDict(dict, "pilot", tmp);
-               tmp = eDVBFrontendParametersSatellite::System_DVB_S2;
-       }
-       else
-               tmp = eDVBFrontendParametersSatellite::System_DVB_S;
-#else
-       PutToDict(dict, "modulation", eDVBFrontendParametersSatellite::Modulation_QPSK );
-       tmp = eDVBFrontendParametersSatellite::System_DVB_S;
-#endif
-       PutToDict(dict, "system", tmp);
-}
-
-static void fillDictWithCableData(ePyObject dict, const FRONTENDPARAMETERS &parm)
-{
-       long tmp=0;
-#if HAVE_DVB_API_VERSION < 3
-       PutToDict(dict, "frequency", parm_frequency);
-#else
-       PutToDict(dict, "frequency", parm_frequency/1000);
-#endif
-       PutToDict(dict, "symbol_rate", parm_u_qam_symbol_rate);
-       switch(parm_u_qam_fec_inner)
-       {
-       case FEC_NONE: tmp = eDVBFrontendParametersCable::FEC_None; break;
-       case FEC_1_2: tmp = eDVBFrontendParametersCable::FEC_1_2; break;
-       case FEC_2_3: tmp = eDVBFrontendParametersCable::FEC_2_3; break;
-       case FEC_3_4: tmp = eDVBFrontendParametersCable::FEC_3_4; break;
-       case FEC_5_6: tmp = eDVBFrontendParametersCable::FEC_5_6; break;
-       case FEC_7_8: tmp = eDVBFrontendParametersCable::FEC_7_8; break;
-#if HAVE_DVB_API_VERSION >= 3
-       case FEC_8_9: tmp = eDVBFrontendParametersCable::FEC_7_8; break;
-#endif
-       default:
-       case FEC_AUTO: tmp = eDVBFrontendParametersCable::FEC_Auto; break;
-       }
-       PutToDict(dict, "fec_inner", tmp);
-       switch(parm_u_qam_modulation)
-       {
-       case QAM_16: tmp = eDVBFrontendParametersCable::Modulation_QAM16; break;
-       case QAM_32: tmp = eDVBFrontendParametersCable::Modulation_QAM32; break;
-       case QAM_64: tmp = eDVBFrontendParametersCable::Modulation_QAM64; break;
-       case QAM_128: tmp = eDVBFrontendParametersCable::Modulation_QAM128; break;
-       case QAM_256: tmp = eDVBFrontendParametersCable::Modulation_QAM256; break;
-       default:
-       case QAM_AUTO:   tmp = eDVBFrontendParametersCable::Modulation_Auto; break;
-       }
-       PutToDict(dict, "modulation", tmp);
-}
-
-static void fillDictWithTerrestrialData(ePyObject dict, const FRONTENDPARAMETERS &parm)
-{
-       long tmp=0;
-       PutToDict(dict, "frequency", parm_frequency);
-       switch (parm_u_ofdm_bandwidth)
-       {
-       case BANDWIDTH_8_MHZ: tmp = eDVBFrontendParametersTerrestrial::Bandwidth_8MHz; break;
-       case BANDWIDTH_7_MHZ: tmp = eDVBFrontendParametersTerrestrial::Bandwidth_7MHz; break;
-       case BANDWIDTH_6_MHZ: tmp = eDVBFrontendParametersTerrestrial::Bandwidth_6MHz; break;
-       default:
-       case BANDWIDTH_AUTO: tmp = eDVBFrontendParametersTerrestrial::Bandwidth_Auto; break;
-       }
-       PutToDict(dict, "bandwidth", tmp);
-       switch (parm_u_ofdm_code_rate_LP)
-       {
-       case FEC_1_2: tmp = eDVBFrontendParametersTerrestrial::FEC_1_2; break;
-       case FEC_2_3: tmp = eDVBFrontendParametersTerrestrial::FEC_2_3; break;
-       case FEC_3_4: tmp = eDVBFrontendParametersTerrestrial::FEC_3_4; break;
-       case FEC_5_6: tmp = eDVBFrontendParametersTerrestrial::FEC_5_6; break;
-       case FEC_7_8: tmp = eDVBFrontendParametersTerrestrial::FEC_7_8; break;
-       default:
-       case FEC_AUTO: tmp = eDVBFrontendParametersTerrestrial::FEC_Auto; break;
-       }
-       PutToDict(dict, "code_rate_lp", tmp);
-       switch (parm_u_ofdm_code_rate_HP)
-       {
-       case FEC_1_2: tmp = eDVBFrontendParametersTerrestrial::FEC_1_2; break;
-       case FEC_2_3: tmp = eDVBFrontendParametersTerrestrial::FEC_2_3; break;
-       case FEC_3_4: tmp = eDVBFrontendParametersTerrestrial::FEC_3_4; break;
-       case FEC_5_6: tmp = eDVBFrontendParametersTerrestrial::FEC_5_6; break;
-       case FEC_7_8: tmp = eDVBFrontendParametersTerrestrial::FEC_7_8; break;
-       default:
-       case FEC_AUTO: tmp = eDVBFrontendParametersTerrestrial::FEC_Auto; break;
-       }
-       PutToDict(dict, "code_rate_hp", tmp);
-       switch (parm_u_ofdm_constellation)
-       {
-       case QPSK: tmp = eDVBFrontendParametersTerrestrial::Modulation_QPSK; break;
-       case QAM_16: tmp = eDVBFrontendParametersTerrestrial::Modulation_QAM16; break;
-       case QAM_64: tmp = eDVBFrontendParametersTerrestrial::Modulation_QAM64; break;
-       default:
-       case QAM_AUTO: tmp = eDVBFrontendParametersTerrestrial::Modulation_Auto; break;
-       }
-       PutToDict(dict, "constellation", tmp);
-       switch (parm_u_ofdm_transmission_mode)
-       {
-       case TRANSMISSION_MODE_2K: tmp = eDVBFrontendParametersTerrestrial::TransmissionMode_2k; break;
-       case TRANSMISSION_MODE_8K: tmp = eDVBFrontendParametersTerrestrial::TransmissionMode_8k; break;
-       default:
-       case TRANSMISSION_MODE_AUTO: tmp = eDVBFrontendParametersTerrestrial::TransmissionMode_Auto; break;
-       }
-       PutToDict(dict, "transmission_mode", tmp);
-       switch (parm_u_ofdm_guard_interval)
-       {
-               case GUARD_INTERVAL_1_32: tmp = eDVBFrontendParametersTerrestrial::GuardInterval_1_32; break;
-               case GUARD_INTERVAL_1_16: tmp = eDVBFrontendParametersTerrestrial::GuardInterval_1_16; break;
-               case GUARD_INTERVAL_1_8: tmp = eDVBFrontendParametersTerrestrial::GuardInterval_1_8; break;
-               case GUARD_INTERVAL_1_4: tmp = eDVBFrontendParametersTerrestrial::GuardInterval_1_4; break;
-               default:
-               case GUARD_INTERVAL_AUTO: tmp = eDVBFrontendParametersTerrestrial::GuardInterval_Auto; break;
-       }
-       PutToDict(dict, "guard_interval", tmp);
-       switch (parm_u_ofdm_hierarchy_information)
-       {
-               case HIERARCHY_NONE: tmp = eDVBFrontendParametersTerrestrial::Hierarchy_None; break;
-               case HIERARCHY_1: tmp = eDVBFrontendParametersTerrestrial::Hierarchy_1; break;
-               case HIERARCHY_2: tmp = eDVBFrontendParametersTerrestrial::Hierarchy_2; break;
-               case HIERARCHY_4: tmp = eDVBFrontendParametersTerrestrial::Hierarchy_4; break;
-               default:
-               case HIERARCHY_AUTO: tmp = eDVBFrontendParametersTerrestrial::Hierarchy_Auto; break;
-       }
-       PutToDict(dict, "hierarchy_information", tmp);
-}
-
-#endif // #if HAVE_DVB_API_VERSION >= 5
-
 void eDVBFrontend::getFrontendStatus(ePyObject dest)
 {
        if (dest && PyDict_Check(dest))
@@ -1623,58 +1374,47 @@ void eDVBFrontend::getTransponderData(ePyObject dest, bool original)
        {
                int type = -1;
                FRONTENDPARAMETERS front;
-#if HAVE_DVB_API_VERSION >= 5
                struct dtv_property p[16];
                struct dtv_properties cmdseq;
                cmdseq.props = p;
                cmdseq.num = 0;
                oparm.getSystem(type);
-               switch(type)
-               {
-                       case feSatellite:
-                               p[0].cmd = DTV_DELIVERY_SYSTEM;
-                               p[1].cmd = DTV_MODULATION;
-                               p[2].cmd = DTV_ROLLOFF;
-                               p[3].cmd = DTV_PILOT;
-                               cmdseq.num = 4;
-                               break;
-                       case feCable:
-                               p[0].cmd = DTV_DELIVERY_SYSTEM;
-                               p[1].cmd = DTV_FREQUENCY;
-                               p[2].cmd = DTV_SYMBOL_RATE;
-                               p[3].cmd = DTV_INNER_FEC;
-                               p[4].cmd = DTV_MODULATION;
-                               p[5].cmd = DTV_INVERSION;
-                               cmdseq.num = 6;
-                               break;
-                       case feTerrestrial:
-                               p[0].cmd = DTV_DELIVERY_SYSTEM;
-                               p[1].cmd = DTV_FREQUENCY;
-                               p[2].cmd = DTV_BANDWIDTH_HZ;
-                               p[3].cmd = DTV_CODE_RATE_LP;
-                               p[4].cmd = DTV_CODE_RATE_HP;
-                               p[5].cmd = DTV_MODULATION;
-                               p[6].cmd = DTV_TRANSMISSION_MODE;
-                               p[7].cmd = DTV_GUARD_INTERVAL;
-                               p[8].cmd = DTV_HIERARCHY;
-                               p[9].cmd = DTV_INVERSION;
-#if DVB_API_VERSION > 5 || DVB_API_VERSION == 5 && DVB_API_VERSION_MINOR >= 9
-                               p[10].cmd = DTV_STREAM_ID;
-                               cmdseq.num = 11;
-#elif DVB_API_VERSION > 5 || DVB_API_VERSION == 5 && DVB_API_VERSION_MINOR >= 3
-                               p[10].cmd = DTV_DVBT2_PLP_ID;
-                               cmdseq.num = 11;
-#else
-                               cmdseq.num = 10;
+
+               p[cmdseq.num++].cmd = DTV_DELIVERY_SYSTEM;
+               p[cmdseq.num++].cmd = DTV_FREQUENCY;
+               p[cmdseq.num++].cmd = DTV_INVERSION;
+               p[cmdseq.num++].cmd = DTV_MODULATION;
+               if(type == feSatellite)
+               {
+                       p[cmdseq.num++].cmd = DTV_SYMBOL_RATE;
+                       p[cmdseq.num++].cmd = DTV_INNER_FEC;
+                       p[cmdseq.num++].cmd = DTV_ROLLOFF;
+                       p[cmdseq.num++].cmd = DTV_PILOT;
+               }
+               else if(type == feCable)
+               {
+                       p[cmdseq.num++].cmd = DTV_SYMBOL_RATE;
+                       p[cmdseq.num++].cmd = DTV_INNER_FEC;
+               }
+               else if(type == feTerrestrial)
+               {
+                       p[cmdseq.num++].cmd = DTV_BANDWIDTH_HZ;
+                       p[cmdseq.num++].cmd = DTV_CODE_RATE_LP;
+                       p[cmdseq.num++].cmd = DTV_CODE_RATE_HP;
+                       p[cmdseq.num++].cmd = DTV_TRANSMISSION_MODE;
+                       p[cmdseq.num++].cmd = DTV_GUARD_INTERVAL;
+                       p[cmdseq.num++].cmd = DTV_HIERARCHY;
+#if defined DTV_STREAM_ID
+                       p[cmdseq.num++].cmd = DTV_STREAM_ID;
+#elif defined DTV_DVBT2_PLP_ID
+                       p[cmdseq.num++].cmd = DTV_DVBT2_PLP_ID;
 #endif
-                               break;
                }
-#endif
+
                if (m_simulate || m_fd == -1 || original)
                {
                        original = true;
                }
-#if HAVE_DVB_API_VERSION >= 5
                else if (ioctl(m_fd, FE_GET_PROPERTY, &cmdseq)<0)
                {
                        eDebug("FE_GET_PROPERTY failed (%m)");
@@ -1686,13 +1426,6 @@ void eDVBFrontend::getTransponderData(ePyObject dest, bool original)
                        eDebug("FE_GET_FRONTEND failed (%m)");
                        original = true;
                }
-#else
-               else if (ioctl(m_fd, FE_GET_FRONTEND, &front)<0)
-               {
-                       eDebug("FE_GET_FRONTEND failed (%m)");
-                       original = true;
-               }
-#endif
                if (original)
                {
                        switch(type)
@@ -1717,13 +1450,12 @@ void eDVBFrontend::getTransponderData(ePyObject dest, bool original)
                else
                {
                        FRONTENDPARAMETERS &parm = front;
-#if HAVE_DVB_API_VERSION >= 5
                        switch(type)
                        {
                                case feSatellite:
                                        eDVBFrontendParametersSatellite sparm;
                                        oparm.getDVBS(sparm);
-                                       fillDictWithSatelliteData(dest, parm, p, m_data[FREQ_OFFSET], sparm.orbital_position, sparm.polarisation);
+                                       fillDictWithSatelliteData(dest, p, m_data[FREQ_OFFSET], sparm.orbital_position, sparm.polarisation);
                                        break;
                                case feCable:
                                        fillDictWithCableData(dest, p);
@@ -1732,34 +1464,6 @@ void eDVBFrontend::getTransponderData(ePyObject dest, bool original)
                                        fillDictWithTerrestrialData(dest, p);
                                        break;
                        }
-#else
-                       long tmp = eDVBFrontendParametersSatellite::Inversion_Unknown;
-                       switch(parm_inversion & 3)
-                       {
-                               case INVERSION_ON:
-                                       tmp = eDVBFrontendParametersSatellite::Inversion_On;
-                                       break;
-                               case INVERSION_OFF:
-                                       tmp = eDVBFrontendParametersSatellite::Inversion_Off;
-                               default:
-                                       break;
-                       }
-                       PutToDict(dest, "inversion", tmp);
-                       switch(type)
-                       {
-                               eDVBFrontendParametersSatellite sparm;
-                               oparm.getDVBS(sparm);
-                               case feSatellite:
-                                       fillDictWithSatelliteData(dest, parm, m_data[FREQ_OFFSET], sparm.orbital_position, sparm.polarisation);
-                                       break;
-                               case feCable:
-                                       fillDictWithCableData(dest, parm);
-                                       break;
-                               case feTerrestrial:
-                                       fillDictWithTerrestrialData(dest, parm);
-                                       break;
-                       }
-#endif
                }
        }
 }
@@ -1775,7 +1479,7 @@ void eDVBFrontend::getFrontendData(ePyObject dest)
                {
                        tmp = "DVB-S";
                }
-#if DVB_API_VERSION > 5 || DVB_API_VERSION == 5 && DVB_API_VERSION_MINOR >= 6
+#if defined SYS_DVBC_ANNEX_A
                else if (supportsDeliverySystem(SYS_DVBC_ANNEX_A, true))
 #else
                else if (supportsDeliverySystem(SYS_DVBC_ANNEX_AC, true))
@@ -2257,7 +1961,6 @@ void eDVBFrontend::setFrontend(bool recvEvents)
                if (recvEvents)
                        m_sn->start();
                feEvent(-1); // flush events
-#if HAVE_DVB_API_VERSION >= 5
                if (type == iDVBFrontend::feSatellite)
                {
                        fe_rolloff_t rolloff = ROLLOFF_35;
@@ -2323,7 +2026,7 @@ void eDVBFrontend::setFrontend(bool recvEvents)
                        struct dtv_properties cmdseq;
                        cmdseq.props = p;
                        p[0].cmd = DTV_CLEAR;
-#if DVB_API_VERSION > 5 || DVB_API_VERSION == 5 && DVB_API_VERSION_MINOR >= 6
+#if defined SYS_DVBC_ANNEX_A
                        p[1].cmd = DTV_DELIVERY_SYSTEM, p[1].u.data = SYS_DVBC_ANNEX_A;
 #else
                        p[1].cmd = DTV_DELIVERY_SYSTEM, p[1].u.data = SYS_DVBC_ANNEX_AC;
@@ -2379,9 +2082,9 @@ void eDVBFrontend::setFrontend(bool recvEvents)
                        p[cmdseq.num].cmd = DTV_HIERARCHY,      p[cmdseq.num].u.data = parm_u_ofdm_hierarchy_information, cmdseq.num++;
                        p[cmdseq.num].cmd = DTV_BANDWIDTH_HZ,   p[cmdseq.num].u.data = bandwidth, cmdseq.num++;
                        p[cmdseq.num].cmd = DTV_INVERSION,      p[cmdseq.num].u.data = parm_inversion, cmdseq.num++;
-#if DVB_API_VERSION > 5 || DVB_API_VERSION == 5 && DVB_API_VERSION_MINOR >= 9
+#if defined DTV_STREAM_ID
                        p[cmdseq.num].cmd = DTV_STREAM_ID       ,       p[cmdseq.num].u.data = tparm.plpid, cmdseq.num++;
-#elif DVB_API_VERSION > 5 || DVB_API_VERSION == 5 && DVB_API_VERSION_MINOR >= 3
+#elif defined DTV_DVBT2_PLP_ID
                        p[cmdseq.num].cmd = DTV_DVBT2_PLP_ID    ,       p[cmdseq.num].u.data = tparm.plpid, cmdseq.num++;
 #endif
                        p[cmdseq.num].cmd = DTV_TUNE, cmdseq.num++;
@@ -2392,7 +2095,6 @@ void eDVBFrontend::setFrontend(bool recvEvents)
                        }
                }
                else
-#endif /* HAVE_DVB_API_VERSION >= 5 */
                {
                        if (ioctl(m_fd, FE_SET_FRONTEND, &parm) == -1)
                        {
@@ -2414,7 +2116,6 @@ RESULT eDVBFrontend::prepare_sat(const eDVBFrontendParametersSatellite &feparm,
        res = m_sec->prepare(*this, parm, feparm, 1 << m_slotid, tunetimeout);
        if (!res)
        {
-#if HAVE_DVB_API_VERSION >= 3
                eDebugNoSimulate("prepare_sat System %d Freq %d Pol %d SR %d INV %d FEC %d orbpos %d system %d modulation %d pilot %d, rolloff %d",
                        feparm.system,
                        feparm.frequency,
@@ -2427,16 +2128,6 @@ RESULT eDVBFrontend::prepare_sat(const eDVBFrontendParametersSatellite &feparm,
                        feparm.modulation,
                        feparm.pilot,
                        feparm.rolloff);
-#else
-               eDebugNoSimulate("prepare_sat System %d Freq %d Pol %d SR %d INV %d FEC %d orbpos %d",
-                       feparm.system,
-                       feparm.frequency,
-                       feparm.polarisation,
-                       feparm.symbol_rate,
-                       feparm.inversion,
-                       feparm.fec,
-                       feparm.orbital_position);
-#endif
                parm_u_qpsk_symbol_rate = feparm.symbol_rate;
                switch (feparm.inversion)
                {
@@ -2480,7 +2171,6 @@ RESULT eDVBFrontend::prepare_sat(const eDVBFrontendParametersSatellite &feparm,
                                        break;
                        }
                }
-#if HAVE_DVB_API_VERSION >= 3
                else // DVB_S2
                {
                        switch (feparm.fec)
@@ -2516,17 +2206,7 @@ RESULT eDVBFrontend::prepare_sat(const eDVBFrontendParametersSatellite &feparm,
                                        eDebugNoSimulate("no valid fec for DVB-S2 set.. abort !!");
                                        return -EINVAL;
                        }
-#if HAVE_DVB_API_VERSION < 5
-                       parm_inversion = (fe_spectral_inversion_t)((feparm.rolloff << 2) | parm_inversion); // Hack.. we use bit 2..3 of inversion param for rolloff
-                       parm_inversion = (fe_spectral_inversion_t)((feparm.pilot << 4) | parm_inversion); // Hack.. we use bit 4..5 of inversion param for pilot
-                       if (feparm.modulation == eDVBFrontendParametersSatellite::Modulation_8PSK) 
-                       {
-                               parm_u_qpsk_fec_inner = (fe_code_rate_t)((int)parm_u_qpsk_fec_inner+9);
-                               // 8PSK fec driver values are decimal 9 bigger
-                       }
-#endif
                }
-#endif
                // FIXME !!! get frequency range from tuner
                if ( parm_frequency < 900000 || parm_frequency > 2200000 )
                {
@@ -2541,11 +2221,7 @@ RESULT eDVBFrontend::prepare_sat(const eDVBFrontendParametersSatellite &feparm,
 
 RESULT eDVBFrontend::prepare_cable(const eDVBFrontendParametersCable &feparm)
 {
-#if HAVE_DVB_API_VERSION < 3
-       parm_frequency = feparm.frequency;
-#else
        parm_frequency = feparm.frequency * 1000;
-#endif
        parm_u_qam_symbol_rate = feparm.symbol_rate;
        switch (feparm.modulation)
        {
@@ -2602,11 +2278,9 @@ RESULT eDVBFrontend::prepare_cable(const eDVBFrontendParametersCable &feparm)
        case eDVBFrontendParametersCable::FEC_7_8:
                parm_u_qam_fec_inner = FEC_7_8;
                break;
-#if HAVE_DVB_API_VERSION >= 3
        case eDVBFrontendParametersCable::FEC_8_9:
                parm_u_qam_fec_inner = FEC_8_9;
                break;
-#endif
        default:
        case eDVBFrontendParametersCable::FEC_Auto:
                parm_u_qam_fec_inner = FEC_AUTO;
@@ -2969,12 +2643,8 @@ RESULT eDVBFrontend::connectStateChange(const Slot1<void,iDVBFrontend*> &stateCh
 
 RESULT eDVBFrontend::setVoltage(int voltage)
 {
-#if HAVE_DVB_API_VERSION < 3
-       secVoltage vlt;
-#else
        bool increased=false;
        fe_sec_voltage_t vlt;
-#endif
        m_data[CUR_VOLTAGE]=voltage;
        switch (voltage)
        {
@@ -2983,22 +2653,12 @@ RESULT eDVBFrontend::setVoltage(int voltage)
                vlt = SEC_VOLTAGE_OFF;
                break;
        case voltage13_5:
-#if HAVE_DVB_API_VERSION < 3
-               vlt = SEC_VOLTAGE_13_5;
-               break;
-#else
                increased = true;
-#endif
        case voltage13:
                vlt = SEC_VOLTAGE_13;
                break;
        case voltage18_5:
-#if HAVE_DVB_API_VERSION < 3
-               vlt = SEC_VOLTAGE_18_5;
-               break;
-#else
                increased = true;
-#endif
        case voltage18:
                vlt = SEC_VOLTAGE_18;
                break;
@@ -3007,12 +2667,9 @@ RESULT eDVBFrontend::setVoltage(int voltage)
        }
        if (m_simulate)
                return 0;
-#if HAVE_DVB_API_VERSION < 3
-       return ::ioctl(m_secfd, SEC_SET_VOLTAGE, vlt);
-#else
+
        ::ioctl(m_fd, FE_ENABLE_HIGH_LNB_VOLTAGE, increased);
        return ::ioctl(m_fd, FE_SET_VOLTAGE, vlt);
-#endif
 }
 
 RESULT eDVBFrontend::getState(int &state)
@@ -3023,11 +2680,7 @@ RESULT eDVBFrontend::getState(int &state)
 
 RESULT eDVBFrontend::setTone(int t)
 {
-#if HAVE_DVB_API_VERSION < 3
-       secToneMode_t tone;
-#else
        fe_sec_tone_mode_t tone;
-#endif
        m_data[CUR_TONE]=t;
        switch (t)
        {
@@ -3042,64 +2695,34 @@ RESULT eDVBFrontend::setTone(int t)
        }
        if (m_simulate)
                return 0;
-#if HAVE_DVB_API_VERSION < 3   
-       return ::ioctl(m_secfd, SEC_SET_TONE, tone);
-#else  
+       
        return ::ioctl(m_fd, FE_SET_TONE, tone);
-#endif
 }
 
-#if HAVE_DVB_API_VERSION < 3 && !defined(SEC_DISEQC_SEND_MASTER_CMD)
-       #define SEC_DISEQC_SEND_MASTER_CMD _IOW('o', 97, struct secCommand *)
-#endif
-
 RESULT eDVBFrontend::sendDiseqc(const eDVBDiseqcCommand &diseqc)
 {
        if (m_simulate)
                return 0;
 
-#if HAVE_DVB_API_VERSION < 3
-       struct secCommand cmd;
-       cmd.type = SEC_CMDTYPE_DISEQC_RAW;
-       cmd.u.diseqc.cmdtype = diseqc.data[0];
-       cmd.u.diseqc.addr = diseqc.data[1];
-       cmd.u.diseqc.cmd = diseqc.data[2];
-       cmd.u.diseqc.numParams = diseqc.len-3;
-       memcpy(cmd.u.diseqc.params, diseqc.data+3, diseqc.len-3);
-       if (::ioctl(m_secfd, SEC_DISEQC_SEND_MASTER_CMD, &cmd))
-#else
        struct dvb_diseqc_master_cmd cmd;
        memcpy(cmd.msg, diseqc.data, diseqc.len);
        cmd.msg_len = diseqc.len;
        if (::ioctl(m_fd, FE_DISEQC_SEND_MASTER_CMD, &cmd))
-#endif
                return -EINVAL;
        return 0;
 }
 
-#if HAVE_DVB_API_VERSION < 3 && !defined(SEC_DISEQC_SEND_BURST)
-       #define SEC_DISEQC_SEND_BURST _IO('o', 96)
-#endif
 RESULT eDVBFrontend::sendToneburst(int burst)
 {
        if (m_simulate)
                return 0;
-#if HAVE_DVB_API_VERSION < 3
-       secMiniCmd cmd = SEC_MINI_NONE;
-#else
        fe_sec_mini_cmd_t cmd = SEC_MINI_A;
-#endif
        if ( burst == eDVBSatelliteDiseqcParameters::A )
                cmd = SEC_MINI_A;
        else if ( burst == eDVBSatelliteDiseqcParameters::B )
                cmd = SEC_MINI_B;
-#if HAVE_DVB_API_VERSION < 3
-       if (::ioctl(m_secfd, SEC_DISEQC_SEND_BURST, cmd))
-               return -EINVAL;
-#else
        if (::ioctl(m_fd, FE_DISEQC_SEND_BURST, cmd))
                return -EINVAL;
-#endif
        return 0;
 }
 
@@ -3198,17 +2821,14 @@ int eDVBFrontend::isCompatibleWith(ePtr<iDVBFrontendParameters> &feparm)
                {
                        return 0;
                }
-#if DVB_API_VERSION > 5 || DVB_API_VERSION == 5 && DVB_API_VERSION_MINOR >= 6
+#if defined SYS_DVBC_ANNEX_A
                if (!supportsDeliverySystem(SYS_DVBC_ANNEX_A, true))
-               {
-                       return 0;
-               }
 #else
                if (!supportsDeliverySystem(SYS_DVBC_ANNEX_AC, true))
+#endif
                {
                        return 0;
                }
-#endif
                score = 2;
        }
 
index c7eb149..6a8c39d 100644 (file)
@@ -87,10 +87,6 @@ private:
        std::map<fe_delivery_system_t, bool> m_delsys, m_delsys_whitelist;
        char m_filename[128];
        char m_description[128];
-#if HAVE_DVB_API_VERSION < 3
-       int m_secfd;
-       char m_sec_filename[128];
-#endif
        FRONTENDPARAMETERS parm;
        eDVBFrontendParameters oparm;
 
index 0bae247..c4989fb 100644 (file)
@@ -3,9 +3,9 @@
 
 #include <lib/python/swig.h>
 
-class SatelliteDeliverySystemDescriptor;
-class CableDeliverySystemDescriptor;
-class TerrestrialDeliverySystemDescriptor;
+#include <dvbsi++/satellite_delivery_system_descriptor.h>
+#include <dvbsi++/cable_delivery_system_descriptor.h>
+#include <dvbsi++/terrestrial_delivery_system_descriptor.h>
 
 struct eDVBFrontendParametersSatellite
 {
@@ -120,4 +120,4 @@ struct eDVBFrontendParametersTerrestrial
 };
 SWIG_ALLOW_OUTPUT_SIMPLE(eDVBFrontendParametersTerrestrial);
 
-#endif
+#endif /* __lib_dvb_frontendparms_h */
index bc444b3..8d5d471 100644 (file)
@@ -3,14 +3,9 @@
 
 #ifndef SWIG
 
-#if HAVE_DVB_API_VERSION < 3
-#include <ost/frontend.h>
-#define FRONTENDPARAMETERS FrontendParameters
-#else
 #include <linux/dvb/frontend.h>
 #include <linux/dvb/video.h>
 #define FRONTENDPARAMETERS struct dvb_frontend_parameters
-#endif
 #include <lib/dvb/frontendparms.h>
 #include <lib/base/object.h>
 #include <lib/base/ebase.h>
@@ -427,10 +422,6 @@ public:
 #endif
        int len;
        __u8 data[MAX_DISEQC_LENGTH];
-#if HAVE_DVB_API_VERSION < 3
-       int tone;
-       int voltage;
-#endif
 #ifdef SWIG
 public:
 #endif
@@ -639,11 +630,6 @@ public:
        virtual int getSource()=0;
 };
 
-#if HAVE_DVB_API_VERSION < 3 && !defined(VIDEO_EVENT_SIZE_CHANGED)
-#define VIDEO_EVENT_SIZE_CHANGED 1
-#define VIDEO_EVENT_FRAME_RATE_CHANGED 2
-#endif
-
 class iTSMPEGDecoder: public iObject
 {
 public:
index fce2520..335c8b1 100644 (file)
@@ -2,15 +2,8 @@
 #include <lib/dvb/sec.h>
 #include <lib/dvb/rotor_calc.h>
 #include <lib/dvb/dvbtime.h>
-
-#include <set>
-
-#if HAVE_DVB_API_VERSION < 3
-#define FREQUENCY Frequency
-#else
-#define FREQUENCY frequency
-#endif
 #include <lib/base/eerror.h>
+#include <set>
 
 //#define SEC_DEBUG
 
@@ -373,8 +366,8 @@ RESULT eDVBSatelliteEquipmentControl::prepare(iDVBFrontend &frontend, FRONTENDPA
                                // calc Frequency
                                int local= abs(sat.frequency
                                        - lof);
-                               parm.FREQUENCY = ((((local * 2) / 125) + 1) / 2) * 125;
-                               frontend.setData(eDVBFrontend::FREQ_OFFSET, sat.frequency - parm.FREQUENCY);
+                               parm.frequency = ((((local * 2) / 125) + 1) / 2) * 125;
+                               frontend.setData(eDVBFrontend::FREQ_OFFSET, sat.frequency - parm.frequency);
 
                                if ( voltage_mode == eDVBSatelliteSwitchParameters::_14V
                                        || ( sat.polarisation & eDVBFrontendParametersSatellite::Polarisation_Vertical
@@ -403,8 +396,8 @@ RESULT eDVBSatelliteEquipmentControl::prepare(iDVBFrontend &frontend, FRONTENDPA
                                                                -lof)
                                                                - 100000;
                                                        volatile unsigned int tmp2 = (1000 + 2 * tmp1) / (2 *1000); //round to multiple of 1000
-                                                       parm.FREQUENCY = lnb_param.SatCRvco - (tmp1 - (1000 * tmp2));
-                                                       frontend.setData(eDVBFrontend::FREQ_OFFSET, sat.frequency - lof -(lnb_param.SatCRvco - parm.FREQUENCY));
+                                                       parm.frequency = lnb_param.SatCRvco - (tmp1 - (1000 * tmp2));
+                                                       frontend.setData(eDVBFrontend::FREQ_OFFSET, sat.frequency - lof -(lnb_param.SatCRvco - parm.frequency));
 
                                                        lnb_param.UnicableTuningWord =
                                                                  (band & 0x3)                                          //Bit0:HighLow  Bit1:VertHor
@@ -426,7 +419,7 @@ RESULT eDVBSatelliteEquipmentControl::prepare(iDVBFrontend &frontend, FRONTENDPA
                                                                + lnb_param.guard_offset;
                                                        volatile unsigned int tmp2 = (4000 + 2 * tmp1) / (2 *4000); //round to multiple of 4000
 
-                                                       parm.FREQUENCY = lnb_param.SatCRvco - (tmp1 - (4000 * tmp2)) + lnb_param.guard_offset;
+                                                       parm.frequency = lnb_param.SatCRvco - (tmp1 - (4000 * tmp2)) + lnb_param.guard_offset;
                                                        lnb_param.UnicableTuningWord = tmp2
                                                                | ((band & 1) ? 0x400 : 0)                      //HighLow
                                                                | ((band & 2) ? 0x800 : 0)                      //VertHor
index 6409dba..b59afb9 100644 (file)
@@ -5,17 +5,10 @@
 #include <sys/ioctl.h>
 #include <unistd.h>
 
-#if HAVE_DVB_API_VERSION < 3
-#define VIDEO_DEV "/dev/dvb/card0/video0"
-#define AUDIO_DEV "/dev/dvb/card0/audio0"
-#include <ost/audio.h>
-#include <ost/video.h>
-#else
 #define VIDEO_DEV "/dev/dvb/adapter0/video0"
 #define AUDIO_DEV "/dev/dvb/adapter0/audio0"
 #include <linux/dvb/audio.h>
 #include <linux/dvb/video.h>
-#endif
 
 eDVBVolumecontrol* eDVBVolumecontrol::instance = NULL;
 
@@ -72,33 +65,18 @@ void eDVBVolumecontrol::setVolume(int left, int right)
        right = 63 - rightVol * 63 / 100;
                /* now range is 63..0, where 0 is loudest */
 
-#if HAVE_DVB_API_VERSION < 3
-       audioMixer_t mixer;
-#else
        audio_mixer_t mixer;
-#endif
 
-#if HAVE_DVB_API_VERSION < 3
-               /* convert to linear scale. 0 = loudest, ..63 */
-       mixer.volume_left = 63.0-pow(1.068241, 63-left);
-       mixer.volume_right = 63.0-pow(1.068241, 63-right);
-#else
        mixer.volume_left = left;
        mixer.volume_right = right;
-#endif
 
        eDebug("Setvolume: %d %d (raw)", leftVol, rightVol);
        eDebug("Setvolume: %d %d (-1db)", left, right);
-#if HAVE_DVB_API_VERSION < 3
-       eDebug("Setvolume: %d %d (lin)", mixer.volume_left, mixer.volume_right);
-#endif
 
        int fd = openMixer();
        if (fd >= 0)
        {
-#ifdef HAVE_DVB_API_VERSION
                ioctl(fd, AUDIO_SET_MIXER, &mixer);
-#endif
                closeMixer(fd);
                return;
        }
@@ -129,9 +107,7 @@ bool eDVBVolumecontrol::isMuted()
 void eDVBVolumecontrol::volumeMute()
 {
        int fd = openMixer();
-#ifdef HAVE_DVB_API_VERSION    
        ioctl(fd, AUDIO_SET_MUTE, true);
-#endif
        closeMixer(fd);
        muted = true;
 
@@ -150,9 +126,7 @@ void eDVBVolumecontrol::volumeMute()
 void eDVBVolumecontrol::volumeUnMute()
 {
        int fd = openMixer();
-#ifdef HAVE_DVB_API_VERSION
        ioctl(fd, AUDIO_SET_MUTE, false);
-#endif
        closeMixer(fd);
        muted = false;
 
index 985f757..cd80571 100644 (file)
@@ -7,30 +7,5 @@ if test "$DVBINCLUDES"; then
        CPPFLAGS="$CPPFLAGS -I$DVBINCLUDES"
 fi
 
-AC_CHECK_HEADERS(ost/dmx.h,[
-       DVB_API_VERSION=1
-       AC_MSG_NOTICE([found dvb version 1])
-])
-
-if test -z "$DVB_API_VERSION"; then
-AC_CHECK_HEADERS(linux/dvb/version.h,[
-       AC_LANG_PREPROC_REQUIRE()
-       AC_REQUIRE([AC_PROG_EGREP])
-       AC_LANG_CONFTEST([AC_LANG_SOURCE([[
-#include <linux/dvb/version.h>
-version DVB_API_VERSION
-       ]])])
-       DVB_API_VERSION=`(eval "$ac_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD | $EGREP "^version" | sed "s,version\ ,,"`
-       rm -f conftest*
-
-       AC_MSG_NOTICE([found dvb version $DVB_API_VERSION])
-])
-fi
-
-if test "$DVB_API_VERSION"; then
-       AC_DEFINE(HAVE_DVB,1,[Define to 1 if you have the dvb includes])
-       AC_DEFINE_UNQUOTED(HAVE_DVB_API_VERSION,$DVB_API_VERSION,[Define to the version of the dvb api])
-else
-       AC_MSG_ERROR([can't find dvb headers])
-fi
+AC_CHECK_HEADERS_ONCE(linux/dvb/version.h)
 ])