From 61a456e19153033fd9592f40b985d5d03483e969 Mon Sep 17 00:00:00 2001 From: Philippe Normand Date: Tue, 30 Sep 2025 00:53:34 -0700 Subject: [PATCH] [GStreamer] Build broken when using GStreamer 1.27.2 built from tarballs https://bugs.webkit.org/show_bug.cgi?id=299656 Reviewed by Xabier Rodriguez-Calvar. gst_pad_probe_info_set_buffer() will ship in GStreamer 1.27.3 which hasn't been released yet. So when building against 1.27.2 use our internal implementation. Also make sure builds against current GStreamer git main still work, by checking the full (including nano) version. * Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp: * Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.h: Canonical link: https://commits.webkit.org/300744@main --- .../WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp | 2 +- Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.h | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp b/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp index 3e974df4e292..ef2b2fb013cf 100644 --- a/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp +++ b/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp @@ -2045,7 +2045,7 @@ GstBuffer* gst_buffer_new_memdup(gconstpointer data, gsize size) } #endif -#if !GST_CHECK_VERSION(1, 27, 0) +#if !GST_CHECK_VERSION_FULL(1, 27, 2, 1) && !GST_CHECK_VERSION(1, 27, 3) && !GST_CHECK_VERSION(1, 28, 0) void gst_pad_probe_info_set_buffer(GstPadProbeInfo* info, GstBuffer* buffer) { g_return_if_fail(info->type & GST_PAD_PROBE_TYPE_BUFFER); diff --git a/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.h b/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.h index 3e8fe5112676..f8286c5a999a 100644 --- a/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.h +++ b/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.h @@ -50,6 +50,9 @@ using TrackID = uint64_t; template using TrackIDHashMap = HashMap, WTF::UnsignedWithZeroKeyHashTraits>; +#define GST_CHECK_VERSION_FULL(major, minor, micro, nano) \ + (GST_CHECK_VERSION(major, minor, micro) && (GST_VERSION_NANO >= nano)) + inline bool webkitGstCheckVersion(guint major, guint minor, guint micro) { guint currentMajor, currentMinor, currentMicro, currentNano; @@ -469,7 +472,7 @@ class GstIteratorAdaptor { GstBuffer* gst_buffer_new_memdup(gconstpointer data, gsize size); #endif -#if !GST_CHECK_VERSION(1, 27, 0) +#if !GST_CHECK_VERSION_FULL(1, 27, 2, 1) && !GST_CHECK_VERSION(1, 27, 3) && !GST_CHECK_VERSION(1, 28, 0) void gst_pad_probe_info_set_buffer(GstPadProbeInfo*, GstBuffer*); #endif