Changeset 243140 in webkit


Ignore:
Timestamp:
Mar 19, 2019 7:53:09 AM (5 years ago)
Author:
Philippe Normand
Message:

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):

Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r243138 r243140  
     12019-03-19  Philippe Normand  <pnormand@igalia.com>
     2
     3        REGRESSION(r243058): [GStreamer] 3 tests now timing out
     4        https://bugs.webkit.org/show_bug.cgi?id=195888
     5
     6        Reviewed by Xabier Rodriguez-Calvar.
     7
     8        A breaking change was introduced in r243058. Now on-disk-buffering
     9        is disabled when the reported Content-Length is 0 or not present
     10        at all. This broke the progress event logic in didLoadProgress()
     11        because leading to progress events not being fired as expected.
     12
     13        The proposed solution is to make webkitwebsrc notify the player
     14        every time the network process receives data from the network. So
     15        the player can now easily determine if the load progressed by
     16        checking the reported statistics.
     17
     18        No new tests, existing media tests cover this change.
     19
     20        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
     21        (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
     22        (WebCore::MediaPlayerPrivateGStreamer::didLoadingProgress const):
     23        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
     24        * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
     25        (CachedResourceStreamingClient::dataReceived):
     26
    1272019-03-19  Alicia Boya García  <aboya@igalia.com>
    228
  • trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp

    r243058 r243140  
    13751375                }
    13761376            }
     1377        } else if (gst_structure_has_name(structure, "webkit-network-statistics")) {
     1378            if (gst_structure_get_uint64(structure, "read-position", &m_networkReadPosition))
     1379                GST_DEBUG_OBJECT(pipeline(), "Updated network read position %" G_GUINT64_FORMAT, m_networkReadPosition);
    13771380        } else if (gst_structure_has_name(structure, "adaptive-streaming-statistics")) {
    13781381            if (WEBKIT_IS_WEB_SRC(m_source.get()))
     
    17041707        return false;
    17051708
    1706     if (isLiveStream())
    1707         return true;
     1709    if (WEBKIT_IS_WEB_SRC(m_source.get())) {
     1710        GST_LOG_OBJECT(pipeline(), "Last network read position: %" G_GUINT64_FORMAT ", current: %" G_GUINT64_FORMAT, m_readPositionAtLastDidLoadingProgress, m_networkReadPosition);
     1711        bool didLoadingProgress = m_readPositionAtLastDidLoadingProgress != m_networkReadPosition;
     1712        m_readPositionAtLastDidLoadingProgress = m_networkReadPosition;
     1713        return didLoadingProgress;
     1714    }
    17081715
    17091716    if (UNLIKELY(!m_pipeline || !durationMediaTime() || (!isMediaSource() && !totalBytes())))
     
    17131720    bool didLoadingProgress = currentMaxTimeLoaded != m_maxTimeLoadedAtLastDidLoadingProgress;
    17141721    m_maxTimeLoadedAtLastDidLoadingProgress = currentMaxTimeLoaded;
    1715     GST_LOG("didLoadingProgress: %s", toString(didLoadingProgress).utf8().data());
     1722    GST_LOG_OBJECT(pipeline(), "didLoadingProgress: %s", boolForPrinting(didLoadingProgress));
    17161723    return didLoadingProgress;
    17171724}
  • trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h

    r239427 r243140  
    289289    virtual bool isMediaSource() const { return false; }
    290290
     291    uint64_t m_networkReadPosition { 0 };
     292    mutable uint64_t m_readPositionAtLastDidLoadingProgress { 0 };
     293
    291294    Optional<bool> m_hasTaintedOrigin { WTF::nullopt };
    292295};
  • trunk/Source/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp

    r243058 r243140  
    979979        priv->requestedPosition = newPosition;
    980980    priv->readPosition = newPosition;
     981    gst_element_post_message(GST_ELEMENT_CAST(src), gst_message_new_element(GST_OBJECT_CAST(src),
     982        gst_structure_new("webkit-network-statistics", "read-position", G_TYPE_UINT64, priv->readPosition, nullptr)));
    981983
    982984    uint64_t newSize = 0;
Note: See TracChangeset for help on using the changeset viewer.