summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2011-04-10 12:54:53 (GMT)
committerMartin Pitt <martin.pitt@ubuntu.com>2011-04-10 12:54:53 (GMT)
commitae13d96fa2a0612b6000f4b8f6ed9d3564035703 (patch)
tree7e2c399438f3b0bbb643210d6535d0ce0b90a03a
parent8f624253f0135ca77a893ad4e8168f51ef90d4da (diff)
Build hald-probe-video4linux on current kernels again
The hald-probe-video4linux prober supports both v4l1 and v4l2. Support for v4l1 has been removed from Linux kernel 2.6.38. Instead of disabling the prober altogether, #ifdef the v4l1 parts when building on a newer kernel. Signed-off-by: Martin Pitt <martin.pitt@ubuntu.com>
-rw-r--r--hald/linux/probing/Makefile.am7
-rw-r--r--hald/linux/probing/probe-video4linux.c9
2 files changed, 10 insertions, 6 deletions
diff --git a/hald/linux/probing/Makefile.am b/hald/linux/probing/Makefile.am
index cbea516..50f0dff 100644
--- a/hald/linux/probing/Makefile.am
+++ b/hald/linux/probing/Makefile.am
@@ -20,11 +20,8 @@ libexec_PROGRAMS = \
hald-probe-serial \
hald-probe-ieee1394-unit \
hald-probe-net-bluetooth \
- hald-probe-lsb-release
-
-if HAVE_V4L1
-libexec_PROGRAMS += hald-probe-video4linux
-endif
+ hald-probe-lsb-release \
+ hald-probe-video4linux
endif
hald_probe_smbios_SOURCES = probe-smbios.c ../../logger.c
diff --git a/hald/linux/probing/probe-video4linux.c b/hald/linux/probing/probe-video4linux.c
index 7bc13e8..b055720 100644
--- a/hald/linux/probing/probe-video4linux.c
+++ b/hald/linux/probing/probe-video4linux.c
@@ -30,7 +30,9 @@
#include <sys/types.h>
#include <sys/time.h>
#include <sys/ioctl.h>
+#ifdef HAVE_LINUX_VIDEODEV_H
#include <linux/videodev.h>
+#endif
#include <linux/videodev2.h>
#include <errno.h>
#include <fcntl.h>
@@ -50,7 +52,9 @@ main (int argc, char *argv[])
int ret = -1;
char *udi;
char *device_file;
+#ifdef HAVE_LINUX_VIDEODEV_H
struct video_capability v1cap;
+#endif
struct v4l2_capability v2cap;
LibHalContext *ctx = NULL;
LibHalChangeSet *cset;
@@ -107,7 +111,9 @@ main (int argc, char *argv[])
LIBHAL_FREE_DBUS_ERROR (&error);
libhal_device_add_capability (ctx, udi, "video4linux.radio", &error);
}
- } else {
+ }
+#ifdef HAVE_LINUX_VIDEODEV_H
+ else {
HAL_DEBUG (("ioctl VIDIOC_QUERYCAP failed"));
if (ioctl (fd, VIDIOCGCAP, &v1cap) == 0) {
@@ -134,6 +140,7 @@ main (int argc, char *argv[])
HAL_DEBUG (("ioctl VIDIOCGCAP failed"));
}
}
+#endif
LIBHAL_FREE_DBUS_ERROR (&error);
libhal_device_commit_changeset (ctx, cset, &error);