mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-20 21:16:24 +00:00
Don't build vaapisink/gl by default. However, if this is enabled, use the GL renderer by default.
This commit is contained in:
parent
28e2b37cfb
commit
3c48a3004c
4 changed files with 27 additions and 10 deletions
17
configure.ac
17
configure.ac
|
@ -75,6 +75,11 @@ AC_ARG_ENABLE(glx,
|
|||
[enable OpenGL/X11 @<:@default=yes@:>@]),
|
||||
[], [enable_glx="yes"])
|
||||
|
||||
AC_ARG_ENABLE(vaapisink-glx,
|
||||
AC_HELP_STRING([--enable-vaapisink-glx],
|
||||
[enable OpenGL/X11 to vaapisink @<:@default=yes@:>@]),
|
||||
[], [enable_vaapisink_glx="no"])
|
||||
|
||||
dnl Check for __attribute__((visibility()))
|
||||
AC_CACHE_CHECK([whether __attribute__((visibility())) is supported],
|
||||
vaapi_cv_visibility_attribute,
|
||||
|
@ -227,9 +232,20 @@ AC_SUBST(LIBVA_GLX_PKGNAME)
|
|||
AC_SUBST(LIBVA_EXTRA_CFLAGS)
|
||||
AC_SUBST(LIBVA_EXTRA_LIBS)
|
||||
|
||||
dnl Check for OpenGL support to
|
||||
if test "$enable_vaapisink_glx:$USE_GLX" = "yes:1"; then
|
||||
USE_VAAPISINK_GLX=1
|
||||
else
|
||||
USE_VAAPISINK_GLX=0
|
||||
fi
|
||||
|
||||
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_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)
|
||||
|
||||
VA_VERSION=`$PKG_CONFIG --modversion libva`
|
||||
VA_MAJOR_VERSION=`echo "$VA_VERSION" | cut -d'.' -f1`
|
||||
VA_MINOR_VERSION=`echo "$VA_VERSION" | cut -d'.' -f2`
|
||||
|
@ -289,4 +305,5 @@ echo $PACKAGE configuration summary:
|
|||
echo
|
||||
echo VA-API version ................... : $VA_VERSION_STR
|
||||
echo GLX support ...................... : $(test $USE_GLX -eq 1 && echo yes || echo no)
|
||||
echo Build vaapisink with OpenGL ...... : $(test $USE_VAAPISINK_GLX -eq 1 && echo yes || echo no)
|
||||
echo
|
||||
|
|
|
@ -3,7 +3,7 @@ plugin_LTLIBRARIES = libgstvaapisink.la
|
|||
libgstvaapi_CFLAGS = \
|
||||
-I$(top_srcdir)/gst-libs
|
||||
|
||||
if USE_GLX
|
||||
if USE_VAAPISINK_GLX
|
||||
libgstvaapi_LIBS = \
|
||||
$(top_builddir)/gst-libs/gst/vaapi/libgstvaapi-glx-$(GST_MAJORMINOR).la
|
||||
else
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
#include <gst/vaapi/gstvaapivideosink.h>
|
||||
#include <gst/vaapi/gstvaapidisplay_x11.h>
|
||||
#include <gst/vaapi/gstvaapiwindow_x11.h>
|
||||
#if USE_GLX
|
||||
#if USE_VAAPISINK_GLX
|
||||
#include <gst/vaapi/gstvaapidisplay_glx.h>
|
||||
#include <gst/vaapi/gstvaapiwindow_glx.h>
|
||||
#endif
|
||||
|
@ -125,7 +125,7 @@ gst_vaapisink_ensure_window(GstVaapiSink *sink, guint width, guint height)
|
|||
GstVaapiDisplay * const display = sink->display;
|
||||
|
||||
if (!sink->window) {
|
||||
#if USE_GLX
|
||||
#if USE_VAAPISINK_GLX
|
||||
if (sink->use_glx)
|
||||
sink->window = gst_vaapi_window_glx_new(display, width, height);
|
||||
else
|
||||
|
@ -139,7 +139,7 @@ static inline gboolean
|
|||
gst_vaapisink_ensure_display(GstVaapiSink *sink)
|
||||
{
|
||||
if (!sink->display) {
|
||||
#if USE_GLX
|
||||
#if USE_VAAPISINK_GLX
|
||||
if (sink->use_glx)
|
||||
sink->display = gst_vaapi_display_glx_new(sink->display_name);
|
||||
else
|
||||
|
@ -285,7 +285,7 @@ gst_vaapisink_show_frame(GstBaseSink *base_sink, GstBuffer *buffer)
|
|||
|
||||
flags = GST_VAAPI_PICTURE_STRUCTURE_FRAME;
|
||||
|
||||
#if USE_GLX
|
||||
#if USE_VAAPISINK_GLX
|
||||
if (sink->use_glx) {
|
||||
GstVaapiWindowGLX * const window = GST_VAAPI_WINDOW_GLX(sink->window);
|
||||
gst_vaapi_window_glx_make_current(window);
|
||||
|
@ -418,14 +418,14 @@ static void gst_vaapisink_class_init(GstVaapiSinkClass *klass)
|
|||
basesink_class->preroll = gst_vaapisink_show_frame;
|
||||
basesink_class->render = gst_vaapisink_show_frame;
|
||||
|
||||
#if USE_GLX
|
||||
#if USE_VAAPISINK_GLX
|
||||
g_object_class_install_property
|
||||
(object_class,
|
||||
PROP_USE_GLX,
|
||||
g_param_spec_boolean("use-glx",
|
||||
"GLX rendering",
|
||||
"Enables GLX rendering",
|
||||
FALSE,
|
||||
TRUE,
|
||||
G_PARAM_READWRITE));
|
||||
#endif
|
||||
|
||||
|
@ -473,7 +473,7 @@ static void gst_vaapisink_init(GstVaapiSink *sink, GstVaapiSinkClass *klass)
|
|||
sink->video_height = 0;
|
||||
sink->fullscreen = FALSE;
|
||||
sink->synchronous = FALSE;
|
||||
sink->use_glx = FALSE;
|
||||
sink->use_glx = USE_VAAPISINK_GLX;
|
||||
}
|
||||
|
||||
GstVaapiDisplay *
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
#include <gst/video/gstvideosink.h>
|
||||
#include <gst/vaapi/gstvaapidisplay.h>
|
||||
#include <gst/vaapi/gstvaapiwindow.h>
|
||||
#if USE_GLX
|
||||
#if USE_VAAPISINK_GLX
|
||||
#include <gst/vaapi/gstvaapitexture.h>
|
||||
#endif
|
||||
#include <X11/Xlib.h>
|
||||
|
@ -58,7 +58,7 @@ G_BEGIN_DECLS
|
|||
typedef struct _GstVaapiSink GstVaapiSink;
|
||||
typedef struct _GstVaapiSinkClass GstVaapiSinkClass;
|
||||
|
||||
#if !USE_GLX
|
||||
#if !USE_VAAPISINK_GLX
|
||||
typedef struct _GstVaapiTexture GstVaapiTexture;
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Reference in a new issue