Title: [201077] trunk/Source/WebCore
- Revision
- 201077
- Author
- [email protected]
- Date
- 2016-05-18 07:39:33 -0700 (Wed, 18 May 2016)
Log Message
[GStreamer] webaudio playback improvements
https://bugs.webkit.org/show_bug.cgi?id=155228
Reviewed by Michael Catanzaro.
* platform/audio/gstreamer/AudioDestinationGStreamer.cpp:
(WebCore::autoAudioSinkChildAddedCallback): Fix sink buffer-time
to 100ms to reduce playback latency.
(WebCore::AudioDestinationGStreamer::AudioDestinationGStreamer):
Connect to child-added signal of autoaudiosink to be notified when
a real sink is added into the bin.
* platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp:
(webKitWebAudioSrcConstructed): Fine-tune blocksize of appsrc
according to the buffer size already configured on the src element.
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (201076 => 201077)
--- trunk/Source/WebCore/ChangeLog 2016-05-18 14:30:41 UTC (rev 201076)
+++ trunk/Source/WebCore/ChangeLog 2016-05-18 14:39:33 UTC (rev 201077)
@@ -1,3 +1,20 @@
+2016-05-18 Philippe Normand <[email protected]>
+
+ [GStreamer] webaudio playback improvements
+ https://bugs.webkit.org/show_bug.cgi?id=155228
+
+ Reviewed by Michael Catanzaro.
+
+ * platform/audio/gstreamer/AudioDestinationGStreamer.cpp:
+ (WebCore::autoAudioSinkChildAddedCallback): Fix sink buffer-time
+ to 100ms to reduce playback latency.
+ (WebCore::AudioDestinationGStreamer::AudioDestinationGStreamer):
+ Connect to child-added signal of autoaudiosink to be notified when
+ a real sink is added into the bin.
+ * platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp:
+ (webKitWebAudioSrcConstructed): Fine-tune blocksize of appsrc
+ according to the buffer size already configured on the src element.
+
2016-05-18 Gwang Yoon Hwang <[email protected]>
[GStreamer] Use FakeSink to get a decoded texture from a pipeline
Modified: trunk/Source/WebCore/platform/audio/gstreamer/AudioDestinationGStreamer.cpp (201076 => 201077)
--- trunk/Source/WebCore/platform/audio/gstreamer/AudioDestinationGStreamer.cpp 2016-05-18 14:30:41 UTC (rev 201076)
+++ trunk/Source/WebCore/platform/audio/gstreamer/AudioDestinationGStreamer.cpp 2016-05-18 14:39:33 UTC (rev 201077)
@@ -28,6 +28,7 @@
#include "GRefPtrGStreamer.h"
#include "Logging.h"
#include "WebKitWebAudioSourceGStreamer.h"
+#include <gst/audio/gstaudiobasesink.h>
#include <gst/gst.h>
#include <wtf/glib/GUniquePtr.h>
@@ -42,6 +43,12 @@
return destination->handleMessage(message);
}
+static void autoAudioSinkChildAddedCallback(GstChildProxy*, GObject* object, gchar*, gpointer)
+{
+ if (GST_IS_AUDIO_BASE_SINK(object))
+ g_object_set(GST_AUDIO_BASE_SINK(object), "buffer-time", static_cast<gint64>(100000), nullptr);
+}
+
std::unique_ptr<AudioDestination> AudioDestination::create(AudioIOCallback& callback, const String&, unsigned numberOfInputChannels, unsigned numberOfOutputChannels, float sampleRate)
{
// FIXME: make use of inputDeviceId as appropriate.
@@ -94,6 +101,8 @@
return;
}
+ g_signal_connect(audioSink.get(), "child-added", G_CALLBACK(autoAudioSinkChildAddedCallback), nullptr);
+
// Autoaudiosink does the real sink detection in the GST_STATE_NULL->READY transition
// so it's best to roll it to READY as soon as possible to ensure the underlying platform
// audiosink was loaded correctly.
Modified: trunk/Source/WebCore/platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp (201076 => 201077)
--- trunk/Source/WebCore/platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp 2016-05-18 14:30:41 UTC (rev 201076)
+++ trunk/Source/WebCore/platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp 2016-05-18 14:39:33 UTC (rev 201077)
@@ -230,6 +230,7 @@
// Configure the appsrc for minimal latency.
g_object_set(appsrc, "max-bytes", 2 * priv->bufferSize, "block", TRUE,
+ "blocksize", priv->bufferSize,
"format", GST_FORMAT_TIME, "caps", caps.get(), nullptr);
priv->sources = g_slist_prepend(priv->sources, gst_object_ref(appsrc));
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes