[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:22:29 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit a13ca18a1f689ed7f32634f8c24f434bab321f8e
Author: kov at webkit.org <kov at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Mar 15 15:20:22 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@55995 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index cf845ba..f4d32f6 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,14 @@
+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
+
+        Unskip the test that now passes.
+
+        * platform/gtk/Skipped:
+
 2010-03-15  Shu Chang  <Chang.Shu at nokia.com>
 
         Reviewed by Holger Freyther.
diff --git a/LayoutTests/platform/gtk/Skipped b/LayoutTests/platform/gtk/Skipped
index 1f021ea..bfac55e 100644
--- a/LayoutTests/platform/gtk/Skipped
+++ b/LayoutTests/platform/gtk/Skipped
@@ -5808,9 +5808,6 @@ fast/dom/Geolocation/permission-denied-already-success.html
 fast/dom/Geolocation/permission-denied-stops-watches.html
 fast/dom/Geolocation/permission-denied.html
 
-# https://bugs.webkit.org/show_bug.cgi?id=35793
-media/video-preload.html
-
 # https://bugs.webkit.org/show_bug.cgi?id=35824 - Doesn't apply to platforms that don't enforce the CFNetwork-style 3rd party cookie policy
 http/tests/cookies/third-party-cookie-relaxing.html
 
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 3de22e1..c769cf8 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-15  Shu Chang  <Chang.Shu at nokia.com>
 
         Reviewed by Holger Freyther.
diff --git a/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp b/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
index d07e43a..861ab8e 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,7 +370,26 @@ MediaPlayerPrivate::~MediaPlayerPrivate()
 
 void MediaPlayerPrivate::load(const String& url)
 {
+    g_object_set(m_playBin, "uri", url.utf8().data(), NULL);
+
     LOG_VERBOSE(Media, "Load %s", url.utf8().data());
+
+    if (m_preload == MediaPlayer::None) {
+        LOG_VERBOSE(Media, "Delaying load.");
+        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, "Committing load.");
     if (m_networkState != MediaPlayer::Loading) {
         m_networkState = MediaPlayer::Loading;
         m_player->networkStateChanged();
@@ -377,12 +398,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 +419,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))
@@ -1366,12 +1389,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