[GStreamer] Silent WebAudio buffers support
authorphiln@webkit.org <philn@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 31 Jan 2018 16:14:32 +0000 (16:14 +0000)
committerphiln@webkit.org <philn@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 31 Jan 2018 16:14:32 +0000 (16:14 +0000)
https://bugs.webkit.org/show_bug.cgi?id=143869

Reviewed by Carlos Garcia Campos.

* platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp:
(webKitWebAudioSrcLoop): Flag silent buffers as GAP buffers. This
enables downstream elements to optimize the buffer processing.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227902 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp

index d389515..2091239 100644 (file)
@@ -1,3 +1,14 @@
+2018-01-31  Philippe Normand  <pnormand@igalia.com>
+
+        [GStreamer] Silent WebAudio buffers support
+        https://bugs.webkit.org/show_bug.cgi?id=143869
+
+        Reviewed by Carlos Garcia Campos.
+
+        * platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp:
+        (webKitWebAudioSrcLoop): Flag silent buffers as GAP buffers. This
+        enables downstream elements to optimize the buffer processing.
+
 2018-01-31  Xabier Rodriguez Calvar  <calvaris@igalia.com>
 
         [EME] Fix NavigatorEME::tryNextSupportedConfiguration typo
index 445c979..b183d04 100644 (file)
@@ -353,6 +353,13 @@ static void webKitWebAudioSrcLoop(WebKitWebAudioSrc* src)
         auto& buffer = channelBufferList[i];
         unmapGstBuffer(buffer.get());
 
+        // This 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
+        if (webkitGstCheckVersion(1, 12, 5)) {
+            if (priv->bus->channel(i)->isSilent())
+                GST_BUFFER_FLAG_SET(buffer.get(), GST_BUFFER_FLAG_GAP);
+        }
+
         if (failed)
             continue;