Title: [219688] trunk
Revision
219688
Author
[email protected]
Date
2017-07-20 08:59:39 -0700 (Thu, 20 Jul 2017)

Log Message

[GTK] Layout Test http/tests/media/hls/hls-progress.html is failing
https://bugs.webkit.org/show_bug.cgi?id=141469

Patch by Charlie Turner <[email protected]> on 2017-07-20
Reviewed by Xabier Rodriguez-Calvar.

Source/WebCore:

A work-around for getting progress information in a timely manner from
live pipelines. We cannot rely on getting BUFFERING messages within
the stalled time window (3s), so we have to poll for progress
information somehow.

Makes the following pass reliably
 http/tests/media/hls/hls-audio-tracks-has-audio.html passed unexpectedly
 http/tests/media/hls/hls-audio-tracks.html passed unexpectedly
 http/tests/media/hls/hls-progress.html passed unexpectedly

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::findHLSQueue):
(WebCore::isHLSProgressing):
(WebCore::MediaPlayerPrivateGStreamer::fillTimerFired):

LayoutTests:

Fixes the removed tests.

* platform/gtk/TestExpectations:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (219687 => 219688)


--- trunk/LayoutTests/ChangeLog	2017-07-20 15:48:44 UTC (rev 219687)
+++ trunk/LayoutTests/ChangeLog	2017-07-20 15:59:39 UTC (rev 219688)
@@ -1,3 +1,14 @@
+2017-07-20  Charlie Turner  <[email protected]>
+
+        [GTK] Layout Test http/tests/media/hls/hls-progress.html is failing
+        https://bugs.webkit.org/show_bug.cgi?id=141469
+
+        Reviewed by Xabier Rodriguez-Calvar.
+
+        Fixes the removed tests.
+
+        * platform/gtk/TestExpectations:
+
 2017-07-20  Michael Catanzaro  <[email protected]>
 
         Unreviewed GTK test gardening

Modified: trunk/LayoutTests/platform/gtk/TestExpectations (219687 => 219688)


--- trunk/LayoutTests/platform/gtk/TestExpectations	2017-07-20 15:48:44 UTC (rev 219687)
+++ trunk/LayoutTests/platform/gtk/TestExpectations	2017-07-20 15:59:39 UTC (rev 219688)
@@ -943,7 +943,6 @@
 webkit.org/b/141466 fast/media/mq-pointer.html [ Failure ]
 
 webkit.org/b/116259 http/tests/cache/willsendrequest-returns-null-for-memory-cache-load.html [ Failure ]
-webkit.org/b/141469 [ Release ] http/tests/media/hls/hls-progress.html [ Failure ]
 webkit.org/b/141423 svg/css/getComputedStyle-basic.xhtml [ Failure ]
 
 webkit.org/b/141467 fast/multicol/pagination/LeftToRight-tb-hittest.html [ Failure ]
@@ -1105,8 +1104,6 @@
 webkit.org/b/154390 [ Release ] http/tests/media/hls/video-controller-getStartDate.html [ Timeout Failure ]
 webkit.org/b/154390 [ Release ] http/tests/media/hls/hls-audio-tracks-locale-selection.html [ Timeout Failure ]
 webkit.org/b/154390 [ Release ] http/tests/media/hls/hls-video-resize.html [ Timeout Failure ]
-webkit.org/b/154390 [ Release ] http/tests/media/hls/hls-audio-tracks.html [ Timeout Failure ]
-webkit.org/b/154390 [ Release ] http/tests/media/hls/hls-audio-tracks-has-audio.html [ Timeout Failure ]
 webkit.org/b/154390 http/tests/security/local-video-source-from-remote.html [ Timeout Pass ]
 
 webkit.org/b/155505 http/tests/security/contentSecurityPolicy/userAgentShadowDOM/allow-audio.html [ Skip ]

Modified: trunk/Source/WebCore/ChangeLog (219687 => 219688)


--- trunk/Source/WebCore/ChangeLog	2017-07-20 15:48:44 UTC (rev 219687)
+++ trunk/Source/WebCore/ChangeLog	2017-07-20 15:59:39 UTC (rev 219688)
@@ -1,3 +1,25 @@
+2017-07-20  Charlie Turner  <[email protected]>
+
+        [GTK] Layout Test http/tests/media/hls/hls-progress.html is failing
+        https://bugs.webkit.org/show_bug.cgi?id=141469
+
+        Reviewed by Xabier Rodriguez-Calvar.
+
+        A work-around for getting progress information in a timely manner from
+        live pipelines. We cannot rely on getting BUFFERING messages within
+        the stalled time window (3s), so we have to poll for progress
+        information somehow.
+
+        Makes the following pass reliably
+         http/tests/media/hls/hls-audio-tracks-has-audio.html passed unexpectedly
+         http/tests/media/hls/hls-audio-tracks.html passed unexpectedly
+         http/tests/media/hls/hls-progress.html passed unexpectedly
+
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
+        (WebCore::findHLSQueue):
+        (WebCore::isHLSProgressing):
+        (WebCore::MediaPlayerPrivateGStreamer::fillTimerFired):
+
 2017-07-20  Andreas Kling  <[email protected]>
 
         Minor Node->Element type tightening fixes

Modified: trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp (219687 => 219688)


--- trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp	2017-07-20 15:48:44 UTC (rev 219687)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp	2017-07-20 15:59:39 UTC (rev 219688)
@@ -1192,13 +1192,51 @@
 }
 #endif
 
+static int findHLSQueue(const GValue* item)
+{
+    GstElement* element = GST_ELEMENT(g_value_get_object(item));
+    if (g_str_has_prefix(GST_ELEMENT_NAME(element), "queue")) {
+        GstElement* parent = GST_ELEMENT(GST_ELEMENT_PARENT(element));
+        if (!GST_IS_OBJECT(parent))
+            return 1;
+
+        if (g_str_has_prefix(GST_ELEMENT_NAME(GST_ELEMENT_PARENT(parent)), "hlsdemux"))
+            return 0;
+    }
+
+    return 1;
+}
+
+static bool isHLSProgressing(GstElement* playbin, GstQuery* query)
+{
+    GValue item = { };
+    GstIterator* binIterator = gst_bin_iterate_recurse(GST_BIN(playbin));
+    bool foundHLSQueue = gst_iterator_find_custom(binIterator, reinterpret_cast<GCompareFunc>(findHLSQueue), &item, nullptr);
+    gst_iterator_free(binIterator);
+
+    if (!foundHLSQueue)
+        return false;
+
+    GstElement* queueElement = GST_ELEMENT(g_value_get_object(&item));
+    bool queryResult = gst_element_query(queueElement, query);
+    g_value_unset(&item);
+
+    return queryResult;
+}
+
 void MediaPlayerPrivateGStreamer::fillTimerFired()
 {
     GstQuery* query = gst_query_new_buffering(GST_FORMAT_PERCENT);
 
-    if (!gst_element_query(m_pipeline.get(), query)) {
-        gst_query_unref(query);
-        return;
+    if (G_UNLIKELY(!gst_element_query(m_pipeline.get(), query))) {
+        // This query always fails for live pipelines. In the case of HLS, try and find
+        // the queue inside the HLS element to get a proxy measure of progress. Note
+        // that the percentage value is rather meaningless as used below.
+        // This is a hack, see https://bugs.webkit.org/show_bug.cgi?id=141469.
+        if (!isHLSProgressing(m_pipeline.get(), query)) {
+            gst_query_unref(query);
+            return;
+        }
     }
 
     gint64 start, stop;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to