Title: [237799] trunk/Source/WebCore
- Revision
- 237799
- Author
- [email protected]
- Date
- 2018-11-05 06:50:28 -0800 (Mon, 05 Nov 2018)
Log Message
[GStreamer] Do not sync libwerbtc stream on the clock
https://bugs.webkit.org/show_bug.cgi?id=190677
The approach here is basically to let libwebrtc do all the
synchronisation for us, and the same way as it is done in apple ports,
we basically try to display what libwebrtc outputs as fast as possible.
Patch by Thibault Saunier <[email protected]> on 2018-11-05
Reviewed by Philippe Normand.
Manually tested
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::setSyncOnSink):
(WebCore::MediaPlayerPrivateGStreamer::syncOnClock):
(WebCore::MediaPlayerPrivateGStreamer::loadFull):
(WebCore::MediaPlayerPrivateGStreamer::load):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (237798 => 237799)
--- trunk/Source/WebCore/ChangeLog 2018-11-05 14:47:40 UTC (rev 237798)
+++ trunk/Source/WebCore/ChangeLog 2018-11-05 14:50:28 UTC (rev 237799)
@@ -1,3 +1,23 @@
+2018-11-05 Thibault Saunier <[email protected]>
+
+ [GStreamer] Do not sync libwerbtc stream on the clock
+ https://bugs.webkit.org/show_bug.cgi?id=190677
+
+ The approach here is basically to let libwebrtc do all the
+ synchronisation for us, and the same way as it is done in apple ports,
+ we basically try to display what libwebrtc outputs as fast as possible.
+
+ Reviewed by Philippe Normand.
+
+ Manually tested
+
+ * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
+ (WebCore::setSyncOnSink):
+ (WebCore::MediaPlayerPrivateGStreamer::syncOnClock):
+ (WebCore::MediaPlayerPrivateGStreamer::loadFull):
+ (WebCore::MediaPlayerPrivateGStreamer::load):
+ * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
+
2018-11-05 Ali Juma <[email protected]>
[IntersectionObserver] Fix isIntersecting computation when 0 is not a threshold
Modified: trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp (237798 => 237799)
--- trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp 2018-11-05 14:47:40 UTC (rev 237798)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp 2018-11-05 14:50:28 UTC (rev 237799)
@@ -248,6 +248,28 @@
loadFull(urlString, nullptr, String());
}
+static void setSyncOnClock(GstElement *element, bool sync)
+{
+ if (!GST_IS_BIN(element)) {
+ g_object_set(element, "sync", sync, NULL);
+ return;
+ }
+
+ GstIterator* it = gst_bin_iterate_sinks(GST_BIN(element));
+ while (gst_iterator_foreach(it, (GstIteratorForeachFunction)([](const GValue* item, void* syncPtr) {
+ bool* sync = static_cast<bool*>(syncPtr);
+ setSyncOnClock(GST_ELEMENT(g_value_get_object(item)), *sync);
+ }), &sync) == GST_ITERATOR_RESYNC)
+ gst_iterator_resync(it);
+ gst_iterator_free(it);
+}
+
+void MediaPlayerPrivateGStreamer::syncOnClock(bool sync)
+{
+ setSyncOnClock(videoSink(), sync);
+ setSyncOnClock(audioSink(), sync);
+}
+
void MediaPlayerPrivateGStreamer::loadFull(const String& urlString, const gchar* playbinName,
const String& pipelineName)
{
@@ -265,7 +287,7 @@
if (!m_pipeline)
createGSTPlayBin(isMediaSource() ? "playbin" : playbinName, pipelineName);
-
+ syncOnClock(true);
if (m_fillTimer.isActive())
m_fillTimer.stop();
@@ -311,6 +333,8 @@
(stream.hasCaptureVideoSource() || stream.hasCaptureAudioSource()) ? "Local" : "Remote", this);
loadFull(String("mediastream://") + stream.id(), "playbin3", pipelineName);
+ syncOnClock(false);
+
#if USE(GSTREAMER_GL)
ensureGLVideoSinkContext();
#endif
Modified: trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h (237798 => 237799)
--- trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h 2018-11-05 14:47:40 UTC (rev 237798)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h 2018-11-05 14:50:28 UTC (rev 237799)
@@ -139,8 +139,8 @@
private:
static void getSupportedTypes(HashSet<String, ASCIICaseInsensitiveHash>&);
static MediaPlayer::SupportsType supportsType(const MediaEngineSupportParameters&);
+ void syncOnClock(bool sync);
-
GstElement* createAudioSink() override;
MediaTime playbackPosition() const;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes