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@:>@]),
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)
[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)
#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
-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 \
#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))
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);
#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)
gst_structure_set(
structure,
"type", G_TYPE_STRING, "vaapi",
- "opengl", G_TYPE_BOOLEAN, USE_VAAPI_GLX,
+ "opengl", G_TYPE_BOOLEAN, USE_GLX,
NULL
);
}
*/
#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",
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)) {
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));
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");
#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)
gst_structure_set(
structure,
"type", G_TYPE_STRING, "vaapi",
- "opengl", G_TYPE_BOOLEAN, USE_VAAPI_GLX,
+ "opengl", G_TYPE_BOOLEAN, USE_GLX,
NULL
);
}
#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
}
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");
}
g_print("\n");
#endif
+#endif
gst_deinit();
return 0;