configure: drop check for --enable-vaapi-glx.

This flag is obsolete. It was meant to explicitly enable/disable VA/GLX API
support, or fallback to TFP+FBO if this API is not found. Now, we check for
the VA/GLX API by default if --enable-glx is set. If this API is not found,
we now default to use TFP+FBO.

Note: TFP+FBO, i.e. using vaPutSurface() is now also a deprecated usage and
will be removed in the future. If GLX rendering is requested, then the VA/GLX
API shall be used as it covers most usages. e.g. AMD driver can't render to
an X pixmap yet.
This commit is contained in:
Gwenole Beauchesne 2012-07-23 16:15:38 +02:00
parent e9112cd3f4
commit 7a0382130f
9 changed files with 50 additions and 45 deletions

View file

@ -107,14 +107,9 @@ AC_ARG_ENABLE(x11,
AC_ARG_ENABLE(glx,
AS_HELP_STRING([--enable-glx],
[enable OpenGL/X11 @<:@default=yes@:>@]),
[enable OpenGL/X11 output @<:@default=yes@:>@]),
[], [enable_glx="yes"])
AC_ARG_ENABLE(vaapi-glx,
AS_HELP_STRING([--enable-vaapi-glx],
[enable VA/GLX extensions @<:@default=yes@:>@]),
[], [enable_vaapi_glx="yes"])
AC_ARG_ENABLE(vaapisink-glx,
AS_HELP_STRING([--enable-vaapisink-glx],
[enable OpenGL/X11 to vaapisink @<:@default=yes@:>@]),
@ -358,10 +353,13 @@ HAVE_VA_GLX=0
LIBVA_GLX_PKGNAME="libva-glx"
if test $USE_GLX -eq 1; then
PKG_CHECK_MODULES(LIBVA_GLX, [$LIBVA_GLX_PKGNAME >= va_api_glx_version],
[HAVE_VA_GLX=1])
if test "$enable_vaapi_glx" = "yes" -a $HAVE_VA_GLX -eq 0; then
AC_MSG_WARN([VA/GLX not found or disabled. Fallbacking to TFP+FBO])
LIBVA_GLX_PKGNAME="$LIBVA_X11_PKGNAME"
[HAVE_VA_GLX=1], [LIBVA_GLX_PKGNAME="$LIBVA_X11_PKGNAME"])
if test $HAVE_VA_GLX -eq 1; then
saved_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$LIBVA_GLX_CPPFLAGS"
AC_CHECK_HEADERS([va/va_glx.h], [:], [HAVE_VA_GLX=0])
CPPFLAGS="$saved_CPPFLAGS"
fi
fi
AC_SUBST(LIBVA_GLX_PKGNAME)
@ -420,10 +418,6 @@ AC_DEFINE_UNQUOTED(USE_GLX, $USE_GLX,
[Defined to 1 if GLX is enabled])
AM_CONDITIONAL(USE_GLX, test $USE_GLX -eq 1)
AC_DEFINE_UNQUOTED([USE_VAAPI_GLX], [$HAVE_VA_GLX],
[Defined to 1 if VA/GLX is enabled])
AM_CONDITIONAL([USE_VAAPI_GLX], [test $HAVE_VA_GLX -eq 1])
AC_DEFINE_UNQUOTED(USE_VAAPISINK_GLX, $USE_VAAPISINK_GLX,
[Defined to 1 to enable GLX support to vaapisink])
AM_CONDITIONAL(USE_VAAPISINK_GLX, test $USE_VAAPISINK_GLX -eq 1)

View file

@ -24,6 +24,12 @@
#include <va/va.h>
#ifdef HAVE_VA_VA_GLX_H
# define USE_VAAPI_GLX 1
#else
# define USE_VAAPI_GLX 0
#endif
#if USE_VAAPI_GLX
# include <va/va_glx.h>
#else

View file

@ -7,14 +7,18 @@ libgstvaapi_CFLAGS = \
-I$(top_builddir)/gst-libs \
$(NULL)
if USE_VAAPI_GLX
libgstvaapi_LIBS = \
$(top_builddir)/gst-libs/gst/vaapi/libgstvaapi-glx-$(GST_MAJORMINOR).la
else
libgstvaapi_LIBS = \
libgstvaapi_LIBS =
if USE_X11
libgstvaapi_LIBS += \
$(top_builddir)/gst-libs/gst/vaapi/libgstvaapi-x11-$(GST_MAJORMINOR).la
endif
if USE_GLX
libgstvaapi_LIBS += \
$(top_builddir)/gst-libs/gst/vaapi/libgstvaapi-glx-$(GST_MAJORMINOR).la
endif
libgstvaapi_la_SOURCES = \
gstvaapi.c \
gstvaapidecode.c \

View file

@ -35,7 +35,7 @@
#include <gst/vaapi/gstvaapivideobuffer.h>
#include <gst/video/videocontext.h>
#if USE_VAAPI_GLX
#if USE_GLX
#include <gst/vaapi/gstvaapivideobuffer_glx.h>
#define gst_vaapi_video_buffer_new(display) \
gst_vaapi_video_buffer_glx_new(GST_VAAPI_DISPLAY_GLX(display))
@ -169,7 +169,7 @@ gst_vaapidecode_update_src_caps(GstVaapiDecode *decode, GstCaps *caps)
gst_structure_set_value(structure, "interlaced", v_interlaced);
gst_structure_set(structure, "type", G_TYPE_STRING, "vaapi", NULL);
gst_structure_set(structure, "opengl", G_TYPE_BOOLEAN, USE_VAAPI_GLX, NULL);
gst_structure_set(structure, "opengl", G_TYPE_BOOLEAN, USE_GLX, NULL);
other_caps = gst_caps_copy(decode->srcpad_caps);
success = gst_pad_set_caps(decode->srcpad, other_caps);

