Index: webkitgtk-2.52.0/Source/cmake/GStreamerChecks.cmake
===================================================================
--- webkitgtk-2.52.0.orig/Source/cmake/GStreamerChecks.cmake
+++ webkitgtk-2.52.0/Source/cmake/GStreamerChecks.cmake
@@ -1,7 +1,7 @@
 if (ENABLE_VIDEO OR ENABLE_WEB_AUDIO OR ENABLE_WEB_CODECS)
     SET_AND_EXPOSE_TO_BUILD(USE_GSTREAMER TRUE)
       if (USE_GSTREAMER_FULL)
-          find_package(GStreamer 1.16.1 REQUIRED COMPONENTS full)
+          find_package(GStreamer 1.8.3 REQUIRED COMPONENTS full)
           if (NOT PC_GSTREAMER_FULL_FOUND)
               message(FATAL_ERROR "GStreamer static library libgstreamer-full-1.0 not found")
           else ()
@@ -25,7 +25,7 @@ if (ENABLE_VIDEO OR ENABLE_WEB_AUDIO OR
               list(APPEND GSTREAMER_COMPONENTS webrtc)
           endif ()
 
-          find_package(GStreamer 1.16.1 REQUIRED COMPONENTS ${GSTREAMER_COMPONENTS})
+          find_package(GStreamer 1.8.3 REQUIRED COMPONENTS ${GSTREAMER_COMPONENTS})
 
           if (ENABLE_WEB_AUDIO)
               if (NOT PC_GSTREAMER_AUDIO_FOUND OR NOT PC_GSTREAMER_FFT_FOUND)
Index: webkitgtk-2.52.0/Source/WebCore/Modules/webaudio/MediaStreamAudioSourceGStreamer.cpp
===================================================================
--- webkitgtk-2.52.0.orig/Source/WebCore/Modules/webaudio/MediaStreamAudioSourceGStreamer.cpp
+++ webkitgtk-2.52.0/Source/WebCore/Modules/webaudio/MediaStreamAudioSourceGStreamer.cpp
@@ -60,7 +60,9 @@ void MediaStreamAudioSource::consumeAudi
             memcpySpan(dest.subspan(channel * numberOfFrames, numberOfFrames), bus.channel(channel)->span());
     }
 
+#if GST_CHECK_VERSION(1, 16, 0)
     gst_buffer_add_audio_meta(buffer.get(), &m_info, numberOfFrames, nullptr);
+#endif
 #if GST_CHECK_VERSION(1, 20, 0)
     if (bus.isSilent())
         gst_buffer_add_audio_level_meta(buffer.get(), 127, FALSE);
Index: webkitgtk-2.52.0/Source/WebCore/platform/audio/gstreamer/AudioFileReaderGStreamer.cpp
===================================================================
--- webkitgtk-2.52.0.orig/Source/WebCore/platform/audio/gstreamer/AudioFileReaderGStreamer.cpp
+++ webkitgtk-2.52.0/Source/WebCore/platform/audio/gstreamer/AudioFileReaderGStreamer.cpp
@@ -207,7 +207,7 @@ static inline std::optional<int> channel
 
 GstFlowReturn AudioFileReader::handleSample(GstAppSink* sink)
 {
-    auto sample = adoptGRef(gst_app_sink_try_pull_sample(sink, 0));
+    auto sample = adoptGRef(gst_app_sink_pull_sample(sink));
     if (!sample)
         return gst_app_sink_is_eos(sink) ? GST_FLOW_EOS : GST_FLOW_ERROR;
 
Index: webkitgtk-2.52.0/Source/WebCore/platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp
===================================================================
--- webkitgtk-2.52.0.orig/Source/WebCore/platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp
+++ webkitgtk-2.52.0/Source/WebCore/platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp
@@ -251,7 +251,7 @@ void AudioSourceProviderGStreamer::provi
 GstFlowReturn AudioSourceProviderGStreamer::handleSample(GstAppSink* sink, bool isPreroll)
 {
     ASP_TRACE("Pulling audio sample from the sink");
-    auto sample = adoptGRef(isPreroll ? gst_app_sink_try_pull_preroll(sink, 0) : gst_app_sink_try_pull_sample(sink, 0));
+    auto sample = adoptGRef(isPreroll ? gst_app_sink_pull_preroll(sink) : gst_app_sink_pull_sample(sink));
     if (!sample)
         return gst_app_sink_is_eos(sink) ? GST_FLOW_EOS : GST_FLOW_ERROR;
 
Index: webkitgtk-2.52.0/Source/WebCore/platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp
===================================================================
--- webkitgtk-2.52.0.orig/Source/WebCore/platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp
+++ webkitgtk-2.52.0/Source/WebCore/platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp
@@ -80,6 +80,7 @@ struct _WebKitWebAudioSrcPrivate {
 
     GRefPtr<GstBufferPool> pool;
 
+    bool enableGapBufferSupport;
     bool hasRenderedAudibleFrame { false };
 
     Lock dispatchToRenderThreadLock;
@@ -94,6 +95,11 @@ struct _WebKitWebAudioSrcPrivate {
         sourcePad = webkitGstGhostPadFromStaticTemplate(&webAudioSrcTemplate, "src"_s, nullptr);
 
         g_rec_mutex_init(&mutex);
+
+        // GAP buffer support is enabled only for GStreamer 1.12.5 because of a
+        // memory leak that was fixed in that version.
+        // https://bugzilla.gnome.org/show_bug.cgi?id=793067
+        enableGapBufferSupport = false;
     }
 
     ~_WebKitWebAudioSrcPrivate()
@@ -181,7 +187,6 @@ static void webKitWebAudioSrcConstructed
     priv->bufferSize = sizeof(float) * priv->framesToPull;
 
     GST_OBJECT_FLAG_SET(GST_OBJECT_CAST(src), GST_ELEMENT_FLAG_SOURCE);
-    gst_bin_set_suppressed_flags(GST_BIN_CAST(src), static_cast<GstElementFlags>(GST_ELEMENT_FLAG_SOURCE | GST_ELEMENT_FLAG_SINK));
 
     gst_element_add_pad(GST_ELEMENT(src), priv->sourcePad);
 
@@ -226,7 +231,9 @@ static GRefPtr<GstBuffer> webKitWebAudio
     }
 
     ASSERT(buffer);
+#if GST_CHECK_VERSION (1, 16, 0)
     gst_buffer_add_audio_meta(buffer.get(), &priv->info, priv->framesToPull, nullptr);
+#endif
 
     {
         GstMappedBuffer mappedBuffer(buffer.get(), GST_MAP_READ);
@@ -288,7 +295,8 @@ static void webKitWebAudioSrcRenderAndPu
         if (quirksManager.isEnabled())
             quirksManager.processWebAudioSilentBuffer(buffer.get());
         else {
-            GST_BUFFER_FLAG_SET(buffer.get(), GST_BUFFER_FLAG_GAP);
+            if (priv->enableGapBufferSupport)
+                GST_BUFFER_FLAG_SET(buffer.get(), GST_BUFFER_FLAG_GAP);
             GST_BUFFER_FLAG_SET(buffer.get(), GST_BUFFER_FLAG_DROPPABLE);
         }
     }
@@ -350,7 +358,9 @@ static GstStateChangeReturn webKitWebAud
     auto* src = WEBKIT_WEB_AUDIO_SRC(element);
     auto* priv = src->priv;
 
+#if GST_CHECK_VERSION(1, 14, 0)
     GST_DEBUG_OBJECT(element, "%s", gst_state_change_get_name(transition));
+#endif
 
     switch (transition) {
     case GST_STATE_CHANGE_NULL_TO_READY:
Index: webkitgtk-2.52.0/Source/WebCore/platform/graphics/gstreamer/AudioTrackPrivateGStreamer.cpp
===================================================================
--- webkitgtk-2.52.0.orig/Source/WebCore/platform/graphics/gstreamer/AudioTrackPrivateGStreamer.cpp
+++ webkitgtk-2.52.0/Source/WebCore/platform/graphics/gstreamer/AudioTrackPrivateGStreamer.cpp
@@ -65,6 +65,7 @@ AudioTrackPrivateGStreamer::AudioTrackPr
     installUpdateConfigurationHandlers();
 }
 
+#if GST_CHECK_VERSION(1, 10, 0)
 AudioTrackPrivateGStreamer::AudioTrackPrivateGStreamer(ThreadSafeWeakPtr<MediaPlayerPrivateGStreamer>&& player, unsigned index, GstStream* stream)
     : TrackPrivateBaseGStreamer(TrackPrivateBaseGStreamer::TrackType::Audio, this, index, stream)
     , m_player(WTF::move(player))
@@ -82,7 +83,9 @@ AudioTrackPrivateGStreamer::AudioTrackPr
 void AudioTrackPrivateGStreamer::capsChanged(TrackID streamId, GRefPtr<GstCaps>&& caps)
 {
     ASSERT(isMainThread());
+#if GST_CHECK_VERSION(1, 10, 0)
     updateConfigurationFromCaps(WTF::move(caps));
+#endif
 
     RefPtr player = m_player.get();
     if (!player)
@@ -155,11 +158,14 @@ void AudioTrackPrivateGStreamer::updateC
         configuration.numberOfChannels = GST_AUDIO_INFO_CHANNELS(&info);
     }
 }
+#endif
 
 AudioTrackPrivate::Kind AudioTrackPrivateGStreamer::kind() const
 {
+#if GST_CHECK_VERSION(1, 10, 0)
     if (m_stream && gst_stream_get_stream_flags(m_stream.get()) & GST_STREAM_FLAG_SELECT)
         return AudioTrackPrivate::Kind::Main;
+#endif
 
     return AudioTrackPrivate::kind();
 }
@@ -168,8 +174,10 @@ void AudioTrackPrivateGStreamer::disconn
 {
     m_taskQueue.startAborting();
 
+#if GST_CHECK_VERSION(1, 10, 0)
     if (m_stream)
         g_signal_handlers_disconnect_matched(m_stream.get(), G_SIGNAL_MATCH_DATA, 0, 0, nullptr, nullptr, this);
+#endif
 
     m_player = nullptr;
     TrackPrivateBaseGStreamer::disconnect();
Index: webkitgtk-2.52.0/Source/WebCore/platform/graphics/gstreamer/AudioTrackPrivateGStreamer.h
===================================================================
--- webkitgtk-2.52.0.orig/Source/WebCore/platform/graphics/gstreamer/AudioTrackPrivateGStreamer.h
+++ webkitgtk-2.52.0/Source/WebCore/platform/graphics/gstreamer/AudioTrackPrivateGStreamer.h
@@ -48,10 +48,12 @@ public:
         return adoptRef(*new AudioTrackPrivateGStreamer(WTF::move(player), index, WTF::move(pad), trackId));
     }
 
+#if GST_CHECK_VERSION(1, 10, 0)
     static Ref<AudioTrackPrivateGStreamer> create(ThreadSafeWeakPtr<MediaPlayerPrivateGStreamer>&& player, unsigned index, GstStream* stream)
     {
         return adoptRef(*new AudioTrackPrivateGStreamer(WTF::move(player), index, stream));
     }
+#endif
 
     Kind kind() const final;
 
@@ -76,18 +78,24 @@ public:
     String label() const final { return m_label; }
     String language() const final { return m_language; }
 
+#if GST_CHECK_VERSION(1, 10, 0)
     void updateConfigurationFromCaps(GRefPtr<GstCaps>&&) final;
+#endif
 
 protected:
+#if GST_CHECK_VERSION(1, 10, 0)
     void updateConfigurationFromTags(GRefPtr<GstTagList>&&) final;
 
     void tagsChanged(GRefPtr<GstTagList>&& tags) final { updateConfigurationFromTags(WTF::move(tags)); }
     void capsChanged(TrackID streamId, GRefPtr<GstCaps>&&) final;
+#endif
 
 private:
     AudioTrackPrivateGStreamer(ThreadSafeWeakPtr<MediaPlayerPrivateGStreamer>&&, unsigned index, GRefPtr<GstPad>&&, bool shouldHandleStreamStartEvent);
     AudioTrackPrivateGStreamer(ThreadSafeWeakPtr<MediaPlayerPrivateGStreamer>&&, unsigned index, GRefPtr<GstPad>&&, TrackID);
+#if GST_CHECK_VERSION(1, 16, 0)
     AudioTrackPrivateGStreamer(ThreadSafeWeakPtr<MediaPlayerPrivateGStreamer>&&, unsigned index, GstStream*);
+#endif
 
     ThreadSafeWeakPtr<MediaPlayerPrivateGStreamer> m_player;
 };
