GStreamer media backend: Fix building and running on Windows

Visual Studio (and possibly other non-GCC compilers) do not like
uses of #-preprocessor directives in macro usage (warning C5101: use of
preprocessor directive in function-like macro argument list is undefined
behavior is also shown), so fix the build by defining another macro
accordingly.
This commit is contained in:
Chun-wei Fan 2024-02-05 17:56:37 +08:00 committed by Matthias Clasen
parent 10345e134f
commit 43910ae33c

View File

@ -72,14 +72,17 @@ GST_DEBUG_CATEGORY (gtk_debug_gst_sink);
#define NOGL_CAPS GST_VIDEO_CAPS_MAKE (FORMATS)
#ifdef HAVE_GSTREAMER_DRM
# define GST_VIDEO_DMA_DRM_CAPS_MAKE_STR GST_VIDEO_DMA_DRM_CAPS_MAKE "; "
#else
# define GST_VIDEO_DMA_DRM_CAPS_MAKE_STR
#endif
static GstStaticPadTemplate gtk_gst_sink_template =
GST_STATIC_PAD_TEMPLATE ("sink",
GST_PAD_SINK,
GST_PAD_ALWAYS,
GST_STATIC_CAPS (
#ifdef HAVE_GSTREAMER_DRM
GST_VIDEO_DMA_DRM_CAPS_MAKE "; "
#endif
GST_STATIC_CAPS (GST_VIDEO_DMA_DRM_CAPS_MAKE_STR
"video/x-raw(" GST_CAPS_FEATURE_MEMORY_GL_MEMORY "), "
"format = (string) RGBA, "
"width = " GST_VIDEO_SIZE_RANGE ", "
@ -89,6 +92,8 @@ GST_STATIC_PAD_TEMPLATE ("sink",
"; " NOGL_CAPS)
);
#undef GST_VIDEO_DMA_DRM_CAPS_MAKE_STR
G_DEFINE_TYPE_WITH_CODE (GtkGstSink, gtk_gst_sink,
GST_TYPE_VIDEO_SINK,
GST_DEBUG_CATEGORY_INIT (gtk_debug_gst_sink,