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

philn at webkit.org philn at webkit.org
Thu Apr 8 01:05:31 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit d293189a6956b27c2cf3a9fcbf1fdbab2c91ad1d
Author: philn at webkit.org <philn at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Jan 14 11:40:18 2010 +0000

    2009-12-09  Philippe Normand  <pnormand at igalia.com>
    
            Reviewed by Xan Lopez.
    
            [GStreamer] Check return values of gst_element_set_state()
            https://bugs.webkit.org/show_bug.cgi?id=30000
    
            Check for state change failure when going from READY/NULL to
            PAUSED or PLAYING. Also refactored the common code of play() and
            pause() to a new private method of the player.
    
            * platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp:
            (WebCore::MediaPlayerPrivate::changePipelineState):
            (WebCore::MediaPlayerPrivate::play):
            (WebCore::MediaPlayerPrivate::pause):
            * platform/graphics/gtk/MediaPlayerPrivateGStreamer.h:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@53255 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index fc3f30f..be74adf 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,20 @@
+2009-12-09  Philippe Normand  <pnormand at igalia.com>
+
+        Reviewed by Xan Lopez.
+
+        [GStreamer] Check return values of gst_element_set_state()
+        https://bugs.webkit.org/show_bug.cgi?id=30000
+
+        Check for state change failure when going from READY/NULL to
+        PAUSED or PLAYING. Also refactored the common code of play() and
+        pause() to a new private method of the player.
+
+        * platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp:
+        (WebCore::MediaPlayerPrivate::changePipelineState):
+        (WebCore::MediaPlayerPrivate::play):
+        (WebCore::MediaPlayerPrivate::pause):
+        * platform/graphics/gtk/MediaPlayerPrivateGStreamer.h:
+
 2010-01-14  Eric Seidel  <eric at webkit.org>
 
         No review, rolling out r53248.
diff --git a/WebCore/platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp b/WebCore/platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp
index 4bcfb69..b99bd26 100644
--- a/WebCore/platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp
+++ b/WebCore/platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp
@@ -142,6 +142,7 @@ static float playbackPosition(GstElement* playbin)
     return ret;
 }
 
+
 void mediaPlayerPrivateRepaintCallback(WebKitVideoSink*, GstBuffer *buffer, MediaPlayerPrivate* playerPrivate)
 {
     g_return_if_fail(GST_IS_BUFFER(buffer));
@@ -259,28 +260,35 @@ void MediaPlayerPrivate::load(const String& url)
     pause();
 }
 
-void MediaPlayerPrivate::play()
+bool MediaPlayerPrivate::changePipelineState(GstState newState)
 {
-    GstState state;
+    ASSERT(newState == GST_STATE_PLAYING || newState == GST_STATE_PAUSED);
+
+    GstState currentState;
     GstState pending;
 
-    gst_element_get_state(m_playBin, &state, &pending, 0);
-    if (state != GST_STATE_PLAYING && pending != GST_STATE_PLAYING) {
-        LOG_VERBOSE(Media, "Play");
-        gst_element_set_state(m_playBin, GST_STATE_PLAYING);
+    gst_element_get_state(m_playBin, &currentState, &pending, 0);
+    if (currentState != newState && pending != newState) {
+        GstStateChangeReturn ret = gst_element_set_state(m_playBin, newState);
+        GstState pausedOrPlaying = newState == GST_STATE_PLAYING ? GST_STATE_PAUSED : GST_STATE_PLAYING;
+        if (currentState != pausedOrPlaying && ret == GST_STATE_CHANGE_FAILURE) {
+            loadingFailed(MediaPlayer::Empty);
+            return false;
+        }
     }
+    return true;
 }
 
-void MediaPlayerPrivate::pause()
+void MediaPlayerPrivate::play()
 {
-    GstState state;
-    GstState pending;
+    if (changePipelineState(GST_STATE_PLAYING))
+        LOG_VERBOSE(Media, "Play");
+}
 
-    gst_element_get_state(m_playBin, &state, &pending, 0);
-    if (state != GST_STATE_PAUSED  && pending != GST_STATE_PAUSED) {
+void MediaPlayerPrivate::pause()
+{
+    if (changePipelineState(GST_STATE_PAUSED))
         LOG_VERBOSE(Media, "Pause");
-        gst_element_set_state(m_playBin, GST_STATE_PAUSED);
-    }
 }
 
 float MediaPlayerPrivate::duration() const
diff --git a/WebCore/platform/graphics/gtk/MediaPlayerPrivateGStreamer.h b/WebCore/platform/graphics/gtk/MediaPlayerPrivateGStreamer.h
index 917c253..9043fa9 100644
--- a/WebCore/platform/graphics/gtk/MediaPlayerPrivateGStreamer.h
+++ b/WebCore/platform/graphics/gtk/MediaPlayerPrivateGStreamer.h
@@ -120,6 +120,7 @@ class MediaPlayerPrivate : public MediaPlayerPrivateInterface {
             void startEndPointTimerIfNeeded();
 
             void createGSTPlayBin(String url);
+            bool changePipelineState(GstState state);
 
         private:
             MediaPlayer* m_player;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list