- Revision
- 289429
- Author
- [email protected]
- Date
- 2022-02-08 14:25:12 -0800 (Tue, 08 Feb 2022)
Log Message
Merge r289154 - [Flatpak SDK] Update to FDO 21.08.10 and GStreamer 1.20 releases
https://bugs.webkit.org/show_bug.cgi?id=236136
Patch by Philippe Normand <[email protected]> on 2022-02-05
Reviewed by Adrian Perez de Castro.
Switch GStreamer 1.19 version checks to 1.20 now that it is officially released. Also
include a couple fixes that are needed with GStreamer 1.20 and one that is useful whatever
the GStreamer version:
- GStreamer 1.20 ships a vp8alphadecodebin element able to handle video/x-vp8 caps, so our
libwebrtc decoder factory needs to account for its presence, in addition to vp8dec.
- With GStreamer 1.20 media/media-source/media-source-seek-back.html started racy crashing
in the VideoTrackPrivateGStreamer configuration update, where the track was disconnected
(hence its stream was cleared) and then a GObject notification was emitted by decodebin3. We
should actually disconnect the GObject signal handlers before clearing the stream, to
prevent potential null pointer access.
* platform/audio/gstreamer/AudioFileReaderGStreamer.cpp:
(WebCore::AudioFileReader::handleNewDeinterleavePad):
* platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp:
(WebCore::AudioSourceProviderGStreamer::handleNewDeinterleavePad):
* platform/graphics/gstreamer/AudioTrackPrivateGStreamer.cpp:
(WebCore::AudioTrackPrivateGStreamer::updateConfigurationFromCaps):
(WebCore::AudioTrackPrivateGStreamer::disconnect):
* platform/graphics/gstreamer/GStreamerCommon.h:
* platform/graphics/gstreamer/ImageDecoderGStreamer.cpp:
(WebCore::ImageDecoderGStreamer::InnerDecoder::connectDecoderPad):
* platform/graphics/gstreamer/VideoTrackPrivateGStreamer.cpp:
(WebCore::VideoTrackPrivateGStreamer::updateConfigurationFromCaps):
(WebCore::VideoTrackPrivateGStreamer::disconnect):
* platform/mediastream/libwebrtc/gstreamer/GStreamerVideoDecoderFactory.cpp:
(WebCore::VP8Decoder::Create):
Modified Paths
Diff
Modified: releases/WebKitGTK/webkit-2.34/Source/WebCore/ChangeLog (289428 => 289429)
--- releases/WebKitGTK/webkit-2.34/Source/WebCore/ChangeLog 2022-02-08 22:21:59 UTC (rev 289428)
+++ releases/WebKitGTK/webkit-2.34/Source/WebCore/ChangeLog 2022-02-08 22:25:12 UTC (rev 289429)
@@ -1,3 +1,38 @@
+2022-02-05 Philippe Normand <[email protected]>
+
+ [Flatpak SDK] Update to FDO 21.08.10 and GStreamer 1.20 releases
+ https://bugs.webkit.org/show_bug.cgi?id=236136
+
+ Reviewed by Adrian Perez de Castro.
+
+ Switch GStreamer 1.19 version checks to 1.20 now that it is officially released. Also
+ include a couple fixes that are needed with GStreamer 1.20 and one that is useful whatever
+ the GStreamer version:
+
+ - GStreamer 1.20 ships a vp8alphadecodebin element able to handle video/x-vp8 caps, so our
+ libwebrtc decoder factory needs to account for its presence, in addition to vp8dec.
+ - With GStreamer 1.20 media/media-source/media-source-seek-back.html started racy crashing
+ in the VideoTrackPrivateGStreamer configuration update, where the track was disconnected
+ (hence its stream was cleared) and then a GObject notification was emitted by decodebin3. We
+ should actually disconnect the GObject signal handlers before clearing the stream, to
+ prevent potential null pointer access.
+
+ * platform/audio/gstreamer/AudioFileReaderGStreamer.cpp:
+ (WebCore::AudioFileReader::handleNewDeinterleavePad):
+ * platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp:
+ (WebCore::AudioSourceProviderGStreamer::handleNewDeinterleavePad):
+ * platform/graphics/gstreamer/AudioTrackPrivateGStreamer.cpp:
+ (WebCore::AudioTrackPrivateGStreamer::updateConfigurationFromCaps):
+ (WebCore::AudioTrackPrivateGStreamer::disconnect):
+ * platform/graphics/gstreamer/GStreamerCommon.h:
+ * platform/graphics/gstreamer/ImageDecoderGStreamer.cpp:
+ (WebCore::ImageDecoderGStreamer::InnerDecoder::connectDecoderPad):
+ * platform/graphics/gstreamer/VideoTrackPrivateGStreamer.cpp:
+ (WebCore::VideoTrackPrivateGStreamer::updateConfigurationFromCaps):
+ (WebCore::VideoTrackPrivateGStreamer::disconnect):
+ * platform/mediastream/libwebrtc/gstreamer/GStreamerVideoDecoderFactory.cpp:
+ (WebCore::VP8Decoder::Create):
+
2022-02-07 Adrian Perez de Castro <[email protected]>
Unreviewed non-unified build fixes.
Modified: releases/WebKitGTK/webkit-2.34/Source/WebCore/platform/audio/gstreamer/AudioFileReaderGStreamer.cpp (289428 => 289429)
--- releases/WebKitGTK/webkit-2.34/Source/WebCore/platform/audio/gstreamer/AudioFileReaderGStreamer.cpp 2022-02-08 22:21:59 UTC (rev 289428)
+++ releases/WebKitGTK/webkit-2.34/Source/WebCore/platform/audio/gstreamer/AudioFileReaderGStreamer.cpp 2022-02-08 22:25:12 UTC (rev 289429)
@@ -258,7 +258,7 @@
[](GstAppSink* sink, gpointer userData) -> GstFlowReturn {
return static_cast<AudioFileReader*>(userData)->handleSample(sink);
},
-#if GST_CHECK_VERSION(1, 19, 1)
+#if GST_CHECK_VERSION(1, 20, 0)
// new_event
nullptr,
#endif
Modified: releases/WebKitGTK/webkit-2.34/Source/WebCore/platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp (289428 => 289429)
--- releases/WebKitGTK/webkit-2.34/Source/WebCore/platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp 2022-02-08 22:21:59 UTC (rev 289428)
+++ releases/WebKitGTK/webkit-2.34/Source/WebCore/platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp 2022-02-08 22:25:12 UTC (rev 289429)
@@ -311,7 +311,7 @@
[](GstAppSink* sink, gpointer userData) -> GstFlowReturn {
return static_cast<AudioSourceProviderGStreamer*>(userData)->handleSample(sink, false);
},
-#if GST_CHECK_VERSION(1, 19, 0)
+#if GST_CHECK_VERSION(1, 20, 0)
// new_event
nullptr,
#endif
Modified: releases/WebKitGTK/webkit-2.34/Source/WebCore/platform/graphics/gstreamer/AudioTrackPrivateGStreamer.cpp (289428 => 289429)
--- releases/WebKitGTK/webkit-2.34/Source/WebCore/platform/graphics/gstreamer/AudioTrackPrivateGStreamer.cpp 2022-02-08 22:21:59 UTC (rev 289428)
+++ releases/WebKitGTK/webkit-2.34/Source/WebCore/platform/graphics/gstreamer/AudioTrackPrivateGStreamer.cpp 2022-02-08 22:25:12 UTC (rev 289429)
@@ -62,6 +62,9 @@
void AudioTrackPrivateGStreamer::disconnect()
{
+ if (m_stream)
+ g_signal_handlers_disconnect_matched(m_stream.get(), G_SIGNAL_MATCH_DATA, 0, 0, nullptr, nullptr, this);
+
m_player = nullptr;
TrackPrivateBaseGStreamer::disconnect();
}
Modified: releases/WebKitGTK/webkit-2.34/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.h (289428 => 289429)
--- releases/WebKitGTK/webkit-2.34/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.h 2022-02-08 22:21:59 UTC (rev 289428)
+++ releases/WebKitGTK/webkit-2.34/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.h 2022-02-08 22:25:12 UTC (rev 289429)
@@ -316,7 +316,7 @@
// In GStreamer 1.20 gst_audio_format_fill_silence() will be deprecated in favor of
// gst_audio_format_info_fill_silence().
-#if GST_CHECK_VERSION(1, 19, 0)
+#if GST_CHECK_VERSION(1, 20, 0)
#define webkitGstAudioFormatFillSilence gst_audio_format_info_fill_silence
#else
#define webkitGstAudioFormatFillSilence gst_audio_format_fill_silence
@@ -324,7 +324,7 @@
// In GStreamer 1.20 gst_element_get_request_pad() was renamed to gst_element_request_pad_simple(),
// so create an alias for older versions.
-#if !GST_CHECK_VERSION(1, 19, 0)
+#if !GST_CHECK_VERSION(1, 20, 0)
#define gst_element_request_pad_simple gst_element_get_request_pad
#endif
Modified: releases/WebKitGTK/webkit-2.34/Source/WebCore/platform/graphics/gstreamer/ImageDecoderGStreamer.cpp (289428 => 289429)
--- releases/WebKitGTK/webkit-2.34/Source/WebCore/platform/graphics/gstreamer/ImageDecoderGStreamer.cpp 2022-02-08 22:21:59 UTC (rev 289428)
+++ releases/WebKitGTK/webkit-2.34/Source/WebCore/platform/graphics/gstreamer/ImageDecoderGStreamer.cpp 2022-02-08 22:25:12 UTC (rev 289429)
@@ -261,7 +261,7 @@
static_cast<ImageDecoderGStreamer*>(userData)->notifySample(WTFMove(sample));
return GST_FLOW_OK;
},
-#if GST_CHECK_VERSION(1, 19, 1)
+#if GST_CHECK_VERSION(1, 20, 0)
// new_event
nullptr,
#endif
Modified: releases/WebKitGTK/webkit-2.34/Source/WebCore/platform/graphics/gstreamer/VideoTrackPrivateGStreamer.cpp (289428 => 289429)
--- releases/WebKitGTK/webkit-2.34/Source/WebCore/platform/graphics/gstreamer/VideoTrackPrivateGStreamer.cpp 2022-02-08 22:21:59 UTC (rev 289428)
+++ releases/WebKitGTK/webkit-2.34/Source/WebCore/platform/graphics/gstreamer/VideoTrackPrivateGStreamer.cpp 2022-02-08 22:25:12 UTC (rev 289429)
@@ -62,6 +62,9 @@
void VideoTrackPrivateGStreamer::disconnect()
{
+ if (m_stream)
+ g_signal_handlers_disconnect_matched(m_stream.get(), G_SIGNAL_MATCH_DATA, 0, 0, nullptr, nullptr, this);
+
m_player = nullptr;
TrackPrivateBaseGStreamer::disconnect();
}
Modified: releases/WebKitGTK/webkit-2.34/Source/WebCore/platform/mediastream/libwebrtc/gstreamer/GStreamerVideoDecoderFactory.cpp (289428 => 289429)
--- releases/WebKitGTK/webkit-2.34/Source/WebCore/platform/mediastream/libwebrtc/gstreamer/GStreamerVideoDecoderFactory.cpp 2022-02-08 22:21:59 UTC (rev 289428)
+++ releases/WebKitGTK/webkit-2.34/Source/WebCore/platform/mediastream/libwebrtc/gstreamer/GStreamerVideoDecoderFactory.cpp 2022-02-08 22:25:12 UTC (rev 289429)
@@ -369,11 +369,12 @@
static std::unique_ptr<webrtc::VideoDecoder> Create()
{
auto factory = GstDecoderFactory("video/x-vp8");
-
- if (factory && !g_strcmp0(GST_OBJECT_NAME(GST_OBJECT(factory.get())), "vp8dec")) {
- GST_INFO("Our best GStreamer VP8 decoder is vp8dec, better use the one from LibWebRTC");
-
- return std::unique_ptr<webrtc::VideoDecoder>(new webrtc::LibvpxVp8Decoder());
+ if (!factory) {
+ const auto* factoryName = GST_OBJECT_NAME(GST_OBJECT(factory.get()));
+ if (!g_strcmp0(factoryName, "vp8dec") || !g_strcmp0(factoryName, "vp8alphadecodebin")) {
+ GST_INFO("Our best GStreamer VP8 decoder is vp8dec, better use the one from LibWebRTC");
+ return std::unique_ptr<webrtc::VideoDecoder>(new webrtc::LibvpxVp8Decoder());
+ }
}
return std::unique_ptr<webrtc::VideoDecoder>(new VP8Decoder());