Index: webkitgtk-2.52.0/Source/WebCore/platform/graphics/gstreamer/eme/GStreamerEMEUtilities.h
===================================================================
--- webkitgtk-2.52.0.orig/Source/WebCore/platform/graphics/gstreamer/eme/GStreamerEMEUtilities.h
+++ webkitgtk-2.52.0/Source/WebCore/platform/graphics/gstreamer/eme/GStreamerEMEUtilities.h
@@ -61,8 +61,10 @@ public:
     const String& systemId() const { return m_systemId; }
     String payloadContainerType() const
     {
+#if GST_CHECK_VERSION(1, 16, 0)
         if (m_systemId == GST_PROTECTION_UNSPECIFIED_SYSTEM_ID ""_s)
             return "webm"_s;
+#endif
         return "cenc"_s;
     }
 
@@ -95,8 +97,10 @@ public:
     static constexpr auto s_WidevineKeySystem = "com.widevine.alpha"_s;
     static constexpr auto s_PlayReadyUUID = WEBCORE_GSTREAMER_EME_UTILITIES_PLAYREADY_UUID;
     static constexpr std::array<ASCIILiteral, 2> s_PlayReadyKeySystems = { "com.microsoft.playready"_s,  "com.youtube.playready"_s };
+#if GST_CHECK_VERSION(1, 16, 0)
     static constexpr auto s_unspecifiedUUID = GST_PROTECTION_UNSPECIFIED_SYSTEM_ID ""_s;
     static constexpr auto s_unspecifiedKeySystem = GST_PROTECTION_UNSPECIFIED_SYSTEM_ID ""_s;
+#endif
 
     static constexpr std::array<ASCIILiteral, 11> s_cencEncryptionMediaTypes = { "video/mp4"_s, "audio/mp4"_s, "video/x-h264"_s, "video/x-h265"_s, "audio/mpeg"_s,
         "audio/x-eac3"_s, "audio/x-ac3"_s, "audio/x-flac"_s, "audio/x-opus"_s, "video/x-vp9"_s, "video/x-av1"_s };
@@ -132,6 +136,7 @@ public:
         return equalIgnoringASCIICase(uuid.span(), s_PlayReadyUUID);
     }
 
+#if GST_CHECK_VERSION(1, 16, 0)
     static bool isUnspecifiedKeySystem(const String& keySystem)
     {
         return equalIgnoringASCIICase(keySystem, s_unspecifiedKeySystem);
@@ -141,6 +146,7 @@ public:
     {
         return equalIgnoringASCIICase(uuid.span(), s_unspecifiedUUID);
     }
+#endif
 
     static ASCIILiteral keySystemToUuid(const String& keySystem)
     {
@@ -153,8 +159,10 @@ public:
         if (isPlayReadyKeySystem(keySystem))
             return s_PlayReadyUUID;
 
+#if GST_CHECK_VERSION(1, 16, 0)
         if (isUnspecifiedKeySystem(keySystem))
             return s_unspecifiedUUID;
+#endif
 
         ASSERT_NOT_REACHED();
         return { };
@@ -171,8 +179,10 @@ public:
         if (isPlayReadyUUID(uuid))
             return s_PlayReadyKeySystems[0];
 
+#if GST_CHECK_VERSION(1, 16, 0)
         if (isUnspecifiedUUID(uuid))
             return s_unspecifiedKeySystem;
+#endif
 
         ASSERT_NOT_REACHED();
         return ""_s;
Index: webkitgtk-2.52.0/Source/WebCore/platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp
===================================================================
--- webkitgtk-2.52.0.orig/Source/WebCore/platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp
+++ webkitgtk-2.52.0/Source/WebCore/platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp
@@ -178,8 +178,7 @@ static GstCaps* transformCaps(GstBaseTra
                 // GST_PROTECTION_UNSPECIFIED_SYSTEM_ID was added in the GStreamer
                 // developement git master which will ship as version 1.16.0.
                 gst_structure_set_name(outgoingStructure.get(),
-                    WebCore::GStreamerEMEUtilities::isUnspecifiedUUID(klass->protectionSystemId(self))
-                    ? "application/x-webm-enc" : "application/x-cenc");
+                    "application/x-cenc");
             }
         }
 
