vaapi: prefix USE_FOO defines to fix build with mesa 22.3.0

Apparently mesa 22.3.0 has updated the egl headers, and eglplatform.h now
contains commit
3670d645f4
after which xlib headers don't get included by default anymore but are
dependent upon whether USE_X11 was defined.

This breaks headless builds of gstreamer-vaapi because we always define
an internal define USE_X11 as either 1 or 0.

Change these defines to GST_VAAPI_USE_XYZ instead to avoid this.

Fixes #1634

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3555>
This commit is contained in:
Tim-Philipp Müller 2022-12-10 13:11:08 +00:00 committed by GStreamer Marge Bot
parent 4aeb3def20
commit 4d70b9f87c
19 changed files with 117 additions and 117 deletions

View file

@ -338,7 +338,7 @@ config_create (GstVaapiContext * context)
g_assert (attrib_index < G_N_ELEMENTS (attribs));
switch (cip->usage) {
#if USE_ENCODERS
#if GST_VAAPI_USE_ENCODERS
case GST_VAAPI_CONTEXT_USAGE_ENCODE:
{
const GstVaapiConfigInfoEncoder *const config = &cip->config.encoder;

View file

@ -115,23 +115,23 @@ gst_vaapi_display_type_get_type (void)
static const GEnumValue display_types[] = {
{GST_VAAPI_DISPLAY_TYPE_ANY,
"Auto detection", "any"},
#if USE_X11
#if GST_VAAPI_USE_X11
{GST_VAAPI_DISPLAY_TYPE_X11,
"VA/X11 display", "x11"},
#endif
#if USE_GLX
#if GST_VAAPI_USE_GLX
{GST_VAAPI_DISPLAY_TYPE_GLX,
"VA/GLX display", "glx"},
#endif
#if USE_EGL
#if GST_VAAPI_USE_EGL
{GST_VAAPI_DISPLAY_TYPE_EGL,
"VA/EGL display", "egl"},
#endif
#if USE_WAYLAND
#if GST_VAAPI_USE_WAYLAND
{GST_VAAPI_DISPLAY_TYPE_WAYLAND,
"VA/Wayland display", "wayland"},
#endif
#if USE_DRM
#if GST_VAAPI_USE_DRM
{GST_VAAPI_DISPLAY_TYPE_DRM,
"VA/DRM display", "drm"},
#endif
@ -1896,13 +1896,13 @@ static gboolean
get_render_mode_default (GstVaapiDisplay * display, GstVaapiRenderMode * pmode)
{
switch (GST_VAAPI_DISPLAY_VADISPLAY_TYPE (display)) {
#if USE_WAYLAND
#if GST_VAAPI_USE_WAYLAND
case GST_VAAPI_DISPLAY_TYPE_WAYLAND:
/* wl_buffer mapped from VA surface through vaGetSurfaceBufferWl() */
*pmode = GST_VAAPI_RENDER_MODE_OVERLAY;
break;
#endif
#if USE_DRM
#if GST_VAAPI_USE_DRM
case GST_VAAPI_DISPLAY_TYPE_DRM:
/* vaGetSurfaceBufferDRM() returns the underlying DRM buffer handle */
*pmode = GST_VAAPI_RENDER_MODE_OVERLAY;

View file

@ -28,10 +28,10 @@
#include "gstvaapiwindow_priv.h"
#include "gstvaapitexture_egl.h"
#if USE_X11
#if GST_VAAPI_USE_X11
#include "gstvaapidisplay_x11.h"
#endif
#if USE_WAYLAND
#if GST_VAAPI_USE_WAYLAND
#include "gstvaapidisplay_wayland.h"
#endif
@ -110,13 +110,13 @@ gst_vaapi_display_egl_bind_display (GstVaapiDisplay * base_display,
native_egl_display = params->gl_display;
if (!native_vaapi_display) {
#if USE_X11
#if GST_VAAPI_USE_X11
if (params->display_type == GST_VAAPI_DISPLAY_TYPE_ANY
|| params->display_type == GST_VAAPI_DISPLAY_TYPE_X11
|| params->display_type == GST_VAAPI_DISPLAY_TYPE_EGL)
native_vaapi_display = gst_vaapi_display_x11_new (NULL);
#endif
#if USE_WAYLAND
#if GST_VAAPI_USE_WAYLAND
if (!native_vaapi_display)
native_vaapi_display = gst_vaapi_display_wayland_new (NULL);
#endif

View file

@ -32,7 +32,7 @@
#include "gstvaapisurface_drm.h"
#include "gstvaapisurface_priv.h"
#if USE_DRM
#if GST_VAAPI_USE_DRM
#include <drm_fourcc.h>
#else
#define DRM_FORMAT_MOD_LINEAR 0ULL

View file

@ -35,7 +35,7 @@
#define DEBUG 1
#include "gst/vaapi/gstvaapidebug.h"
#if USE_DRM
#if GST_VAAPI_USE_DRM
#include <drm_fourcc.h>
#endif
@ -49,7 +49,7 @@ typedef struct _GstVideoFormatMapMap
#define VA_BYTE_ORDER_NOT_CARE 0
#if USE_DRM
#if GST_VAAPI_USE_DRM
#define MAKE_DRM_FORMAT(DRM_FORMAT) G_PASTE(DRM_FORMAT_,DRM_FORMAT)
#else
#define MAKE_DRM_FORMAT(DRM_FORMAT) 0
@ -643,7 +643,7 @@ gst_vaapi_video_format_create_map (VAImageFormat * formats, guint n)
guint
gst_vaapi_drm_format_from_va_fourcc (guint32 fourcc)
{
#if USE_DRM
#if GST_VAAPI_USE_DRM
const GArray *map = gst_vaapi_video_formats_map;
const GstVideoFormatMap *m;
guint i;
@ -679,7 +679,7 @@ gst_vaapi_drm_format_from_va_fourcc (guint32 fourcc)
GstVideoFormat
gst_vaapi_video_format_from_drm_format (guint drm_format)
{
#if USE_DRM
#if GST_VAAPI_USE_DRM
const GArray *map = gst_vaapi_video_formats_map;
const GstVideoFormatMap *m;
guint i;

View file

@ -29,14 +29,14 @@
#include "gstvaapisink.h"
#include "gstvaapidecodebin.h"
#if USE_ENCODERS
#if GST_VAAPI_USE_ENCODERS
#include "gstvaapiencode_h264.h"
#include "gstvaapiencode_mpeg2.h"
#include "gstvaapiencode_jpeg.h"
#include "gstvaapiencode_vp8.h"
#include "gstvaapiencode_h265.h"
#if USE_VP9_ENCODER
#if GST_VAAPI_USE_VP9_ENCODER
#include "gstvaapiencode_vp9.h"
#endif
#endif
@ -109,7 +109,7 @@ display_get_decoder_codecs (GstVaapiDisplay * display)
return codecs;
}
#if USE_ENCODERS
#if GST_VAAPI_USE_ENCODERS
static GArray *
display_get_encoder_codecs (GstVaapiDisplay * display)
{
@ -144,7 +144,7 @@ static const GstVaapiEncoderMap vaapi_encode_map[] = {
DEF_ENC (MPEG2, mpeg2),
DEF_ENC (JPEG, jpeg),
DEF_ENC (VP8, vp8),
#if USE_VP9_ENCODER
#if GST_VAAPI_USE_VP9_ENCODER
DEF_ENC (VP9, vp9),
#endif
DEF_ENC (H265, h265),
@ -217,7 +217,7 @@ plugin_init (GstPlugin * plugin)
rank = GST_RANK_MARGINAL;
gst_element_register (plugin, "vaapisink", rank, GST_TYPE_VAAPISINK);
#if USE_ENCODERS
#if GST_VAAPI_USE_ENCODERS
gst_vaapiencode_register (plugin, display);
#endif

View file

@ -30,7 +30,7 @@
#include "gstvaapidecode_props.h"
#include "gstvaapipluginutil.h"
#include "gstvaapivideobuffer.h"
#if (USE_GLX || USE_EGL)
#if (GST_VAAPI_USE_GLX || GST_VAAPI_USE_EGL)
#include "gstvaapivideometa_texture.h"
#endif
#include "gstvaapivideobufferpool.h"
@ -44,7 +44,7 @@
#include <gst/vaapi/gstvaapidecoder_vp8.h>
#include <gst/vaapi/gstvaapidecoder_h265.h>
#include <gst/vaapi/gstvaapidecoder_vp9.h>
#if USE_AV1_DECODER
#if GST_VAAPI_USE_AV1_DECODER
#include <gst/vaapi/gstvaapidecoder_av1.h>
#endif
@ -72,7 +72,7 @@ char *gst_vaapidecode_sink_caps_str = NULL;
static const char gst_vaapidecode_src_caps_str[] =
GST_VAAPI_MAKE_SURFACE_CAPS "; "
GST_VIDEO_CAPS_MAKE_WITH_FEATURES(GST_CAPS_FEATURE_MEMORY_DMABUF, GST_VAAPI_FORMATS_ALL) " ;"
#if (USE_GLX || USE_EGL)
#if (GST_VAAPI_USE_GLX || GST_VAAPI_USE_EGL)
GST_VAAPI_MAKE_GLTEXUPLOAD_CAPS "; "
#endif
GST_VIDEO_CAPS_MAKE(GST_VAAPI_FORMATS_ALL);
@ -269,7 +269,7 @@ gst_vaapidecode_ensure_allowed_srcpad_caps (GstVaapiDecode * decode)
gst_caps_set_features_simple (dma_caps,
gst_caps_features_from_string (GST_CAPS_FEATURE_MEMORY_DMABUF));
}
#if (USE_GLX || USE_EGL)
#if (GST_VAAPI_USE_GLX || GST_VAAPI_USE_EGL)
if (!GST_VAAPI_PLUGIN_BASE_SRC_PAD_CAN_DMABUF (decode)
&& gst_vaapi_display_has_opengl (GST_VAAPI_PLUGIN_BASE_DISPLAY (decode))) {
gltexup_caps = gst_caps_from_string (GST_VAAPI_MAKE_GLTEXUPLOAD_CAPS);
@ -341,7 +341,7 @@ gst_vaapidecode_update_src_caps (GstVaapiDecode * decode)
if (feature == GST_VAAPI_CAPS_FEATURE_NOT_NEGOTIATED)
return FALSE;
#if (!USE_GLX && !USE_EGL)
#if (!GST_VAAPI_USE_GLX && !GST_VAAPI_USE_EGL)
/* This is a very pathological situation. Should not happen. */
if (feature == GST_VAAPI_CAPS_FEATURE_GL_TEXTURE_UPLOAD_META)
return FALSE;
@ -632,7 +632,7 @@ gst_vaapidecode_push_decoded_frame (GstVideoDecoder * vdec,
GST_BUFFER_FLAG_SET (out_frame->output_buffer,
GST_VIDEO_BUFFER_FLAG_FIRST_IN_BUNDLE);
}
#if (USE_GLX || USE_EGL)
#if (GST_VAAPI_USE_GLX || GST_VAAPI_USE_EGL)
if (decode->has_texture_upload_meta)
gst_buffer_ensure_texture_upload_meta (out_frame->output_buffer);
#endif
@ -860,7 +860,7 @@ gst_vaapidecode_decide_allocation (GstVideoDecoder * vdec, GstQuery * query)
decode->has_texture_upload_meta = FALSE;
#if (USE_GLX || USE_EGL)
#if (GST_VAAPI_USE_GLX || GST_VAAPI_USE_EGL)
decode->has_texture_upload_meta =
gst_query_find_allocation_meta (query,
GST_VIDEO_GL_TEXTURE_UPLOAD_META_API_TYPE, NULL) &&
@ -972,7 +972,7 @@ gst_vaapidecode_create (GstVaapiDecode * decode, GstCaps * caps)
case GST_VAAPI_CODEC_VP9:
decode->decoder = gst_vaapi_decoder_vp9_new (dpy, caps);
break;
#if USE_AV1_DECODER
#if GST_VAAPI_USE_AV1_DECODER
case GST_VAAPI_CODEC_AV1:
decode->decoder = gst_vaapi_decoder_av1_new (dpy, caps);
break;

View file

@ -96,7 +96,7 @@ static const char gst_vaapi_decode_bin_sink_caps_str[] =
static const char gst_vaapi_decode_bin_src_caps_str[] =
GST_VAAPI_MAKE_SURFACE_CAPS ", "
GST_CAPS_INTERLACED_FALSE "; "
#if (USE_GLX || USE_EGL)
#if (GST_VAAPI_USE_GLX || GST_VAAPI_USE_EGL)
GST_VAAPI_MAKE_GLTEXUPLOAD_CAPS ", "
GST_CAPS_INTERLACED_FALSE "; "
#endif

View file

@ -698,7 +698,7 @@ gst_vaapi_plugin_base_create_pool (GstVaapiPluginBase * plugin, GstCaps * caps,
gst_buffer_pool_config_add_option (config,
GST_BUFFER_POOL_OPTION_VIDEO_ALIGNMENT);
}
#if (USE_GLX || USE_EGL)
#if (GST_VAAPI_USE_GLX || GST_VAAPI_USE_EGL)
if (options & GST_VAAPI_VIDEO_BUFFER_POOL_OPTION_GL_TEXTURE_UPLOAD) {
gst_buffer_pool_config_add_option (config,
GST_BUFFER_POOL_OPTION_VIDEO_GL_TEXTURE_UPLOAD_META);
@ -987,7 +987,7 @@ gst_vaapi_plugin_base_decide_allocation (GstVaapiPluginBase * plugin,
guint i, size, min, max, pool_options, num_allocators;
gint index_allocator;
gboolean update_pool = FALSE;
#if (USE_GLX || USE_EGL)
#if (GST_VAAPI_USE_GLX || GST_VAAPI_USE_EGL)
guint idx;
#endif
@ -999,7 +999,7 @@ gst_vaapi_plugin_base_decide_allocation (GstVaapiPluginBase * plugin,
if (gst_query_find_allocation_meta (query, GST_VIDEO_META_API_TYPE, NULL))
pool_options |= GST_VAAPI_VIDEO_BUFFER_POOL_OPTION_VIDEO_META;
#if (USE_GLX || USE_EGL)
#if (GST_VAAPI_USE_GLX || GST_VAAPI_USE_EGL)
if (gst_query_find_allocation_meta (query,
GST_VIDEO_GL_TEXTURE_UPLOAD_META_API_TYPE, &idx) &&
gst_vaapi_caps_feature_contains (caps,
@ -1328,13 +1328,13 @@ gst_vaapi_plugin_base_set_gl_context (GstVaapiPluginBase * plugin,
gst_object_replace (&plugin->gl_context, object);
switch (gst_gl_context_get_gl_platform (gl_context)) {
#if USE_GLX
#if GST_VAAPI_USE_GLX
case GST_GL_PLATFORM_GLX:
display_type = GST_VAAPI_DISPLAY_TYPE_GLX;
break;
#endif
case GST_GL_PLATFORM_EGL:
#if USE_EGL
#if GST_VAAPI_USE_EGL
display_type = GST_VAAPI_DISPLAY_TYPE_EGL;
break;
#endif
@ -1531,7 +1531,7 @@ void
gst_vaapi_plugin_base_set_srcpad_can_dmabuf (GstVaapiPluginBase * plugin,
GstObject * object)
{
#if USE_EGL && USE_GST_GL_HELPERS
#if GST_VAAPI_USE_EGL && USE_GST_GL_HELPERS
GstVaapiPadPrivate *srcpriv = GST_VAAPI_PAD_PRIVATE (plugin->srcpad);
GstGLContext *const gl_context = GST_GL_CONTEXT (object);

View file

@ -26,24 +26,24 @@
#include "gstvaapivideocontext.h"
#include <gst/vaapi/gstvaapiprofilecaps.h>
#include <gst/vaapi/gstvaapiutils.h>
#if USE_DRM
#if GST_VAAPI_USE_DRM
# include <gst/vaapi/gstvaapidisplay_drm.h>
#endif
#if USE_X11
#if GST_VAAPI_USE_X11
# include <gst/vaapi/gstvaapidisplay_x11.h>
#endif
#if USE_GLX
#if GST_VAAPI_USE_GLX
# include <gst/vaapi/gstvaapidisplay_glx.h>
#endif
#if USE_EGL
#if GST_VAAPI_USE_EGL
# include <gst/vaapi/gstvaapidisplay_egl.h>
#endif
#if USE_WAYLAND
#if GST_VAAPI_USE_WAYLAND
# include <gst/vaapi/gstvaapidisplay_wayland.h>
#endif
#if USE_GST_GL_HELPERS
# include <gst/gl/gl.h>
#if USE_EGL && GST_GL_HAVE_PLATFORM_EGL
#if GST_VAAPI_USE_EGL && GST_GL_HAVE_PLATFORM_EGL
# include <gst/gl/egl/gstgldisplay_egl.h>
#endif
#endif
@ -66,28 +66,28 @@ typedef struct
/* *INDENT-OFF* */
static const DisplayMap g_display_map[] = {
#if USE_WAYLAND
#if GST_VAAPI_USE_WAYLAND
{"wayland",
GST_VAAPI_DISPLAY_TYPE_WAYLAND,
gst_vaapi_display_wayland_new,
(GstVaapiDisplayCreateFromHandleFunc)
gst_vaapi_display_wayland_new_with_display},
#endif
#if USE_GLX
#if GST_VAAPI_USE_GLX
{"glx",
GST_VAAPI_DISPLAY_TYPE_GLX,
gst_vaapi_display_glx_new,
(GstVaapiDisplayCreateFromHandleFunc)
gst_vaapi_display_glx_new_with_display},
#endif
#if USE_X11
#if GST_VAAPI_USE_X11
{"x11",
GST_VAAPI_DISPLAY_TYPE_X11,
gst_vaapi_display_x11_new,
(GstVaapiDisplayCreateFromHandleFunc)
gst_vaapi_display_x11_new_with_display},
#endif
#if USE_DRM
#if GST_VAAPI_USE_DRM
{"drm",
GST_VAAPI_DISPLAY_TYPE_DRM,
gst_vaapi_display_drm_new},
@ -140,26 +140,26 @@ gst_vaapi_get_display_type_from_gl (GstGLDisplayType gl_display_type,
GstGLPlatform gl_platform)
{
switch (gl_display_type) {
#if USE_X11
#if GST_VAAPI_USE_X11
case GST_GL_DISPLAY_TYPE_X11:{
#if USE_GLX
#if GST_VAAPI_USE_GLX
if (gl_platform == GST_GL_PLATFORM_GLX)
return GST_VAAPI_DISPLAY_TYPE_GLX;
#endif
return GST_VAAPI_DISPLAY_TYPE_X11;
}
#endif
#if USE_WAYLAND
#if GST_VAAPI_USE_WAYLAND
case GST_GL_DISPLAY_TYPE_WAYLAND:{
return GST_VAAPI_DISPLAY_TYPE_WAYLAND;
}
#endif
#if USE_EGL
#if GST_VAAPI_USE_EGL
case GST_GL_DISPLAY_TYPE_EGL:{
return GST_VAAPI_DISPLAY_TYPE_EGL;
}
#endif
#if USE_DRM
#if GST_VAAPI_USE_DRM
case GST_GL_DISPLAY_TYPE_GBM:{
return GST_VAAPI_DISPLAY_TYPE_DRM;
}
@ -178,23 +178,23 @@ gst_vaapi_get_display_type_from_gl_env (void)
const gchar *const gl_window_type = g_getenv ("GST_GL_WINDOW");
if (!gl_window_type) {
#if USE_X11 && GST_GL_HAVE_WINDOW_X11
#if GST_VAAPI_USE_X11 && GST_GL_HAVE_WINDOW_X11
return GST_VAAPI_DISPLAY_TYPE_X11;
#elif USE_WAYLAND && GST_GL_HAVE_WINDOW_WAYLAND
#elif GST_VAAPI_USE_WAYLAND && GST_GL_HAVE_WINDOW_WAYLAND
return GST_VAAPI_DISPLAY_TYPE_WAYLAND;
#elif USE_EGL && GST_GL_HAVE_PLATFORM_EGL
#elif GST_VAAPI_USE_EGL && GST_GL_HAVE_PLATFORM_EGL
return GST_VAAPI_DISPLAY_TYPE_EGL;
#endif
}
#if USE_X11
#if GST_VAAPI_USE_X11
if (g_strcmp0 (gl_window_type, "x11") == 0)
return GST_VAAPI_DISPLAY_TYPE_X11;
#endif
#if USE_WAYLAND
#if GST_VAAPI_USE_WAYLAND
if (g_strcmp0 (gl_window_type, "wayland") == 0)
return GST_VAAPI_DISPLAY_TYPE_WAYLAND;
#endif
#if USE_EGL
#if GST_VAAPI_USE_EGL
{
const gchar *const gl_platform_type = g_getenv ("GST_GL_PLATFORM");
if (g_strcmp0 (gl_platform_type, "egl") == 0)
@ -205,7 +205,7 @@ gst_vaapi_get_display_type_from_gl_env (void)
return GST_VAAPI_DISPLAY_TYPE_ANY;
}
#if USE_EGL
#if GST_VAAPI_USE_EGL
static gint
gst_vaapi_get_gles_version_from_gl_api (GstGLAPI gl_api)
{
@ -236,7 +236,7 @@ gst_vaapi_get_egl_handle_from_gl_display (GstGLDisplay * gl_display)
}
return egl_handle;
}
#endif /* USE_EGL */
#endif /* GST_VAAPI_USE_EGL */
static GstVaapiDisplay *
gst_vaapi_create_display_from_egl (GstGLDisplay * gl_display,
@ -244,7 +244,7 @@ gst_vaapi_create_display_from_egl (GstGLDisplay * gl_display,
gpointer native_display)
{
GstVaapiDisplay *display = NULL;
#if USE_EGL
#if GST_VAAPI_USE_EGL
GstGLAPI gl_api;
gint gles_version;
guintptr egl_handler;
@ -917,10 +917,10 @@ gst_vaapi_create_test_display (void)
guint i;
GstVaapiDisplay *display = NULL;
const GstVaapiDisplayType test_display_map[] = {
#if USE_DRM
#if GST_VAAPI_USE_DRM
GST_VAAPI_DISPLAY_TYPE_DRM,
#endif
#if USE_X11
#if GST_VAAPI_USE_X11
GST_VAAPI_DISPLAY_TYPE_X11,
#endif
};

View file

@ -72,7 +72,7 @@ static const char gst_vaapipostproc_sink_caps_str[] =
static const char gst_vaapipostproc_src_caps_str[] =
GST_VAAPI_MAKE_SURFACE_CAPS ", "
GST_CAPS_INTERLACED_FALSE "; "
#if (USE_GLX || USE_EGL)
#if (GST_VAAPI_USE_GLX || GST_VAAPI_USE_EGL)
GST_VAAPI_MAKE_GLTEXUPLOAD_CAPS "; "
#endif
GST_VIDEO_CAPS_MAKE (GST_VAAPI_FORMATS_ALL) ", "

View file

@ -177,7 +177,7 @@ gst_vaapisink_render_surface (GstVaapiSink * sink, GstVaapiSurface * surface,
/* --- DRM Backend --- */
/* ------------------------------------------------------------------------ */
#if USE_DRM
#if GST_VAAPI_USE_DRM
#include <gst/vaapi/gstvaapidisplay_drm.h>
static gboolean
@ -212,7 +212,7 @@ gst_vaapisink_backend_drm (void)
/* --- X11 Backend --- */
/* ------------------------------------------------------------------------ */
#if USE_X11
#if GST_VAAPI_USE_X11
#include <gst/vaapi/gstvaapidisplay_x11.h>
#include <gst/vaapi/gstvaapiwindow_x11.h>
@ -528,7 +528,7 @@ gst_vaapisink_backend_x11 (void)
/* --- Wayland Backend --- */
/* ------------------------------------------------------------------------ */
#if USE_WAYLAND
#if GST_VAAPI_USE_WAYLAND
#include <gst/vaapi/gstvaapidisplay_wayland.h>
#include <gst/vaapi/gstvaapiwindow_wayland.h>
@ -1021,22 +1021,22 @@ static void
gst_vaapisink_ensure_backend (GstVaapiSink * sink)
{
switch (GST_VAAPI_PLUGIN_BASE_DISPLAY_TYPE (sink)) {
#if USE_DRM
#if GST_VAAPI_USE_DRM
case GST_VAAPI_DISPLAY_TYPE_DRM:
sink->backend = gst_vaapisink_backend_drm ();
break;
#endif
#if USE_X11
#if GST_VAAPI_USE_X11
case GST_VAAPI_DISPLAY_TYPE_X11:
sink->backend = gst_vaapisink_backend_x11 ();
break;
#endif
#if USE_GLX
#if GST_VAAPI_USE_GLX
case GST_VAAPI_DISPLAY_TYPE_GLX:
sink->backend = gst_vaapisink_backend_x11 ();
break;
#endif
#if USE_WAYLAND
#if GST_VAAPI_USE_WAYLAND
case GST_VAAPI_DISPLAY_TYPE_WAYLAND:
sink->backend = gst_vaapisink_backend_wayland ();
break;

View file

@ -25,7 +25,7 @@
#include "gstvaapivideobuffer.h"
#include "gstvaapivideomemory.h"
#include "gstvaapipluginutil.h"
#if (USE_GLX || USE_EGL)
#if (GST_VAAPI_USE_GLX || GST_VAAPI_USE_EGL)
#include "gstvaapivideometa_texture.h"
#endif
@ -431,7 +431,7 @@ gst_vaapi_video_buffer_pool_alloc_buffer (GstBufferPool * pool,
GST_META_FLAG_SET (vmeta, GST_META_FLAG_POOLED);
}
#if (USE_GLX || USE_EGL)
#if (GST_VAAPI_USE_GLX || GST_VAAPI_USE_EGL)
if (priv->options & GST_VAAPI_VIDEO_BUFFER_POOL_OPTION_GL_TEXTURE_UPLOAD) {
GstMeta *tex_meta = gst_buffer_add_texture_upload_meta (buffer);
if (tex_meta)

View file

@ -28,13 +28,13 @@
#if USE_GST_GL_HELPERS
# include <gst/gl/gl.h>
#endif
#if USE_X11
#if GST_VAAPI_USE_X11
#include <gst/vaapi/gstvaapidisplay_x11.h>
#endif
#if USE_WAYLAND
#if GST_VAAPI_USE_WAYLAND
#include <gst/vaapi/gstvaapidisplay_wayland.h>
#endif
#if USE_DRM
#if GST_VAAPI_USE_DRM
#include <gst/vaapi/gstvaapidisplay_drm.h>
#endif
@ -104,7 +104,7 @@ gst_vaapi_video_context_get_display (GstContext * context, gboolean app_context,
if (gst_structure_get (structure, "va-display", G_TYPE_POINTER, &va_display,
NULL)) {
#if USE_X11
#if GST_VAAPI_USE_X11
Display *x11_display = NULL;
if (gst_structure_get (structure, "x11-display", G_TYPE_POINTER,
&x11_display, NULL)) {
@ -112,7 +112,7 @@ gst_vaapi_video_context_get_display (GstContext * context, gboolean app_context,
gst_vaapi_display_x11_new_with_va_display (va_display, x11_display);
}
#endif
#if USE_WAYLAND
#if GST_VAAPI_USE_WAYLAND
if (!display) {
struct wl_display *wl_display = NULL;
if (gst_structure_get (structure, "wl-display", G_TYPE_POINTER,
@ -123,7 +123,7 @@ gst_vaapi_video_context_get_display (GstContext * context, gboolean app_context,
}
}
#endif
#if USE_DRM
#if GST_VAAPI_USE_DRM
if (!display) {
gint fd = -1;
if (gst_structure_get (structure, "drm-device-fd", G_TYPE_INT, &fd,

View file

@ -30,13 +30,13 @@
#include "gstvaapivideometa_texture.h"
#include "gstvaapipluginutil.h"
#if USE_GLX
#if GST_VAAPI_USE_GLX
#include <gst/vaapi/gstvaapitexture_glx.h>
#endif
#define DEFAULT_FORMAT GST_VIDEO_FORMAT_RGBA
#if (USE_GLX || USE_EGL)
#if (GST_VAAPI_USE_GLX || GST_VAAPI_USE_EGL)
struct _GstVaapiVideoMetaTexture
{
GstVaapiTexture *texture;

View file

@ -188,14 +188,14 @@ cdata.set_quoted('PACKAGE_NAME', 'GStreamer VA-API Plug-ins')
cdata.set_quoted('PACKAGE_STRING', 'GStreamer VA-API Plug-ins @0@'.format(gst_version))
cdata.set_quoted('PACKAGE_BUGREPORT', get_option('package-origin'))
cdata.set_quoted('VA_DRIVERS_PATH', '@0@'.format(driverdir))
cdata.set10('USE_DRM', USE_DRM)
cdata.set10('USE_EGL', USE_EGL)
cdata.set10('USE_ENCODERS', USE_ENCODERS)
cdata.set10('USE_GLX', USE_GLX)
cdata.set10('USE_VP9_ENCODER', USE_VP9_ENCODER)
cdata.set10('USE_AV1_DECODER', USE_AV1_DECODER)
cdata.set10('USE_WAYLAND', USE_WAYLAND)
cdata.set10('USE_X11', USE_X11)
cdata.set10('GST_VAAPI_USE_DRM', USE_DRM)
cdata.set10('GST_VAAPI_USE_EGL', USE_EGL)
cdata.set10('GST_VAAPI_USE_ENCODERS', USE_ENCODERS)
cdata.set10('GST_VAAPI_USE_GLX', USE_GLX)
cdata.set10('GST_VAAPI_USE_VP9_ENCODER', USE_VP9_ENCODER)
cdata.set10('GST_VAAPI_USE_AV1_DECODER', USE_AV1_DECODER)
cdata.set10('GST_VAAPI_USE_WAYLAND', USE_WAYLAND)
cdata.set10('GST_VAAPI_USE_X11', USE_X11)
cdata.set10('HAVE_XKBLIB', cc.has_header('X11/XKBlib.h', dependencies: x11_dep))
cdata.set10('HAVE_XRANDR', xrandr_dep.found())
cdata.set10('USE_GST_GL_HELPERS', gstgl_dep.found())

View file

@ -22,23 +22,23 @@
#include "gst/vaapi/sysdeps.h"
#include <gst/gst.h>
#if USE_DRM
#if GST_VAAPI_USE_DRM
# include <gst/vaapi/gstvaapidisplay_drm.h>
# include <gst/vaapi/gstvaapiwindow_drm.h>
#endif
#if USE_X11
#if GST_VAAPI_USE_X11
# include <gst/vaapi/gstvaapidisplay_x11.h>
# include <gst/vaapi/gstvaapiwindow_x11.h>
#endif
#if USE_GLX
#if GST_VAAPI_USE_GLX
# include <gst/vaapi/gstvaapidisplay_glx.h>
# include <gst/vaapi/gstvaapiwindow_glx.h>
#endif
#if USE_EGL
#if GST_VAAPI_USE_EGL
# include <gst/vaapi/gstvaapidisplay_egl.h>
# include <gst/vaapi/gstvaapiwindow_egl.h>
#endif
#if USE_WAYLAND
#if GST_VAAPI_USE_WAYLAND
# include <gst/vaapi/gstvaapidisplay_wayland.h>
# include <gst/vaapi/gstvaapiwindow_wayland.h>
#endif
@ -47,22 +47,22 @@
static const VideoOutputInfo *g_video_output;
static const VideoOutputInfo g_video_outputs[] = {
/* Video outputs are sorted in test order for automatic characterisation */
#if USE_WAYLAND
#if GST_VAAPI_USE_WAYLAND
{"wayland",
gst_vaapi_display_wayland_new,
gst_vaapi_window_wayland_new},
#endif
#if USE_X11
#if GST_VAAPI_USE_X11
{"x11",
gst_vaapi_display_x11_new,
gst_vaapi_window_x11_new},
#endif
#if USE_GLX
#if GST_VAAPI_USE_GLX
{"glx",
gst_vaapi_display_glx_new,
gst_vaapi_window_glx_new},
#endif
#if USE_DRM
#if GST_VAAPI_USE_DRM
{"drm",
gst_vaapi_display_drm_new,
gst_vaapi_window_drm_new},
@ -188,7 +188,7 @@ video_output_create_display (const gchar * display_name)
display = o->create_display (display_name);
if (g_egl_mode) {
#if USE_EGL
#if GST_VAAPI_USE_EGL
egl_display = gst_vaapi_display_egl_new (display, g_gles_version);
#else
egl_display = NULL;
@ -211,7 +211,7 @@ video_output_create_window (GstVaapiDisplay * display, guint width,
if (!g_video_output)
return NULL;
#if USE_EGL
#if GST_VAAPI_USE_EGL
if (g_egl_mode)
window = gst_vaapi_window_egl_new (display, width, height);
else

View file

@ -25,7 +25,7 @@
#define _GNU_SOURCE
#include "gst/vaapi/sysdeps.h"
#include <gst/video/video.h>
#if USE_DRM
#if GST_VAAPI_USE_DRM
# include <gst/vaapi/gstvaapidisplay_drm.h>
# include <va/va_drm.h>
# include <fcntl.h>
@ -34,16 +34,16 @@
# define DRM_DEVICE_PATH "/dev/dri/card0"
# endif
#endif
#if USE_X11
#if GST_VAAPI_USE_X11
# include <gst/vaapi/gstvaapidisplay_x11.h>
#endif
#if USE_GLX
#if GST_VAAPI_USE_GLX
# include <gst/vaapi/gstvaapidisplay_glx.h>
#endif
#if USE_WAYLAND
#if GST_VAAPI_USE_WAYLAND
# include <gst/vaapi/gstvaapidisplay_wayland.h>
#endif
#if USE_EGL
#if GST_VAAPI_USE_EGL
# include <gst/vaapi/gstvaapidisplay_egl.h>
#endif
@ -205,14 +205,14 @@ int
main (int argc, char *argv[])
{
GstVaapiDisplay *display;
#if USE_GLX || USE_WAYLAND
#if GST_VAAPI_USE_GLX || GST_VAAPI_USE_WAYLAND
guint width, height;
guint par_n, par_d;
#endif
gst_init (&argc, &argv);
#if USE_DRM
#if GST_VAAPI_USE_DRM
g_print ("#\n");
g_print ("# Create display with gst_vaapi_display_drm_new()\n");
g_print ("#\n");
@ -273,7 +273,7 @@ main (int argc, char *argv[])
g_print ("\n");
#endif
#if USE_X11
#if GST_VAAPI_USE_X11
g_print ("#\n");
g_print ("# Create display with gst_vaapi_display_x11_new()\n");
g_print ("#\n");
@ -331,7 +331,7 @@ main (int argc, char *argv[])
g_print ("\n");
#endif
#if USE_GLX
#if GST_VAAPI_USE_GLX
g_print ("#\n");
g_print ("# Create display with gst_vaapi_display_glx_new()\n");
g_print ("#\n");
@ -400,7 +400,7 @@ main (int argc, char *argv[])
#endif
#endif
#if USE_WAYLAND
#if GST_VAAPI_USE_WAYLAND
g_print ("#\n");
g_print ("# Create display with gst_vaapi_display_wayland_new()\n");
g_print ("#\n");

View file

@ -25,19 +25,19 @@
#include "gst/vaapi/sysdeps.h"
#include <gst/vaapi/gstvaapisurface.h>
#include <gst/vaapi/gstvaapiimage.h>
#if USE_DRM
#if GST_VAAPI_USE_DRM
# include <gst/vaapi/gstvaapidisplay_drm.h>
# include <gst/vaapi/gstvaapiwindow_drm.h>
#endif
#if USE_X11
#if GST_VAAPI_USE_X11
# include <gst/vaapi/gstvaapidisplay_x11.h>
# include <gst/vaapi/gstvaapiwindow_x11.h>
#endif
#if USE_WAYLAND
#if GST_VAAPI_USE_WAYLAND
# include <gst/vaapi/gstvaapidisplay_wayland.h>
# include <gst/vaapi/gstvaapiwindow_wayland.h>
#endif
#if USE_EGL
#if GST_VAAPI_USE_EGL
# include <gst/vaapi/gstvaapidisplay_egl.h>
# include <gst/vaapi/gstvaapiwindow_egl.h>
#endif
@ -108,7 +108,7 @@ main (int argc, char *argv[])
gst_init (&argc, &argv);
#if USE_DRM
#if GST_VAAPI_USE_DRM
display = gst_vaapi_display_drm_new (NULL);
if (!display)
g_error ("could not create Gst/VA (DRM) display");
@ -138,7 +138,7 @@ main (int argc, char *argv[])
gst_object_unref (display);
#endif
#if USE_X11
#if GST_VAAPI_USE_X11
display = gst_vaapi_display_x11_new (NULL);
if (!display)
g_error ("could not create Gst/VA display");
@ -203,7 +203,7 @@ main (int argc, char *argv[])
gst_object_unref (display);
#endif
#if USE_WAYLAND
#if GST_VAAPI_USE_WAYLAND
display = gst_vaapi_display_wayland_new (NULL);
if (!display)
g_error ("could not create Gst/VA (Wayland) display");