Commits

Francesco Romani committed 7a373ae

split configure checks for video4linux and video4linux2

the v4l checks are interwined by accident. Moreover, v4l v1 code
is just a legacy, and provided for retrocompatibility.
Now the v4l and v4l2 checks are performed indipendently
if --enable-v4l is issued and the import modules are build according
to the interface avalability.

  • Participants
  • Parent commits e8ac68d
  • Branches transcode-1_1

Comments (0)

Files changed (3)

 AC_MSG_RESULT($enable_v4l)
 
 have_v4l=no
+have_v4l2=no
 if test x"$enable_v4l" = x"yes" ; then
   AC_CHECK_HEADERS([linux/videodev.h], [v4l=yes], [v4l=no])
   AC_CHECK_HEADERS([linux/videodev2.h], [v4l2=yes], [v4l2=no],
 #include <linux/videodev2.h>
 ],   [
 struct v4l2_buffer buf;
-buffer.memory = V4L2_MEMORY_MMAP
+buf.memory = V4L2_MEMORY_MMAP
 ],    [AC_DEFINE([HAVE_STRUCT_V4L2_BUFFER], 1,
         [define if your videodev2 header has struct v4l2_buffer])
         AC_MSG_RESULT([yes])],
   fi
 
   if test x"$v4l" = x"yes" -o x"$v4l2" = x"yes" ; then
-    have_v4l=yes
+    if test x"$v4l" = x"yes" ; then
+      have_v4l=yes
+    fi
+    if test x"$v4l2" = x"yes" ; then
+      have_v4l2=yes
+    fi
+    dnl yes, this is pure cargo cult.
     ifelse([$1], , :, [$1])
   else
     AC_MSG_ERROR([v4l is requested, but cannot find headers])
 dnl
 TC_CHECK_V4L(AC_DEFINE([HAVE_V4L], 1, [Have video4linux(2)]))
 AM_CONDITIONAL(HAVE_V4L, test x"$have_v4l" = x"yes")
+AM_CONDITIONAL(HAVE_V4L2, test x"$have_v4l2" = x"yes")
 
 dnl
 dnl bktr
 $FFMPEG_OUTPUT
 hardware support
 ----------------------------------------
-v4l/v4l2                       $have_v4l
+v4l (legacy)                   $have_v4l
+v4l2                           $have_v4l2
 ALSA                           $have_alsa
 OSS                            $have_oss
 bktr                           $have_bktr

import/v4l/Makefile.am

 endif
 
 if HAVE_V4L
-MOD_V4LDEV = import_v4l.la import_v4l2.la
+MOD_V4LDEV = import_v4l.la
+endif
+if HAVE_V4L2
+MOD_V4L2DEV = import_v4l2.la
 endif
 
-pkg_LTLIBRARIES = $(MOD_V4LDEV) $(MOD_V4LCAM)
+pkg_LTLIBRARIES = $(MOD_V4LDEV) $(MOD_V4L2DEV) $(MOD_V4LCAM)
 
 import_v4l_la_SOURCES = import_v4l.c
 import_v4l_la_LDFLAGS = -module -avoid-version