View file

@ -35,7 +35,7 @@
#include <gst/vaapi/gstvaapivideosink.h>
#include <gst/vaapi/gstvaapivideobuffer.h>
#if USE_VAAPI_GLX
#if USE_GLX
#include <gst/vaapi/gstvaapivideobuffer_glx.h>
#define gst_vaapi_video_buffer_new_from_pool(pool) \
gst_vaapi_video_buffer_glx_new_from_pool(pool)
@ -493,7 +493,7 @@ gst_vaapidownload_transform_caps(
gst_structure_set(
structure,
"type", G_TYPE_STRING, "vaapi",
"opengl", G_TYPE_BOOLEAN, USE_VAAPI_GLX,
"opengl", G_TYPE_BOOLEAN, USE_GLX,
NULL
);
}

View file

@ -22,19 +22,20 @@
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
# include "config.h"
#endif
#include <string.h>
#if USE_X11
# include <gst/vaapi/gstvaapidisplay_x11.h>
#endif
#if USE_GLX
# include <gst/vaapi/gstvaapidisplay_glx.h>
#endif
#include "gstvaapipluginutil.h"
#include <string.h>
#if USE_VAAPI_GLX
#include <gst/vaapi/gstvaapidisplay_glx.h>
#else
#include <gst/vaapi/gstvaapidisplay_x11.h>
#endif
/* Preferred first */
static const char *display_types[] = {
"gst-vaapi-display",
@ -60,12 +61,12 @@ gst_vaapi_ensure_display (gpointer element, GstVaapiDisplay **display)
gst_video_context_prepare (context, display_types);
/* If no neighboor, or application not interested, use system default */
#if USE_GLX
if (!*display)
#if USE_VAAPI_GLX
*display = gst_vaapi_display_glx_new (NULL);
#else
*display = gst_vaapi_display_x11_new (NULL);
#endif
if (!*display)
*display = gst_vaapi_display_x11_new (NULL);
/* FIXME allocator should return NULL in case of failure */
if (*display && !gst_vaapi_display_get_display(*display)) {
@ -85,18 +86,18 @@ gst_vaapi_set_display (const gchar *type,
if (!strcmp (type, "x11-display-name")) {
g_return_if_fail (G_VALUE_HOLDS_STRING (value));
#if USE_VAAPI_GLX
#if USE_GLX
dpy = gst_vaapi_display_glx_new (g_value_get_string (value));
#else
dpy = gst_vaapi_display_x11_new (g_value_get_string (value));
#endif
if (!dpy)
dpy = gst_vaapi_display_x11_new (g_value_get_string (value));
} else if (!strcmp (type, "x11-display")) {
g_return_if_fail (G_VALUE_HOLDS_POINTER (value));
#if USE_VAAPI_GLX
#if USE_GLX
dpy = gst_vaapi_display_glx_new_with_display (g_value_get_pointer (value));
#else
dpy = gst_vaapi_display_x11_new_with_display (g_value_get_pointer (value));
#endif
if (!dpy)
dpy = gst_vaapi_display_x11_new_with_display (g_value_get_pointer (value));
} else if (!strcmp (type, "vaapi-display")) {
g_return_if_fail (G_VALUE_HOLDS_POINTER (value));
dpy = gst_vaapi_display_new_with_display (g_value_get_pointer (value));

View file

@ -401,7 +401,7 @@ gst_vaapipostproc_update_src_caps(GstVaapiPostproc *postproc, GstCaps *caps)
gst_structure_set_value(structure, "pixel-aspect-ratio", v_par);
gst_structure_set(structure, "type", G_TYPE_STRING, "vaapi", NULL);
gst_structure_set(structure, "opengl", G_TYPE_BOOLEAN, USE_VAAPI_GLX, NULL);
gst_structure_set(structure, "opengl", G_TYPE_BOOLEAN, USE_GLX, NULL);
if (!postproc->deinterlace)
gst_structure_remove_field(structure, "interlaced");

View file

@ -36,7 +36,7 @@
#include <gst/vaapi/gstvaapivideosink.h>
#include <gst/vaapi/gstvaapivideobuffer.h>
#if USE_VAAPI_GLX
#if USE_GLX
#include <gst/vaapi/gstvaapivideobuffer_glx.h>
#define gst_vaapi_video_buffer_new_from_pool(pool) \
gst_vaapi_video_buffer_glx_new_from_pool(pool)
@ -471,7 +471,7 @@ gst_vaapiupload_transform_caps(
gst_structure_set(
structure,
"type", G_TYPE_STRING, "vaapi",
"opengl", G_TYPE_BOOLEAN, USE_VAAPI_GLX,
"opengl", G_TYPE_BOOLEAN, USE_GLX,
NULL
);
}

View file

@ -28,10 +28,8 @@
#include <gst/vaapi/gstvaapidisplay_glx.h>
#endif
#if USE_VAAPI_GLX
#ifdef HAVE_VA_VA_GLX_H
# include <va/va_glx.h>
#else
# define vaGetDisplayGLX(dpy) vaGetDisplay(dpy)
#endif
static void
@ -255,6 +253,7 @@ main(int argc, char *argv[])
}
g_print("\n");
#ifdef HAVE_VA_VA_GLX_H
g_print("#\n");
g_print("# Create display with gst_vaapi_display_new_with_display() [vaGetDisplayGLX()]\n");
g_print("#\n");
@ -276,6 +275,7 @@ main(int argc, char *argv[])
XCloseDisplay(x11_display);
}
g_print("\n");
#endif
#endif
gst_deinit();