Commit 7f39bd11 authored by Jean-Baptiste Kempf's avatar 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
parent 14e3a156
...@@ -2954,19 +2954,29 @@ dnl ...@@ -2954,19 +2954,29 @@ dnl
dnl libva needs avcodec dnl libva needs avcodec
dnl dnl
AC_ARG_ENABLE(libva, AC_ARG_ENABLE(libva,
[ --enable-libva libva VAAPI support (default disabled)]) [ --enable-libva libva VAAPI support (default auto)])
AS_IF([test "${enable_libva}" = "yes"], [
AS_IF([test "${enable_libva}" != "no"], [
AS_IF([test "x${have_avcodec}" = "xyes"], [ AS_IF([test "x${have_avcodec}" = "xyes"], [
PKG_CHECK_MODULES(LIBVA, [libva libva-x11], PKG_CHECK_MODULES(LIBVA, [libva libva-x11],
[ [
AC_CHECK_HEADERS(libavcodec/vaapi.h, [
VLC_ADD_LIBS([avcodec],[$LIBVA_LIBS]) VLC_ADD_LIBS([avcodec],[$LIBVA_LIBS])
VLC_ADD_CFLAGS([avcodec],[$LIBVA_CFLAGS]) VLC_ADD_CFLAGS([avcodec],[$LIBVA_CFLAGS])
AC_DEFINE(HAVE_AVCODEC_VAAPI, 1, [Define if avcodec has to be built with VAAPI support.]) 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.])
]) ])
]) ])
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment