[vlc-commits] Define HAVE_V4L2 conditional

Rémi Denis-Courmont git at videolan.org
Tue Aug 16 18:20:59 CEST 2011


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Tue Aug 16 19:15:57 2011 +0300| [c88c8eae2044d68159de295191e75cdc50343a66] | committer: Rémi Denis-Courmont

Define HAVE_V4L2 conditional

There should be more V4L2-based plugins later, e.g. FM RX, FM TX, VOUT.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c88c8eae2044d68159de295191e75cdc50343a66
---

 configure.ac              |   28 ++++++++++++----------------
 modules/access/Modules.am |    9 ++++++++-
 2 files changed, 20 insertions(+), 17 deletions(-)

diff --git a/configure.ac b/configure.ac
index 73a3330..270a76b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2032,22 +2032,18 @@ dnl  Video4Linux2 plugin
 dnl
 AC_ARG_ENABLE(v4l2,
   [AS_HELP_STRING([--disable-v4l2],
-    [do not support Video4Linux version 2 (default auto)])])
-AC_ARG_WITH(v4l2,
-  [AS_HELP_STRING([--with-v4l2=PATH], [path to a V4L2-enabled kernel tree])])
-if test "${enable_v4l2}" != "no"
-then
-  if test "${with_v4l2}" != "no" -a -n "${with_v4l2}"
-  then
-    VLC_ADD_CPPFLAGS([v4l2],[-I${with_v4l2}/include])
-  fi
-
-  CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_v4l2}"
-  AC_CHECK_HEADERS(linux/videodev2.h sys/videoio.h, [
-    VLC_ADD_PLUGIN([v4l2])
-  ],[])
-  CPPFLAGS="${CPPFLAGS_save}"
-fi
+    [disable Video4Linux2 support (default auto)])])
+have_v4l2="no"
+AS_IF([test "${enable_v4l2}" != "no"], [
+  AC_CHECK_HEADERS([linux/videodev2.h sys/videoio.h], [
+    have_v4l2="yes"
+  ], [
+    AS_IF([test "x${enable_v4l2}" != "x"], [
+      AC_MSG_ERROR([Video4Linux2 headers not found!])
+    ])
+  ])
+])
+AM_CONDITIONAL(HAVE_V4L2, [test "${have_v4l2}" != "no"])
 
 dnl
 dnl libv4l2 support for video4linux.
diff --git a/modules/access/Modules.am b/modules/access/Modules.am
index aa06e8d..4d3ac9f 100644
--- a/modules/access/Modules.am
+++ b/modules/access/Modules.am
@@ -44,7 +44,6 @@ SOURCES_dvdnav = dvdnav.c
 SOURCES_dvdread = dvdread.c
 SOURCES_dc1394 = dc1394.c
 SOURCES_pvr = pvr.c
-SOURCES_v4l2 = v4l2.c
 SOURCES_qtcapture = qtcapture.m
 SOURCES_linsys_sdi = linsys/linsys_sdi.c linsys/linsys_sdi.h
 SOURCES_linsys_hdsdi = \
@@ -120,6 +119,14 @@ libaccess_shm_plugin_la_LIBADD = $(AM_LIBADD)
 libaccess_shm_plugin_la_DEPENDENCIES =
 libvlc_LTLIBRARIES += $(LTLIBaccess_shm)
 
+libv4l2_plugin_la_SOURCES = v4l2.c
+libv4l2_plugin_la_CFLAGS = $(AM_CFLAGS)
+libv4l2_plugin_la_LIBADD = $(AM_LIBADD)
+libv4l2_plugin_la_DEPENDENCIES =
+if HAVE_V4L2
+libvlc_LTLIBRARIES += libv4l2_plugin.la
+endif
+
 libxcb_screen_plugin_la_SOURCES = screen/xcb.c
 libxcb_screen_plugin_la_CFLAGS = $(AM_CFLAGS) \
 	$(XCB_CFLAGS) $(XCB_COMPOSITE_CFLAGS)



More information about the vlc-commits mailing list