Changeset 152391 in webkit


Ignore:
Timestamp:
Jul 4, 2013 12:44:16 AM (11 years ago)
Author:
kbalazs@webkit.org
Message:

[GStreamer] support preload="metadata"
https://bugs.webkit.org/show_bug.cgi?id=116817

Reviewed by Eric Carlson.

Source/WebCore:

Add appropriate behavior for preload="metadata". Delay enabling download buffering
until playback is started in this case. This behavior fits with the standard quite
well and this is the most exact match we can get (at least without adding too much
extra complexity). What matters mostly is that we can avoid loading the media
before playback but we have the first frame and the metadata.

Test: media/video-load-preload-metadata.html

  • platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:

(WebCore::MediaPlayerPrivateGStreamer::prepareToPlay): Set |m_preload| to |Auto|
so we will start download buffering if we did not start it yet.
(WebCore::MediaPlayerPrivateGStreamer::play): Ditto.
(MediaPlayerPrivateGStreamer::setDownloadBuffering): Only start download
buffering if |m_preload == Auto|. Also make sure we don't clear the download
flag once we started downloading because it would result in not well defined
behavior and it does not really makes sense.
(MediaPlayerPrivateGStreamer::setPreload): Set download buffering accordingly.

LayoutTests:

  • media/video-load-preload-metadata.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r152388 r152391  
     12013-07-04  Balazs Kelemen  <b.kelemen@samsung.com>
     2
     3        [GStreamer] support preload="metadata"
     4        https://bugs.webkit.org/show_bug.cgi?id=116817
     5
     6        Reviewed by Eric Carlson.
     7
     8        * media/video-load-preload-metadata.html: Added.
     9
    1102013-07-03  Chris Fleizach  <cfleizach@apple.com>
    211
  • trunk/Source/WebCore/ChangeLog

    r152390 r152391  
     12013-07-04  Balazs Kelemen  <b.kelemen@samsung.com>
     2
     3        [GStreamer] support preload="metadata"
     4        https://bugs.webkit.org/show_bug.cgi?id=116817
     5
     6        Reviewed by Eric Carlson.
     7
     8        Add appropriate behavior for preload="metadata". Delay enabling download buffering
     9        until playback is started in this case. This behavior fits with the standard quite
     10        well and this is the most exact match we can get (at least without adding too much
     11        extra complexity). What matters mostly is that we can avoid loading the media
     12        before playback but we have the first frame and the metadata.
     13
     14        Test: media/video-load-preload-metadata.html
     15
     16        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
     17        (WebCore::MediaPlayerPrivateGStreamer::prepareToPlay): Set |m_preload| to |Auto|
     18        so we will start download buffering if we did not start it yet.
     19        (WebCore::MediaPlayerPrivateGStreamer::play): Ditto.
     20        (MediaPlayerPrivateGStreamer::setDownloadBuffering): Only start download
     21        buffering if |m_preload == Auto|. Also make sure we don't clear the download
     22        flag once we started downloading because it would result in not well defined
     23        behavior and it does not really makes sense.
     24        (MediaPlayerPrivateGStreamer::setPreload): Set download buffering accordingly.
     25
    1262013-07-03  Jae Hyun Park  <jae.park@company100.net>
    227
  • trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp

    r151797 r152391  
    397397void MediaPlayerPrivateGStreamer::prepareToPlay()
    398398{
     399    m_preload = MediaPlayer::Auto;
    399400    if (m_delayingLoad) {
    400401        m_delayingLoad = false;
     
    408409        m_isEndReached = false;
    409410        m_delayingLoad = false;
     411        m_preload = MediaPlayer::Auto;
    410412        setDownloadBuffering();
    411413        LOG_MEDIA_MESSAGE("Play");
     
    10821084            m_resetPipeline = true;
    10831085            m_mediaDuration = 0;
    1084         } else
     1086        } else {
     1087            m_resetPipeline = false;
    10851088            cacheDuration();
     1089        }
    10861090
    10871091        bool didBuffering = m_buffering;
     
    15181522    GstPlayFlags flags;
    15191523    g_object_get(m_playBin.get(), "flags", &flags, NULL);
    1520     bool shouldDownload = !isLiveStream();
     1524
     1525    // We don't want to stop downloading if we already started it.
     1526    if (flags & GST_PLAY_FLAG_DOWNLOAD && m_readyState > MediaPlayer::HaveNothing && !m_resetPipeline)
     1527        return;
     1528
     1529    bool shouldDownload = !isLiveStream() && m_preload == MediaPlayer::Auto;
    15211530    if (shouldDownload) {
    15221531        LOG_MEDIA_MESSAGE("Enabling on-disk buffering");
     
    15361545
    15371546    m_preload = preload;
     1547    setDownloadBuffering();
    15381548
    15391549    if (m_delayingLoad && m_preload != MediaPlayer::None) {
Note: See TracChangeset for help on using the changeset viewer.