Title: [243976] releases/WebKitGTK/webkit-2.24/Source/WebCore
Revision
243976
Author
carlo...@webkit.org
Date
2019-04-08 03:14:20 -0700 (Mon, 08 Apr 2019)

Log Message

Merge r243140 - REGRESSION(r243058): [GStreamer] 3 tests now timing out
https://bugs.webkit.org/show_bug.cgi?id=195888

Reviewed by Xabier Rodriguez-Calvar.

A breaking change was introduced in r243058. Now on-disk-buffering
is disabled when the reported Content-Length is 0 or not present
at all. This broke the progress event logic in didLoadProgress()
because leading to progress events not being fired as expected.

The proposed solution is to make webkitwebsrc notify the player
every time the network process receives data from the network. So
the player can now easily determine if the load progressed by
checking the reported statistics.

No new tests, existing media tests cover this change.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::handleMessage):
(WebCore::MediaPlayerPrivateGStreamer::didLoadingProgress const):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
* platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
(CachedResourceStreamingClient::dataReceived):

Modified Paths

Diff

Modified: releases/WebKitGTK/webkit-2.24/Source/WebCore/ChangeLog (243975 => 243976)


--- releases/WebKitGTK/webkit-2.24/Source/WebCore/ChangeLog	2019-04-08 10:14:16 UTC (rev 243975)
+++ releases/WebKitGTK/webkit-2.24/Source/WebCore/ChangeLog	2019-04-08 10:14:20 UTC (rev 243976)
@@ -1,3 +1,29 @@
+2019-03-19  Philippe Normand  <pnorm...@igalia.com>
+
+        REGRESSION(r243058): [GStreamer] 3 tests now timing out
+        https://bugs.webkit.org/show_bug.cgi?id=195888
+
+        Reviewed by Xabier Rodriguez-Calvar.
+
+        A breaking change was introduced in r243058. Now on-disk-buffering
+        is disabled when the reported Content-Length is 0 or not present
+        at all. This broke the progress event logic in didLoadProgress()
+        because leading to progress events not being fired as expected.
+
+        The proposed solution is to make webkitwebsrc notify the player
+        every time the network process receives data from the network. So
+        the player can now easily determine if the load progressed by
+        checking the reported statistics.
+
+        No new tests, existing media tests cover this change.
+
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
+        (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
+        (WebCore::MediaPlayerPrivateGStreamer::didLoadingProgress const):
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
+        * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
+        (CachedResourceStreamingClient::dataReceived):
+
 2019-03-18  Philippe Normand  <pnorm...@igalia.com>
 
         [GStreamer] Rewrite HTTP source element using pushsrc base class

Modified: releases/WebKitGTK/webkit-2.24/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp (243975 => 243976)


--- releases/WebKitGTK/webkit-2.24/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp	2019-04-08 10:14:16 UTC (rev 243975)
+++ releases/WebKitGTK/webkit-2.24/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp	2019-04-08 10:14:20 UTC (rev 243976)
@@ -1387,6 +1387,9 @@
                     setDownloadBuffering();
                 }
             }
+        } else if (gst_structure_has_name(structure, "webkit-network-statistics")) {
+            if (gst_structure_get_uint64(structure, "read-position", &m_networkReadPosition))
+                GST_DEBUG_OBJECT(pipeline(), "Updated network read position %" G_GUINT64_FORMAT, m_networkReadPosition);
         } else if (gst_structure_has_name(structure, "adaptive-streaming-statistics")) {
             if (WEBKIT_IS_WEB_SRC(m_source.get()))
                 if (const char* uri = gst_structure_get_string(structure, "uri"))
@@ -1716,8 +1719,12 @@
     if (m_errorOccured || m_loadingStalled)
         return false;
 
-    if (isLiveStream())
-        return true;
+    if (WEBKIT_IS_WEB_SRC(m_source.get())) {
+        GST_LOG_OBJECT(pipeline(), "Last network read position: %" G_GUINT64_FORMAT ", current: %" G_GUINT64_FORMAT, m_readPositionAtLastDidLoadingProgress, m_networkReadPosition);
+        bool didLoadingProgress = m_readPositionAtLastDidLoadingProgress != m_networkReadPosition;
+        m_readPositionAtLastDidLoadingProgress = m_networkReadPosition;
+        return didLoadingProgress;
+    }
 
     if (UNLIKELY(!m_pipeline || !durationMediaTime() || (!isMediaSource() && !totalBytes())))
         return false;
@@ -1725,7 +1732,7 @@
     MediaTime currentMaxTimeLoaded = maxTimeLoaded();
     bool didLoadingProgress = currentMaxTimeLoaded != m_maxTimeLoadedAtLastDidLoadingProgress;
     m_maxTimeLoadedAtLastDidLoadingProgress = currentMaxTimeLoaded;
-    GST_LOG("didLoadingProgress: %s", toString(didLoadingProgress).utf8().data());
+    GST_LOG_OBJECT(pipeline(), "didLoadingProgress: %s", boolForPrinting(didLoadingProgress));
     return didLoadingProgress;
 }
 

Modified: releases/WebKitGTK/webkit-2.24/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h (243975 => 243976)


--- releases/WebKitGTK/webkit-2.24/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h	2019-04-08 10:14:16 UTC (rev 243975)
+++ releases/WebKitGTK/webkit-2.24/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h	2019-04-08 10:14:20 UTC (rev 243976)
@@ -287,6 +287,9 @@
 #endif
     virtual bool isMediaSource() const { return false; }
 
+    uint64_t m_networkReadPosition { 0 };
+    mutable uint64_t m_readPositionAtLastDidLoadingProgress { 0 };
+
     Optional<bool> m_hasTaintedOrigin { WTF::nullopt };
 };
 }

Modified: releases/WebKitGTK/webkit-2.24/Source/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp (243975 => 243976)


--- releases/WebKitGTK/webkit-2.24/Source/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp	2019-04-08 10:14:16 UTC (rev 243975)
+++ releases/WebKitGTK/webkit-2.24/Source/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp	2019-04-08 10:14:20 UTC (rev 243976)
@@ -978,6 +978,8 @@
     if (LIKELY (priv->requestedPosition == priv->readPosition))
         priv->requestedPosition = newPosition;
     priv->readPosition = newPosition;
+    gst_element_post_message(GST_ELEMENT_CAST(src), gst_message_new_element(GST_OBJECT_CAST(src),
+        gst_structure_new("webkit-network-statistics", "read-position", G_TYPE_UINT64, priv->readPosition, nullptr)));
 
     uint64_t newSize = 0;
     if (priv->haveSize && (newPosition > priv->size)) {
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to