[GTK] Layout Test http/tests/media/hls/hls-progress.html is failing
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 20 Jul 2017 15:59:39 +0000 (15:59 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 20 Jul 2017 15:59:39 +0000 (15:59 +0000)
https://bugs.webkit.org/show_bug.cgi?id=141469

Patch by Charlie Turner <cturner@igalia.com> 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:

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

LayoutTests/ChangeLog
LayoutTests/platform/gtk/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp

index 58cc290..b91c32b 100644 (file)
@@ -1,3 +1,14 @@
+2017-07-20  Charlie Turner  <cturner@igalia.com>
+
+        [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  <mcatanzaro@igalia.com>
 
         Unreviewed GTK test gardening
index 6be19a6..c6d15b0 100644 (file)
@@ -943,7 +943,6 @@ webkit.org/b/141466 fast/media/mq-pointer-styling.html [ Failure ]
 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 http/tests/media/video-redirect.html [ Timeout Pass ]
 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 ]
index 78f07bf..1cc8878 100644 (file)
@@ -1,3 +1,25 @@
+2017-07-20  Charlie Turner  <cturner@igalia.com>
+
+        [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  <akling@apple.com>
 
         Minor Node->Element type tightening fixes
index 7c3fdd3..1b15e82 100644 (file)
@@ -1192,13 +1192,51 @@ void MediaPlayerPrivateGStreamer::processTableOfContentsEntry(GstTocEntry* entry
 }
 #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;