<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[277947] trunk/Source/WebCore</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/277947">277947</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2021-05-24 04:22:32 -0700 (Mon, 24 May 2021)</dd>
</dl>

<h3>Log Message</h3>
<pre>[GStreamer] WebProcess crashes when certain elements are missing
https://bugs.webkit.org/show_bug.cgi?id=226081

Patch by Philippe Normand <pnormand@igalia.com> on 2021-05-24
Reviewed by Xabier Rodriguez-Calvar.

Introducing makeGStreamerElement() and makeGStreamerBin() that should be used when
requesting non-WebKit and non-core GStreamer elements/bins to be created at runtime. The
goal is to prevent NULL pointers to be used in case the runtime host has an incomplete
GStreamer plugins installation.

* platform/audio/gstreamer/AudioDestinationGStreamer.cpp:
(WebCore::AudioDestinationGStreamer::AudioDestinationGStreamer):
* platform/audio/gstreamer/AudioFileReaderGStreamer.cpp:
(WebCore::AudioFileReader::handleNewDeinterleavePad):
(WebCore::AudioFileReader::plugDeinterleave):
(WebCore::AudioFileReader::decodeAudioForBusCreation):
* platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp:
(WebCore::AudioSourceProviderGStreamer::configureAudioBin):
(WebCore::AudioSourceProviderGStreamer::setClient):
(WebCore::AudioSourceProviderGStreamer::handleNewDeinterleavePad):
* platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp:
(webKitWebAudioSrcConstructed):
* platform/graphics/gstreamer/GLVideoSinkGStreamer.cpp:
(webKitGLVideoSinkConstructed):
* platform/graphics/gstreamer/GStreamerAudioMixer.cpp:
(WebCore::GStreamerAudioMixer::GStreamerAudioMixer):
(WebCore::GStreamerAudioMixer::registerProducer):
* platform/graphics/gstreamer/GStreamerCommon.cpp:
(WebCore::createPlatformAudioSink):
(WebCore::makeGStreamerElement):
(WebCore::makeGStreamerBin):
* platform/graphics/gstreamer/GStreamerCommon.h:
* platform/graphics/gstreamer/ImageDecoderGStreamer.cpp:
(WebCore::ImageDecoderGStreamer::InnerDecoder::connectDecoderPad):
(WebCore::ImageDecoderGStreamer::InnerDecoder::preparePipeline):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
(WebCore::MediaPlayerPrivateGStreamer::createHolePunchVideoSink):
(WebCore::MediaPlayerPrivateGStreamer::createVideoSink):
* platform/graphics/gstreamer/TextCombinerGStreamer.cpp:
(webKitTextCombinerHandleCapsEvent):
* platform/graphics/gstreamer/TextSinkGStreamer.cpp:
(webkitTextSinkConstructed):
* platform/graphics/gstreamer/WebKitAudioSinkGStreamer.cpp:
(webKitAudioSinkConfigure):
* platform/graphics/gstreamer/mse/AppendPipeline.cpp:
(WebCore::AppendPipeline::AppendPipeline):
(WebCore::createOptionalParserForFormat):
* platform/mediastream/gstreamer/GStreamerAudioCapturer.cpp:
(WebCore::GStreamerAudioCapturer::createConverter):
* platform/mediastream/gstreamer/GStreamerCapturer.cpp:
(WebCore::GStreamerCapturer::makeElement):
* platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp:
* platform/mediastream/gstreamer/GStreamerVideoCapturer.cpp:
(WebCore::GStreamerVideoCapturer::createConverter):
* platform/mediastream/libwebrtc/GStreamerVideoDecoderFactory.cpp:
(WebCore::GStreamerVideoDecoder::makeElement):
* platform/mediastream/libwebrtc/GStreamerVideoEncoder.cpp:
(webrtcVideoEncoderSetEncoder):
(webrtcVideoEncoderSetFormat):
* platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
(WebCore::GStreamerVideoEncoder::makeElement):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreplatformaudiogstreamerAudioDestinationGStreamercpp">trunk/Source/WebCore/platform/audio/gstreamer/AudioDestinationGStreamer.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformaudiogstreamerAudioFileReaderGStreamercpp">trunk/Source/WebCore/platform/audio/gstreamer/AudioFileReaderGStreamer.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformaudiogstreamerAudioSourceProviderGStreamercpp">trunk/Source/WebCore/platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformaudiogstreamerWebKitWebAudioSourceGStreamercpp">trunk/Source/WebCore/platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsgstreamerGLVideoSinkGStreamercpp">trunk/Source/WebCore/platform/graphics/gstreamer/GLVideoSinkGStreamer.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsgstreamerGStreamerAudioMixercpp">trunk/Source/WebCore/platform/graphics/gstreamer/GStreamerAudioMixer.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsgstreamerGStreamerCommoncpp">trunk/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsgstreamerGStreamerCommonh">trunk/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsgstreamerImageDecoderGStreamercpp">trunk/Source/WebCore/platform/graphics/gstreamer/ImageDecoderGStreamer.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsgstreamerMediaPlayerPrivateGStreamercpp">trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsgstreamerTextCombinerGStreamercpp">trunk/Source/WebCore/platform/graphics/gstreamer/TextCombinerGStreamer.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsgstreamerTextSinkGStreamercpp">trunk/Source/WebCore/platform/graphics/gstreamer/TextSinkGStreamer.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsgstreamerWebKitAudioSinkGStreamercpp">trunk/Source/WebCore/platform/graphics/gstreamer/WebKitAudioSinkGStreamer.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsgstreamermseAppendPipelinecpp">trunk/Source/WebCore/platform/graphics/gstreamer/mse/AppendPipeline.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformmediastreamgstreamerGStreamerAudioCapturercpp">trunk/Source/WebCore/platform/mediastream/gstreamer/GStreamerAudioCapturer.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformmediastreamgstreamerGStreamerCapturercpp">trunk/Source/WebCore/platform/mediastream/gstreamer/GStreamerCapturer.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformmediastreamgstreamerGStreamerMediaStreamSourcecpp">trunk/Source/WebCore/platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformmediastreamgstreamerGStreamerVideoCapturercpp">trunk/Source/WebCore/platform/mediastream/gstreamer/GStreamerVideoCapturer.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformmediastreamlibwebrtcGStreamerVideoDecoderFactorycpp">trunk/Source/WebCore/platform/mediastream/libwebrtc/GStreamerVideoDecoderFactory.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformmediastreamlibwebrtcGStreamerVideoEncodercpp">trunk/Source/WebCore/platform/mediastream/libwebrtc/GStreamerVideoEncoder.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformmediastreamlibwebrtcGStreamerVideoEncoderFactorycpp">trunk/Source/WebCore/platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (277946 => 277947)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2021-05-24 08:55:08 UTC (rev 277946)
+++ trunk/Source/WebCore/ChangeLog      2021-05-24 11:22:32 UTC (rev 277947)
</span><span class="lines">@@ -1,3 +1,68 @@
</span><ins>+2021-05-24  Philippe Normand  <pnormand@igalia.com>
+
+        [GStreamer] WebProcess crashes when certain elements are missing
+        https://bugs.webkit.org/show_bug.cgi?id=226081
+
+        Reviewed by Xabier Rodriguez-Calvar.
+
+        Introducing makeGStreamerElement() and makeGStreamerBin() that should be used when
+        requesting non-WebKit and non-core GStreamer elements/bins to be created at runtime. The
+        goal is to prevent NULL pointers to be used in case the runtime host has an incomplete
+        GStreamer plugins installation.
+
+        * platform/audio/gstreamer/AudioDestinationGStreamer.cpp:
+        (WebCore::AudioDestinationGStreamer::AudioDestinationGStreamer):
+        * platform/audio/gstreamer/AudioFileReaderGStreamer.cpp:
+        (WebCore::AudioFileReader::handleNewDeinterleavePad):
+        (WebCore::AudioFileReader::plugDeinterleave):
+        (WebCore::AudioFileReader::decodeAudioForBusCreation):
+        * platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp:
+        (WebCore::AudioSourceProviderGStreamer::configureAudioBin):
+        (WebCore::AudioSourceProviderGStreamer::setClient):
+        (WebCore::AudioSourceProviderGStreamer::handleNewDeinterleavePad):
+        * platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp:
+        (webKitWebAudioSrcConstructed):
+        * platform/graphics/gstreamer/GLVideoSinkGStreamer.cpp:
+        (webKitGLVideoSinkConstructed):
+        * platform/graphics/gstreamer/GStreamerAudioMixer.cpp:
+        (WebCore::GStreamerAudioMixer::GStreamerAudioMixer):
+        (WebCore::GStreamerAudioMixer::registerProducer):
+        * platform/graphics/gstreamer/GStreamerCommon.cpp:
+        (WebCore::createPlatformAudioSink):
+        (WebCore::makeGStreamerElement):
+        (WebCore::makeGStreamerBin):
+        * platform/graphics/gstreamer/GStreamerCommon.h:
+        * platform/graphics/gstreamer/ImageDecoderGStreamer.cpp:
+        (WebCore::ImageDecoderGStreamer::InnerDecoder::connectDecoderPad):
+        (WebCore::ImageDecoderGStreamer::InnerDecoder::preparePipeline):
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
+        (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
+        (WebCore::MediaPlayerPrivateGStreamer::createHolePunchVideoSink):
+        (WebCore::MediaPlayerPrivateGStreamer::createVideoSink):
+        * platform/graphics/gstreamer/TextCombinerGStreamer.cpp:
+        (webKitTextCombinerHandleCapsEvent):
+        * platform/graphics/gstreamer/TextSinkGStreamer.cpp:
+        (webkitTextSinkConstructed):
+        * platform/graphics/gstreamer/WebKitAudioSinkGStreamer.cpp:
+        (webKitAudioSinkConfigure):
+        * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
+        (WebCore::AppendPipeline::AppendPipeline):
+        (WebCore::createOptionalParserForFormat):
+        * platform/mediastream/gstreamer/GStreamerAudioCapturer.cpp:
+        (WebCore::GStreamerAudioCapturer::createConverter):
+        * platform/mediastream/gstreamer/GStreamerCapturer.cpp:
+        (WebCore::GStreamerCapturer::makeElement):
+        * platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp:
+        * platform/mediastream/gstreamer/GStreamerVideoCapturer.cpp:
+        (WebCore::GStreamerVideoCapturer::createConverter):
+        * platform/mediastream/libwebrtc/GStreamerVideoDecoderFactory.cpp:
+        (WebCore::GStreamerVideoDecoder::makeElement):
+        * platform/mediastream/libwebrtc/GStreamerVideoEncoder.cpp:
+        (webrtcVideoEncoderSetEncoder):
+        (webrtcVideoEncoderSetFormat):
+        * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
+        (WebCore::GStreamerVideoEncoder::makeElement):
+
</ins><span class="cx"> 2021-05-23  Chris Dumez  <cdumez@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Make CheckedLock the default Lock
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformaudiogstreamerAudioDestinationGStreamercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/audio/gstreamer/AudioDestinationGStreamer.cpp (277946 => 277947)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/audio/gstreamer/AudioDestinationGStreamer.cpp      2021-05-24 08:55:08 UTC (rev 277946)
+++ trunk/Source/WebCore/platform/audio/gstreamer/AudioDestinationGStreamer.cpp 2021-05-24 11:22:32 UTC (rev 277947)
</span><span class="lines">@@ -159,8 +159,8 @@
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    GstElement* audioConvert = gst_element_factory_make("audioconvert", nullptr);
-    GstElement* audioResample = gst_element_factory_make("audioresample", nullptr);
</del><ins>+    GstElement* audioConvert = makeGStreamerElement("audioconvert", nullptr);
+    GstElement* audioResample = makeGStreamerElement("audioresample", nullptr);
</ins><span class="cx">     gst_bin_add_many(GST_BIN_CAST(m_pipeline.get()), m_src.get(), audioConvert, audioResample, audioSink.get(), nullptr);
</span><span class="cx"> 
</span><span class="cx">     // Link src pads from webkitAudioSrc to audioConvert ! audioResample ! autoaudiosink.
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformaudiogstreamerAudioFileReaderGStreamercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/audio/gstreamer/AudioFileReaderGStreamer.cpp (277946 => 277947)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/audio/gstreamer/AudioFileReaderGStreamer.cpp       2021-05-24 08:55:08 UTC (rev 277946)
+++ trunk/Source/WebCore/platform/audio/gstreamer/AudioFileReaderGStreamer.cpp  2021-05-24 11:22:32 UTC (rev 277947)
</span><span class="lines">@@ -255,7 +255,7 @@
</span><span class="cx">     // in an appsink so we can pull the data from each
</span><span class="cx">     // channel. Pipeline looks like:
</span><span class="cx">     // ... deinterleave ! appsink.
</span><del>-    GstElement* sink = gst_element_factory_make("appsink", nullptr);
</del><ins>+    GstElement* sink = makeGStreamerElement("appsink", nullptr);
</ins><span class="cx"> 
</span><span class="cx">     m_channels++;
</span><span class="cx"> 
</span><span class="lines">@@ -300,10 +300,10 @@
</span><span class="cx">     // A decodebin pad was added, plug in a deinterleave element to
</span><span class="cx">     // separate each planar channel. Sub pipeline looks like
</span><span class="cx">     // ... decodebin2 ! audioconvert ! audioresample ! capsfilter ! deinterleave.
</span><del>-    GstElement* audioConvert  = gst_element_factory_make("audioconvert", nullptr);
-    GstElement* audioResample = gst_element_factory_make("audioresample", nullptr);
</del><ins>+    GstElement* audioConvert  = makeGStreamerElement("audioconvert", nullptr);
+    GstElement* audioResample = makeGStreamerElement("audioresample", nullptr);
</ins><span class="cx">     GstElement* capsFilter = gst_element_factory_make("capsfilter", nullptr);
</span><del>-    m_deInterleave = gst_element_factory_make("deinterleave", "deinterleave");
</del><ins>+    m_deInterleave = makeGStreamerElement("deinterleave", "deinterleave");
</ins><span class="cx"> 
</span><span class="cx">     g_object_set(m_deInterleave.get(), "keep-positions", TRUE, nullptr);
</span><span class="cx">     g_signal_connect_swapped(m_deInterleave.get(), "pad-added", G_CALLBACK(deinterleavePadAddedCallback), this);
</span><span class="lines">@@ -358,7 +358,7 @@
</span><span class="cx">     GstElement* source;
</span><span class="cx">     if (m_data) {
</span><span class="cx">         ASSERT(m_dataSize);
</span><del>-        source = gst_element_factory_make("giostreamsrc", nullptr);
</del><ins>+        source = makeGStreamerElement("giostreamsrc", nullptr);
</ins><span class="cx">         GRefPtr<GInputStream> memoryStream = adoptGRef(g_memory_input_stream_new_from_data(m_data, m_dataSize, nullptr));
</span><span class="cx">         g_object_set(source, "stream", memoryStream.get(), nullptr);
</span><span class="cx">     } else {
</span><span class="lines">@@ -366,7 +366,7 @@
</span><span class="cx">         g_object_set(source, "location", m_filePath, nullptr);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    m_decodebin = gst_element_factory_make("decodebin", "decodebin");
</del><ins>+    m_decodebin = makeGStreamerElement("decodebin", "decodebin");
</ins><span class="cx">     g_signal_connect_swapped(m_decodebin.get(), "pad-added", G_CALLBACK(decodebinPadAddedCallback), this);
</span><span class="cx"> 
</span><span class="cx">     gst_bin_add_many(GST_BIN(m_pipeline.get()), source, m_decodebin.get(), nullptr);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformaudiogstreamerAudioSourceProviderGStreamercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp (277946 => 277947)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp   2021-05-24 08:55:08 UTC (rev 277946)
+++ trunk/Source/WebCore/platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp      2021-05-24 11:22:32 UTC (rev 277947)
</span><span class="lines">@@ -132,11 +132,11 @@
</span><span class="cx"> 
</span><span class="cx">     GstElement* audioTee = gst_element_factory_make("tee", "audioTee");
</span><span class="cx">     GstElement* audioQueue = gst_element_factory_make("queue", nullptr);
</span><del>-    GstElement* audioConvert = gst_element_factory_make("audioconvert", nullptr);
-    GstElement* audioConvert2 = gst_element_factory_make("audioconvert", nullptr);
-    GstElement* audioResample = gst_element_factory_make("audioresample", nullptr);
-    GstElement* audioResample2 = gst_element_factory_make("audioresample", nullptr);
-    GstElement* volumeElement = gst_element_factory_make("volume", "volume");
</del><ins>+    GstElement* audioConvert = makeGStreamerElement("audioconvert", nullptr);
+    GstElement* audioConvert2 = makeGStreamerElement("audioconvert", nullptr);
+    GstElement* audioResample = makeGStreamerElement("audioresample", nullptr);
+    GstElement* audioResample2 = makeGStreamerElement("audioresample", nullptr);
+    GstElement* volumeElement = makeGStreamerElement("volume", "volume");
</ins><span class="cx"> 
</span><span class="cx">     gst_bin_add_many(GST_BIN_CAST(m_audioSinkBin.get()), audioTee, audioQueue, audioConvert, audioResample, volumeElement, audioConvert2, audioResample2, audioSink, nullptr);
</span><span class="cx"> 
</span><span class="lines">@@ -249,10 +249,10 @@
</span><span class="cx">         // ensure deinterleave and the sinks downstream receive buffers in
</span><span class="cx">         // the format specified by the capsfilter.
</span><span class="cx">         auto* audioQueue = gst_element_factory_make("queue", "queue");
</span><del>-        auto* audioConvert = gst_element_factory_make("audioconvert", "audioconvert");
-        auto* audioResample = gst_element_factory_make("audioresample", "audioresample");
</del><ins>+        auto* audioConvert = makeGStreamerElement("audioconvert", "audioconvert");
+        auto* audioResample = makeGStreamerElement("audioresample", "audioresample");
</ins><span class="cx">         auto* capsFilter = gst_element_factory_make("capsfilter", "capsfilter");
</span><del>-        auto* deInterleave = gst_element_factory_make("deinterleave", "deinterleave");
</del><ins>+        auto* deInterleave = makeGStreamerElement("deinterleave", "deinterleave");
</ins><span class="cx"> 
</span><span class="cx">         GST_DEBUG("Setting up audio deinterleave chain");
</span><span class="cx">         g_object_set(deInterleave, "keep-positions", TRUE, nullptr);
</span><span class="lines">@@ -300,7 +300,7 @@
</span><span class="cx">     // channel. Pipeline looks like:
</span><span class="cx">     // ... deinterleave ! queue ! appsink.
</span><span class="cx">     auto* queue = gst_element_factory_make("queue", nullptr);
</span><del>-    auto* sink = gst_element_factory_make("appsink", nullptr);
</del><ins>+    auto* sink = makeGStreamerElement("appsink", nullptr);
</ins><span class="cx"> 
</span><span class="cx">     static GstAppSinkCallbacks callbacks = {
</span><span class="cx">         nullptr,
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformaudiogstreamerWebKitWebAudioSourceGStreamercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp (277946 => 277947)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp  2021-05-24 08:55:08 UTC (rev 277946)
+++ trunk/Source/WebCore/platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp     2021-05-24 11:22:32 UTC (rev 277947)
</span><span class="lines">@@ -208,7 +208,7 @@
</span><span class="cx">     priv->task = adoptGRef(gst_task_new(reinterpret_cast<GstTaskFunction>(webKitWebAudioSrcRenderIteration), src, nullptr));
</span><span class="cx">     gst_task_set_lock(priv->task.get(), &priv->mutex);
</span><span class="cx"> 
</span><del>-    priv->interleave = gst_element_factory_make("audiointerleave", nullptr);
</del><ins>+    priv->interleave = makeGStreamerElement("audiointerleave", nullptr);
</ins><span class="cx"> 
</span><span class="cx">     if (!priv->interleave) {
</span><span class="cx">         GST_ERROR_OBJECT(src, "Failed to create audiointerleave");
</span><span class="lines">@@ -221,7 +221,7 @@
</span><span class="cx">     // appsrc ! . which is plugged to a new interleave request sinkpad.
</span><span class="cx">     for (unsigned channelIndex = 0; channelIndex < priv->bus->numberOfChannels(); channelIndex++) {
</span><span class="cx">         GUniquePtr<gchar> appsrcName(g_strdup_printf("webaudioSrc%u", channelIndex));
</span><del>-        GRefPtr<GstElement> appsrc = gst_element_factory_make("appsrc", appsrcName.get());
</del><ins>+        GRefPtr<GstElement> appsrc = makeGStreamerElement("appsrc", appsrcName.get());
</ins><span class="cx">         GRefPtr<GstCaps> monoCaps = adoptGRef(getGStreamerMonoAudioCaps(priv->sampleRate));
</span><span class="cx"> 
</span><span class="cx">         GstAudioInfo info;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsgstreamerGLVideoSinkGStreamercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/gstreamer/GLVideoSinkGStreamer.cpp (277946 => 277947)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/gstreamer/GLVideoSinkGStreamer.cpp        2021-05-24 08:55:08 UTC (rev 277946)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/GLVideoSinkGStreamer.cpp   2021-05-24 11:22:32 UTC (rev 277947)
</span><span class="lines">@@ -66,7 +66,7 @@
</span><span class="cx"> 
</span><span class="cx">     WebKitGLVideoSink* sink = WEBKIT_GL_VIDEO_SINK(object);
</span><span class="cx"> 
</span><del>-    sink->priv->appSink = gst_element_factory_make("appsink", "webkit-gl-video-appsink");
</del><ins>+    sink->priv->appSink = makeGStreamerElement("appsink", "webkit-gl-video-appsink");
</ins><span class="cx">     ASSERT(sink->priv->appSink);
</span><span class="cx">     g_object_set(sink->priv->appSink.get(), "enable-last-sample", FALSE, "emit-signals", TRUE, "max-buffers", 1, nullptr);
</span><span class="cx"> 
</span><span class="lines">@@ -81,10 +81,10 @@
</span><span class="cx">     if (imxVideoConvertG2D)
</span><span class="cx">         gst_bin_add(GST_BIN_CAST(sink), imxVideoConvertG2D);
</span><span class="cx"> 
</span><del>-    GstElement* upload = gst_element_factory_make("glupload", nullptr);
-    GstElement* colorconvert = gst_element_factory_make("glcolorconvert", nullptr);
</del><ins>+    GstElement* upload = makeGStreamerElement("glupload", nullptr);
+    GstElement* colorconvert = makeGStreamerElement("glcolorconvert", nullptr);
</ins><span class="cx"> 
</span><del>-    GstElement* videoFlip = gst_element_factory_make("glvideoflip", nullptr);
</del><ins>+    GstElement* videoFlip = makeGStreamerElement("glvideoflip", nullptr);
</ins><span class="cx">     sink->priv->handlesRotationTags = videoFlip;
</span><span class="cx"> 
</span><span class="cx">     if (videoFlip) {
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsgstreamerGStreamerAudioMixercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/gstreamer/GStreamerAudioMixer.cpp (277946 => 277947)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/gstreamer/GStreamerAudioMixer.cpp 2021-05-24 08:55:08 UTC (rev 277946)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/GStreamerAudioMixer.cpp    2021-05-24 11:22:32 UTC (rev 277947)
</span><span class="lines">@@ -47,8 +47,8 @@
</span><span class="cx">     m_pipeline = gst_element_factory_make("pipeline", "webkitaudiomixer");
</span><span class="cx">     connectSimpleBusMessageCallback(m_pipeline.get());
</span><span class="cx"> 
</span><del>-    m_mixer = gst_element_factory_make("audiomixer", nullptr);
-    GstElement* audioSink = gst_element_factory_make("autoaudiosink", nullptr);
</del><ins>+    m_mixer = makeGStreamerElement("audiomixer", nullptr);
+    GstElement* audioSink = makeGStreamerElement("autoaudiosink", nullptr);
</ins><span class="cx"> 
</span><span class="cx">     gst_bin_add_many(GST_BIN_CAST(m_pipeline.get()), m_mixer.get(), audioSink, nullptr);
</span><span class="cx">     gst_element_link(m_mixer.get(), audioSink);
</span><span class="lines">@@ -85,11 +85,11 @@
</span><span class="cx"> 
</span><span class="cx"> GRefPtr<GstPad> GStreamerAudioMixer::registerProducer(GstElement* interaudioSink)
</span><span class="cx"> {
</span><del>-    GstElement* src = gst_element_factory_make("interaudiosrc", nullptr);
</del><ins>+    GstElement* src = makeGStreamerElement("interaudiosrc", nullptr);
</ins><span class="cx">     g_object_set(src, "channel", GST_ELEMENT_NAME(interaudioSink), nullptr);
</span><span class="cx">     g_object_set(interaudioSink, "channel", GST_ELEMENT_NAME(interaudioSink), nullptr);
</span><span class="cx"> 
</span><del>-    GstElement* audioResample = gst_element_factory_make("audioresample", nullptr);
</del><ins>+    GstElement* audioResample = makeGStreamerElement("audioresample", nullptr);
</ins><span class="cx">     gst_bin_add_many(GST_BIN_CAST(m_pipeline.get()), src, audioResample, nullptr);
</span><span class="cx">     gst_element_link(src, audioResample);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsgstreamerGStreamerCommoncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp (277946 => 277947)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp     2021-05-24 08:55:08 UTC (rev 277946)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp        2021-05-24 11:22:32 UTC (rev 277947)
</span><span class="lines">@@ -452,12 +452,8 @@
</span><span class="cx">         //   runtime requirements are not fullfilled.
</span><span class="cx">         // - the sink was created for the WPE port, audio mixing was not requested and no
</span><span class="cx">         //   WPEBackend-FDO audio receiver has been registered at runtime.
</span><del>-        audioSink = gst_element_factory_make("autoaudiosink", nullptr);
</del><ins>+        audioSink = makeGStreamerElement("autoaudiosink", nullptr);
</ins><span class="cx">     }
</span><del>-    if (!audioSink) {
-        GST_WARNING("GStreamer's autoaudiosink not found. Please check your gst-plugins-good installation");
-        return nullptr;
-    }
</del><span class="cx"> 
</span><span class="cx">     return audioSink;
</span><span class="cx"> }
</span><span class="lines">@@ -508,6 +504,21 @@
</span><span class="cx">     return gst_buffer_new_wrapped_full(static_cast<GstMemoryFlags>(0), data, length, 0, length, data, fastFree);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+GstElement* makeGStreamerElement(const char* factoryName, const char* name)
+{
+    auto* element = gst_element_factory_make(factoryName, name);
+    RELEASE_ASSERT_WITH_MESSAGE(element, "GStreamer element %s not found. Please install it", factoryName);
+    return element;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+GstElement* makeGStreamerBin(const char* description, bool ghostUnlinkedPads)
+{
+    GUniqueOutPtr<GError> error;
+    auto* bin = gst_parse_bin_from_description(description, ghostUnlinkedPads, &error.outPtr());
+    RELEASE_ASSERT_WITH_MESSAGE(bin, "Unable to create bin for description: \"%s\". Error: %s", description, error->message);
+    return bin;
+}
+
+}
+
</ins><span class="cx"> #endif // USE(GSTREAMER)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsgstreamerGStreamerCommonh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.h (277946 => 277947)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.h       2021-05-24 08:55:08 UTC (rev 277946)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.h  2021-05-24 11:22:32 UTC (rev 277947)
</span><span class="lines">@@ -302,6 +302,10 @@
</span><span class="cx"> 
</span><span class="cx"> GstBuffer* gstBufferNewWrappedFast(void* data, size_t length);
</span><span class="cx"> 
</span><ins>+// These functions should be used for elements not provided by WebKit itself and not provided by GStreamer -core.
+GstElement* makeGStreamerElement(const char* factoryName, const char* name);
+GstElement* makeGStreamerBin(const char* description, bool ghostUnlinkedPads);
+
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #ifndef GST_BUFFER_DTS_OR_PTS
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsgstreamerImageDecoderGStreamercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/gstreamer/ImageDecoderGStreamer.cpp (277946 => 277947)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/gstreamer/ImageDecoderGStreamer.cpp       2021-05-24 08:55:08 UTC (rev 277946)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/ImageDecoderGStreamer.cpp  2021-05-24 11:22:32 UTC (rev 277947)
</span><span class="lines">@@ -242,7 +242,7 @@
</span><span class="cx">     GST_DEBUG_OBJECT(m_pipeline.get(), "New decodebin pad %" GST_PTR_FORMAT " caps: %" GST_PTR_FORMAT, pad, padCaps.get());
</span><span class="cx">     RELEASE_ASSERT(doCapsHaveType(padCaps.get(), "video"));
</span><span class="cx"> 
</span><del>-    GstElement* sink = gst_element_factory_make("appsink", nullptr);
</del><ins>+    GstElement* sink = makeGStreamerElement("appsink", nullptr);
</ins><span class="cx">     static GstAppSinkCallbacks callbacks = {
</span><span class="cx">         nullptr,
</span><span class="cx">         [](GstAppSink* sink, gpointer userData) -> GstFlowReturn {
</span><span class="lines">@@ -262,7 +262,7 @@
</span><span class="cx">     GRefPtr<GstCaps> caps = adoptGRef(gst_caps_from_string("video/x-raw, format=(string)RGBA"));
</span><span class="cx">     g_object_set(sink, "sync", false, "caps", caps.get(), nullptr);
</span><span class="cx"> 
</span><del>-    GstElement* videoconvert = gst_element_factory_make("videoconvert", nullptr);
</del><ins>+    GstElement* videoconvert = makeGStreamerElement("videoconvert", nullptr);
</ins><span class="cx"> 
</span><span class="cx">     gst_bin_add_many(GST_BIN_CAST(m_pipeline.get()), videoconvert, sink, nullptr);
</span><span class="cx">     gst_element_link(videoconvert, sink);
</span><span class="lines">@@ -387,10 +387,10 @@
</span><span class="cx">         return GST_BUS_DROP;
</span><span class="cx">     }, this, nullptr);
</span><span class="cx"> 
</span><del>-    GstElement* source = gst_element_factory_make("giostreamsrc", nullptr);
</del><ins>+    GstElement* source = makeGStreamerElement("giostreamsrc", nullptr);
</ins><span class="cx">     g_object_set(source, "stream", m_memoryStream.get(), nullptr);
</span><span class="cx"> 
</span><del>-    m_decodebin = gst_element_factory_make("decodebin3", nullptr);
</del><ins>+    m_decodebin = makeGStreamerElement("decodebin3", nullptr);
</ins><span class="cx">     g_signal_connect_swapped(m_decodebin.get(), "pad-added", G_CALLBACK(decodebinPadAddedCallback), this);
</span><span class="cx"> 
</span><span class="cx">     gst_bin_add_many(GST_BIN_CAST(m_pipeline.get()), source, m_decodebin.get(), nullptr);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsgstreamerMediaPlayerPrivateGStreamercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp (277946 => 277947)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp 2021-05-24 08:55:08 UTC (rev 277946)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp    2021-05-24 11:22:32 UTC (rev 277947)
</span><span class="lines">@@ -2708,7 +2708,7 @@
</span><span class="cx"> 
</span><span class="cx">     static Atomic<uint32_t> pipelineId;
</span><span class="cx"> 
</span><del>-    m_pipeline = gst_element_factory_make(playbinName, makeString(type, elementId, '-', pipelineId.exchangeAdd(1)).ascii().data());
</del><ins>+    m_pipeline = makeGStreamerElement(playbinName, makeString(type, elementId, '-', pipelineId.exchangeAdd(1)).ascii().data());
</ins><span class="cx">     if (!m_pipeline) {
</span><span class="cx">         GST_WARNING("%s not found, make sure to install gst-plugins-base", playbinName);
</span><span class="cx">         loadingFailed(MediaPlayer::NetworkState::FormatError, MediaPlayer::ReadyState::HaveNothing, true);
</span><span class="lines">@@ -2796,7 +2796,7 @@
</span><span class="cx">     if (!m_canRenderingBeAccelerated) {
</span><span class="cx">         // If not using accelerated compositing, let GStreamer handle
</span><span class="cx">         // the image-orientation tag.
</span><del>-        GstElement* videoFlip = gst_element_factory_make("videoflip", nullptr);
</del><ins>+        GstElement* videoFlip = makeGStreamerElement("videoflip", nullptr);
</ins><span class="cx">         if (videoFlip) {
</span><span class="cx">             gst_util_set_object_arg(G_OBJECT(videoFlip), "method", "automatic");
</span><span class="cx">             g_object_set(m_pipeline.get(), "video-filter", videoFlip, nullptr);
</span><span class="lines">@@ -3401,7 +3401,7 @@
</span><span class="cx"> {
</span><span class="cx">     // Here goes the platform-dependant code to create the videoSink. As a default
</span><span class="cx">     // we use a fakeVideoSink so nothing is drawn to the page.
</span><del>-    GstElement* videoSink =  gst_element_factory_make("fakevideosink", nullptr);
</del><ins>+    GstElement* videoSink =  makeGStreamerElement("fakevideosink", nullptr);
</ins><span class="cx"> 
</span><span class="cx">     return videoSink;
</span><span class="cx"> }
</span><span class="lines">@@ -3431,7 +3431,7 @@
</span><span class="cx">     acceleratedRenderingStateChanged();
</span><span class="cx"> 
</span><span class="cx">     if (!m_player->isVideoPlayer()) {
</span><del>-        m_videoSink = gst_element_factory_make("fakevideosink", nullptr);
</del><ins>+        m_videoSink = makeGStreamerElement("fakevideosink", nullptr);
</ins><span class="cx">         return m_videoSink.get();
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsgstreamerTextCombinerGStreamercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/gstreamer/TextCombinerGStreamer.cpp (277946 => 277947)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/gstreamer/TextCombinerGStreamer.cpp       2021-05-24 08:55:08 UTC (rev 277946)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/TextCombinerGStreamer.cpp  2021-05-24 11:22:32 UTC (rev 277947)
</span><span class="lines">@@ -70,7 +70,7 @@
</span><span class="cx">         // Caps are plain text, we want a WebVTT encoder between the ghostpad and the combinerElement.
</span><span class="cx">         if (!target || gstElementFactoryEquals(targetParent.get(), "webvttenc"_s)) {
</span><span class="cx">             GST_DEBUG_OBJECT(combiner, "Setting up a WebVTT encoder");
</span><del>-            auto* encoder = gst_element_factory_make("webvttenc", nullptr);
</del><ins>+            auto* encoder = makeGStreamerElement("webvttenc", nullptr);
</ins><span class="cx">             ASSERT(encoder);
</span><span class="cx"> 
</span><span class="cx">             gst_bin_add(GST_BIN_CAST(combiner), encoder);
</span><span class="lines">@@ -97,9 +97,9 @@
</span><span class="cx">         GST_DEBUG_OBJECT(combiner, "Converting CEA-608 closed captions to WebVTT.");
</span><span class="cx">         auto* encoder = gst_bin_new(nullptr);
</span><span class="cx">         auto* queue = gst_element_factory_make("queue", nullptr);
</span><del>-        auto* converter = gst_element_factory_make("ccconverter", nullptr);
</del><ins>+        auto* converter = makeGStreamerElement("ccconverter", nullptr);
</ins><span class="cx">         auto* rawCapsFilter = gst_element_factory_make("capsfilter", nullptr);
</span><del>-        auto* webvttEncoder = gst_element_factory_make("cea608tott", nullptr);
</del><ins>+        auto* webvttEncoder = makeGStreamerElement("cea608tott", nullptr);
</ins><span class="cx">         auto* vttCapsFilter = gst_element_factory_make("capsfilter", nullptr);
</span><span class="cx"> 
</span><span class="cx">         auto rawCaps = adoptGRef(gst_caps_new_simple("closedcaption/x-cea-608", "format", G_TYPE_STRING, "raw", nullptr));
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsgstreamerTextSinkGStreamercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/gstreamer/TextSinkGStreamer.cpp (277946 => 277947)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/gstreamer/TextSinkGStreamer.cpp   2021-05-24 08:55:08 UTC (rev 277946)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/TextSinkGStreamer.cpp      2021-05-24 11:22:32 UTC (rev 277947)
</span><span class="lines">@@ -81,7 +81,7 @@
</span><span class="cx">     auto* sink = WEBKIT_TEXT_SINK(object);
</span><span class="cx">     auto* priv = sink->priv;
</span><span class="cx"> 
</span><del>-    priv->appSink = gst_element_factory_make("appsink", nullptr);
</del><ins>+    priv->appSink = makeGStreamerElement("appsink", nullptr);
</ins><span class="cx">     gst_bin_add(GST_BIN_CAST(sink), priv->appSink.get());
</span><span class="cx"> 
</span><span class="cx">     auto pad = adoptGRef(gst_element_get_static_pad(priv->appSink.get(), "sink"));
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsgstreamerWebKitAudioSinkGStreamercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/gstreamer/WebKitAudioSinkGStreamer.cpp (277946 => 277947)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/gstreamer/WebKitAudioSinkGStreamer.cpp    2021-05-24 08:55:08 UTC (rev 277946)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/WebKitAudioSinkGStreamer.cpp       2021-05-24 11:22:32 UTC (rev 277947)
</span><span class="lines">@@ -150,8 +150,8 @@
</span><span class="cx">     if (is<PlatformDisplayLibWPE>(sharedDisplay)) {
</span><span class="cx">         sink->priv->wpeAudioSource.reset(wpe_audio_source_create(downcast<PlatformDisplayLibWPE>(sharedDisplay).backend()));
</span><span class="cx">         if (wpe_audio_source_has_receiver(sink->priv->wpeAudioSource.get())) {
</span><del>-            sink->priv->volumeElement = gst_element_factory_make("volume", nullptr);
-            sink->priv->appsink = gst_element_factory_make("appsink", nullptr);
</del><ins>+            sink->priv->volumeElement = makeGStreamerElement("volume", nullptr);
+            sink->priv->appsink = makeGStreamerElement("appsink", nullptr);
</ins><span class="cx">             gst_app_sink_set_emit_signals(GST_APP_SINK(sink->priv->appsink.get()), TRUE);
</span><span class="cx"> 
</span><span class="cx">             g_signal_connect(sink->priv->appsink.get(), "new-sample", G_CALLBACK(+[](GstElement* appsink, WebKitAudioSink* sink) -> GstFlowReturn {
</span><span class="lines">@@ -189,7 +189,7 @@
</span><span class="cx">             return false;
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        sink->priv->interAudioSink = gst_element_factory_make("interaudiosink", nullptr);
</del><ins>+        sink->priv->interAudioSink = makeGStreamerElement("interaudiosink", nullptr);
</ins><span class="cx">         RELEASE_ASSERT(sink->priv->interAudioSink);
</span><span class="cx"> 
</span><span class="cx">         gst_bin_add(GST_BIN_CAST(sink), sink->priv->interAudioSink.get());
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsgstreamermseAppendPipelinecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/gstreamer/mse/AppendPipeline.cpp (277946 => 277947)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/gstreamer/mse/AppendPipeline.cpp  2021-05-24 08:55:08 UTC (rev 277946)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/mse/AppendPipeline.cpp     2021-05-24 11:22:32 UTC (rev 277947)
</span><span class="lines">@@ -134,7 +134,7 @@
</span><span class="cx"> 
</span><span class="cx">     // We assign the created instances here instead of adoptRef() because gst_bin_add_many()
</span><span class="cx">     // below will already take the initial reference and we need an additional one for us.
</span><del>-    m_appsrc = gst_element_factory_make("appsrc", nullptr);
</del><ins>+    m_appsrc = makeGStreamerElement("appsrc", nullptr);
</ins><span class="cx"> 
</span><span class="cx">     GRefPtr<GstPad> appsrcPad = adoptGRef(gst_element_get_static_pad(m_appsrc.get(), "src"));
</span><span class="cx">     gst_pad_add_probe(appsrcPad.get(), GST_PAD_PROBE_TYPE_BUFFER, [](GstPad*, GstPadProbeInfo* padProbeInfo, void* userData) {
</span><span class="lines">@@ -144,13 +144,13 @@
</span><span class="cx">     const String& type = m_sourceBufferPrivate.type().containerType();
</span><span class="cx">     GST_DEBUG("SourceBuffer containerType: %s", type.utf8().data());
</span><span class="cx">     if (type.endsWith("mp4") || type.endsWith("aac"))
</span><del>-        m_demux = gst_element_factory_make("qtdemux", nullptr);
</del><ins>+        m_demux = makeGStreamerElement("qtdemux", nullptr);
</ins><span class="cx">     else if (type.endsWith("webm"))
</span><del>-        m_demux = gst_element_factory_make("matroskademux", nullptr);
</del><ins>+        m_demux = makeGStreamerElement("matroskademux", nullptr);
</ins><span class="cx">     else
</span><span class="cx">         ASSERT_NOT_REACHED();
</span><span class="cx"> 
</span><del>-    m_appsink = gst_element_factory_make("appsink", nullptr);
</del><ins>+    m_appsink = makeGStreamerElement("appsink", nullptr);
</ins><span class="cx"> 
</span><span class="cx">     gst_app_sink_set_emit_signals(GST_APP_SINK(m_appsink.get()), TRUE);
</span><span class="cx">     gst_base_sink_set_sync(GST_BASE_SINK(m_appsink.get()), FALSE);
</span><span class="lines">@@ -664,15 +664,11 @@
</span><span class="cx">     GUniquePtr<char> parserName(g_strdup_printf("%s_parser", demuxerPadName.get()));
</span><span class="cx"> 
</span><span class="cx">     if (!g_strcmp0(mediaType, "audio/x-opus")) {
</span><del>-        GstElement* opusparse = gst_element_factory_make("opusparse", parserName.get());
-        ASSERT(opusparse);
-        g_return_val_if_fail(opusparse, nullptr);
</del><ins>+        GstElement* opusparse = makeGStreamerElement("opusparse", parserName.get());
</ins><span class="cx">         return GRefPtr<GstElement>(opusparse);
</span><span class="cx">     }
</span><span class="cx">     if (!g_strcmp0(mediaType, "video/x-h264")) {
</span><del>-        GstElement* h264parse = gst_element_factory_make("h264parse", parserName.get());
-        ASSERT(h264parse);
-        g_return_val_if_fail(h264parse, nullptr);
</del><ins>+        GstElement* h264parse = makeGStreamerElement("h264parse", parserName.get());
</ins><span class="cx">         return GRefPtr<GstElement>(h264parse);
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmediastreamgstreamerGStreamerAudioCapturercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mediastream/gstreamer/GStreamerAudioCapturer.cpp (277946 => 277947)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediastream/gstreamer/GStreamerAudioCapturer.cpp   2021-05-24 08:55:08 UTC (rev 277946)
+++ trunk/Source/WebCore/platform/mediastream/gstreamer/GStreamerAudioCapturer.cpp      2021-05-24 11:22:32 UTC (rev 277947)
</span><span class="lines">@@ -51,11 +51,7 @@
</span><span class="cx"> 
</span><span class="cx"> GstElement* GStreamerAudioCapturer::createConverter()
</span><span class="cx"> {
</span><del>-    auto converter = gst_parse_bin_from_description("audioconvert ! audioresample", TRUE, nullptr);
-
-    ASSERT(converter);
-
-    return converter;
</del><ins>+    return makeGStreamerBin("audioconvert ! audioresample", true);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool GStreamerAudioCapturer::setSampleRate(int sampleRate)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmediastreamgstreamerGStreamerCapturercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mediastream/gstreamer/GStreamerCapturer.cpp (277946 => 277947)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediastream/gstreamer/GStreamerCapturer.cpp        2021-05-24 08:55:08 UTC (rev 277946)
+++ trunk/Source/WebCore/platform/mediastream/gstreamer/GStreamerCapturer.cpp   2021-05-24 11:22:32 UTC (rev 277947)
</span><span class="lines">@@ -126,8 +126,7 @@
</span><span class="cx"> 
</span><span class="cx"> GstElement* GStreamerCapturer::makeElement(const char* factoryName)
</span><span class="cx"> {
</span><del>-    auto element = gst_element_factory_make(factoryName, nullptr);
-    ASSERT(element);
</del><ins>+    auto* element = makeGStreamerElement(factoryName, nullptr);
</ins><span class="cx">     GUniquePtr<char> capturerName(g_strdup_printf("%s_capturer_%s_%p", name(), GST_OBJECT_NAME(element), this));
</span><span class="cx">     gst_object_set_name(GST_OBJECT(element), capturerName.get());
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmediastreamgstreamerGStreamerMediaStreamSourcecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp (277946 => 277947)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp       2021-05-24 08:55:08 UTC (rev 277946)
+++ trunk/Source/WebCore/platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp  2021-05-24 11:22:32 UTC (rev 277947)
</span><span class="lines">@@ -133,8 +133,7 @@
</span><span class="cx">             m_videoTrack = VideoTrackPrivateMediaStream::create(track);
</span><span class="cx"> 
</span><span class="cx">         bool isCaptureTrack = track.isCaptureTrack();
</span><del>-        m_src = gst_element_factory_make("appsrc", nullptr);
-        RELEASE_ASSERT_WITH_MESSAGE(GST_IS_APP_SRC(m_src.get()), "GStreamer appsrc element not found. Please make sure to install gst-plugins-base");
</del><ins>+        m_src = makeGStreamerElement("appsrc", nullptr);
</ins><span class="cx"> 
</span><span class="cx">         g_object_set(m_src.get(), "is-live", TRUE, "format", GST_FORMAT_TIME, "emit-signals", TRUE, "min-percent", 100,
</span><span class="cx">             "do-timestamp", isCaptureTrack, nullptr);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmediastreamgstreamerGStreamerVideoCapturercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mediastream/gstreamer/GStreamerVideoCapturer.cpp (277946 => 277947)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediastream/gstreamer/GStreamerVideoCapturer.cpp   2021-05-24 08:55:08 UTC (rev 277946)
+++ trunk/Source/WebCore/platform/mediastream/gstreamer/GStreamerVideoCapturer.cpp      2021-05-24 11:22:32 UTC (rev 277947)
</span><span class="lines">@@ -40,10 +40,7 @@
</span><span class="cx"> GstElement* GStreamerVideoCapturer::createConverter()
</span><span class="cx"> {
</span><span class="cx">     // https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/issues/97#note_56575
</span><del>-    auto converter = gst_parse_bin_from_description("videoscale ! videoconvert ! videorate drop-only=1 average-period=1", TRUE, nullptr);
-    ASSERT(converter);
-
-    return converter;
</del><ins>+    return makeGStreamerBin("videoscale ! videoconvert ! videorate drop-only=1 average-period=1", true);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> GstVideoInfo GStreamerVideoCapturer::getBestFormat()
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmediastreamlibwebrtcGStreamerVideoDecoderFactorycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mediastream/libwebrtc/GStreamerVideoDecoderFactory.cpp (277946 => 277947)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediastream/libwebrtc/GStreamerVideoDecoderFactory.cpp     2021-05-24 08:55:08 UTC (rev 277946)
+++ trunk/Source/WebCore/platform/mediastream/libwebrtc/GStreamerVideoDecoderFactory.cpp        2021-05-24 11:22:32 UTC (rev 277947)
</span><span class="lines">@@ -77,7 +77,7 @@
</span><span class="cx">     {
</span><span class="cx">         GUniquePtr<char> name(g_strdup_printf("%s_dec_%s_%p", Name(), factoryName, this));
</span><span class="cx"> 
</span><del>-        return gst_element_factory_make(factoryName, name.get());
</del><ins>+        return makeGStreamerElement(factoryName, name.get());
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     void handleError(GError* error)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmediastreamlibwebrtcGStreamerVideoEncodercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mediastream/libwebrtc/GStreamerVideoEncoder.cpp (277946 => 277947)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediastream/libwebrtc/GStreamerVideoEncoder.cpp    2021-05-24 08:55:08 UTC (rev 277946)
+++ trunk/Source/WebCore/platform/mediastream/libwebrtc/GStreamerVideoEncoder.cpp       2021-05-24 11:22:32 UTC (rev 277947)
</span><span class="lines">@@ -158,7 +158,7 @@
</span><span class="cx">     auto encoder = Encoders::definition(encoderId);
</span><span class="cx">     ASSERT(encoder);
</span><span class="cx">     if (encoder->parserName)
</span><del>-        priv->parser = gst_element_factory_make(encoder->parserName, nullptr);
</del><ins>+        priv->parser = makeGStreamerElement(encoder->parserName, nullptr);
</ins><span class="cx"> 
</span><span class="cx">     encoder->setupEncoder(self);
</span><span class="cx"> 
</span><span class="lines">@@ -200,7 +200,7 @@
</span><span class="cx">     for (const auto& pair : Encoders::singleton()) {
</span><span class="cx">         const auto& encoder = pair.second;
</span><span class="cx">         if (gst_caps_can_intersect(encoder.caps.get(), caps)) {
</span><del>-            GRefPtr<GstElement> element = gst_element_factory_make(encoder.name, nullptr);
</del><ins>+            GRefPtr<GstElement> element = makeGStreamerElement(encoder.name, nullptr);
</ins><span class="cx">             webrtcVideoEncoderSetEncoder(self, WTFMove(element), pair.first);
</span><span class="cx">             return;
</span><span class="cx">         }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmediastreamlibwebrtcGStreamerVideoEncoderFactorycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp (277946 => 277947)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp     2021-05-24 08:55:08 UTC (rev 277946)
+++ trunk/Source/WebCore/platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp        2021-05-24 11:22:32 UTC (rev 277947)
</span><span class="lines">@@ -120,7 +120,7 @@
</span><span class="cx">     {
</span><span class="cx">         static Atomic<uint32_t> elementId;
</span><span class="cx">         auto name = makeString(Name(), "-enc-", factoryName, "-", elementId.exchangeAdd(1));
</span><del>-        auto* elem = gst_element_factory_make(factoryName, name.utf8().data());
</del><ins>+        auto* elem = makeGStreamerElement(factoryName, name.utf8().data());
</ins><span class="cx">         return elem;
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>