[vlc-devel] [PATCH] -Autotools support for libv4l2 - Nicolas Chauvet (kwizart)
Nicolas Chauvet (kwizart)
kwizart at fedoraprojet.org
Wed Oct 15 19:15:35 CEST 2008
---
configure.ac | 5 +++++
modules/access/v4l2/v4l2.c | 10 ++++++++++
2 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/configure.ac b/configure.ac
index c4ad736..063983e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2365,6 +2365,11 @@ then
AC_DEFINE(HAVE_ALSA, 1, Define if ALSA is present.)
fi
+ PKG_CHECK_MODULES(V4L2,libv4l2, [
+ VLC_ADD_LDFLAGS([v4l2],[${V4L2_LIBS}])
+ VLC_ADD_CFLAGS([v4l2],[${V4L2_CFLAGS}])
+ AC_DEFINE(HAVE_LIBV4L2, 1, Define if LIBV4L2 is available))
+ ],[])
CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_v4l2}"
AC_CHECK_HEADERS(linux/videodev2.h, [
VLC_ADD_PLUGIN([v4l2])
diff --git a/modules/access/v4l2/v4l2.c b/modules/access/v4l2/v4l2.c
index 59ac47b..fae777e 100644
--- a/modules/access/v4l2/v4l2.c
+++ b/modules/access/v4l2/v4l2.c
@@ -67,7 +67,17 @@
#include <poll.h>
+#ifdef HAVE_LIBV4L2
#include <libv4l2.h>
+#else
+#define v4l2_fd_open(fd, flags) (fd)
+#define v4l2_close close
+#define v4l2_dup dup
+#define v4l2_ioctl ioctl
+#define v4l2_read read
+#define v4l2_mmap mmap
+#define v4l2_munmap munmap
+#endif
/*****************************************************************************
* Module descriptior
--
1.5.4.3
More information about the vlc-devel
mailing list