Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

vaapi: fix check for VA/GLX API.

Use pkg-config to check for VA/GLX API. This fixes build with VA-API
installations into non-standard locations.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
  • Loading branch information...
commit 2b6d4808bb56921059c99fd53b8614d6919b4794 1 parent 97cd8af
@gbeauchesne authored
View
18 configure.in
@@ -1538,10 +1538,19 @@ if test "x$use_vaapi" != "xno"; then
fi
USE_VAAPI=0
else
+ has_va_x11="no"
+ has_va_glx="no"
initial_val=$use_vaapi
- AC_CHECK_LIB([va], main, :, use_vaapi=no)
+ PKG_CHECK_MODULES([LIBVA], [libva], [
+ INCLUDES="$INCLUDES $LIBVA_CFLAGS"
+ LIBS="$LIBS $LIBVA_LIBS"], [use_vaapi="no"])
if test "x$use_vaapi" != "xno"; then
- AC_CHECK_LIB([va-glx], main, LIBS="-lva -lva-glx $LIBS", use_vaapi=no, -lva)
+ if test "$use_gl" = "yes"; then
+ PKG_CHECK_MODULES([LIBVA_GLX], [libva-glx], [
+ INCLUDES="$INCLUDES $LIBVA_GLX_CFLAGS"
+ LIBS="$LIBS $LIBVA_GLX_LIBS"
+ has_va_glx="yes"], [use_vaapi="no"])
+ fi
fi
if test "x$use_vaapi" = "xno"; then
@@ -1552,7 +1561,10 @@ if test "x$use_vaapi" != "xno"; then
fi
USE_VAAPI=0
else
- AC_DEFINE([HAVE_LIBVA], [1], [Define to 1 if you have the 'vaapi' libraries (-lva AND -lva-glx)])
+ AC_DEFINE([HAVE_LIBVA], [1], [Define to 1 if you have the 'vaapi' libraries])
+ if test "$has_va_glx" = "yes"; then
+ AC_DEFINE([HAVE_VA_GLX], [1], [Defined to 1 if VA/GLX API is available])
+ fi
USE_VAAPI=1
fi
fi
View
4 xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp
@@ -89,7 +89,9 @@ static CDisplayPtr GetGlobalDisplay()
}
VADisplay disp;
+#ifdef HAVE_VA_GLX
disp = vaGetDisplayGLX(g_Windowing.GetDisplay());
+#endif
int major_version, minor_version;
VAStatus res = vaInitialize(disp, &major_version, &minor_version);
@@ -139,7 +141,9 @@ CSurfaceGL::~CSurfaceGL()
{
CLog::Log(LOGDEBUG, "VAAPI - destroying glx surface %p", m_id);
CSingleLock lock(*m_display);
+#ifdef HAVE_VA_GLX
WARN(vaDestroySurfaceGLX(m_display->get(), m_id))
+#endif
}
CDecoder::CDecoder()
View
5 xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.h
@@ -26,11 +26,12 @@
#include "DVDVideoCodecFFmpeg.h"
#include <libavcodec/vaapi.h>
#include <va/va.h>
-#include <va/va_x11.h>
-#include <va/va_glx.h>
#include <list>
#include <boost/shared_ptr.hpp>
+#ifdef HAVE_VA_GLX
+# include <va/va_glx.h>
+#endif
namespace VAAPI {
Please sign in to comment.
Something went wrong with that request. Please try again.