⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 246261 in webkit


Ignore:
Timestamp:
Jun 10, 2019, 7:39:18 AM (7 years ago)
Author:
Adrian Perez de Castro
Message:

Merged r245848 - [MSE][GStreamer] update the readyState correctly in MediaPlayerPrivateGStreamerMSE
https://bugs.webkit.org/show_bug.cgi?id=197834

Patch by Yacine Bandou <yacine.bandou@softathome.com> on 2019-05-28
Reviewed by Xabier Rodriguez-Calvar.

Source/WebCore:

The buffering state and the m_downloadFinished boolean aren't supported in the MSE case.
When the readyState is already "HaveEnoughData", we don't want to revert it to "HaveFutureData",
or else the MediaPlayer would send a "canplay" event instead of a "canplaythrough".

Test: media/media-source/media-source-canplaythrough-event.html

  • platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:

(WebCore::MediaPlayerPrivateGStreamerMSE::updateStates):

LayoutTests:

Add a new test that checks if the MediaElement receives the "canplaythrough"
event when the media content is entirely injected to MSE sourceBuffer.

  • media/media-source/media-source-canplaythrough-event-expected.txt: Added.
  • media/media-source/media-source-canplaythrough-event.html: Added.
Location:
releases/WebKitGTK/webkit-2.24
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • releases/WebKitGTK/webkit-2.24/LayoutTests/ChangeLog

    r245454 r246261  
     12019-05-28  Yacine Bandou  <yacine.bandou@softathome.com>
     2
     3        [MSE][GStreamer] update the readyState correctly in MediaPlayerPrivateGStreamerMSE
     4        https://bugs.webkit.org/show_bug.cgi?id=197834
     5
     6        Reviewed by Xabier Rodriguez-Calvar.
     7
     8        Add a new test that checks if the MediaElement receives the "canplaythrough"
     9        event when the media content is entirely injected to MSE sourceBuffer.
     10
     11        * media/media-source/media-source-canplaythrough-event-expected.txt: Added.
     12        * media/media-source/media-source-canplaythrough-event.html: Added.
     13
    1142019-05-15  Zalan Bujtas  <zalan@apple.com>
    215
  • releases/WebKitGTK/webkit-2.24/Source/WebCore/ChangeLog

    r246259 r246261  
     12019-05-28  Yacine Bandou  <yacine.bandou@softathome.com>
     2
     3        [MSE][GStreamer] update the readyState correctly in MediaPlayerPrivateGStreamerMSE
     4        https://bugs.webkit.org/show_bug.cgi?id=197834
     5
     6        Reviewed by Xabier Rodriguez-Calvar.
     7
     8        The buffering state and the m_downloadFinished boolean aren't supported in the MSE case.
     9        When the readyState is already "HaveEnoughData", we don't want to revert it to "HaveFutureData",
     10        or else the MediaPlayer would send a "canplay" event instead of a "canplaythrough".
     11
     12        Test: media/media-source/media-source-canplaythrough-event.html
     13
     14        * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
     15        (WebCore::MediaPlayerPrivateGStreamerMSE::updateStates):
     16
    1172019-05-23  Adrian Perez de Castro  <aperez@igalia.com>
    218
  • releases/WebKitGTK/webkit-2.24/Source/WebCore/platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp

    r243589 r246261  
    521521                // FIXME: Should we manage NetworkState too?
    522522                GST_DEBUG("m_readyState=%s", dumpReadyState(m_readyState));
    523             } else if (m_buffering) {
    524                 if (m_bufferingPercentage == 100) {
    525                     GST_DEBUG("[Buffering] Complete.");
    526                     m_buffering = false;
    527                     m_readyState = MediaPlayer::HaveEnoughData;
    528                     GST_DEBUG("m_readyState=%s", dumpReadyState(m_readyState));
    529                     m_networkState = m_downloadFinished ? MediaPlayer::Idle : MediaPlayer::Loading;
    530                 } else {
    531                     m_readyState = MediaPlayer::HaveCurrentData;
    532                     GST_DEBUG("m_readyState=%s", dumpReadyState(m_readyState));
    533                     m_networkState = MediaPlayer::Loading;
    534                 }
    535             } else if (m_downloadFinished) {
    536                 m_readyState = MediaPlayer::HaveEnoughData;
    537                 GST_DEBUG("m_readyState=%s", dumpReadyState(m_readyState));
    538                 m_networkState = MediaPlayer::Loaded;
    539523            } else {
    540                 m_readyState = MediaPlayer::HaveFutureData;
     524                if (m_readyState < MediaPlayer::HaveFutureData)
     525                    m_readyState = MediaPlayer::HaveFutureData;
    541526                GST_DEBUG("m_readyState=%s", dumpReadyState(m_readyState));
    542527                m_networkState = MediaPlayer::Loading;
     
    560545            }
    561546
    562             if (!seeking() && !m_buffering && !m_paused && m_playbackRate) {
     547            if (!seeking() && !m_paused && m_playbackRate) {
    563548                GST_DEBUG("[Buffering] Restarting playback.");
    564549                changePipelineState(GST_STATE_PLAYING);
     
    567552            m_paused = false;
    568553
    569             if ((m_buffering && !isLiveStream()) || !m_playbackRate) {
     554            if (!m_playbackRate) {
    570555                GST_DEBUG("[Buffering] Pausing stream for buffering.");
    571556                changePipelineState(GST_STATE_PAUSED);
Note: See TracChangeset for help on using the changeset viewer.