[vlc-devel] commit: Move the libVA detection to auto (Jean-Baptiste Kempf )

git version control git at videolan.org
Fri Jan 8 19:44:07 CET 2010


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Fri Jan  8 18:37:46 2010 +0100| [7f39bd111ba7a4cf65a982fe70fba1beb7b37e4a] | committer: Jean-Baptiste Kempf 

Move the libVA detection to auto

It now autodetects the presence of libVA pkg:
It will fail if --enable-libva is defined and it is not present
It will be activated if nothing is specified and libVA pkg is present

Moreover, it will check the presence of the avcodec/libva.h

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

 configure.ac |   26 ++++++++++++++++++--------
 1 files changed, 18 insertions(+), 8 deletions(-)

diff --git a/configure.ac b/configure.ac
index dfb4a9c..b2632ba 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2954,19 +2954,29 @@ dnl
 dnl libva needs avcodec
 dnl
 AC_ARG_ENABLE(libva,
-  [  --enable-libva          libva VAAPI support (default disabled)])
-AS_IF([test "${enable_libva}" = "yes"], [
+  [  --enable-libva          libva VAAPI support (default auto)])
+
+AS_IF([test "${enable_libva}" != "no"], [
   AS_IF([test "x${have_avcodec}" = "xyes"], [
     PKG_CHECK_MODULES(LIBVA, [libva libva-x11],
       [
-        VLC_ADD_LIBS([avcodec],[$LIBVA_LIBS])
-        VLC_ADD_CFLAGS([avcodec],[$LIBVA_CFLAGS])
-        AC_DEFINE(HAVE_AVCODEC_VAAPI, 1, [Define if avcodec has to be built with VAAPI support.])
+        AC_CHECK_HEADERS(libavcodec/vaapi.h, [
+           VLC_ADD_LIBS([avcodec],[$LIBVA_LIBS])
+           VLC_ADD_CFLAGS([avcodec],[$LIBVA_CFLAGS])
+           AC_DEFINE(HAVE_AVCODEC_VAAPI, 1, [Define if avcodec has to be built with VAAPI support.])
+           echo "VAAPI acceleration activated"
+        ],[
+	AS_IF([test "${enable_libva}" == "yes"],
+	      [AC_MSG_ERROR([libva is present but libavcodec/vaapi.h is missing])],
+              [AC_MSG_WARN([libva is present but libavcodec/vaapi.h is missing ])])
+        ])
       ],[
-        AC_MSG_ERROR([Could not find libva.])
-    ])
+	AS_IF([test "${enable_libva}" == "yes"],
+              [AC_MSG_ERROR([Could not find required libva.])],
+              [AC_MSG_WARN([libva not found  ])])
+      ])
   ],[
-    AC_MSG_ERROR([libva VAAPI support depends on libavcodec.])
+    AC_MSG_ERROR([libva VAAPI support depends on libavcodec. You cannot use --disable-avcodec.])
   ])
 ])
 




More information about the vlc-devel mailing list