Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixes #9595. Allows MythTV to compile on newer Linux distro's that do…

…n't include V4L version 1 headers.
  • Loading branch information...
commit 893edf31f911c12d29530e2c2901da869217bd7c 1 parent 15eaffe
@daniel-kristjansson daniel-kristjansson authored
View
26 mythtv/configure
@@ -108,8 +108,8 @@ Advanced options (experts only):
--disable-firewire disable support for FireWire cable boxes
--disable-iptv disable support for recording RTSP/UDP/RTP streams
--disable-hdhomerun disable support for HDHomeRun boxes
- --disable-v4l disable Video4Linux support
- --disable-ivtv disable ivtv support (PVR-x50) req. v4l support
+ --disable-v4l2 disable Video4Linux support
+ --disable-ivtv disable ivtv support (PVR-x50) req. v4l2 support
--disable-hdpvr disable HD-PVR support
--disable-dvb disable DVB support
--dvb-path=HDRLOC location of directory containing
@@ -1357,7 +1357,8 @@ MYTHTV_CONFIG_LIST='
qtdbus
qtwebkit
quartz_video
- v4l
+ v4l2
+ v4l1
valgrind
x11
xrandr
@@ -1763,15 +1764,16 @@ audio_oss_deps_any="soundcard_h sys_soundcard_h"
dvb_deps="backend"
firewire_deps="backend"
iptv_deps="backend"
-ivtv_deps="backend v4l"
-hdpvr_deps="backend v4l"
+ivtv_deps="backend v4l2"
+hdpvr_deps="backend v4l2"
hdhomerun_deps="backend"
mpegtsraw_demuxer_deps="merge_libavformat_mpegts_c"
mythtranscode_deps="backend frontend"
opengl_deps_any="agl_h GL_gl_h GLES2_gl2_h darwin windows x11"
opengles_deps="GLES2_gl2_h"
opengl_video_deps="opengl"
-v4l_deps="backend linux_videodev_h linux_videodev2_h"
+v4l2_deps="backend linux_videodev2_h"
+v4l1_deps="backend v4l2 linux_videodev_h"
vdpau_deps="opengl vdpau_vdpau_h vdpau_vdpau_x11_h"
xrandr_deps="x11"
xv_deps="x11"
@@ -1993,10 +1995,12 @@ enable opengles
enable opengl_video
enable quartz_video
enable symbol_visibility
-enable v4l
+enable v4l1
+enable v4l2
enable x11
enable xrandr
enable xv
+disable indevs
# mythtv paths
dvb_path_default="${sysroot}/usr/include"
@@ -3120,7 +3124,8 @@ EOF
disable mmx
enable disable_mmx_for_debugging # prevent later call to die
fi
- disable v4l
+ disable v4l1
+ disable v4l2
disable x11
# Workaround compile errors from missing gmtime_r/localtime_r/uint def
CFLAGS=`echo $CFLAGS | sed 's/-D_POSIX_C_SOURCE=200112//'`
@@ -3165,7 +3170,8 @@ EOF
disable protocols
fi
disable symver
- disable v4l
+ disable v4l1
+ disable v4l2
enable windows
disable x11
###### Standard ffmpeg configure stuff follows:
@@ -4446,7 +4452,7 @@ enabled stripping || strip="echo skipping strip"
config_files="$TMPH $TMPMAK"
if enabled backend; then
- echo "Video4Linux sup. ${v4l-no}"
+ echo "Video4Linux sup. ${v4l2-no} (v1 ${v4l1-no})"
echo "ivtv support ${ivtv-no}"
echo "HD-PVR support ${hdpvr-no}"
echo "FireWire support ${firewire-no}"
View
51 mythtv/libs/libmythtv/NuppelVideoRecorder.cpp
@@ -43,17 +43,20 @@ extern "C" {
#include "libswscale/swscale.h"
}
-#ifdef USING_V4L
-#include <linux/videodev.h>
+#ifdef USING_V4L2
#include <linux/videodev2.h>
#include "go7007_myth.h"
+#ifdef USING_V4L1
+#include <linux/videodev.h>
+#endif // USING_V4L1
+
#ifndef MJPIOC_S_PARAMS
#include "videodev_mjpeg.h"
#endif
-#endif // USING_V4l
+#endif // USING_V4L2
#define KEYFRAMEDIST 30
@@ -829,7 +832,7 @@ int NuppelVideoRecorder::AudioInit(bool skipdevice)
*/
bool NuppelVideoRecorder::MJPEGInit(void)
{
-#ifdef USING_V4L
+#ifdef USING_V4L1
bool we_opened_fd = false;
int init_fd = fd;
if (init_fd < 0)
@@ -871,7 +874,7 @@ bool NuppelVideoRecorder::MJPEGInit(void)
hmjpg_maxw = 640;
return true;
}
-#endif // USING_V4L
+#endif // USING_V4L1
VERBOSE(VB_IMPORTANT, LOC_ERR + "MJPEG not supported by device");
return false;
@@ -1020,7 +1023,7 @@ bool NuppelVideoRecorder::Open(void)
void NuppelVideoRecorder::ProbeV4L2(void)
{
-#ifdef USING_V4L
+#ifdef USING_V4L2
usingv4l2 = true;
struct v4l2_capability vcap;
@@ -1050,7 +1053,7 @@ void NuppelVideoRecorder::ProbeV4L2(void)
QString driver = (char *)vcap.driver;
if (driver == "go7007")
go7007 = true;
-#endif // USING_V4L
+#endif // USING_V4L2
}
void NuppelVideoRecorder::StartRecording(void)
@@ -1132,11 +1135,11 @@ void NuppelVideoRecorder::StartRecording(void)
return;
}
else
- DoV4L();
+ DoV4L1();
}
-#ifdef USING_V4L
-void NuppelVideoRecorder::DoV4L(void)
+#ifdef USING_V4L1
+void NuppelVideoRecorder::DoV4L1(void)
{
struct video_capability vc;
struct video_mmap mm;
@@ -1326,7 +1329,11 @@ void NuppelVideoRecorder::DoV4L(void)
recording = false;
close(fd);
}
+#else // if !USING_V4L1
+void NuppelVideoRecorder::DoV4L1(void) {}
+#endif // !USING_V4L1
+#ifdef USING_V4L2
bool NuppelVideoRecorder::SetFormatV4L2(void)
{
struct v4l2_format vfmt;
@@ -1403,7 +1410,11 @@ bool NuppelVideoRecorder::SetFormatV4L2(void)
return true;
}
+#else // if !USING_V4L2
+bool NuppelVideoRecorder::SetFormatV4L2(void) { return false; }
+#endif // !USING_V4L2
+#ifdef USING_V4L2
#define MAX_VIDEO_BUFFERS 5
void NuppelVideoRecorder::DoV4L2(void)
{
@@ -1730,7 +1741,11 @@ void NuppelVideoRecorder::DoV4L2(void)
close(fd);
close(channelfd);
}
+#else // if !USING_V4L2
+void NuppelVideoRecorder::DoV4L2(void) {}
+#endif // !USING_V4L2
+#ifdef USING_V4L1
void NuppelVideoRecorder::DoMJPEG(void)
{
struct mjpeg_params bparm;
@@ -1871,13 +1886,9 @@ void NuppelVideoRecorder::DoMJPEG(void)
recording = false;
close(fd);
}
-
-#else // USING_V4L
-void NuppelVideoRecorder::DoV4L(void) {}
-bool NuppelVideoRecorder::SetFormatV4L2(void) { return false; }
-void NuppelVideoRecorder::DoV4L2(void) {}
-void NuppelVideoRecorder::DoMJPEG(void) {}
-#endif // USING_V4L
+#else // if !USING_V4L1
+void NuppelVideoRecorder::DoMJPEG(void) {}
+#endif // !USING_V4L1
bool NuppelVideoRecorder::SpawnChildren(void)
{
@@ -2446,7 +2457,7 @@ void NuppelVideoRecorder::doAudioThread(void)
audio_device->Close();
}
-#ifdef USING_V4L
+#ifdef USING_V4L2
void NuppelVideoRecorder::FormatTT(struct VBIData *vbidata)
{
struct timeval tnow;
@@ -2613,9 +2624,9 @@ void NuppelVideoRecorder::FormatTT(struct VBIData *vbidata)
act_text_buffer = 0;
textbuffer[act]->freeToEncode = 1;
}
-#else // USING_V4L
+#else // USING_V4L2
void NuppelVideoRecorder::FormatTT(struct VBIData*) {}
-#endif // USING_V4L
+#endif // USING_V4L2
void NuppelVideoRecorder::FormatCC(struct cc *cc)
{
View
2  mythtv/libs/libmythtv/NuppelVideoRecorder.h
@@ -153,7 +153,7 @@ class MTV_PUBLIC NuppelVideoRecorder : public V4LRecorder, public CC608Input
void ProbeV4L2(void);
bool SetFormatV4L2(void);
- void DoV4L(void);
+ void DoV4L1(void);
void DoV4L2(void);
void DoMJPEG(void);
View
4 mythtv/libs/libmythtv/analogsignalmonitor.cpp
@@ -6,7 +6,9 @@
#include <sys/ioctl.h>
#include <poll.h>
+#ifdef USING_V4L1
#include <linux/videodev.h>
+#endif USING_V4L1
#include "mythverbose.h"
#include "analogsignalmonitor.h"
@@ -159,6 +161,7 @@ void AnalogSignalMonitor::UpdateValues(void)
}
}
}
+#ifdef USING_V4L1
else
{
struct video_tuner tuner;
@@ -174,6 +177,7 @@ void AnalogSignalMonitor::UpdateValues(void)
isLocked = tuner.signal;
}
}
+#endif USING_V4L1
{
QMutexLocker locker(&statusLock);
View
37 mythtv/libs/libmythtv/cardutil.cpp
@@ -4,7 +4,7 @@
#include <algorithm>
-#if defined(USING_V4L) || defined(USING_DVB)
+#if defined(USING_V4L2) || defined(USING_DVB)
#include <sys/ioctl.h>
#endif
@@ -26,8 +26,11 @@
#include "dvbtypes.h"
#endif
-#ifdef USING_V4L
+#ifdef USING_V4L1
#include <linux/videodev.h>
+#endif
+
+#ifdef USING_V4L2
#include <linux/videodev2.h>
#endif
@@ -52,14 +55,14 @@ QString CardUtil::GetScanableCardTypes(void)
cardTypes += "'DVB'";
#endif // USING_DVB
-#ifdef USING_V4L
+#ifdef USING_V4L2
if (!cardTypes.isEmpty())
cardTypes += ",";
cardTypes += "'V4L'";
# ifdef USING_IVTV
cardTypes += ",'MPEG'";
# endif // USING_IVTV
-#endif // USING_V4L
+#endif // USING_V4L2
#ifdef USING_IPTV
if (!cardTypes.isEmpty())
@@ -1537,15 +1540,15 @@ uint CardUtil::GetQuickTuning(uint cardid, const QString &input_name)
bool CardUtil::hasV4L2(int videofd)
{
(void) videofd;
-#ifdef USING_V4L
+#ifdef USING_V4L2
struct v4l2_capability vcap;
memset(&vcap, 0, sizeof(vcap));
return ((ioctl(videofd, VIDIOC_QUERYCAP, &vcap) >= 0) &&
(vcap.capabilities & V4L2_CAP_VIDEO_CAPTURE));
-#else // if !USING_V4L
+#else // if !USING_V4L2
return false;
-#endif // !USING_V4L
+#endif // !USING_V4L2
}
bool CardUtil::GetV4LInfo(
@@ -1559,7 +1562,7 @@ bool CardUtil::GetV4LInfo(
if (videofd < 0)
return false;
-#ifdef USING_V4L
+#ifdef USING_V4L2
// First try V4L2 query
struct v4l2_capability capability;
memset(&capability, 0, sizeof(struct v4l2_capability));
@@ -1570,13 +1573,15 @@ bool CardUtil::GetV4LInfo(
version = capability.version;
capabilities = capability.capabilities;
}
+#ifdef USING_V4L1
else // Fallback to V4L1 query
{
struct video_capability capability;
if (ioctl(videofd, VIDIOCGCAP, &capability) >= 0)
card = QString::fromAscii((const char*)capability.name);
}
-#endif // !USING_V4L
+#endif // USING_V4L1
+#endif // USING_V4L2
if (!driver.isEmpty())
driver.remove( QRegExp("\\[[0-9]\\]$") );
@@ -1591,7 +1596,7 @@ InputNames CardUtil::ProbeV4LVideoInputs(int videofd, bool &ok)
InputNames list;
ok = false;
-#ifdef USING_V4L
+#ifdef USING_V4L2
bool usingv4l2 = hasV4L2(videofd);
// V4L v2 query
@@ -1609,6 +1614,7 @@ InputNames CardUtil::ProbeV4LVideoInputs(int videofd, bool &ok)
return list;
}
+#ifdef USING_V4L1
// V4L v1 query
struct video_capability vidcap;
memset(&vidcap, 0, sizeof(vidcap));
@@ -1637,15 +1643,16 @@ InputNames CardUtil::ProbeV4LVideoInputs(int videofd, bool &ok)
list[i] = test.name;
}
+#endif // USING_V4L1
// Create an input on single input cards that don't advertise input
if (!list.size())
list[0] = "Television";
ok = true;
-#else // if !USING_V4L
+#else // if !USING_V4L2
list[-1] += QObject::tr("ERROR, Compile with V4L support to query inputs");
-#endif // !USING_V4L
+#endif // !USING_V4L2
return list;
}
@@ -1656,7 +1663,7 @@ InputNames CardUtil::ProbeV4LAudioInputs(int videofd, bool &ok)
InputNames list;
ok = false;
-#ifdef USING_V4L
+#ifdef USING_V4L2
bool usingv4l2 = hasV4L2(videofd);
// V4L v2 query
@@ -1675,10 +1682,10 @@ InputNames CardUtil::ProbeV4LAudioInputs(int videofd, bool &ok)
}
ok = true;
-#else // if !USING_V4L
+#else // if !USING_V4L2
list[-1] += QObject::tr(
"ERROR, Compile with V4L support to query audio inputs");
-#endif // !USING_V4L
+#endif // !USING_V4L2
return list;
}
View
2  mythtv/libs/libmythtv/channelbase.cpp
@@ -1174,7 +1174,7 @@ ChannelBase *ChannelBase::CreateChannel(
}
else if (CardUtil::IsV4L(genOpt.cardtype))
{
-#ifdef USING_V4L
+#ifdef USING_V4L2
channel = new V4LChannel(tvrec, genOpt.videodev);
#endif
if ((genOpt.cardtype != "MPEG") && (genOpt.cardtype != "HDPVR"))
View
2  mythtv/libs/libmythtv/channelscan/channelscan_sm.cpp
@@ -1402,7 +1402,7 @@ const DVBChannel *ChannelScanSM::GetDVBChannel(void) const
V4LChannel *ChannelScanSM::GetV4LChannel(void)
{
-#ifdef USING_V4L
+#ifdef USING_V4L2
return dynamic_cast<V4LChannel*>(channel);
#else
return NULL;
View
2  mythtv/libs/libmythtv/channelscan/channelscanner.cpp
@@ -350,7 +350,7 @@ void ChannelScanner::PreScanCommon(
channel = new DVBChannel(device);
#endif
-#ifdef USING_V4L
+#ifdef USING_V4L2
if (("V4L" == card_type) || ("MPEG" == card_type))
channel = new V4LChannel(NULL, device);
#endif
View
7 mythtv/libs/libmythtv/libmythtv.pro
@@ -112,7 +112,7 @@ cygwin:DEFINES += _WIN32
using_valgrind:DEFINES += USING_VALGRIND
# old libvbitext (Caption decoder)
-#using_v4l {
+#using_v4l2 {
HEADERS += vbitext/cc.h vbitext/dllist.h vbitext/hamm.h vbitext/lang.h
HEADERS += vbitext/vbi.h vbitext/vt.h
SOURCES += vbitext/cc.cpp vbitext/vbi.c vbitext/hamm.c vbitext/lang.c
@@ -488,11 +488,12 @@ using_backend {
# Support for Video4Linux devices
HEADERS += v4lrecorder.h
SOURCES += v4lrecorder.cpp
- using_v4l {
+ using_v4l2 {
HEADERS += v4lchannel.h analogsignalmonitor.h
SOURCES += v4lchannel.cpp analogsignalmonitor.cpp
- DEFINES += USING_V4L
+ DEFINES += USING_V4L2
+ using_v4l1:DEFINES += USING_V4L1
}
# Support for cable boxes that provide Firewire out
View
4 mythtv/libs/libmythtv/recorderbase.cpp
@@ -537,11 +537,11 @@ RecorderBase *RecorderBase::CreateRecorder(
}
else if (CardUtil::IsV4L(genOpt.cardtype))
{
-#ifdef USING_V4L
+#ifdef USING_V4L2
// V4L/MJPEG/GO7007 from here on
recorder = new NuppelVideoRecorder(tvrec, channel);
recorder->SetOption("skipbtaudio", genOpt.skip_btaudio);
-#endif // USING_V4L
+#endif // USING_V4L2
}
if (recorder)
View
4 mythtv/libs/libmythtv/signalmonitor.cpp
@@ -23,7 +23,7 @@ extern "C" {
# include "dvbchannel.h"
#endif
-#ifdef USING_V4L
+#ifdef USING_V4L2
# include "analogsignalmonitor.h"
# include "v4lchannel.h"
#endif
@@ -98,7 +98,7 @@ SignalMonitor *SignalMonitor::Init(QString cardtype, int db_cardnum,
}
#endif
-#ifdef USING_V4L
+#ifdef USING_V4L2
if ((cardtype.toUpper() == "HDPVR"))
{
V4LChannel *chan = dynamic_cast<V4LChannel*>(channel);
View
6 mythtv/libs/libmythtv/tv_rec.cpp
@@ -1088,11 +1088,11 @@ DTVChannel *TVRec::GetDTVChannel(void)
V4LChannel *TVRec::GetV4LChannel(void)
{
-#ifdef USING_V4L
+#ifdef USING_V4L2
return dynamic_cast<V4LChannel*>(channel);
#else
return NULL;
-#endif // USING_V4L
+#endif // USING_V4L2
}
/** \fn TVReEventThread::run(void)
@@ -3991,7 +3991,7 @@ void TVRec::TuningNewRecorder(MPEGStreamData *streamData)
channel->GetCurrentName());
}
-#ifdef USING_V4L
+#ifdef USING_V4L2
if (GetV4LChannel())
{
channel->InitPictureAttributes();
View
31 mythtv/libs/libmythtv/v4lchannel.cpp
@@ -16,7 +16,10 @@
#include <iostream>
using namespace std;
+#ifdef USING_V4L1
#include <linux/videodev.h>
+#endif // USING_V4L1
+
#include <linux/videodev2.h>
// MythTV headers
@@ -172,6 +175,7 @@ static int format_to_mode(const QString &fmt, int v4l_version)
return V4L2_STD_PAL;
return V4L2_STD_NTSC;
}
+#ifdef USING_V4L1
else if (1 == v4l_version)
{
if (fmt == "NTSC-JP")
@@ -193,6 +197,7 @@ static int format_to_mode(const QString &fmt, int v4l_version)
return VIDEO_MODE_NTSC; // We've dropped V4L ATSC support...
return VIDEO_MODE_NTSC;
}
+#endif
VERBOSE(VB_IMPORTANT,
"format_to_mode() does not recognize V4L" << v4l_version);
@@ -261,6 +266,7 @@ static QString mode_to_format(int mode, int v4l_version)
return "ATSC";
}
}
+#ifdef USING_V4L1
else if (1 == v4l_version)
{
if (mode == VIDEO_MODE_NTSC)
@@ -276,6 +282,7 @@ static QString mode_to_format(int mode, int v4l_version)
else if (mode == 6)
return "NTSC-JP";
}
+#endif
else
{
VERBOSE(VB_IMPORTANT,
@@ -529,6 +536,7 @@ bool V4LChannel::Tune(uint64_t frequency, QString inputname)
return true;
}
+#ifdef USING_V4L1
// Video4Linux version 1 tuning
uint freq = frequency / 62500;
ioctlval = ioctl(videofd, VIDIOCSFREQ, &freq);
@@ -540,8 +548,10 @@ bool V4LChannel::Tune(uint64_t frequency, QString inputname)
.arg(device).arg(ioctlval).arg(strerror(errno)));
return false;
}
-
return true;
+#else
+ return false;
+#endif
}
/** \fn V4LChannel::Retune(void)
@@ -689,6 +699,8 @@ bool V4LChannel::SetInputAndFormat(int inputNum, QString newFmt)
}
}
+ (void) usingv4l1;
+#ifdef USING_V4L1
if (usingv4l1)
{
VERBOSE(VB_CHANNEL, LOC + msg + "(v4l v1)");
@@ -715,6 +727,8 @@ bool V4LChannel::SetInputAndFormat(int inputNum, QString newFmt)
"\n\t\t\tSetting video mode with v4l version 1 worked");
}
}
+#endif // USING_V4L1
+
return ok;
}
@@ -779,6 +793,7 @@ bool V4LChannel::SwitchToInput(int inputnum, bool setstarting)
return ok;
}
+#ifdef USING_V4L1
static unsigned short *get_v4l1_field(
int v4l2_attrib, struct video_picture &vid_pic)
{
@@ -798,6 +813,7 @@ static unsigned short *get_v4l1_field(
}
return NULL;
}
+#endif
static int get_v4l2_attribute(const QString &db_col_name)
{
@@ -894,6 +910,7 @@ bool V4LChannel::InitPictureAttribute(const QString db_col_name)
return true;
}
+#ifdef USING_V4L1
// V4L1
unsigned short *setfield;
struct video_picture vid_pic;
@@ -917,6 +934,9 @@ bool V4LChannel::InitPictureAttribute(const QString db_col_name)
}
return true;
+#else
+ return false;
+#endif
}
bool V4LChannel::InitPictureAttributes(void)
@@ -982,6 +1002,9 @@ static int get_v4l2_attribute_value(int videofd, int v4l2_attrib)
static int get_v4l1_attribute_value(int videofd, int v4l2_attrib)
{
+ (void) videofd;
+ (void) v4l2_attrib;
+#ifdef USING_V4L1
struct video_picture vid_pic;
memset(&vid_pic, 0, sizeof(vid_pic));
@@ -995,7 +1018,7 @@ static int get_v4l1_attribute_value(int videofd, int v4l2_attrib)
unsigned short *setfield = get_v4l1_field(v4l2_attrib, vid_pic);
if (setfield)
return *setfield;
-
+#endif
return -1;
}
@@ -1038,6 +1061,7 @@ static int set_v4l2_attribute_value(int videofd, int v4l2_attrib, int newvalue)
static int set_v4l1_attribute_value(int videofd, int v4l2_attrib, int newvalue)
{
+#ifdef USING_V4L1
unsigned short *setfield;
struct video_picture vid_pic;
memset(&vid_pic, 0, sizeof(vid_pic));
@@ -1066,6 +1090,9 @@ static int set_v4l1_attribute_value(int videofd, int v4l2_attrib, int newvalue)
}
return 0;
+#else
+ return -1;
+#endif
}
static int set_attribute_value(bool usingv4l2, int videofd,
View
4 mythtv/libs/libmythtv/v4lchannel.h
@@ -4,11 +4,11 @@
#define CHANNEL_H
#include "dtvchannel.h"
-#ifdef USING_V4L
+#ifdef USING_V4L2
#include <linux/videodev2.h> // needed for v4l2_std_id type
#else
typedef uint64_t v4l2_std_id;
-#endif //USING_V4L
+#endif //USING_V4L2
using namespace std;
View
15 mythtv/libs/libmythtv/v4lrecorder.cpp
@@ -1,8 +1,9 @@
// -*- Mode: c++ -*-
-#ifdef USING_V4L
+#ifdef USING_V4L1
#include <linux/videodev.h> // for vbi_format
-#endif // USING_V4L
+#endif // USING_V4L1
+#include <linux/videodev2.h>
#include <sys/ioctl.h> // for ioctl
#include <sys/time.h> // for gettimeofday
@@ -127,12 +128,13 @@ int V4LRecorder::OpenVBIDevice(void)
if (VBIMode::NTSC_CC == vbimode)
{
-#ifdef USING_V4L
+#ifdef USING_V4L2
struct v4l2_format fmt;
memset(&fmt, 0, sizeof(fmt));
fmt.type = V4L2_BUF_TYPE_VBI_CAPTURE;
if (0 != ioctl(fd, VIDIOC_G_FMT, &fmt))
{
+#ifdef USING_V4L1
VERBOSE(VB_RECORD, "V4L2 VBI setup failed, trying v1 ioctl");
// Try V4L v1 VBI ioctls, iff V4L v2 fails
struct vbi_format old_fmt;
@@ -152,6 +154,11 @@ int V4LRecorder::OpenVBIDevice(void)
fmt.fmt.vbi.count[0] = old_fmt.count[0];
fmt.fmt.vbi.count[1] = old_fmt.count[1];
fmt.fmt.vbi.flags = old_fmt.flags;
+#else // if !USING_V4L1
+ VERBOSE(VB_RECORD, "V4L2 VBI setup failed");
+ close(fd);
+ return -1;
+#endif // !USING_V4L1
}
VERBOSE(VB_RECORD, LOC + "vbi_format rate: "<<fmt.fmt.vbi.sampling_rate
<<"\n\t\t\t offset: "<<fmt.fmt.vbi.offset
@@ -181,7 +188,7 @@ int V4LRecorder::OpenVBIDevice(void)
close(fd);
return -1;
}
-#endif // USING_V4L
+#endif // USING_V4L2
}
if (VBIMode::PAL_TT == vbimode)
View
23 mythtv/libs/libmythtv/vbitext/vbi.c
@@ -10,14 +10,16 @@
#include <stdio.h>
#include <stdarg.h>
-#ifdef USING_V4L
+#ifdef USING_V4L2
// HACK. Broken kernel headers < 2.6.25 fail compile in videodev2.h when
// compiling with -std=c99. We could remove this in the .pro file,
// but that would disable it for all .c files.
#undef __STRICT_ANSI__
+#ifdef USING_V4L1
#include <linux/videodev.h>
+#endif // USING_V4L1
#include <linux/videodev2.h>
-#endif // USING_V4L
+#endif // USING_V4L2
// vbitext headers
#include "vt.h"
@@ -27,9 +29,9 @@
#define FAC (1<<16) // factor for fix-point arithmetic
static unsigned char *rawbuf; // one common buffer for raw vbi data.
-#ifdef USING_V4L
+#ifdef USING_V4L2
static int rawbuf_size; // its current size
-#endif // USING_V4L
+#endif // USING_V4L2
/***** bttv api *****/
#define BTTV_VBISIZE _IOR('v' , BASE_VIDIOCPRIVATE+8, int)
@@ -469,7 +471,7 @@ vbi_del_handler(struct vbi *vbi, void *handler, void *data)
return;
}
-#ifdef USING_V4L
+#ifdef USING_V4L2
static int
set_decode_parms(struct vbi *vbi, struct v4l2_vbi_format *p)
{
@@ -529,12 +531,12 @@ set_decode_parms(struct vbi *vbi, struct v4l2_vbi_format *p)
return 0;
}
-#endif // USING_V4L
+#endif // USING_V4L2
static int
setup_dev(struct vbi *vbi)
{
-#ifdef USING_V4L
+#ifdef USING_V4L2
struct v4l2_format v4l2_format;
struct v4l2_vbi_format *vbifmt = &v4l2_format.fmt.vbi;
@@ -542,6 +544,7 @@ setup_dev(struct vbi *vbi)
v4l2_format.type = V4L2_BUF_TYPE_VBI_CAPTURE;
if (ioctl(vbi->fd, VIDIOC_G_FMT, &v4l2_format) == -1)
{
+#ifdef USING_V4L1
// not a v4l2 device. assume bttv and create a standard fmt-struct.
int size;
perror("ioctl VIDIOC_G_FMT");
@@ -567,6 +570,10 @@ setup_dev(struct vbi *vbi)
vbifmt->count[0] = size/2;
vbifmt->count[1] = size - size/2;
}
+#else
+ error("Video 4 Linux version 1 support is not enabled.");
+ return -1;
+#endif
}
if (set_decode_parms(vbi, vbifmt) == -1)
@@ -590,7 +597,7 @@ setup_dev(struct vbi *vbi)
return 0;
#else
return -1;
-#endif // USING_V4L
+#endif // USING_V4L2
}
View
14 mythtv/libs/libmythtv/videosource.cpp
@@ -47,7 +47,7 @@ using namespace std;
#include "dvbtypes.h"
#endif
-#ifdef USING_V4L
+#ifdef USING_V4L2
#include <linux/videodev2.h>
#endif
@@ -2166,7 +2166,7 @@ CaptureCardGroup::CaptureCardGroup(CaptureCard &parent) :
setTrigger(cardtype);
setSaveAll(false);
-#ifdef USING_V4L
+#ifdef USING_V4L2
addTarget("V4L", new V4LConfigurationGroup(parent));
# ifdef USING_IVTV
addTarget("MPEG", new MPEGConfigurationGroup(parent));
@@ -2174,7 +2174,7 @@ CaptureCardGroup::CaptureCardGroup(CaptureCard &parent) :
# ifdef USING_HDPVR
addTarget("HDPVR", new HDPVRConfigurationGroup(parent));
# endif // USING_HDPVR
-#endif // USING_V4L
+#endif // USING_V4L2
#ifdef USING_DVB
addTarget("DVB", new DVBConfigurationGroup(parent));
@@ -2359,7 +2359,7 @@ CardType::CardType(const CaptureCard &parent) :
void CardType::fillSelections(SelectSetting* setting)
{
-#ifdef USING_V4L
+#ifdef USING_V4L2
setting->addSelection(
QObject::tr("Analog V4L capture card"), "V4L");
setting->addSelection(
@@ -2372,7 +2372,7 @@ void CardType::fillSelections(SelectSetting* setting)
setting->addSelection(
QObject::tr("H.264 encoder card (HD-PVR)"), "HDPVR");
# endif // USING_HDPVR
-#endif // USING_V4L
+#endif // USING_V4L2
#ifdef USING_DVB
setting->addSelection(
@@ -2384,11 +2384,11 @@ void CardType::fillSelections(SelectSetting* setting)
QObject::tr("FireWire cable box"), "FIREWIRE");
#endif // USING_FIREWIRE
-#ifdef USING_V4L
+#ifdef USING_V4L2
setting->addSelection(
QObject::tr("USB MPEG-4 encoder box (Plextor ConvertX, etc)"),
"GO7007");
-#endif // USING_V4L
+#endif // USING_V4L2
#ifdef USING_HDHOMERUN
setting->addSelection(
Please sign in to comment.
Something went wrong with that request. Please try again.