Index: webkitgtk-2.52.0/Source/WebCore/platform/graphics/gstreamer/GLVideoSinkGStreamer.cpp
===================================================================
--- webkitgtk-2.52.0.orig/Source/WebCore/platform/graphics/gstreamer/GLVideoSinkGStreamer.cpp
+++ webkitgtk-2.52.0/Source/WebCore/platform/graphics/gstreamer/GLVideoSinkGStreamer.cpp
@@ -153,11 +153,15 @@ static void webKitGLVideoSinkConstructed
 
 static GstStateChangeReturn webKitGLVideoSinkChangeState(GstElement* element, GstStateChange transition)
 {
+#if GST_CHECK_VERSION(1, 14, 0)
     GST_DEBUG_OBJECT(element, "%s", gst_state_change_get_name(transition));
+#endif
 
     switch (transition) {
     case GST_STATE_CHANGE_NULL_TO_READY:
+#if GST_CHECK_VERSION(1, 14, 0)
     case GST_STATE_CHANGE_READY_TO_READY:
+#endif
     case GST_STATE_CHANGE_READY_TO_PAUSED: {
         static ASCIILiteral gstGlDisplayContextyType = ASCIILiteral::fromLiteralUnsafe(GST_GL_DISPLAY_CONTEXT_TYPE);
         if (!setGstElementGLContext(element, gstGlDisplayContextyType))
Index: webkitgtk-2.52.0/Source/WebCore/platform/graphics/gstreamer/GRefPtrGStreamer.h
===================================================================
--- webkitgtk-2.52.0.orig/Source/WebCore/platform/graphics/gstreamer/GRefPtrGStreamer.h
+++ webkitgtk-2.52.0/Source/WebCore/platform/graphics/gstreamer/GRefPtrGStreamer.h
@@ -66,8 +66,10 @@ WTF_DEFINE_GREF_TRAITS_INLINE(WebKitVide
 WTF_DEFINE_GREF_TRAITS_INLINE(WebKitWebSrc, gst_object_ref_sink, gst_object_unref, g_object_is_floating)
 
 WTF_DEFINE_GREF_TRAITS_INLINE(GstObject, gst_object_ref, gst_object_unref, g_object_is_floating)
+#if GST_CHECK_VERSION(1, 10, 0)
 WTF_DEFINE_GREF_TRAITS_INLINE(GstStream, gst_object_ref, gst_object_unref, g_object_is_floating)
 WTF_DEFINE_GREF_TRAITS_INLINE(GstStreamCollection, gst_object_ref, gst_object_unref, g_object_is_floating)
+#endif
 WTF_DEFINE_GREF_TRAITS_INLINE(GstClock, gst_object_ref, gst_object_unref, g_object_is_floating)
 WTF_DEFINE_GREF_TRAITS_INLINE(GstDeviceMonitor, gst_object_ref, gst_object_unref, g_object_is_floating)
 WTF_DEFINE_GREF_TRAITS_INLINE(GstDeviceProvider, gst_object_ref, gst_object_unref, g_object_is_floating)
Index: webkitgtk-2.52.0/Source/WebCore/platform/graphics/gstreamer/GstAllocatorFastMalloc.cpp
===================================================================
--- webkitgtk-2.52.0.orig/Source/WebCore/platform/graphics/gstreamer/GstAllocatorFastMalloc.cpp
+++ webkitgtk-2.52.0/Source/WebCore/platform/graphics/gstreamer/GstAllocatorFastMalloc.cpp
@@ -183,7 +183,9 @@ static void gstAllocatorFastMallocConstr
 {
     G_OBJECT_CLASS(gst_allocator_fast_malloc_parent_class)->constructed(object);
 IGNORE_WARNINGS_BEGIN("cast-align")
+#if GST_CHECK_VERSION(1, 10, 0)
     GST_OBJECT_FLAG_SET(GST_OBJECT_CAST(object), GST_OBJECT_FLAG_MAY_BE_LEAKED);
+#endif
     auto allocator = GST_ALLOCATOR_CAST(object);
 IGNORE_WARNINGS_END
 
Index: webkitgtk-2.52.0/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp
===================================================================
--- webkitgtk-2.52.0.orig/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp
+++ webkitgtk-2.52.0/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp
@@ -345,6 +345,7 @@ std::optional<TrackID> getStreamIdFromPa
     return streamId;
 }
 
+#if GST_CHECK_VERSION(1, 10, 0)
 std::optional<TrackID> getStreamIdFromStream(const GRefPtr<GstStream>& stream)
 {
     auto streamIdAsString = CStringView::unsafeFromUTF8(gst_stream_get_stream_id(stream.get()));
@@ -359,6 +360,7 @@ std::optional<TrackID> getStreamIdFromSt
 
     return streamId;
 }
+#endif
 
 std::optional<TrackID> parseStreamId(const String& stringId)
 {
@@ -742,7 +744,6 @@ void deinitializeGStreamer()
     teardownGStreamerRegistryScanner();
 #if ENABLE(VIDEO)
     teardownVideoEncoderSingleton();
-    teardownGStreamerImageDecoders();
 #endif
 }
 
@@ -940,6 +941,7 @@ unsigned GstMappedFrame::componentPlaneO
 }
 WTF_ALLOW_UNSAFE_BUFFER_USAGE_END;
 
+#if GST_CHECK_VERSION(1, 16, 0)
 GstMappedAudioBuffer::GstMappedAudioBuffer(GstBuffer* buffer, GstAudioInfo info, GstMapFlags flags)
 {
     m_isValid = gst_audio_buffer_map(&m_buffer, &info, buffer, flags);
@@ -1021,6 +1023,7 @@ template Vector<std::span<uint8_t>> GstM
 template Vector<std::span<int16_t>> GstMappedAudioBuffer::samples(size_t) const;
 template Vector<std::span<int32_t>> GstMappedAudioBuffer::samples(size_t) const;
 template Vector<std::span<float>> GstMappedAudioBuffer::samples(size_t) const;
+#endif
 
 static GQuark customMessageHandlerQuark()
 {
@@ -1043,31 +1046,11 @@ void disconnectSimpleBusMessageCallback(
 struct MessageBusData {
     GThreadSafeWeakPtr<GstElement> pipeline;
     Function<void(GstMessage*)> handler;
-    AsynchronousPipelineDumping asynchronousPipelineDumping;
 };
 WEBKIT_DEFINE_ASYNC_DATA_STRUCT(MessageBusData)
 
-struct AsyncPipelineDumpData {
-    String dotFileName;
-};
-WEBKIT_DEFINE_ASYNC_DATA_STRUCT(AsyncPipelineDumpData)
 
-static void dumpPipeline(const GRefPtr<GstElement>& pipeline, String&& dotFileName, AsynchronousPipelineDumping asynchronousPipelineDumping)
-{
-    if (asynchronousPipelineDumping == AsynchronousPipelineDumping::No) {
-        GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS(GST_BIN_CAST(pipeline.get()), GST_DEBUG_GRAPH_SHOW_ALL, dotFileName.utf8().data());
-        return;
-    }
-
-    auto data = createAsyncPipelineDumpData();
-    data->dotFileName = WTF::move(dotFileName);
-    gst_element_call_async(pipeline.get(), reinterpret_cast<GstElementCallAsyncFunc>(+[](GstElement* pipeline, gpointer userData) {
-        auto data = reinterpret_cast<AsyncPipelineDumpData*>(userData);
-        GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS(GST_BIN_CAST(pipeline), GST_DEBUG_GRAPH_SHOW_ALL, data->dotFileName.utf8().data());
-    }), data, reinterpret_cast<GDestroyNotify>(destroyAsyncPipelineDumpData));
-}
-
-void connectSimpleBusMessageCallback(GstElement* pipeline, Function<void(GstMessage*)>&& customHandler, AsynchronousPipelineDumping asynchronousPipelineDumping)
+void connectSimpleBusMessageCallback(GstElement* pipeline, Function<void(GstMessage*)>&& customHandler)
 {
     auto bus = adoptGRef(gst_pipeline_get_bus(GST_PIPELINE(pipeline)));
     gst_bus_add_signal_watch_full(bus.get(), RunLoopSourcePriority::RunLoopDispatcher);
@@ -1075,7 +1058,6 @@ void connectSimpleBusMessageCallback(Gst
     auto data = createMessageBusData();
     data->pipeline.reset(pipeline);
     data->handler = WTF::move(customHandler);
-    data->asynchronousPipelineDumping = asynchronousPipelineDumping;
     auto handler = g_signal_connect_data(bus.get(), "message", G_CALLBACK(+[](GstBus*, GstMessage* message, gpointer userData) {
         auto data = reinterpret_cast<MessageBusData*>(userData);
         auto pipeline = data->pipeline.get();
@@ -1086,7 +1068,7 @@ void connectSimpleBusMessageCallback(Gst
         case GST_MESSAGE_ERROR: {
             GST_ERROR_OBJECT(pipeline.get(), "Got message: %" GST_PTR_FORMAT, message);
             auto dotFileName = makeString(unsafeSpan(GST_OBJECT_NAME(pipeline.get())), "_error"_s);
-            dumpPipeline(pipeline, WTF::move(dotFileName), data->asynchronousPipelineDumping);
+            GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS(GST_BIN_CAST(pipeline.get()), GST_DEBUG_GRAPH_SHOW_ALL, dotFileName.utf8().data());
             break;
         }
         case GST_MESSAGE_STATE_CHANGED: {
@@ -1102,7 +1084,7 @@ void connectSimpleBusMessageCallback(Gst
                 gst_element_state_get_name(newState), gst_element_state_get_name(pending));
 
             auto dotFileName = makeString(unsafeSpan(GST_OBJECT_NAME(pipeline.get())), '_', unsafeSpan(gst_element_state_get_name(oldState)), '_', unsafeSpan(gst_element_state_get_name(newState)));
-            dumpPipeline(pipeline, WTF::move(dotFileName), data->asynchronousPipelineDumping);
+            GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS(GST_BIN_CAST(pipeline.get()), GST_DEBUG_GRAPH_SHOW_ALL, dotFileName.utf8().data());
             break;
         }
         case GST_MESSAGE_LATENCY:
@@ -1111,10 +1093,7 @@ void connectSimpleBusMessageCallback(Gst
             // This can happen if the latency of live elements changes, or
             // for one reason or another a new live element is added or
             // removed from the pipeline.
-            gst_element_call_async(pipeline.get(), reinterpret_cast<GstElementCallAsyncFunc>(+[](GstElement* pipeline, gpointer userData) {
-                UNUSED_PARAM(userData);
-                gst_bin_recalculate_latency(GST_BIN_CAST(pipeline));
-            }), nullptr, nullptr);
+            gst_bin_recalculate_latency(GST_BIN_CAST(pipeline.get()));
             break;
         default:
             break;
@@ -1652,9 +1631,6 @@ PlatformVideoColorSpace videoColorSpaceF
 PlatformVideoColorSpace videoColorSpaceFromInfo(const GstVideoInfo& info)
 {
     ensureGStreamerInitialized();
-#ifndef GST_DISABLE_GST_DEBUG
-    auto colorimetry = GMallocString::unsafeAdoptFromUTF8(gst_video_colorimetry_to_string(&GST_VIDEO_INFO_COLORIMETRY(&info)));
-#endif
     PlatformVideoColorSpace colorSpace;
     switch (GST_VIDEO_INFO_COLORIMETRY(&info).matrix) {
     case GST_VIDEO_COLOR_MATRIX_RGB:
@@ -1679,9 +1655,6 @@ PlatformVideoColorSpace videoColorSpaceF
         colorSpace.matrix = PlatformVideoMatrixCoefficients::Unspecified;
         break;
     default:
-#ifndef GST_DISABLE_GST_DEBUG
-        GST_WARNING("Unhandled colorspace matrix from %s", colorimetry.utf8());
-#endif
         break;
     }
 
@@ -1731,9 +1704,6 @@ PlatformVideoColorSpace videoColorSpaceF
         colorSpace.transfer = PlatformVideoTransferCharacteristics::Unspecified;
         break;
     default:
-#ifndef GST_DISABLE_GST_DEBUG
-        GST_WARNING("Unhandled colorspace transfer from %s", colorimetry.utf8());
-#endif
         break;
     }
 
@@ -1750,12 +1720,14 @@ PlatformVideoColorSpace videoColorSpaceF
     case GST_VIDEO_COLOR_PRIMARIES_SMPTE170M:
         colorSpace.primaries = PlatformVideoColorPrimaries::Smpte170m;
         break;
+#if GST_CHECK_VERSION(1, 16, 0)
     case GST_VIDEO_COLOR_PRIMARIES_SMPTERP431:
         colorSpace.primaries = PlatformVideoColorPrimaries::SmpteRp431;
         break;
     case GST_VIDEO_COLOR_PRIMARIES_SMPTEEG432:
         colorSpace.primaries = PlatformVideoColorPrimaries::SmpteEg432;
         break;
+#endif
     case GST_VIDEO_COLOR_PRIMARIES_FILM:
         colorSpace.primaries = PlatformVideoColorPrimaries::Film;
         break;
@@ -1765,16 +1737,15 @@ PlatformVideoColorSpace videoColorSpaceF
     case GST_VIDEO_COLOR_PRIMARIES_SMPTE240M:
         colorSpace.primaries = PlatformVideoColorPrimaries::Smpte240m;
         break;
+#if GST_CHECK_VERSION(1, 16, 0)
     case GST_VIDEO_COLOR_PRIMARIES_EBU3213:
         colorSpace.primaries = PlatformVideoColorPrimaries::JedecP22Phosphors;
         break;
+#endif
     case GST_VIDEO_COLOR_PRIMARIES_UNKNOWN:
         colorSpace.primaries = PlatformVideoColorPrimaries::Unspecified;
         break;
     default:
-#ifndef GST_DISABLE_GST_DEBUG
-        GST_WARNING("Unhandled colorspace primaries from %s", colorimetry.utf8());
-#endif
         break;
     }
 
@@ -1882,12 +1853,14 @@ void fillVideoInfoColorimetryFromColorSp
         case PlatformVideoColorPrimaries::Smpte170m:
             GST_VIDEO_INFO_COLORIMETRY(info).primaries = GST_VIDEO_COLOR_PRIMARIES_SMPTE170M;
             break;
+#if GST_CHECK_VERSION(1, 16, 0)
         case PlatformVideoColorPrimaries::SmpteRp431:
             GST_VIDEO_INFO_COLORIMETRY(info).primaries = GST_VIDEO_COLOR_PRIMARIES_SMPTERP431;
             break;
         case PlatformVideoColorPrimaries::SmpteEg432:
             GST_VIDEO_INFO_COLORIMETRY(info).primaries = GST_VIDEO_COLOR_PRIMARIES_SMPTEEG432;
             break;
+#endif
         case PlatformVideoColorPrimaries::Film:
             GST_VIDEO_INFO_COLORIMETRY(info).primaries = GST_VIDEO_COLOR_PRIMARIES_FILM;
             break;
@@ -1897,9 +1870,11 @@ void fillVideoInfoColorimetryFromColorSp
         case PlatformVideoColorPrimaries::Smpte240m:
             GST_VIDEO_INFO_COLORIMETRY(info).primaries = GST_VIDEO_COLOR_PRIMARIES_SMPTE240M;
             break;
+#if GST_CHECK_VERSION(1, 16, 0)
         case PlatformVideoColorPrimaries::JedecP22Phosphors:
             GST_VIDEO_INFO_COLORIMETRY(info).primaries = GST_VIDEO_COLOR_PRIMARIES_EBU3213;
             break;
+#endif
         case PlatformVideoColorPrimaries::Unspecified:
             GST_VIDEO_INFO_COLORIMETRY(info).primaries = GST_VIDEO_COLOR_PRIMARIES_UNKNOWN;
             break;
@@ -2318,7 +2293,7 @@ void gst_pad_probe_info_set_buffer(GstPa
 {
     g_return_if_fail(info->type & GST_PAD_PROBE_TYPE_BUFFER);
 
-    gst_clear_mini_object(&info->data);
+    g_clear_pointer (&info->data, gst_mini_object_unref);
     info->data = buffer;
 }
 
@@ -2326,7 +2301,7 @@ void gst_pad_probe_info_set_event(GstPad
 {
     g_return_if_fail(info->type & (GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM | GST_PAD_PROBE_TYPE_EVENT_UPSTREAM));
 
-    gst_clear_mini_object(&info->data);
+    g_clear_pointer(&info->data, gst_mini_object_unref);
     info->data = event;
 }
 #endif
Index: webkitgtk-2.52.0/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.h
===================================================================
--- webkitgtk-2.52.0.orig/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.h
+++ webkitgtk-2.52.0/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.h
@@ -22,7 +22,6 @@
 #if USE(GSTREAMER)
 #include "GRefPtrGStreamer.h"
 
-#include <gst/audio/audio-buffer.h>
 #include <gst/audio/audio-info.h>
 #include <gst/gst.h>
 #include <gst/video/video-format.h>
@@ -100,7 +99,9 @@ bool isProtocolAllowed(const WTF::URL&);
 #endif
 CStringView capsMediaType(const GstCaps*);
 std::optional<TrackID> getStreamIdFromPad(const GRefPtr<GstPad>&);
+#if GST_CHECK_VERSION(1, 10, 0)
 std::optional<TrackID> getStreamIdFromStream(const GRefPtr<GstStream>&);
+#endif
 std::optional<TrackID> parseStreamId(const String& stringId);
 bool doCapsHaveType(const GstCaps*, ASCIILiteral);
 bool areEncryptedCaps(const GstCaps*);
@@ -269,6 +270,7 @@ private:
     std::array<size_t, GST_VIDEO_MAX_PLANES> m_planeSizes { };
 };
 
+#if GST_CHECK_VERSION(1, 16, 0)
 class GstMappedAudioBuffer {
     WTF_MAKE_TZONE_ALLOCATED(GstMappedAudioBuffer);
     WTF_MAKE_NONCOPYABLE(GstMappedAudioBuffer);
@@ -288,9 +290,9 @@ private:
     GstAudioBuffer m_buffer;
     bool m_isValid { false };
 };
+#endif
 
-enum class AsynchronousPipelineDumping : bool { No, Yes };
-void connectSimpleBusMessageCallback(GstElement*, Function<void(GstMessage*)>&& = [](GstMessage*) { }, AsynchronousPipelineDumping = AsynchronousPipelineDumping::No);
+void connectSimpleBusMessageCallback(GstElement*, Function<void(GstMessage*)>&& = [](GstMessage*) { });
 void disconnectSimpleBusMessageCallback(GstElement*);
 
 enum class GstVideoDecoderPlatform { ImxVPU, Video4Linux, OpenMAX };
@@ -513,4 +515,7 @@ void gst_pad_probe_info_set_buffer(GstPa
 void gst_pad_probe_info_set_event(GstPadProbeInfo*, GstEvent*);
 #endif
 
+#if !GST_CHECK_VERSION(1, 16, 0)
+#define         gst_sample_make_writable(sample)   GST_SAMPLE_CAST (gst_mini_object_make_writable (GST_MINI_OBJECT_CAST (sample)))
+#endif
 #endif // USE(GSTREAMER)
Index: webkitgtk-2.52.0/Source/WebCore/platform/graphics/gstreamer/GStreamerRegistryScanner.cpp
===================================================================
--- webkitgtk-2.52.0.orig/Source/WebCore/platform/graphics/gstreamer/GStreamerRegistryScanner.cpp
+++ webkitgtk-2.52.0/Source/WebCore/platform/graphics/gstreamer/GStreamerRegistryScanner.cpp
@@ -553,8 +553,6 @@ void GStreamerRegistryScanner::initializ
         { ElementFactories::Type::AudioDecoder, "audio/x-dts"_s, { }, { } },
         { ElementFactories::Type::AudioDecoder, "audio/x-sbc"_s, { }, { } },
         { ElementFactories::Type::AudioDecoder, "audio/x-sid"_s, { }, { } },
-        { ElementFactories::Type::AudioDecoder, "audio/x-alaw"_s, { }, { "alaw"_s } },
-        { ElementFactories::Type::AudioDecoder, "audio/x-mulaw"_s, { }, { "ulaw"_s } },
         { ElementFactories::Type::AudioDecoder, "audio/x-speex"_s, { "audio/speex"_s, "audio/x-speex"_s }, { } },
         { ElementFactories::Type::AudioDecoder, "audio/x-wavpack"_s, { "audio/x-wavpack"_s }, { } },
         { ElementFactories::Type::VideoDecoder, "video/mpeg, mpegversion=(int){1,2}, systemstream=(boolean)false"_s, { "video/mpeg"_s }, { "mpeg"_s } },
Index: webkitgtk-2.52.0/Source/WebCore/platform/graphics/gstreamer/ImageDecoderGStreamer.cpp
===================================================================
--- webkitgtk-2.52.0.orig/Source/WebCore/platform/graphics/gstreamer/ImageDecoderGStreamer.cpp
+++ webkitgtk-2.52.0/Source/WebCore/platform/graphics/gstreamer/ImageDecoderGStreamer.cpp
@@ -290,9 +290,11 @@ void ImageDecoderGStreamer::storeDecoded
 
 void ImageDecoderGStreamer::pushEncodedData(const FragmentedSharedBuffer& sharedBuffer)
 {
+    gsize size;
     auto data = sharedBuffer.makeContiguous();
     auto bytes = data->createGBytes();
-    auto buffer = adoptGRef(gst_buffer_new_wrapped_bytes(bytes.get()));
+  guint8 *bytes_data = (guint8 *) g_bytes_get_data (bytes.get(), &size);
+    auto buffer = adoptGRef(gst_buffer_new_wrapped_full(GST_MEMORY_FLAG_READONLY, bytes_data, size, 0, size, g_bytes_ref (bytes.get()), (GDestroyNotify) g_bytes_unref));
     m_eos = false;
     m_error = false;
 
Index: webkitgtk-2.52.0/Source/WebCore/platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.cpp
===================================================================
--- webkitgtk-2.52.0.orig/Source/WebCore/platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.cpp
+++ webkitgtk-2.52.0/Source/WebCore/platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.cpp
@@ -63,6 +63,7 @@ InbandTextTrackPrivateGStreamer::InbandT
     installUpdateConfigurationHandlers();
 }
 
+#if GST_CHECK_VERSION(1, 10, 0)
 InbandTextTrackPrivateGStreamer::InbandTextTrackPrivateGStreamer(unsigned index, GstStream* stream)
     : InbandTextTrackPrivate(CueFormat::WebVTT)
     , TrackPrivateBaseGStreamer(TrackPrivateBaseGStreamer::TrackType::Text, this, index, stream)
@@ -76,6 +77,7 @@ InbandTextTrackPrivateGStreamer::InbandT
     auto caps = adoptGRef(gst_stream_get_caps(m_stream.get()));
     m_kind = doCapsHaveType(caps.get(), "closedcaption/"_s) ? Kind::Captions : Kind::Subtitles;
 }
+#endif
 
 void InbandTextTrackPrivateGStreamer::tagsChanged(GRefPtr<GstTagList>&& tags)
 {
Index: webkitgtk-2.52.0/Source/WebCore/platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.h
===================================================================
--- webkitgtk-2.52.0.orig/Source/WebCore/platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.h
+++ webkitgtk-2.52.0/Source/WebCore/platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.h
@@ -52,10 +52,12 @@ public:
         return create(index, WTF::move(pad));
     }
 
+#if GST_CHECK_VERSION(1, 10, 0)
     static Ref<InbandTextTrackPrivateGStreamer> create(ThreadSafeWeakPtr<MediaPlayerPrivateGStreamer>&&, unsigned index, GstStream* stream)
     {
         return adoptRef(*new InbandTextTrackPrivateGStreamer(index, stream));
     }
+#endif
 
     Kind kind() const final { return m_kind; }
     TrackID id() const final { return m_trackID.value_or(m_id); }
@@ -72,7 +74,9 @@ protected:
 private:
     InbandTextTrackPrivateGStreamer(unsigned index, GRefPtr<GstPad>&&, bool shouldHandleStreamStartEvent);
     InbandTextTrackPrivateGStreamer(unsigned index, GRefPtr<GstPad>&&, TrackID);
+#if GST_CHECK_VERSION(1, 16, 0)
     InbandTextTrackPrivateGStreamer(unsigned index, GstStream*);
+#endif
 
     void notifyTrackOfSample();
 
Index: webkitgtk-2.52.0/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
===================================================================
--- webkitgtk-2.52.0.orig/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
+++ webkitgtk-2.52.0/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
@@ -50,7 +50,6 @@
 #include "TextCombinerGStreamer.h"
 #include "TextSinkGStreamer.h"
 #include "TimeRanges.h"
-#include "VideoFrameMetadataGStreamer.h"
 #include "VideoSinkGStreamer.h"
 #include "VideoTrackPrivateGStreamer.h"
 #include "WebKitAudioSinkGStreamer.h"
@@ -163,6 +162,12 @@ MediaLogObserver& mediaLogObserverSingle
 }
 #endif // GST_DISABLE_GST_DEBUG
 
+static void convertToInternalProtocol(URL& url)
+{
+    if (url.protocolIsInHTTPFamily() || url.protocolIsBlob())
+        url.setProtocol(makeString("webkit+"_s, url.protocol()));
+}
+
 MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer(MediaPlayer& player)
     : m_notifier(MainThreadNotifier<MainThreadNotification>::create())
     , m_player(player)
@@ -396,6 +401,7 @@ void MediaPlayerPrivateGStreamer::load(c
     m_readyState = MediaPlayer::ReadyState::HaveNothing;
     player->readyStateChanged();
     m_areVolumeAndMuteInitialized = false;
+    m_hasTaintedOrigin = std::nullopt;
 
     if (!m_isDelayingLoad)
         commitLoad();
@@ -629,6 +635,7 @@ bool MediaPlayerPrivateGStreamer::doSeek
     auto seekStop = toGstClockTime(endTime);
     auto event = adoptGRef(gst_event_new_seek(rate, GST_FORMAT_TIME, seekFlags, GST_SEEK_TYPE_SET, seekStart, GST_SEEK_TYPE_SET, seekStop));
 
+#if 0
     if (isAsync) {
         auto data = createAsyncSeekData();
         data->event = WTF::move(event);
@@ -662,8 +669,9 @@ bool MediaPlayerPrivateGStreamer::doSeek
         return result;
 
     GST_DEBUG_OBJECT(m_pipeline.get(), "Resuming segment playback");
+#endif
     seekFlags = static_cast<GstSeekFlags>(GST_SEEK_FLAG_SEGMENT | GST_SEEK_FLAG_ACCURATE);
-    return gst_element_send_event(m_pipeline.get(), gst_event_new_seek(rate, GST_FORMAT_TIME, seekFlags, GST_SEEK_TYPE_SET, seekStart, GST_SEEK_TYPE_SET, seekStop));
+    return gst_element_seek(m_pipeline.get(), rate, GST_FORMAT_TIME, seekFlags, GST_SEEK_TYPE_SET, seekStart, GST_SEEK_TYPE_SET, seekStop);
 }
 
 void MediaPlayerPrivateGStreamer::seekToTarget(const SeekTarget& inTarget)
@@ -1044,6 +1052,12 @@ unsigned long long MediaPlayerPrivateGSt
 
 std::optional<bool> MediaPlayerPrivateGStreamer::isCrossOrigin(const SecurityOrigin& origin) const
 {
+    // GStreamer < 1.12 has an incomplete uridownloader implementation so we
+    // can't use WebKitWebSrc for adaptive fragments downloading if this
+    // version is detected.
+    if (m_hasTaintedOrigin)
+        return true;
+
     if (WEBKIT_IS_WEB_SRC(m_source.get()))
         return webKitSrcIsCrossOrigin(WEBKIT_WEB_SRC(m_source.get()), origin);
     return false;
@@ -1162,6 +1176,7 @@ void MediaPlayerPrivateGStreamer::setPla
         cleanURLString = cleanURLString.left(url.pathEnd());
 
     m_url = URL { cleanURLString };
+    convertToInternalProtocol(m_url);
     GST_INFO_OBJECT(pipeline(), "Load %s", m_url.string().utf8().data());
     g_object_set(m_pipeline.get(), "uri", m_url.string().utf8().data(), nullptr);
 }
@@ -1718,6 +1733,7 @@ void MediaPlayerPrivateGStreamer::update
 
 void MediaPlayerPrivateGStreamer::playbin3SendSelectStreamsIfAppropriate()
 {
+#if GST_CHECK_VERSION(1, 10, 0)
     ASSERT(!m_isLegacyPlaybin);
 
     bool haveDifferentStreamIds = (m_wantedAudioStreamId != m_currentAudioStreamId || m_wantedVideoStreamId != m_currentVideoStreamId);
@@ -1750,8 +1766,10 @@ void MediaPlayerPrivateGStreamer::playbi
     m_waitingForStreamsSelectedEvent = true;
     gst_element_send_event(m_pipeline.get(), gst_event_new_select_streams(streams));
     g_list_free_full(streams, reinterpret_cast<GDestroyNotify>(g_free));
+#endif
 }
 
+#if GST_CHECK_VERSION(1, 10, 0)
 void MediaPlayerPrivateGStreamer::updateTracks([[maybe_unused]] const GRefPtr<GstObject>& collectionOwner)
 {
     ASSERT(!m_isLegacyPlaybin);
@@ -1856,7 +1874,9 @@ void MediaPlayerPrivateGStreamer::update
     }
 #undef CREATE_OR_SELECT_TRACK
 }
+#endif // GST_CHECK_VERSION(1, 10, 0)
 
+#if GST_CHECK_VERSION(1, 10, 0)
 void MediaPlayerPrivateGStreamer::handleStreamCollectionMessage(GstMessage* message)
 {
     if (m_isLegacyPlaybin)
@@ -1888,6 +1908,7 @@ void MediaPlayerPrivateGStreamer::handle
     callOnMainThreadAndWait(WTF::move(callback));
     GST_DEBUG_OBJECT(pipeline(), "Updating tracks DONE");
 }
+#endif
 
 bool MediaPlayerPrivateGStreamer::handleNeedContextMessage(GstMessage* message)
 {
@@ -2221,6 +2242,7 @@ void MediaPlayerPrivateGStreamer::handle
         GstState newState;
         gst_message_parse_state_changed(message, &currentState, &newState, nullptr);
 
+#if GST_CHECK_VERSION(1, 16, 0)
         if (isHolePunchRenderingEnabled() && currentState <= GST_STATE_READY && newState >= GST_STATE_READY) {
             // If we didn't create a video sink, store a reference to the created one.
             if (!m_videoSink) {
@@ -2254,6 +2276,7 @@ void MediaPlayerPrivateGStreamer::handle
 
         if (quirksManager.isEnabled() && quirksManager.needsBufferingPercentageCorrection() && !isMediaSource() && !isMediaStreamPlayer())
             quirksManager.setupBufferingPercentageCorrection(this, currentState, newState, GRefPtr<GstElement>(GST_ELEMENT(GST_MESSAGE_SRC(message))));
+#endif
 
         if (!messageSourceIsPlaybin || m_isDelayingLoad)
             break;
@@ -2310,6 +2333,7 @@ void MediaPlayerPrivateGStreamer::handle
             GST_DEBUG_OBJECT(pipeline(), "Processing HTTP headers: %" GST_PTR_FORMAT, structure);
             if (auto uri = gstStructureGetString(structure, "uri"_s)) {
                 URL url { uri.span() };
+                convertToInternalProtocol(m_url);
 
                 if (url != m_url) {
                     GST_DEBUG_OBJECT(pipeline(), "Ignoring HTTP response headers for non-main URI.");
@@ -2361,6 +2385,11 @@ void MediaPlayerPrivateGStreamer::handle
                 }
             }
         } else if (gst_structure_has_name(structure, "GstCacheDownloadComplete")) {
+        } else if (gst_structure_has_name(structure, "adaptive-streaming-statistics")) {
+            if (WEBKIT_IS_WEB_SRC(m_source.get())) {
+                if (const char* uri = gst_structure_get_string(structure, "uri"))
+                    m_hasTaintedOrigin = webKitSrcIsCrossOrigin(WEBKIT_WEB_SRC_CAST(m_source.get()), SecurityOrigin::create(URL(URL(), String::fromLatin1(uri))));
+            }
             GST_INFO_OBJECT(pipeline(), "Stream is fully downloaded, stopping monitoring downloading progress.");
             m_fillTimer.stop();
             m_bufferingPercentage = 100;
@@ -2374,6 +2403,7 @@ void MediaPlayerPrivateGStreamer::handle
     case GST_MESSAGE_TOC:
         processTableOfContents(message);
         break;
+#if GST_CHECK_VERSION(1, 10, 0)
     case GST_MESSAGE_STREAMS_SELECTED: {
         if (m_isLegacyPlaybin)
             break;
@@ -2412,6 +2442,7 @@ void MediaPlayerPrivateGStreamer::handle
         notifyPlayerOfTrack<InbandTextTrackPrivateGStreamer>();
         break;
     }
+#endif
     default:
         GST_DEBUG_OBJECT(pipeline(), "Unhandled GStreamer message type: %s", GST_MESSAGE_TYPE_NAME(message));
         break;
@@ -2693,6 +2724,7 @@ void MediaPlayerPrivateGStreamer::config
 #endif
 }
 
+#if 0
 void MediaPlayerPrivateGStreamer::configureElement(GstElement* element)
 {
     configureElementPlatformQuirks(element);
@@ -2755,6 +2787,7 @@ void MediaPlayerPrivateGStreamer::config
     if (equal(unsafeSpan(G_OBJECT_TYPE_NAME(G_OBJECT(element))), "GstQueue2"_s))
         g_object_set(G_OBJECT(element), "high-watermark", 0.10, nullptr);
 }
+#endif
 
 void MediaPlayerPrivateGStreamer::configureElementPlatformQuirks(GstElement* element)
 {
@@ -3434,8 +3467,10 @@ void MediaPlayerPrivateGStreamer::create
     auto usePlaybin3 = StringView::fromLatin1(g_getenv("WEBKIT_GST_USE_PLAYBIN3"));
     bool isMediaStream = url.protocolIs("mediastream"_s);
     bool isBlob = url.protocolIs("blob"_s);
+#if GST_CHECK_VERSION(1, 10, 0)
     if (isMediaSource() || isMediaStream || isBlob || usePlaybin3 == "1"_s)
         playbinName = "playbin3"_s;
+#endif
 
     ASSERT(!m_pipeline);
 
@@ -3506,9 +3541,11 @@ void MediaPlayerPrivateGStreamer::create
     // initilization segment is parsed and "updateend" is fired. We need therefore to handle these
     // synchronously in the same main thread tick to make the tracks information available to JS no
     // later than "updateend".
+#if GST_CHECK_VERSION(1, 10, 0)
     g_signal_connect_swapped(bus.get(), "sync-message::stream-collection", G_CALLBACK(+[](MediaPlayerPrivateGStreamer* player, GstMessage* message) {
         player->handleStreamCollectionMessage(message);
     }), this);
+#endif
 
     g_signal_connect_swapped(bus.get(), "sync-message::error", G_CALLBACK(+[](MediaPlayerPrivateGStreamer* player, GstMessage* message) {
         player->handleSyncErrorMessage(message);
@@ -3517,14 +3554,47 @@ void MediaPlayerPrivateGStreamer::create
     g_object_set(m_pipeline.get(), "mute", static_cast<gboolean>(player->muted()), nullptr);
 
     // From GStreamer 1.22.0, uridecodebin3 is created in playbin3's _init(), so "element-setup" isn't called with it.
+#if GST_CHECK_VERSION(1, 10, 0)
     if (!m_isLegacyPlaybin && gst_check_version(1, 22, 0)) {
         if (auto uriDecodeBin3 = adoptGRef(gst_bin_get_by_name(GST_BIN_CAST(m_pipeline.get()), "uridecodebin3")))
             configureElement(uriDecodeBin3.get());
     }
+#endif
+
+
+#if 0 // FIXME: causes gcc segfault
+    g_signal_connect(GST_BIN_CAST(m_pipeline.get()), "deep-element-added", G_CALLBACK(+[](GstBin*, GstBin* subBin, GstElement* element, MediaPlayerPrivateGStreamer* player) {
+        GUniquePtr<char> binName(gst_element_get_name(GST_ELEMENT_CAST(subBin)));
+        GUniquePtr<char> elementName(gst_element_get_name(element));
+
+        if (g_str_has_prefix(elementName.get(), "downloadbuffer")) {
+            player->configureDownloadBuffer(element);
+            return;
+        }
+
+        if (g_str_has_prefix(elementName.get(), "uridecodebin")) {
+            // This will set the multiqueue size to the default value.
+            g_object_set(element, "buffer-size", 2 * MB, nullptr);
+            return;
+        }
 
     g_signal_connect(GST_BIN_CAST(m_pipeline.get()), "element-setup", G_CALLBACK(+[](GstBin*, GstElement* element, MediaPlayerPrivateGStreamer* player) {
         player->configureElement(element);
+        if (!g_str_has_prefix(binName.get(), "decodebin"))
+            return;
+
+        if (g_str_has_prefix(elementName.get(), "v4l2"))
+            player->m_videoDecoderPlatform = GstVideoDecoderPlatform::Video4Linux;
+        else if (g_str_has_prefix(elementName.get(), "imxvpudec"))
+            player->m_videoDecoderPlatform = GstVideoDecoderPlatform::ImxVPU;
+        else if (g_str_has_prefix(elementName.get(), "omx"))
+            player->m_videoDecoderPlatform = GstVideoDecoderPlatform::OpenMAX;
+
+#if USE(TEXTURE_MAPPER_GL)
+        player->updateTextureMapperFlags();
+#endif
     }), this);
+#endif
 
     g_signal_connect_swapped(m_pipeline.get(), "source-setup", G_CALLBACK(sourceSetupCallback), this);
 
@@ -3593,6 +3663,7 @@ void MediaPlayerPrivateGStreamer::config
         configureMediaStreamAudioDecoder(decoder);
 }
 
+#if 0
 void MediaPlayerPrivateGStreamer::configureVideoDecoder(GstElement* decoder)
 {
     auto name = GMallocString::unsafeAdoptFromUTF8(gst_element_get_name(decoder));
@@ -3677,6 +3748,7 @@ void MediaPlayerPrivateGStreamer::config
         return GST_PAD_PROBE_OK;
     }, this, nullptr);
 }
+#endif
 
 bool MediaPlayerPrivateGStreamer::didPassCORSAccessCheck() const
 {
@@ -4061,7 +4133,7 @@ void MediaPlayerPrivateGStreamer::flushC
 {
     Locker sampleLocker { m_sampleMutex };
 
-    if (m_sample && gst_sample_get_buffer(m_sample.get())) {
+    if (m_sample) {
         // Allocate a new copy of the sample which has to be released. The copy is necessary so that
         // the video dimensions can still be fetched and also for canvas rendering. The release is
         // necessary because the sample might have been allocated by a hardware decoder and memory
@@ -4298,9 +4370,11 @@ GstElement* MediaPlayerPrivateGStreamer:
     else
         sink = GStreamerQuirksManager::singleton().createHolePunchVideoSink(m_isLegacyPlaybin, player.get());
 
+#if GST_CHECK_VERSION(1, 10, 0)
     // Configure sink before it allocates resources.
     if (sink)
         configureElement(sink);
+#endif
     return sink;
 }
 
@@ -4627,6 +4701,7 @@ WTFLogChannel& MediaPlayerPrivateGStream
 }
 #endif
 
+#if 0
 std::optional<VideoFrameMetadata> MediaPlayerPrivateGStreamer::videoFrameMetadata()
 {
     Locker sampleLocker { m_sampleMutex };
@@ -4659,6 +4734,7 @@ std::optional<VideoFrameMetadata> MediaP
 
     return metadata;
 }
+#endif
 
 static bool areAllSinksPlayingForBin(GstBin* bin)
 {
Index: webkitgtk-2.52.0/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h
===================================================================
--- webkitgtk-2.52.0.orig/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h
+++ webkitgtk-2.52.0/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h
@@ -273,8 +273,12 @@ protected:
         AudioChanged = 1 << 2,
         VolumeChanged = 1 << 3,
         MuteChanged = 1 << 4,
+#if GST_CHECK_VERSION (1, 10, 0)
         TextChanged = 1 << 5,
         StreamCollectionChanged = 1 << 7
+#else
+        TextChanged = 1 << 5
+#endif
     };
 
     enum class PlaybackRatePausedState {
@@ -553,7 +557,6 @@ private:
     static void downloadBufferFileCreatedCallback(MediaPlayerPrivateGStreamer*);
 
     void configureAudioDecoder(GstElement*);
-    void configureVideoDecoder(GstElement*);
     void configureElement(GstElement*);
     void configureParsebin(GstElement*);
     void configureUriDecodebin2(GstElement*);
@@ -564,7 +567,9 @@ private:
 
     void setPlaybinURL(const URL& urlString);
 
+#if GST_CHECK_VERSION(1, 10, 0)
     void updateTracks(const GRefPtr<GstObject>& collectionOwner);
+#endif
     void updateVideoSizeAndOrientationFromCaps(const GstCaps*);
     bool hasFirstVideoSampleReachedSink() const;
 
@@ -650,6 +655,8 @@ private:
     uint64_t m_networkReadPosition { 0 };
     mutable uint64_t m_readPositionAtLastDidLoadingProgress { 0 };
 
+    std::optional<bool> m_hasTaintedOrigin { std::nullopt };
+
     uint64_t m_totalVideoFrames { 0 };
     uint64_t m_droppedVideoFrames { 0 };
     uint64_t m_decodedVideoFrames { 0 };
@@ -661,14 +668,12 @@ private:
     DataMutex<TaskAtMediaTimeScheduler> m_TaskAtMediaTimeSchedulerDataMutex;
 
 private:
-    std::optional<VideoFrameMetadata> videoFrameMetadata() final;
 #if ENABLE(MEDIA_STREAM)
     std::pair<String, GRefPtr<GstDevice>> resolveAudioOutputDevice(const String& deviceId);
 #endif
     bool applyAudioSinkDevice(GstElement* audioSink, const GRefPtr<GstDevice>&, const String& deviceId);
 
     uint64_t m_sampleCount { 0 };
-    uint64_t m_lastVideoFrameMetadataSampleCount { 0 };
     mutable PlatformTimeRanges m_buffered;
 #if !RELEASE_LOG_DISABLED
     const Ref<const Logger> m_logger;
@@ -679,7 +684,9 @@ private:
 
     String m_errorMessage;
 
+#if GST_CHECK_VERSION (1, 10, 0)
     GRefPtr<GstStreamCollection> m_streamCollection;
+#endif
 
     AbortableTaskQueue m_sinkTaskQueue;
 
Index: webkitgtk-2.52.0/Source/WebCore/platform/graphics/gstreamer/PlatformDisplayGStreamer.cpp
===================================================================
--- webkitgtk-2.52.0.orig/Source/WebCore/platform/graphics/gstreamer/PlatformDisplayGStreamer.cpp
+++ webkitgtk-2.52.0/Source/WebCore/platform/graphics/gstreamer/PlatformDisplayGStreamer.cpp
@@ -45,11 +45,12 @@ static void ensureDebugCategoryInitializ
     });
 }
 
+#if ENABLE(VIDEO) && USE(GSTREAMER_GL)
 GstGLDisplay* PlatformDisplay::gstGLDisplay() const
 {
     ensureDebugCategoryInitialized();
     if (!m_gstGLDisplay)
-        m_gstGLDisplay = adoptGRef(GST_GL_DISPLAY(gst_gl_display_egl_new_with_egl_display(eglDisplay())));
+        m_gstGLDisplay = GST_GL_DISPLAY(gst_gl_display_egl_new_with_egl_display(eglDisplay()));
     GST_TRACE("Using GL display %" GST_PTR_FORMAT, m_gstGLDisplay.get());
     return m_gstGLDisplay.get();
 }
@@ -73,7 +74,7 @@ GstGLContext* PlatformDisplay::gstGLCont
         return nullptr;
     }
 
-    m_gstGLContext = adoptGRef(gst_gl_context_new_wrapped(gstDisplay, reinterpret_cast<guintptr>(context->platformContext()), GST_GL_PLATFORM_EGL, GST_GL_API_GLES2));
+    m_gstGLContext = gst_gl_context_new_wrapped(gstDisplay, reinterpret_cast<guintptr>(context->platformContext()), GST_GL_PLATFORM_EGL, GST_GL_API_GLES2);
     {
         GLContext::ScopedGLContextCurrent scopedCurrent(*context);
         if (gst_gl_context_activate(m_gstGLContext.get(), TRUE)) {
@@ -86,6 +87,7 @@ GstGLContext* PlatformDisplay::gstGLCont
     GST_DEBUG("Created GL context %" GST_PTR_FORMAT, m_gstGLContext.get());
     return m_gstGLContext.get();
 }
+#endif
 
 void PlatformDisplay::clearGStreamerGLState()
 {
Index: webkitgtk-2.52.0/Source/WebCore/platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp
===================================================================
--- webkitgtk-2.52.0.orig/Source/WebCore/platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp
+++ webkitgtk-2.52.0/Source/WebCore/platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp
@@ -88,6 +88,7 @@ TrackPrivateBaseGStreamer::TrackPrivateB
     tagsChanged();
 }
 
+#if GST_CHECK_VERSION(1, 10, 0)
 TrackPrivateBaseGStreamer::TrackPrivateBaseGStreamer(TrackType type, TrackPrivateBase* owner, unsigned index, GstStream* stream)
     : m_notifier(MainThreadNotifier<MainThreadNotification>::create())
     , m_index(index)
@@ -106,6 +107,7 @@ TrackPrivateBaseGStreamer::TrackPrivateB
     // We can't call notifyTrackOfTagsChanged() directly, because we need tagsChanged() to setup m_tags.
     tagsChanged();
 }
+#endif
 
 void TrackPrivateBaseGStreamer::setPad(GRefPtr<GstPad>&& pad)
 {
@@ -159,8 +161,10 @@ TrackPrivateBaseGStreamer::~TrackPrivate
 
 GstObject* TrackPrivateBaseGStreamer::objectForLogging() const
 {
+#if GST_CHECK_VERSION(1, 10, 0)
     if (m_stream)
         return GST_OBJECT_CAST(m_stream.get());
+#endif
 
     ASSERT(m_pad);
     return GST_OBJECT_CAST(m_pad.get());
@@ -168,8 +172,10 @@ GstObject* TrackPrivateBaseGStreamer::ob
 
 void TrackPrivateBaseGStreamer::disconnect()
 {
+#if GST_CHECK_VERSION(1, 10, 0)
     if (m_stream)
         g_signal_handlers_disconnect_matched(m_stream.get(), G_SIGNAL_MATCH_DATA, 0, 0, nullptr, nullptr, this);
+#endif
 
     m_tags.clear();
 
@@ -207,8 +213,11 @@ void TrackPrivateBaseGStreamer::tagsChan
             }
             i++;
         } while (tagEvent);
-    } else if (m_stream)
+    }
+#if GST_CHECK_VERSION(1, 10, 0)
+  else if (m_stream)
         tags = adoptGRef(gst_stream_get_tags(m_stream.get()));
+#endif
 
     if (!tags)
         tags = adoptGRef(gst_tag_list_new_empty());
@@ -325,6 +334,7 @@ void TrackPrivateBaseGStreamer::installU
                 track->updateConfigurationFromTags(getAllTags(track->m_pad));
             });
         }), this);
+#if GST_CHECK_VERSION(1, 10, 0)
     } else if (m_stream) {
         g_signal_connect_swapped(m_stream.get(), "notify::caps", G_CALLBACK(+[](TrackPrivateBaseGStreamer* track) {
             track->m_taskQueue.enqueueTask([track]() {
@@ -347,6 +357,7 @@ void TrackPrivateBaseGStreamer::installU
                 track->updateConfigurationFromTags(WTF::move(tags));
             });
         }), this);
+#endif
     }
 }
 
Index: webkitgtk-2.52.0/Source/WebCore/platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h
===================================================================
--- webkitgtk-2.52.0.orig/Source/WebCore/platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h
+++ webkitgtk-2.52.0/Source/WebCore/platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h
@@ -60,7 +60,9 @@ public:
     unsigned index() { return m_index; };
     void setIndex(unsigned index) { m_index =  index; }
 
+#if GST_CHECK_VERSION(1, 10, 0)
     GstStream* stream() const { return m_stream.get(); }
+#endif
 
     // Used for MSE, where the initial caps of the pad are relevant for initializing the matching pad in the
     // playback pipeline.
@@ -75,7 +77,9 @@ public:
 protected:
     TrackPrivateBaseGStreamer(TrackType, TrackPrivateBase*, unsigned index, GRefPtr<GstPad>&&, bool shouldHandleStreamStartEvent);
     TrackPrivateBaseGStreamer(TrackType, TrackPrivateBase*, unsigned index, GRefPtr<GstPad>&&, TrackID);
+#if GST_CHECK_VERSION(1, 16, 0)
     TrackPrivateBaseGStreamer(TrackType, TrackPrivateBase*, unsigned index, GstStream*);
+#endif
 
     void notifyTrackOfTagsChanged();
     void notifyTrackOfStreamChanged();
@@ -104,7 +108,9 @@ protected:
     TrackID m_id;
     GRefPtr<GstPad> m_pad;
     GRefPtr<GstPad> m_bestUpstreamPad;
+#if GST_CHECK_VERSION(1, 10, 0)
     GRefPtr<GstStream> m_stream;
+#endif
     unsigned long m_eventProbe { 0 };
     GRefPtr<GstCaps> m_initialCaps;
     AbortableTaskQueue m_taskQueue;
Index: webkitgtk-2.52.0/Source/WebCore/platform/graphics/gstreamer/VideoEncoderGStreamer.cpp
===================================================================
--- webkitgtk-2.52.0.orig/Source/WebCore/platform/graphics/gstreamer/VideoEncoderGStreamer.cpp
+++ webkitgtk-2.52.0/Source/WebCore/platform/graphics/gstreamer/VideoEncoderGStreamer.cpp
@@ -333,6 +333,7 @@ bool GStreamerInternalVideoEncoder::enco
         m_orientation = WTF::move(orientation);
     }
 
+#if GST_CHECK_VERSION(1, 10, 0)
     if (m_config.frameRate) {
         int framerateNumerator, framerateDenominator;
         gst_util_double_to_fraction(m_config.frameRate, &framerateNumerator, &framerateDenominator);
@@ -343,6 +344,7 @@ bool GStreamerInternalVideoEncoder::enco
         gst_caps_set_simple(caps.get(), "framerate", GST_TYPE_FRACTION, framerateNumerator, framerateDenominator, nullptr);
         gst_sample_set_caps(sample.get(), caps.get());
     }
+#endif
     return m_harness->pushSample(WTF::move(sample));
 }
 
Index: webkitgtk-2.52.0/Source/WebCore/platform/graphics/gstreamer/VideoFrameGStreamer.cpp
===================================================================
--- webkitgtk-2.52.0.orig/Source/WebCore/platform/graphics/gstreamer/VideoFrameGStreamer.cpp
+++ webkitgtk-2.52.0/Source/WebCore/platform/graphics/gstreamer/VideoFrameGStreamer.cpp
@@ -156,7 +156,7 @@ static RefPtr<ImageGStreamer> convertSam
     auto format = GST_VIDEO_INFO_HAS_ALPHA(&videoInfo) ? "ARGB"_s : "xRGB"_s;
 #endif
     auto caps = adoptGRef(gst_caps_new_simple("video/x-raw", "format", G_TYPE_STRING, format.characters(), "framerate", GST_TYPE_FRACTION, GST_VIDEO_INFO_FPS_N(&videoInfo), GST_VIDEO_INFO_FPS_D(&videoInfo), "width", G_TYPE_INT, GST_VIDEO_INFO_WIDTH(&videoInfo), "height", G_TYPE_INT, GST_VIDEO_INFO_HEIGHT(&videoInfo), nullptr));
-    auto convertedSample = GStreamerVideoFrameConverter::singleton().convert(sample, caps);
+    auto convertedSample = adoptGRef(gst_video_convert_sample(sample.get(), caps.get(), GST_CLOCK_TIME_NONE, nullptr));
     if (!convertedSample)
         return nullptr;
 
@@ -465,10 +465,14 @@ RefPtr<VideoFrameGStreamer> VideoFrameGS
             gst_caps_set_simple(outputCaps.get(), "framerate", GST_TYPE_FRACTION, frameRateNumerator, frameRateDenominator, nullptr);
 
         auto inputSample = adoptGRef(gst_sample_new(buffer.get(), caps.get(), nullptr, nullptr));
-        sample = GStreamerVideoFrameConverter::singleton().convert(inputSample, outputCaps);
-        if (!sample)
+        GUniqueOutPtr<GError> error;
+        sample = adoptGRef(gst_video_convert_sample(inputSample.get(), outputCaps.get(), GST_CLOCK_TIME_NONE, &error.outPtr()));
+        if (!sample) {
+            GST_ERROR("Video sample conversion failed: %s", error->message);
             return nullptr;
+        }
 
+#if 0
         info = infoFromCaps(outputCaps);
         GRefPtr buffer = gst_sample_get_buffer(sample.get());
         auto outputBuffer = webkitGstBufferSetVideoFrameMetadata(WTF::move(buffer), options.timeMetadata, options.rotation, options.isMirrored, options.contentHint);
@@ -476,6 +480,7 @@ RefPtr<VideoFrameGStreamer> VideoFrameGS
         setBufferFields(outputBuffer.get(), options.presentationTime, frameRate);
         sample = adoptGRef(gst_sample_make_writable(sample.leakRef()));
         gst_sample_set_buffer(sample.get(), outputBuffer.get());
+#endif
     } else {
         auto outputBuffer = webkitGstBufferSetVideoFrameMetadata(WTF::move(buffer), options.timeMetadata, options.rotation, options.isMirrored, options.contentHint);
         gst_buffer_add_video_meta(outputBuffer.get(), GST_VIDEO_FRAME_FLAG_NONE, format, width, height);
@@ -525,6 +530,7 @@ VideoFrameGStreamer::VideoFrameGStreamer
 
 void VideoFrameGStreamer::setFrameRate(double frameRate)
 {
+#if GST_CHECK_VERSION(1, 16, 0)
     auto caps = adoptGRef(gst_caps_copy(gst_sample_get_caps(m_sample.get())));
     int frameRateNumerator, frameRateDenominator;
     gst_util_double_to_fraction(frameRate, &frameRateNumerator, &frameRateDenominator);
@@ -535,16 +541,19 @@ void VideoFrameGStreamer::setFrameRate(d
 
     m_sample = adoptGRef(gst_sample_make_writable(m_sample.leakRef()));
     gst_sample_set_caps(m_sample.get(), caps.get());
+#endif
 }
 
 void VideoFrameGStreamer::setMaxFrameRate(double maxFrameRate)
 {
+#if GST_CHECK_VERSION(1, 16, 0)
     auto caps = adoptGRef(gst_caps_copy(gst_sample_get_caps(m_sample.get())));
     int frameRateNumerator, frameRateDenominator;
     gst_util_double_to_fraction(maxFrameRate, &frameRateNumerator, &frameRateDenominator);
     gst_caps_set_simple(caps.get(), "framerate", GST_TYPE_FRACTION, 0, 1, "max-framerate", GST_TYPE_FRACTION, frameRateNumerator, frameRateDenominator, nullptr);
     m_sample = adoptGRef(gst_sample_make_writable(m_sample.leakRef()));
     gst_sample_set_caps(m_sample.get(), caps.get());
+#endif
 }
 
 void VideoFrameGStreamer::setPresentationTime(const MediaTime& presentationTime)
@@ -556,11 +565,13 @@ void VideoFrameGStreamer::setPresentatio
 
 void VideoFrameGStreamer::setMetadataAndContentHint(std::optional<VideoFrameTimeMetadata> metadata, VideoFrameContentHint hint)
 {
+#if GST_CHECK_VERSION (1, 16, 0)
     GRefPtr buffer = gst_sample_get_buffer(m_sample.get());
     RELEASE_ASSERT(buffer);
     auto modifiedBuffer = webkitGstBufferSetVideoFrameMetadata(WTF::move(buffer), metadata, rotation(), isMirrored(), hint);
     m_sample = adoptGRef(gst_sample_make_writable(m_sample.leakRef()));
     gst_sample_set_buffer(m_sample.get(), modifiedBuffer.get());
+#endif
 }
 
 static void copyPlane(std::span<uint8_t>& destination, const std::span<uint8_t>& source, uint64_t sourceStride, const ComputedPlaneLayout& spanPlaneLayout)
@@ -736,7 +747,12 @@ GRefPtr<GstSample> VideoFrameGStreamer::
     if (gst_caps_is_equal(caps, outputCaps.get()))
         return GRefPtr<GstSample>(m_sample);
 
-    return GStreamerVideoFrameConverter::singleton().convert(m_sample, outputCaps);
+    GUniqueOutPtr<GError> error;
+    auto convertedSample = adoptGRef(gst_video_convert_sample(m_sample.get(), outputCaps.get(), GST_CLOCK_TIME_NONE, &error.outPtr()));
+    if (!convertedSample)
+        GST_ERROR("Conversion to %s failed: %s", formatName.span().data(), error->message);
+
+    return convertedSample;
 }
 
 GRefPtr<GstSample> VideoFrameGStreamer::downloadSample(std::optional<GstVideoFormat> destinationFormat)
Index: webkitgtk-2.52.0/Source/WebCore/platform/graphics/gstreamer/VideoTrackPrivateGStreamer.cpp
===================================================================
--- webkitgtk-2.52.0.orig/Source/WebCore/platform/graphics/gstreamer/VideoTrackPrivateGStreamer.cpp
+++ webkitgtk-2.52.0/Source/WebCore/platform/graphics/gstreamer/VideoTrackPrivateGStreamer.cpp
@@ -66,6 +66,7 @@ VideoTrackPrivateGStreamer::VideoTrackPr
     installUpdateConfigurationHandlers();
 }
 
+#if GST_CHECK_VERSION(1, 10, 0)
 VideoTrackPrivateGStreamer::VideoTrackPrivateGStreamer(ThreadSafeWeakPtr<MediaPlayerPrivateGStreamer>&& player, unsigned index, GstStream* stream)
     : TrackPrivateBaseGStreamer(TrackPrivateBaseGStreamer::TrackType::Video, this, index, stream)
     , m_player(WTF::move(player))
@@ -170,11 +171,14 @@ void VideoTrackPrivateGStreamer::updateC
     configuration.framerate = frameRate;
     configuration.colorSpace = colorSpace;
 }
+#endif
 
 VideoTrackPrivate::Kind VideoTrackPrivateGStreamer::kind() const
 {
+#if GST_CHECK_VERSION(1, 10, 0)
     if (m_stream && gst_stream_get_stream_flags(m_stream.get()) & GST_STREAM_FLAG_SELECT)
         return VideoTrackPrivate::Kind::Main;
+#endif
 
     return VideoTrackPrivate::kind();
 }
@@ -183,8 +187,10 @@ void VideoTrackPrivateGStreamer::disconn
 {
     m_taskQueue.startAborting();
 
+#if GST_CHECK_VERSION(1, 10, 0)
     if (m_stream)
         g_signal_handlers_disconnect_matched(m_stream.get(), G_SIGNAL_MATCH_DATA, 0, 0, nullptr, nullptr, this);
+#endif
 
     m_player = nullptr;
     TrackPrivateBaseGStreamer::disconnect();
Index: webkitgtk-2.52.0/Source/WebCore/platform/graphics/gstreamer/VideoTrackPrivateGStreamer.h
===================================================================
--- webkitgtk-2.52.0.orig/Source/WebCore/platform/graphics/gstreamer/VideoTrackPrivateGStreamer.h
+++ webkitgtk-2.52.0/Source/WebCore/platform/graphics/gstreamer/VideoTrackPrivateGStreamer.h
@@ -49,10 +49,12 @@ public:
         return adoptRef(*new VideoTrackPrivateGStreamer(WTF::move(player), index, WTF::move(pad), trackId));
     }
 
+#if GST_CHECK_VERSION(1, 10, 0)
     static Ref<VideoTrackPrivateGStreamer> create(ThreadSafeWeakPtr<MediaPlayerPrivateGStreamer>&& player, unsigned index, GstStream* stream)
     {
         return adoptRef(*new VideoTrackPrivateGStreamer(WTF::move(player), index, stream));
     }
+#endif
 
     Kind kind() const final;
 
@@ -77,18 +79,24 @@ public:
     String label() const final { return m_label; }
     String language() const final { return m_language; }
 
+#if GST_CHECK_VERSION(1, 16, 0)
     void updateConfigurationFromCaps(GRefPtr<GstCaps>&&) final;
+#endif
 
 protected:
+#if GST_CHECK_VERSION(1, 16, 0)
     void updateConfigurationFromTags(GRefPtr<GstTagList>&&) final;
 
     void tagsChanged(GRefPtr<GstTagList>&& tags) final { updateConfigurationFromTags(WTF::move(tags)); }
     void capsChanged(TrackID, GRefPtr<GstCaps>&&) final;
+#endif
 
 private:
     VideoTrackPrivateGStreamer(ThreadSafeWeakPtr<MediaPlayerPrivateGStreamer>&&, unsigned index, GRefPtr<GstPad>&&, bool shouldHandleStreamStartEvent);
     VideoTrackPrivateGStreamer(ThreadSafeWeakPtr<MediaPlayerPrivateGStreamer>&&, unsigned index, GRefPtr<GstPad>&&, TrackID);
+#if GST_CHECK_VERSION(1, 16, 0)
     VideoTrackPrivateGStreamer(ThreadSafeWeakPtr<MediaPlayerPrivateGStreamer>&&, unsigned index, GstStream*);
+#endif
 
     ThreadSafeWeakPtr<MediaPlayerPrivateGStreamer> m_player;
 };
Index: webkitgtk-2.52.0/Source/WebCore/platform/graphics/gstreamer/WebKitAudioSinkGStreamer.cpp
===================================================================
--- webkitgtk-2.52.0.orig/Source/WebCore/platform/graphics/gstreamer/WebKitAudioSinkGStreamer.cpp
+++ webkitgtk-2.52.0/Source/WebCore/platform/graphics/gstreamer/WebKitAudioSinkGStreamer.cpp
@@ -151,7 +151,9 @@ static GstStateChangeReturn webKitAudioS
     auto* sink = WEBKIT_AUDIO_SINK(element);
     auto* priv = sink->priv;
 
+#if GST_CHECK_VERSION(1, 14, 0)
     GST_DEBUG_OBJECT(sink, "Handling %s transition", gst_state_change_get_name(stateChange));
+#endif
 
     auto& mixer = GStreamerAudioMixer::singleton();
     if (priv->interAudioSink && stateChange == GST_STATE_CHANGE_NULL_TO_READY) {
@@ -181,7 +183,6 @@ static void webKitAudioSinkConstructed(G
     G_OBJECT_CLASS(webkit_audio_sink_parent_class)->constructed(object);
     IGNORE_WARNINGS_BEGIN("cast-align");
     GST_OBJECT_FLAG_SET(GST_OBJECT_CAST(object), GST_ELEMENT_FLAG_SINK);
-    gst_bin_set_suppressed_flags(GST_BIN_CAST(object), static_cast<GstElementFlags>(GST_ELEMENT_FLAG_SOURCE | GST_ELEMENT_FLAG_SINK));
     IGNORE_WARNINGS_END;
 }
 
Index: webkitgtk-2.52.0/Source/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp
===================================================================
--- webkitgtk-2.52.0.orig/Source/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp
+++ webkitgtk-2.52.0/Source/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp
@@ -45,6 +45,7 @@
 #include <wtf/glib/WTFGType.h>
 #include <wtf/text/CString.h>
 #include <wtf/text/StringToIntegerConversion.h>
+#include <wtf/URL.h>
 
 using namespace WebCore;
 
@@ -473,20 +474,11 @@ static GstFlowReturn webKitWebSrcCreate(
     //    "source-setup" event. This doesn't work for additional WebKitWebSrc elements created by adaptivedemux.
     //
     // 2) A GstContext query made here.
-    if (!members->loader) {
-        members.runUnlocked([src, baseSrc]() {
-            GRefPtr<GstQuery> query = adoptGRef(gst_query_new_context(WEBKIT_WEB_SRC_RESOURCE_LOADER_CONTEXT_TYPE_NAME));
-            if (gst_pad_peer_query(GST_BASE_SRC_PAD(baseSrc), query.get())) {
-                GstContext* context;
-
-                gst_query_parse_context(query.get(), &context);
-                gst_element_set_context(GST_ELEMENT_CAST(src), context);
-            } else
-                gst_element_post_message(GST_ELEMENT_CAST(src), gst_message_new_need_context(GST_OBJECT_CAST(src), WEBKIT_WEB_SRC_RESOURCE_LOADER_CONTEXT_TYPE_NAME));
-        });
-        if (members->isFlushing)
-            return GST_FLOW_FLUSHING;
-    }
+    // 2) A GstContext query made here. Because of a bug, this only works in GStreamer >= 1.12.
+    //
+    // As a compatibility workaround, the http: URI protocol is only registered for gst>=1.12; otherwise using
+    // webkit+http:, which is used by MediaPlayerPrivateGStreamer but not by adaptivedemux's additional source
+    // elements, therefore using souphttpsrc instead and not routing traffic through the NetworkProcess.
     if (!members->loader) {
         GST_ERROR_OBJECT(src, "Couldn't obtain WebKitWebSrcPlayerContext, which is necessary to make network requests");
         return GST_FLOW_ERROR;
@@ -893,7 +885,10 @@ const gchar* const* webKitWebSrcGetProto
 
 static URL convertPlaybinURI(String&& uriString)
 {
-    return URL { WTF::move(uriString) };
+    URL url { WTF::move(uriString) };
+    ASSERT(url.protocol().substring(0, 7) == "webkit+");
+    url.setProtocol(url.protocol().substring(7).toString());
+     return url;
 }
 
 static gchar* webKitWebSrcGetUri(GstURIHandler* handler)
Index: webkitgtk-2.52.0/Source/WebCore/platform/graphics/ImageDecoder.cpp
===================================================================
--- webkitgtk-2.52.0.orig/Source/WebCore/platform/graphics/ImageDecoder.cpp
+++ webkitgtk-2.52.0/Source/WebCore/platform/graphics/ImageDecoder.cpp
@@ -39,10 +39,6 @@
 #include "ImageDecoderAVFObjC.h"
 #endif
 
-#if USE(GSTREAMER) && ENABLE(VIDEO)
-#include "ImageDecoderGStreamer.h"
-#endif
-
 namespace WebCore {
 
 WTF_MAKE_TZONE_ALLOCATED_IMPL(ImageDecoder);
@@ -106,11 +102,6 @@ RefPtr<ImageDecoder> ImageDecoder::creat
     }
 #endif
 
-#if USE(GSTREAMER) && ENABLE(VIDEO)
-    if (ImageDecoderGStreamer::canDecodeType(mimeType))
-        return ImageDecoderGStreamer::create(data, mimeType, alphaOption, gammaAndColorProfileOption);
-#endif
-
 #if USE(CG)
     // ScalableImageDecoder is used on CG ports for some specific image formats which the platform doesn't support directly.
     if (auto imageDecoder = ScalableImageDecoder::create(data, alphaOption, gammaAndColorProfileOption))
@@ -147,11 +138,6 @@ bool ImageDecoder::supportsMediaType(Med
 #endif
 #endif
 
-#if USE(GSTREAMER) && ENABLE(VIDEO)
-    if (ImageDecoderGStreamer::supportsMediaType(type))
-        return true;
-#endif
-
     return false;
 }
 
Index: webkitgtk-2.52.0/Source/WebCore/platform/gstreamer/GStreamerCodecUtilities.cpp
===================================================================
--- webkitgtk-2.52.0.orig/Source/WebCore/platform/gstreamer/GStreamerCodecUtilities.cpp
+++ webkitgtk-2.52.0/Source/WebCore/platform/gstreamer/GStreamerCodecUtilities.cpp
@@ -239,13 +239,13 @@ static std::pair<GRefPtr<GstCaps>, GRefP
     else if (primaries == VPConfigurationColorPrimaries::BT_2020_Nonconstant_Luminance)
         GST_VIDEO_INFO_COLORIMETRY(&info).primaries = GST_VIDEO_COLOR_PRIMARIES_BT2020;
     else if (primaries == VPConfigurationColorPrimaries::SMPTE_ST_428_1)
-        GST_VIDEO_INFO_COLORIMETRY(&info).primaries = GST_VIDEO_COLOR_PRIMARIES_SMPTEST428;
+        GST_VIDEO_INFO_COLORIMETRY(&info).primaries = GST_VIDEO_COLOR_PRIMARIES_UNKNOWN;
     else if (primaries == VPConfigurationColorPrimaries::SMPTE_RP_431_2)
-        GST_VIDEO_INFO_COLORIMETRY(&info).primaries = GST_VIDEO_COLOR_PRIMARIES_SMPTERP431;
+        GST_VIDEO_INFO_COLORIMETRY(&info).primaries = GST_VIDEO_COLOR_PRIMARIES_UNKNOWN;
     else if (primaries == VPConfigurationColorPrimaries::SMPTE_EG_432_1)
-        GST_VIDEO_INFO_COLORIMETRY(&info).primaries = GST_VIDEO_COLOR_PRIMARIES_SMPTEEG432;
+        GST_VIDEO_INFO_COLORIMETRY(&info).primaries = GST_VIDEO_COLOR_PRIMARIES_UNKNOWN;
     else if (primaries == VPConfigurationColorPrimaries::EBU_Tech_3213_E)
-        GST_VIDEO_INFO_COLORIMETRY(&info).primaries = GST_VIDEO_COLOR_PRIMARIES_EBU3213;
+        GST_VIDEO_INFO_COLORIMETRY(&info).primaries = GST_VIDEO_COLOR_PRIMARIES_UNKNOWN;
     else if (primaries == VPConfigurationColorPrimaries::Unspecified)
         GST_VIDEO_INFO_COLORIMETRY(&info).primaries = GST_VIDEO_COLOR_PRIMARIES_UNKNOWN;
 
@@ -401,6 +401,7 @@ static std::pair<GRefPtr<GstCaps>, GRefP
     case AV1ConfigurationColorPrimaries::BT_2020_Nonconstant_Luminance:
         GST_VIDEO_INFO_COLORIMETRY(&info).primaries = GST_VIDEO_COLOR_PRIMARIES_BT2020;
         break;
+#if GST_CHECK_VERSION(1, 18, 0)
     case AV1ConfigurationColorPrimaries::SMPTE_ST_428_1:
         GST_VIDEO_INFO_COLORIMETRY(&info).primaries = GST_VIDEO_COLOR_PRIMARIES_SMPTEST428;
         break;
@@ -413,6 +414,7 @@ static std::pair<GRefPtr<GstCaps>, GRefP
     case AV1ConfigurationColorPrimaries::EBU_Tech_3213_E:
         GST_VIDEO_INFO_COLORIMETRY(&info).primaries = GST_VIDEO_COLOR_PRIMARIES_EBU3213;
         break;
+#endif
     };
 
     switch (static_cast<AV1ConfigurationTransferCharacteristics>(configurationRecord->transferCharacteristics)) {
Index: webkitgtk-2.52.0/Source/WebCore/platform/gstreamer/GStreamerElementHarness.cpp
===================================================================
--- webkitgtk-2.52.0.orig/Source/WebCore/platform/gstreamer/GStreamerElementHarness.cpp
+++ webkitgtk-2.52.0/Source/WebCore/platform/gstreamer/GStreamerElementHarness.cpp
@@ -393,10 +393,12 @@ const GRefPtr<GstCaps>& GStreamerElement
     if (m_outputCaps)
         return m_outputCaps;
 
+#if GST_CHECK_VERSION (1, 16, 0)
     auto stream = adoptGRef(gst_pad_get_stream(m_pad.get()));
     if (stream)
         m_outputCaps = adoptGRef(gst_stream_get_caps(stream.get()));
     else
+#endif
         m_outputCaps = adoptGRef(gst_pad_get_current_caps(m_pad.get()));
     GST_DEBUG_OBJECT(m_pad.get(), "Output caps: %" GST_PTR_FORMAT, m_outputCaps.get());
     return m_outputCaps;
Index: webkitgtk-2.52.0/Source/WebCore/platform/gstreamer/GStreamerQuirks.cpp
===================================================================
--- webkitgtk-2.52.0.orig/Source/WebCore/platform/gstreamer/GStreamerQuirks.cpp
+++ webkitgtk-2.52.0/Source/WebCore/platform/gstreamer/GStreamerQuirks.cpp
@@ -87,7 +87,7 @@ GStreamerQuirksManager::GStreamerQuirksM
     GST_DEBUG("Attempting to parse requested quirks: %s", GST_STR_NULL(quirksString.utf8()));
     if (quirksString) {
         if (WTF::equalLettersIgnoringASCIICase(quirksString.span(), "help"_s)) {
-            gst_printerrln("Supported quirks for WEBKIT_GST_QUIRKS are: amlogic, broadcom, bcmnexus, openmax, realtek, rialto, westeros");
+            WTFLogAlways("Supported quirks for WEBKIT_GST_QUIRKS are: amlogic, broadcom, bcmnexus, openmax, realtek, rialto, westeros");
             return;
         }
 
@@ -126,7 +126,7 @@ GStreamerQuirksManager::GStreamerQuirksM
         return;
 
     if (WTF::equalLettersIgnoringASCIICase(identifierString.span(), "help"_s)) {
-        gst_printerrln("Supported quirks for WEBKIT_GST_HOLE_PUNCH_QUIRK are: fake, bcmnexus, rialto, westeros");
+        WTFLogAlways("Supported quirks for WEBKIT_GST_HOLE_PUNCH_QUIRK are: fake, bcmnexus, rialto, westeros");
         return;
     }
 
Index: webkitgtk-2.52.0/Source/WebCore/platform/gstreamer/VideoEncoderPrivateGStreamer.cpp
===================================================================
--- webkitgtk-2.52.0.orig/Source/WebCore/platform/gstreamer/VideoEncoderPrivateGStreamer.cpp
+++ webkitgtk-2.52.0/Source/WebCore/platform/gstreamer/VideoEncoderPrivateGStreamer.cpp
@@ -179,12 +179,16 @@ public:
         }
 
         auto caps = adoptGRef(gst_caps_from_string(capsString));
+#if GST_CHECK_VERSION(1, 10, 0)
         GST_MINI_OBJECT_FLAG_SET(caps.get(), GST_MINI_OBJECT_FLAG_MAY_BE_LEAKED);
+#endif
 
         GRefPtr<GstCaps> encodedFormat;
         if (encodedFormatString) {
             encodedFormat = adoptGRef(gst_caps_from_string(encodedFormatString));
+#if GST_CHECK_VERSION(1, 10, 0)
             GST_MINI_OBJECT_FLAG_SET(encodedFormat.get(), GST_MINI_OBJECT_FLAG_MAY_BE_LEAKED);
+#endif
         }
 
         singleton().emplace(std::make_pair(id, EncoderDefinition {
@@ -357,7 +361,9 @@ static bool videoEncoderSetEncoder(WebKi
     encoderDefinition->setupEncoder(self);
 
     ASSERT(GST_IS_VIDEO_ENCODER(priv->encoder.get()));
+#if GST_CHECK_VERSION(1, 16, 0)
     gst_video_encoder_set_qos_enabled(GST_VIDEO_ENCODER_CAST(priv->encoder.get()), TRUE);
+#endif
 
     encoderDefinition->setBitrateMode(priv->encoder.get(), priv->bitrateMode);
     encoderDefinition->setLatencyMode(priv->encoder.get(), priv->latencyMode);
Index: webkitgtk-2.52.0/Source/WebCore/platform/MIMETypeRegistry.cpp
===================================================================
--- webkitgtk-2.52.0.orig/Source/WebCore/platform/MIMETypeRegistry.cpp
+++ webkitgtk-2.52.0/Source/WebCore/platform/MIMETypeRegistry.cpp
@@ -63,10 +63,6 @@
 #include "PreviewConverter.h"
 #endif
 
-#if USE(GSTREAMER) && ENABLE(VIDEO)
-#include "ImageDecoderGStreamer.h"
-#endif
-
 namespace WebCore {
 
 WTF_MAKE_TZONE_ALLOCATED_IMPL(MIMETypeRegistryThreadGlobalData);
@@ -461,11 +457,6 @@ bool MIMETypeRegistry::isSupportedImageV
         return true;
 #endif
 
-#if USE(GSTREAMER) && ENABLE(VIDEO)
-    if (ImageDecoderGStreamer::supportsContainerType(mimeType))
-        return true;
-#endif
-
     return false;
 }
 
Index: webkitgtk-2.52.0/Source/WebCore/platform/SourcesGStreamer.txt
===================================================================
--- webkitgtk-2.52.0.orig/Source/WebCore/platform/SourcesGStreamer.txt
+++ webkitgtk-2.52.0/Source/WebCore/platform/SourcesGStreamer.txt
@@ -60,10 +60,8 @@ platform/graphics/gstreamer/GStreamerAud
 platform/graphics/gstreamer/GStreamerCommon.cpp
 platform/graphics/gstreamer/GStreamerRegistryScanner.cpp
 platform/graphics/gstreamer/GStreamerSinksWorkarounds.cpp
-platform/graphics/gstreamer/GStreamerVideoFrameConverter.cpp
 platform/graphics/gstreamer/GStreamerVideoSinkCommon.cpp
 platform/graphics/gstreamer/GstAllocatorFastMalloc.cpp
-platform/graphics/gstreamer/ImageDecoderGStreamer.cpp
 platform/graphics/gstreamer/ImageGStreamerCairo.cpp
 platform/graphics/gstreamer/ImageGStreamerSkia.cpp
 platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.cpp
@@ -80,7 +78,7 @@ platform/graphics/gstreamer/VideoEncoder
 platform/graphics/gstreamer/VideoFrameGStreamer.cpp
 platform/graphics/gstreamer/VideoFrameMetadataGStreamer.cpp
 platform/graphics/gstreamer/VideoSinkGStreamer.cpp
-platform/graphics/gstreamer/VideoTrackPrivateGStreamer.cpp
+platform/graphics/gstreamer/VideoTrackPrivateGStreamer.cpp @no-unify
 platform/graphics/gstreamer/WebKitAudioSinkGStreamer.cpp
 platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp
 
Index: webkitgtk-2.52.0/Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml
===================================================================
--- webkitgtk-2.52.0.orig/Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml
+++ webkitgtk-2.52.0/Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml
@@ -9462,10 +9462,8 @@ WebRTCAV1CodecEnabled:
     WebKitLegacy:
       default: false
     WebKit:
-      "USE(GSTREAMER)": true
       default: false
     WebCore:
-      "USE(GSTREAMER)": true
       default: false
 
 WebRTCAudioLatencyAdaptationEnabled:
Index: webkitgtk-2.52.0/Source/WebCore/platform/audio/gstreamer/AudioDestinationGStreamer.cpp
===================================================================
--- webkitgtk-2.52.0.orig/Source/WebCore/platform/audio/gstreamer/AudioDestinationGStreamer.cpp
+++ webkitgtk-2.52.0/Source/WebCore/platform/audio/gstreamer/AudioDestinationGStreamer.cpp
@@ -212,9 +212,7 @@ bool AudioDestinationGStreamer::handleMe
     case GST_MESSAGE_LATENCY:
         if (!handleLatencyMessage)
             break;
-        gst_element_call_async(m_pipeline.get(), reinterpret_cast<GstElementCallAsyncFunc>(+[](GstElement* pipeline, gpointer) {
-            gst_bin_recalculate_latency(GST_BIN_CAST(pipeline));
-        }), nullptr, nullptr);
+        gst_bin_recalculate_latency(GST_BIN_CAST(m_pipeline.get()));
         break;
     default:
         break;
Index: webkitgtk-2.52.0/Source/WebCore/platform/graphics/gstreamer/GStreamerAudioMixer.cpp
===================================================================
--- webkitgtk-2.52.0.orig/Source/WebCore/platform/graphics/gstreamer/GStreamerAudioMixer.cpp
+++ webkitgtk-2.52.0/Source/WebCore/platform/graphics/gstreamer/GStreamerAudioMixer.cpp
@@ -105,8 +105,6 @@ void GStreamerAudioMixer::ensureState(Gs
     RELEASE_ASSERT(it != locker->m_pipelines.end());
     auto& mp = *it->value;
 
-    GST_DEBUG_OBJECT(mp.pipeline.get(), "Handling %s transition (%u mixer pads).", gst_state_change_get_name(stateChange), mp.mixer->numsinkpads);
-
     switch (stateChange) {
     case GST_STATE_CHANGE_READY_TO_PAUSED:
         gst_element_set_state(mp.pipeline.get(), GST_STATE_PAUSED);
