[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

kov at webkit.org kov at webkit.org
Thu Apr 8 02:21:13 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit df1a34bb26e19555e67caaf9ea6b84310c812e18
Author: kov at webkit.org <kov at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Mar 12 20:11:06 2010 +0000

    2010-03-12  Gustavo Noronha Silva  <gustavo.noronha at collabora.co.uk>
    
            Reviewed by Eric Carlson.
    
            media/video-preload.html fails
            https://bugs.webkit.org/show_bug.cgi?id=35793
    
            Only effectively load, and start buffering when playing, or when
            the preload attribute is set.
    
            Test: media/video-preload.html
    
            * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
            (WebCore::MediaPlayerPrivate::MediaPlayerPrivate):
            (WebCore::MediaPlayerPrivate::load):
            (WebCore::MediaPlayerPrivate::commitLoad):
            (WebCore::MediaPlayerPrivate::prepareToPlay):
            (WebCore::MediaPlayerPrivate::setPreload):
            * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55927 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index ccbf5dc..285292d 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,23 @@
+2010-03-12  Gustavo Noronha Silva  <gustavo.noronha at collabora.co.uk>
+
+        Reviewed by Eric Carlson.
+
+        media/video-preload.html fails
+        https://bugs.webkit.org/show_bug.cgi?id=35793
+
+        Only effectively load, and start buffering when playing, or when
+        the preload attribute is set.
+
+        Test: media/video-preload.html
+
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
+        (WebCore::MediaPlayerPrivate::MediaPlayerPrivate):
+        (WebCore::MediaPlayerPrivate::load):
+        (WebCore::MediaPlayerPrivate::commitLoad):
+        (WebCore::MediaPlayerPrivate::prepareToPlay):
+        (WebCore::MediaPlayerPrivate::setPreload):
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
+
 2010-03-12  Dmitry Titov  <dimich at chromium.org>
 
         Not reviewed, build fix.
diff --git a/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp b/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
index 2acf149..8fc2e3e 100644
--- a/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
+++ b/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
@@ -314,6 +314,8 @@ MediaPlayerPrivate::MediaPlayerPrivate(MediaPlayer* player)
     , m_fillTimeoutId(0)
     , m_maxTimeLoaded(0)
     , m_bufferingPercentage(0)
+    , m_preload(MediaPlayer::Auto)
+    , m_delayingLoad(false)
 {
     if (doGstInit())
         createGSTPlayBin();
@@ -368,6 +370,22 @@ MediaPlayerPrivate::~MediaPlayerPrivate()
 
 void MediaPlayerPrivate::load(const String& url)
 {
+    g_object_set(m_playBin, "uri", url.utf8().data(), NULL);
+
+    if (m_preload == MediaPlayer::None) {
+        m_delayingLoad = true;
+        return;
+    }
+
+    commitLoad();
+}
+
+void MediaPlayerPrivate::commitLoad()
+{
+    // GStreamer needs to have the pipeline set to a paused state to
+    // start providing anything useful.
+    gst_element_set_state(m_playBin, GST_STATE_PAUSED);
+
     LOG_VERBOSE(Media, "Load %s", url.utf8().data());
     if (m_networkState != MediaPlayer::Loading) {
         m_networkState = MediaPlayer::Loading;
@@ -377,12 +395,6 @@ void MediaPlayerPrivate::load(const String& url)
         m_readyState = MediaPlayer::HaveNothing;
         m_player->readyStateChanged();
     }
-
-    g_object_set(m_playBin, "uri", url.utf8().data(), NULL);
-
-    // GStreamer needs to have the pipeline set to a paused state to
-    // start providing anything useful.
-    gst_element_set_state(m_playBin, GST_STATE_PAUSED);
 }
 
 bool MediaPlayerPrivate::changePipelineState(GstState newState)
@@ -404,6 +416,14 @@ bool MediaPlayerPrivate::changePipelineState(GstState newState)
     return true;
 }
 
+void MediaPlayerPrivate::prepareToPlay()
+{
+    if (m_delayingLoad) {
+        m_delayingLoad = false;
+        commitLoad();
+    }
+}
+
 void MediaPlayerPrivate::play()
 {
     if (changePipelineState(GST_STATE_PLAYING))
@@ -1365,12 +1385,19 @@ void MediaPlayerPrivate::setPreload(MediaPlayer::Preload preload)
 {
     ASSERT(m_playBin);
 
+    m_preload = preload;
+
     GstPlayFlags flags;
     g_object_get(m_playBin, "flags", &flags, NULL);
     if (preload == MediaPlayer::None)
         g_object_set(m_playBin, "flags", flags & ~GST_PLAY_FLAG_DOWNLOAD, NULL);
     else
         g_object_set(m_playBin, "flags", flags | GST_PLAY_FLAG_DOWNLOAD, NULL);
+
+    if (m_delayingLoad && m_preload != MediaPlayer::None) {
+        m_delayingLoad = false;
+        commitLoad();
+    }
 }
 
 void MediaPlayerPrivate::createGSTPlayBin()
diff --git a/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h b/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h
index 8f3166e..9ec16a0 100644
--- a/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h
+++ b/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h
@@ -63,9 +63,11 @@ class MediaPlayerPrivate : public MediaPlayerPrivateInterface {
             bool hasAudio() const;
 
             void load(const String &url);
+            void commitLoad();
             void cancelLoad();
             bool loadNextLocation();
 
+            void prepareToPlay();
             void play();
             void pause();
 
@@ -167,6 +169,8 @@ class MediaPlayerPrivate : public MediaPlayerPrivateInterface {
             guint m_fillTimeoutId;
             float m_maxTimeLoaded;
             int m_bufferingPercentage;
+            MediaPlayer::Preload m_preload;
+            bool m_delayingLoad;
     };
 }
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list