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

eric at webkit.org eric at webkit.org
Wed Apr 7 23:07:43 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 9dac0bf5740d41104cf8826ed94fb466266db852
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Oct 27 02:42:48 2009 +0000

    2009-10-26  Benjamin Otte  <otte at gnome.org>
    
            Reviewed by Gustavo Noronha.
    
            Don't store properties in the MediaPlayerPrivate class
    
            Access them via the MediaPlayer class instead.
            https://bugs.webkit.org/show_bug.cgi?id=30462
    
            * platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp:
            (WebCore::MediaPlayerPrivate::MediaPlayerPrivate):
            (WebCore::MediaPlayerPrivate::seek):
            (WebCore::MediaPlayerPrivate::setVolume):
            (WebCore::MediaPlayerPrivate::setRate):
            (WebCore::MediaPlayerPrivate::setVisible):
            (WebCore::MediaPlayerPrivate::paint):
            (WebCore::MediaPlayerPrivate::createGSTPlayBin):
            * platform/graphics/gtk/MediaPlayerPrivateGStreamer.h:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@50122 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index b70af9f..a9b095a 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,22 @@
+2009-10-26  Benjamin Otte  <otte at gnome.org>
+
+        Reviewed by Gustavo Noronha.
+
+        Don't store properties in the MediaPlayerPrivate class
+
+        Access them via the MediaPlayer class instead.
+        https://bugs.webkit.org/show_bug.cgi?id=30462
+
+        * platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp:
+        (WebCore::MediaPlayerPrivate::MediaPlayerPrivate):
+        (WebCore::MediaPlayerPrivate::seek):
+        (WebCore::MediaPlayerPrivate::setVolume):
+        (WebCore::MediaPlayerPrivate::setRate):
+        (WebCore::MediaPlayerPrivate::setVisible):
+        (WebCore::MediaPlayerPrivate::paint):
+        (WebCore::MediaPlayerPrivate::createGSTPlayBin):
+        * platform/graphics/gtk/MediaPlayerPrivateGStreamer.h:
+
 2009-10-26  Brian Weinstein  <bweinstein at apple.com>
 
         Reviewed by Timothy Hatcher.
diff --git a/WebCore/platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp b/WebCore/platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp
index a32053b..8d1d261 100644
--- a/WebCore/platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp
+++ b/WebCore/platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp
@@ -132,15 +132,12 @@ MediaPlayerPrivate::MediaPlayerPrivate(MediaPlayer* player)
     , m_playBin(0)
     , m_videoSink(0)
     , m_source(0)
-    , m_rate(1.0f)
     , m_endTime(numeric_limits<float>::infinity())
-    , m_volume(0.5f)
     , m_networkState(MediaPlayer::Empty)
     , m_readyState(MediaPlayer::HaveNothing)
     , m_startedPlaying(false)
     , m_isStreaming(false)
     , m_size(IntSize())
-    , m_visible(true)
     , m_buffer(0)
     , m_paused(true)
     , m_seeking(false)
@@ -257,7 +254,7 @@ void MediaPlayerPrivate::seek(float time)
         return;
 
     LOG_VERBOSE(Media, "Seek: %" GST_TIME_FORMAT, GST_TIME_ARGS(sec));
-    if (!gst_element_seek( m_playBin, m_rate,
+    if (!gst_element_seek(m_playBin, m_player->rate(),
             GST_FORMAT_TIME,
             (GstSeekFlags)(GST_SEEK_FLAG_FLUSH),
             GST_SEEK_TYPE_SET, sec,
@@ -348,21 +345,10 @@ bool MediaPlayerPrivate::hasAudio() const
 
 void MediaPlayerPrivate::setVolume(float volume)
 {
-    m_volume = volume;
-    LOG_VERBOSE(Media, "Volume to %f", volume);
-
-    if (!m_playBin)
-        return;
-
-    g_object_set(G_OBJECT(m_playBin), "volume", m_volume, NULL);
-}
-
-void MediaPlayerPrivate::setMuted(bool mute)
-{
     if (!m_playBin)
         return;
 
-    g_object_set(G_OBJECT(m_playBin), "mute", mute, NULL);
+    g_object_set(G_OBJECT(m_playBin), "volume", static_cast<double>(volume), NULL);
 }
 
 void MediaPlayerPrivate::setRate(float rate)
@@ -375,7 +361,6 @@ void MediaPlayerPrivate::setRate(float rate)
     if (m_isStreaming)
         return;
 
-    m_rate = rate;
     LOG_VERBOSE(Media, "Set Rate to %f", rate);
     seek(currentTime());
 }
@@ -621,7 +606,6 @@ void MediaPlayerPrivate::setSize(const IntSize& size)
 
 void MediaPlayerPrivate::setVisible(bool visible)
 {
-    m_visible = visible;
 }
 
 void MediaPlayerPrivate::repaint()
@@ -634,7 +618,7 @@ void MediaPlayerPrivate::paint(GraphicsContext* context, const IntRect& rect)
     if (context->paintingDisabled())
         return;
 
-    if (!m_visible)
+    if (!m_player->visible())
         return;
     if (!m_buffer)
         return;
@@ -819,7 +803,8 @@ void MediaPlayerPrivate::createGSTPlayBin(String url)
     g_signal_connect(bus, "message", G_CALLBACK(mediaPlayerPrivateMessageCallback), this);
     gst_object_unref(bus);
 
-    g_object_set(G_OBJECT(m_playBin), "uri", url.utf8().data(), NULL);
+    g_object_set(G_OBJECT(m_playBin), "uri", url.utf8().data(),
+        "volume", static_cast<double>(m_player->volume()), NULL);
 
     m_videoSink = webkit_video_sink_new();
 
@@ -827,8 +812,6 @@ void MediaPlayerPrivate::createGSTPlayBin(String url)
     g_object_set(m_playBin, "video-sink", m_videoSink, NULL);
 
     g_signal_connect(m_videoSink, "repaint-requested", G_CALLBACK(mediaPlayerPrivateRepaintCallback), this);
-
-    setVolume(m_volume);
 }
 
 }
diff --git a/WebCore/platform/graphics/gtk/MediaPlayerPrivateGStreamer.h b/WebCore/platform/graphics/gtk/MediaPlayerPrivateGStreamer.h
index 10ee7dd..54da420 100644
--- a/WebCore/platform/graphics/gtk/MediaPlayerPrivateGStreamer.h
+++ b/WebCore/platform/graphics/gtk/MediaPlayerPrivateGStreamer.h
@@ -73,7 +73,6 @@ namespace WebCore {
 
             void setRate(float);
             void setVolume(float);
-            void setMuted(bool);
 
             int dataRate() const;
 
@@ -125,16 +124,13 @@ namespace WebCore {
             GstElement* m_playBin;
             GstElement* m_videoSink;
             GstElement* m_source;
-            float m_rate;
             float m_endTime;
             bool m_isEndReached;
-            double m_volume;
             MediaPlayer::NetworkState m_networkState;
             MediaPlayer::ReadyState m_readyState;
             bool m_startedPlaying;
             mutable bool m_isStreaming;
             IntSize m_size;
-            bool m_visible;
             GstBuffer* m_buffer;
 
             bool m_paused;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list