Ticket #9595: move_rec2_to_v4l2.patch

File move_rec2_to_v4l2.patch, 20.9 KB (added by warped <warpme@…>, 9 years ago)

v4l2 patch for rec2 branch

  • mythtv/configure

    diff -Naur mythtv-rec2-20110515-old/mythtv/configure mythtv-rec2-20110515-new/mythtv/configure
    old new  
    109109  --disable-iptv           disable support for recording RTSP/UDP/RTP streams
    110110  --disable-hdhomerun      disable support for HDHomeRun boxes
    111111  --disable-v4l            disable Video4Linux support
    112   --disable-ivtv           disable ivtv support (PVR-x50) req. v4l support
     112  --disable-v4l2           disable Video4Linux2 support
     113  --disable-ivtv           disable ivtv support (PVR-x50) req. v4l2 support
    113114  --disable-hdpvr          disable HD-PVR support
    114115  --disable-dvb            disable DVB support
    115116  --dvb-path=HDRLOC        location of directory containing
     
    13601361    qtwebkit
    13611362    quartz_video
    13621363    v4l
     1364    v4l2
    13631365    valgrind
    13641366    x11
    13651367    xrandr
     
    17651767dvb_deps="backend"
    17661768firewire_deps="backend"
    17671769iptv_deps="backend"
    1768 ivtv_deps="backend v4l"
    1769 hdpvr_deps="backend v4l"
     1770ivtv_deps="backend v4l2"
     1771hdpvr_deps="backend v4l2"
    17701772hdhomerun_deps="backend"
    17711773mpegtsraw_demuxer_deps="merge_libavformat_mpegts_c"
    17721774mythtranscode_deps="backend frontend"
     
    17741776opengles_deps="GLES2_gl2_h"
    17751777opengl_video_deps="opengl"
    17761778v4l_deps="backend linux_videodev_h linux_videodev2_h"
     1779v4l2_deps="backend linux_videodev2_h"
    17771780vdpau_deps="opengl vdpau_vdpau_h vdpau_vdpau_x11_h"
    17781781xrandr_deps="x11"
    17791782xv_deps="x11"
     
    19982001enable quartz_video
    19992002enable symbol_visibility
    20002003enable v4l
     2004enable v4l2
    20012005enable x11
    20022006enable xrandr
    20032007enable xv
     
    31253129            enable disable_mmx_for_debugging   # prevent later call to die
    31263130        fi
    31273131        disable v4l
     3132        disable v4l2
    31283133        disable x11
    31293134        # Workaround compile errors from missing gmtime_r/localtime_r/uint def
    31303135        CFLAGS=`echo $CFLAGS | sed 's/-D_POSIX_C_SOURCE=200112//'`
     
    31703175        fi
    31713176        disable symver
    31723177        disable v4l
     3178        disable v4l2
    31733179        enable  windows
    31743180        disable x11
    31753181        ###### Standard ffmpeg configure stuff follows:
     
    44514457
    44524458if enabled backend; then
    44534459  echo "Video4Linux sup.          ${v4l-no}"
     4460  echo "Video4Linux2 sup.         ${v4l2-no}"
    44544461  echo "ivtv support              ${ivtv-no}"
    44554462  echo "HD-PVR support            ${hdpvr-no}"
    44564463  echo "FireWire support          ${firewire-no}"
  • mythtv/libs/libmythtv/analogsignalmonitor.cpp

    diff -Naur mythtv-rec2-20110515-old/mythtv/libs/libmythtv/analogsignalmonitor.cpp mythtv-rec2-20110515-new/mythtv/libs/libmythtv/analogsignalmonitor.cpp
    old new  
    66#include <sys/ioctl.h>
    77#include <poll.h>
    88
     9#if defined(USING_V4L) || defined(USING_V4L2)
     10#ifdef USING_V4L
    911#include <linux/videodev.h>
     12#endif
     13#ifdef USING_V4L2
     14#include <linux/videodev2.h>
     15#endif
     16
    1017
    1118#include "mythverbose.h"
    1219#include "analogsignalmonitor.h"
     
    161168    }
    162169    else
    163170    {
     171#if defined(USING_V4L) || defined(USING_V4L2)
    164172        struct video_tuner tuner;
    165173        memset(&tuner, 0, sizeof(tuner));
    166174
     
    173181        {
    174182            isLocked = tuner.signal;
    175183        }
     184#endif // USING_V4L || USING_V4L
    176185    }
    177186
    178187    {
  • mythtv/libs/libmythtv/cardutil.cpp

    diff -Naur mythtv-rec2-20110515-old/mythtv/libs/libmythtv/cardutil.cpp mythtv-rec2-20110515-new/mythtv/libs/libmythtv/cardutil.cpp
    old new  
    44
    55#include <algorithm>
    66
    7 #if defined(USING_V4L) || defined(USING_DVB)
     7#if defined(USING_V4L) || defined(USING_V4L2) || defined(USING_DVB)
    88#include <sys/ioctl.h>
    99#endif
    1010
     
    2828
    2929#ifdef USING_V4L
    3030#include <linux/videodev.h>
     31#endif
     32#ifdef USING_V4L2
    3133#include <linux/videodev2.h>
    3234#endif
    3335
     
    15451547bool CardUtil::hasV4L2(int videofd)
    15461548{
    15471549    (void) videofd;
    1548 #ifdef USING_V4L
     1550#ifdef USING_V4L2
    15491551    struct v4l2_capability vcap;
    15501552    memset(&vcap, 0, sizeof(vcap));
    15511553
    15521554    return ((ioctl(videofd, VIDIOC_QUERYCAP, &vcap) >= 0) &&
    15531555            (vcap.capabilities & V4L2_CAP_VIDEO_CAPTURE));
    1554 #else // if !USING_V4L
     1556#else // if !USING_V4L2
    15551557    return false;
    1556 #endif // !USING_V4L
     1558#endif // !USING_V4L2
    15571559}
    15581560
    15591561bool CardUtil::GetV4LInfo(
     
    15671569    if (videofd < 0)
    15681570        return false;
    15691571
    1570 #ifdef USING_V4L
     1572#if defined(USING_V4L) || defined(USING_V4L2)
    15711573    // First try V4L2 query
    15721574    struct v4l2_capability capability;
    15731575    memset(&capability, 0, sizeof(struct v4l2_capability));
     
    15801582    }
    15811583    else // Fallback to V4L1 query
    15821584    {
     1585#ifdef USING_V4L
    15831586        struct video_capability capability;
    15841587        if (ioctl(videofd, VIDIOCGCAP, &capability) >= 0)
    15851588            card = QString::fromAscii((const char*)capability.name);
     1589#endif //USING_V4L
    15861590    }
    1587 #endif // !USING_V4L
     1591#endif // !USING_V4L || USING_V4L2
    15881592
    15891593    if (!driver.isEmpty())
    15901594        driver.remove( QRegExp("\\[[0-9]\\]$") );
     
    15991603    InputNames list;
    16001604    ok = false;
    16011605
    1602 #ifdef USING_V4L
     1606#if defined(USING_V4L) || defined(USING_V4L2)
    16031607    bool usingv4l2 = hasV4L2(videofd);
    1604 
     1608#ifdef USING_V4L2
    16051609    // V4L v2 query
    16061610    struct v4l2_input vin;
    16071611    memset(&vin, 0, sizeof(vin));
     
    16161620        ok = true;
    16171621        return list;
    16181622    }
     1623#endif
    16191624
    16201625    // V4L v1 query
     1626#ifdef USING_V4L
    16211627    struct video_capability vidcap;
    16221628    memset(&vidcap, 0, sizeof(vidcap));
    16231629    if (ioctl(videofd, VIDIOCGCAP, &vidcap) != 0)
     
    16451651
    16461652        list[i] = test.name;
    16471653    }
    1648 
     1654#endif
    16491655    // Create an input on single input cards that don't advertise input
    16501656    if (!list.size())
    16511657        list[0] = "Television";
    16521658
    16531659    ok = true;
    1654 #else // if !USING_V4L
     1660#else // if !USING_V4L || USING_V4L2
    16551661    list[-1] += QObject::tr("ERROR, Compile with V4L support to query inputs");
    1656 #endif // !USING_V4L
     1662#endif // !USING_V4L || USING_V4L2
    16571663    return list;
    16581664}
    16591665
  • mythtv/libs/libmythtv/channelscan/channelscanner.cpp

    diff -Naur mythtv-rec2-20110515-old/mythtv/libs/libmythtv/channelscan/channelscanner.cpp mythtv-rec2-20110515-new/mythtv/libs/libmythtv/channelscan/channelscanner.cpp
    old new  
    350350        channel = new DVBChannel(device);
    351351#endif
    352352
    353 #ifdef USING_V4L
     353#if defined(USING_V4L) || defined(USING_V4L2)
    354354    if (("V4L" == card_type) || ("MPEG" == card_type))
    355355        channel = new V4LChannel(NULL, device);
    356356#endif
  • mythtv/libs/libmythtv/channelscan/channelscan_sm.cpp

    diff -Naur mythtv-rec2-20110515-old/mythtv/libs/libmythtv/channelscan/channelscan_sm.cpp mythtv-rec2-20110515-new/mythtv/libs/libmythtv/channelscan/channelscan_sm.cpp
    old new  
    14021402
    14031403V4LChannel *ChannelScanSM::GetV4LChannel(void)
    14041404{
    1405 #ifdef USING_V4L
     1405#if defined(USING_V4L) || defined(USING_V4L2)
    14061406    return dynamic_cast<V4LChannel*>(channel);
    14071407#else
    14081408    return NULL;
  • mythtv/libs/libmythtv/libmythtv.pro

    diff -Naur mythtv-rec2-20110515-old/mythtv/libs/libmythtv/libmythtv.pro mythtv-rec2-20110515-new/mythtv/libs/libmythtv/libmythtv.pro
    old new  
    112112using_valgrind:DEFINES += USING_VALGRIND
    113113
    114114# old libvbitext (Caption decoder)
    115 using_v4l {
     115using_v4l || using_v4l2 {
    116116    HEADERS += vbitext/cc.h vbitext/dllist.h vbitext/hamm.h vbitext/lang.h
    117117    HEADERS += vbitext/vbi.h vbitext/vt.h
    118118    SOURCES += vbitext/cc.cpp vbitext/vbi.c vbitext/hamm.c vbitext/lang.c
     
    486486    }
    487487
    488488    # Support for Video4Linux devices
    489     using_v4l {
     489    using_v4l || using_v4l2 {
    490490        HEADERS += v4lchannel.h                analogsignalmonitor.h
    491491        HEADERS += v4lrecorder.h
    492492        SOURCES += v4lchannel.cpp              analogsignalmonitor.cpp
    493493        SOURCES += v4lrecorder.cpp
    494494
    495         DEFINES += USING_V4L
     495        using_v4l {
     496            DEFINES += USING_V4L
     497        }
     498
     499        using_v4l2 {
     500            DEFINES += USING_V4L2
     501        }
    496502    }
    497503
    498504    # Support for cable boxes that provide Firewire out
  • mythtv/libs/libmythtv/NuppelVideoRecorder.cpp

    diff -Naur mythtv-rec2-20110515-old/mythtv/libs/libmythtv/NuppelVideoRecorder.cpp mythtv-rec2-20110515-new/mythtv/libs/libmythtv/NuppelVideoRecorder.cpp
    old new  
    4343#include "libswscale/swscale.h"
    4444}
    4545
     46#if defined(USING_V4L) || defined(USING_V4L2)
    4647#ifdef USING_V4L
    4748#include <linux/videodev.h>
     49#endif
     50#ifdef USING_V4L2
    4851#include <linux/videodev2.h>
     52#endif
    4953
    5054#include "go7007_myth.h"
    5155
     
    5357#include "videodev_mjpeg.h"
    5458#endif
    5559
    56 #else  // USING_V4l
     60#else  // USING_V4l || USING_V4L2
    5761#define VT_WIDTH 0
    58 #endif // USING_V4l
     62#endif // USING_V4l || USING_V4L2
    5963
    6064#define KEYFRAMEDIST   30
    6165
     
    838842 */
    839843bool NuppelVideoRecorder::MJPEGInit(void)
    840844{
    841 #ifdef USING_V4L
     845#if defined(USING_V4L) || defined(USING_V4L2)
    842846    bool we_opened_fd = false;
    843847    int init_fd = fd;
    844848    if (init_fd < 0)
     
    880884            hmjpg_maxw = 640;
    881885        return true;
    882886    }
    883 #endif // USING_V4L
     887#endif // USING_V4L || USING_V4L2
    884888
    885889    VERBOSE(VB_IMPORTANT, LOC_ERR + "MJPEG not supported by device");
    886890    return false;
     
    10291033
    10301034void NuppelVideoRecorder::ProbeV4L2(void)
    10311035{
    1032 #ifdef USING_V4L
     1036#if defined(USING_V4L) || defined(USING_V4L2)
    10331037    usingv4l2 = true;
    10341038
    10351039    struct v4l2_capability vcap;
     
    10591063    QString driver = (char *)vcap.driver;
    10601064    if (driver == "go7007")
    10611065        go7007 = true;
    1062 #endif // USING_V4L
     1066#endif // USING_V4L || USING_V4L2
    10631067}
    10641068
    10651069void NuppelVideoRecorder::StartRecording(void)
     
    11441148        DoV4L();
    11451149}
    11461150
    1147 #ifdef USING_V4L
     1151#if defined(USING_V4L) || defined(USING_V4L2)
    11481152void NuppelVideoRecorder::DoV4L(void)
    11491153{
    11501154    struct video_capability vc;
     
    18811885    close(fd);
    18821886}
    18831887
    1884 #else  // USING_V4L
     1888#else  // USING_V4L || USING_V4L2
    18851889void NuppelVideoRecorder::DoV4L(void)         {}
    18861890bool NuppelVideoRecorder::SetFormatV4L2(void) { return false; }
    18871891void NuppelVideoRecorder::DoV4L2(void)        {}
    18881892void NuppelVideoRecorder::DoMJPEG(void)       {}
    1889 #endif // USING_V4L
     1893#endif // USING_V4L || USING_V4L2
    18901894
    18911895bool NuppelVideoRecorder::SpawnChildren(void)
    18921896{
     
    24602464        audio_device->Close();
    24612465}
    24622466
    2463 #ifdef USING_V4L
     2467#if defined(USING_V4L) || defined(USING_V4L2)
    24642468void NuppelVideoRecorder::FormatTT(struct VBIData *vbidata)
    24652469{
    24662470    struct timeval tnow;
     
    26272631        act_text_buffer = 0;
    26282632    textbuffer[act]->freeToEncode = 1;
    26292633}
    2630 #else  // USING_V4L
     2634#else  // USING_V4L || USING_V4L2
    26312635void NuppelVideoRecorder::FormatTeletextSubtitles(struct VBIData *vbidata) {}
    2632 #endif // USING_V4L
     2636#endif // USING_V4L || USING_V4L2
    26332637
    26342638void NuppelVideoRecorder::FormatCC(struct cc *cc)
    26352639{
  • mythtv/libs/libmythtv/recorderbase.cpp

    diff -Naur mythtv-rec2-20110515-old/mythtv/libs/libmythtv/recorderbase.cpp mythtv-rec2-20110515-new/mythtv/libs/libmythtv/recorderbase.cpp
    old new  
    547547    }
    548548    else if (CardUtil::IsV4L(genOpt.cardtype))
    549549    {
    550 #ifdef USING_V4L
     550#if defined(USING_V4L) || defined(USING_V4L2)
    551551        // V4L/MJPEG/GO7007 from here on
    552552        recorder = new NuppelVideoRecorder(tvrec, channel);
    553553        recorder->SetOption("skipbtaudio", genOpt.skip_btaudio);
    554 #endif // USING_V4L
     554#endif // USING_V4L || USING_V4L
    555555    }
    556556
    557557    if (recorder)
  • mythtv/libs/libmythtv/signalmonitor.cpp

    diff -Naur mythtv-rec2-20110515-old/mythtv/libs/libmythtv/signalmonitor.cpp mythtv-rec2-20110515-new/mythtv/libs/libmythtv/signalmonitor.cpp
    old new  
    2323#   include "dvbchannel.h"
    2424#endif
    2525
    26 #ifdef USING_V4L
     26#ifdef USING_V4L2
    2727#   include "analogsignalmonitor.h"
    2828#   include "v4lchannel.h"
    2929#endif
     
    9898    }
    9999#endif
    100100
    101 #ifdef USING_V4L
     101#ifdef USING_V4L2
    102102    if ((cardtype.toUpper() == "HDPVR"))
    103103    {
    104104        V4LChannel *chan = dynamic_cast<V4LChannel*>(channel);
  • mythtv/libs/libmythtv/tv_rec.cpp

    diff -Naur mythtv-rec2-20110515-old/mythtv/libs/libmythtv/tv_rec.cpp mythtv-rec2-20110515-new/mythtv/libs/libmythtv/tv_rec.cpp
    old new  
    10881088
    10891089V4LChannel *TVRec::GetV4LChannel(void)
    10901090{
    1091 #ifdef USING_V4L
     1091#if defined(USING_V4L) || defined(USING_V4L2)
    10921092    return dynamic_cast<V4LChannel*>(channel);
    10931093#else
    10941094    return NULL;
    1095 #endif // USING_V4L
     1095#endif // USING_V4l || USING_V4L2
    10961096}
    10971097
    10981098/** \fn TVReEventThread::run(void)
     
    39923992                                  channel->GetCurrentName());
    39933993    }
    39943994
    3995 #ifdef USING_V4L
     3995#if defined(USING_V4L) || defined(USING_V4L2)
    39963996    if (GetV4LChannel())
    39973997    {
    39983998        channel->InitPictureAttributes();
    39993999        CloseChannel();
    40004000    }
    4001 #endif
     4001#endif // USING_V4l || USING_V4L2
    40024002
    40034003    recorderThread = new RecorderThread(recorder);
    40044004    recorderThread->start();
  • mythtv/libs/libmythtv/v4lchannel.cpp

    diff -Naur mythtv-rec2-20110515-old/mythtv/libs/libmythtv/v4lchannel.cpp mythtv-rec2-20110515-new/mythtv/libs/libmythtv/v4lchannel.cpp
    old new  
    1616#include <iostream>
    1717using namespace std;
    1818
     19#ifdef USING_V4L
    1920#include <linux/videodev.h>
     21#endif
     22#ifdef USING_V4L2
    2023#include <linux/videodev2.h>
     24#endif
    2125
    2226// MythTV headers
    2327#include "v4lchannel.h"
     
    176180    {
    177181        if (fmt == "NTSC-JP")
    178182            return 6;
     183#ifdef USING_V4L
    179184        else if (fmt.left(5) == "SECAM")
    180185            return VIDEO_MODE_SECAM;
     186#endif
    181187        else if (fmt == "PAL-NC")
    182188            return 3;
    183189        else if (fmt == "PAL-M")
     
    185191        else if (fmt == "PAL-N")
    186192            return 5;
    187193        // generics...
     194#ifdef USING_V4L
    188195        else if (fmt.left(3) == "PAL")
    189196            return VIDEO_MODE_PAL;
    190197        else if (fmt.left(4) == "NTSC")
     
    192199        else if (fmt.left(4) == "ATSC")
    193200            return VIDEO_MODE_NTSC; // We've dropped V4L ATSC support...
    194201        return VIDEO_MODE_NTSC;
     202#endif
    195203    }
    196204
    197205    VERBOSE(VB_IMPORTANT,
     
    263271    }
    264272    else if (1 == v4l_version)
    265273    {
     274#ifdef USING_V4L   
    266275        if (mode == VIDEO_MODE_NTSC)
    267276            return "NTSC";
    268277        else if (mode == VIDEO_MODE_PAL)
     
    275284            return "PAL-N";
    276285        else if (mode == 6)
    277286            return "NTSC-JP";
     287#endif
    278288    }
    279289    else
    280290    {
     
    529539        return true;
    530540    }
    531541
     542#ifdef USING_V4L
    532543    // Video4Linux version 1 tuning
    533544    uint freq = frequency / 62500;
    534545    ioctlval = ioctl(videofd, VIDIOCSFREQ, &freq);
     
    540551                .arg(device).arg(ioctlval).arg(strerror(errno)));
    541552        return false;
    542553    }
     554#endif
    543555
    544556    return true;
    545557}
     
    691703
    692704    if (usingv4l1)
    693705    {
     706#ifdef USING_V4L
    694707        VERBOSE(VB_CHANNEL, LOC + msg + "(v4l v1)");
    695708
    696709        // read in old settings
     
    708721        {
    709722            VERBOSE(VB_IMPORTANT, LOC_ERR + msg +
    710723                    "\n\t\t\twhile setting format (v4l v1)" + ENO);
    711         }
    712         else if (usingv4l2)
     724        } else
     725#endif
     726        if (usingv4l2)
    713727        {
    714728            VERBOSE(VB_IMPORTANT, LOC + msg +
    715729                    "\n\t\t\tSetting video mode with v4l version 1 worked");
     
    779793    return ok;
    780794}
    781795
     796#ifdef USING_V4L
    782797static unsigned short *get_v4l1_field(
    783798    int v4l2_attrib, struct video_picture &vid_pic)
    784799{
     
    798813    }
    799814    return NULL;
    800815}
     816#endif
    801817
    802818static int get_v4l2_attribute(const QString &db_col_name)
    803819{
     
    895911    }
    896912
    897913    // V4L1
     914#ifdef USING_V4L
    898915    unsigned short *setfield;
    899916    struct video_picture vid_pic;
    900917    memset(&vid_pic, 0, sizeof(vid_pic));
     
    915932        VERBOSE(VB_IMPORTANT, loc_err + "failed to set controls." + ENO);
    916933        return false;
    917934    }
    918 
     935#endif
    919936    return true;
    920937}
    921938
     
    982999
    9831000static int get_v4l1_attribute_value(int videofd, int v4l2_attrib)
    9841001{
     1002#ifdef USING_V4L
    9851003    struct video_picture vid_pic;
    9861004    memset(&vid_pic, 0, sizeof(vid_pic));
    9871005
     
    9951013    unsigned short *setfield = get_v4l1_field(v4l2_attrib, vid_pic);
    9961014    if (setfield)
    9971015        return *setfield;
     1016#endif
    9981017
    9991018    return -1;
    10001019}
     
    10381057
    10391058static int set_v4l1_attribute_value(int videofd, int v4l2_attrib, int newvalue)
    10401059{
     1060#ifdef USING_V4L
    10411061    unsigned short *setfield;
    10421062    struct video_picture vid_pic;
    10431063    memset(&vid_pic, 0, sizeof(vid_pic));
     
    10641084        // ???
    10651085        return -1;
    10661086    }
    1067 
     1087#endif
    10681088    return 0;
    10691089}
    10701090
  • mythtv/libs/libmythtv/v4lchannel.h

    diff -Naur mythtv-rec2-20110515-old/mythtv/libs/libmythtv/v4lchannel.h mythtv-rec2-20110515-new/mythtv/libs/libmythtv/v4lchannel.h
    old new  
    44#define CHANNEL_H
    55
    66#include "dtvchannel.h"
    7 #ifdef USING_V4L
     7#ifdef USING_V4L2
    88#include <linux/videodev2.h> // needed for v4l2_std_id type
    99#else
    1010typedef uint64_t v4l2_std_id;
    11 #endif //USING_V4L
     11#endif //USING_V4L2
    1212
    1313using namespace std;
    1414
  • mythtv/libs/libmythtv/vbitext/vbi.c

    diff -Naur mythtv-rec2-20110515-old/mythtv/libs/libmythtv/vbitext/vbi.c mythtv-rec2-20110515-new/mythtv/libs/libmythtv/vbitext/vbi.c
    old new  
    1414//       compiling with -std=c99.  We could remove this in the .pro file,
    1515//       but that would disable it for all .c files.
    1616#undef __STRICT_ANSI__
     17#ifdef USING_V4L
    1718#include <linux/videodev.h>
     19#endif
     20#ifdef USING_V4L2
    1821#include <linux/videodev2.h>
     22#endif
    1923
    2024// vbitext headers
    2125#include "vt.h"
     
    2933
    3034
    3135/***** bttv api *****/
     36#ifdef USING_V4L
    3237#define BTTV_VBISIZE           _IOR('v' , BASE_VIDIOCPRIVATE+8, int)
    33 
     38#else // !USING_V4L
     39#ifdef USING_V4L2
     40#define BTTV_VBISIZE           _IOR('v' , BASE_VIDIOC_PRIVATE+8, int)
     41#endif // USING_V4L2
     42#endif // !USING_V4L
    3443
    3544static void
    3645error(const char *str, ...)
  • mythtv/libs/libmythtv/videosource.cpp

    diff -Naur mythtv-rec2-20110515-old/mythtv/libs/libmythtv/videosource.cpp mythtv-rec2-20110515-new/mythtv/libs/libmythtv/videosource.cpp
    old new  
    4747#include "dvbtypes.h"
    4848#endif
    4949
    50 #ifdef USING_V4L
     50#ifdef USING_V4L2
    5151#include <linux/videodev2.h>
    5252#endif
    5353
     
    22822282    setTrigger(cardtype);
    22832283    setSaveAll(false);
    22842284
    2285 #ifdef USING_V4L
     2285#if defined(USING_V4L) || defined(USING_V4L2)
    22862286    addTarget("V4L",       new V4LConfigurationGroup(parent));
    22872287# ifdef USING_IVTV
    22882288    addTarget("MPEG",      new MPEGConfigurationGroup(parent));
     
    22902290# ifdef USING_HDPVR
    22912291    addTarget("HDPVR",     new HDPVRConfigurationGroup(parent));
    22922292# endif // USING_HDPVR
    2293 #endif // USING_V4L
     2293#endif // USING_V4L || USING_V4L2
    22942294
    22952295#ifdef USING_DVB
    22962296    addTarget("DVB",       new DVBConfigurationGroup(parent));
     
    24792479
    24802480void CardType::fillSelections(SelectSetting* setting)
    24812481{
    2482 #ifdef USING_V4L
     2482#if defined(USING_V4L) || defined(USING_V4L2)
    24832483    setting->addSelection(
    24842484        QObject::tr("Analog V4L capture card"), "V4L");
    24852485    setting->addSelection(
     
    24922492    setting->addSelection(
    24932493        QObject::tr("H.264 encoder card (HD-PVR)"), "HDPVR");
    24942494# endif // USING_HDPVR
    2495 #endif // USING_V4L
     2495#endif // USING_V4L || USING_V4L2
    24962496
    24972497#ifdef USING_DVB
    24982498    setting->addSelection(
     
    25042504        QObject::tr("FireWire cable box"), "FIREWIRE");
    25052505#endif // USING_FIREWIRE
    25062506
    2507 #ifdef USING_V4L
     2507#if defined(USING_V4L) || defined(USING_V4L2)
    25082508    setting->addSelection(
    25092509        QObject::tr("USB MPEG-4 encoder box (Plextor ConvertX, etc)"),
    25102510        "GO7007");
    2511 #endif // USING_V4L
     2511#endif // USING_V4L || USING_V4L2
    25122512
    25132513#ifdef USING_HDHOMERUN
    25142514    setting->addSelection(