Title: [240782] trunk/Source/WebCore
Revision
240782
Author
commit-qu...@webkit.org
Date
2019-01-31 06:24:05 -0800 (Thu, 31 Jan 2019)

Log Message

[GStreamer][WebRTC] Avoid returning FLUSHING when it is not the case in GStreamerMediaStreamSource
https://bugs.webkit.org/show_bug.cgi?id=194087

Basically GstFlowCombiner was mostly designed for element that have 1 sinkpad and several srcpad
meaning that it makes sense that when any of the downstream pad is returning flushing, you should
return FLUSHING upstream. But in our case we have several sinkpads and FLUSHING should be returned
*only* if the internally linked srcpad is FLUSHING otherwise we might end up setting the upstream
source element task to PAUSED (because downstream returned flushing) on a branch that was not
flushing!

Patch by Thibault Saunier <tsaun...@igalia.com> on 2019-01-31
Reviewed by Philippe Normand.

This is a theorical race we can't really cover with tests.

* platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp:
(WebCore::webkitMediaStreamSrcChain):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (240781 => 240782)


--- trunk/Source/WebCore/ChangeLog	2019-01-31 13:59:43 UTC (rev 240781)
+++ trunk/Source/WebCore/ChangeLog	2019-01-31 14:24:05 UTC (rev 240782)
@@ -1,3 +1,22 @@
+2019-01-31  Thibault Saunier  <tsaun...@igalia.com>
+
+        [GStreamer][WebRTC] Avoid returning FLUSHING when it is not the case in GStreamerMediaStreamSource
+        https://bugs.webkit.org/show_bug.cgi?id=194087
+
+        Basically GstFlowCombiner was mostly designed for element that have 1 sinkpad and several srcpad
+        meaning that it makes sense that when any of the downstream pad is returning flushing, you should
+        return FLUSHING upstream. But in our case we have several sinkpads and FLUSHING should be returned
+        *only* if the internally linked srcpad is FLUSHING otherwise we might end up setting the upstream
+        source element task to PAUSED (because downstream returned flushing) on a branch that was not
+        flushing!
+
+        Reviewed by Philippe Normand.
+
+        This is a theorical race we can't really cover with tests.
+
+        * platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp:
+        (WebCore::webkitMediaStreamSrcChain):
+
 2019-01-31  Zalan Bujtas  <za...@apple.com>
 
         [LFC] Margin before/after/start/end initial value is 0 and not auto.

Modified: trunk/Source/WebCore/platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp (240781 => 240782)


--- trunk/Source/WebCore/platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp	2019-01-31 13:59:43 UTC (rev 240781)
+++ trunk/Source/WebCore/platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp	2019-01-31 14:24:05 UTC (rev 240782)
@@ -368,12 +368,15 @@
 
 static GstFlowReturn webkitMediaStreamSrcChain(GstPad* pad, GstObject* parent, GstBuffer* buffer)
 {
-    GstFlowReturn result;
+    GstFlowReturn result, chain_result;
     GRefPtr<WebKitMediaStreamSrc> self = adoptGRef(WEBKIT_MEDIA_STREAM_SRC(gst_object_get_parent(parent)));
 
-    result = gst_flow_combiner_update_pad_flow(self.get()->flowCombiner, pad,
-        gst_proxy_pad_chain_default(pad, GST_OBJECT(self.get()), buffer));
+    chain_result = gst_proxy_pad_chain_default(pad, GST_OBJECT(self.get()), buffer);
+    result = gst_flow_combiner_update_pad_flow(self.get()->flowCombiner, pad, chain_result);
 
+    if (result == GST_FLOW_FLUSHING)
+        return chain_result;
+
     return result;
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to