[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

vestbo at webkit.org vestbo at webkit.org
Wed Dec 22 12:12:58 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 1e4144b946e99400725a85d5a2ad7d2a2fe35722
Author: vestbo at webkit.org <vestbo at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Aug 17 12:15:04 2010 +0000

    [Qt] Pre-roll media when loading media elements
    
    Reviewed by Antonio Gomes.
    
    This ensures we get correct size-hints from QtMultimedia, as well as
    the media states Buffering and Buffered instead of Loading and Loaded,
    which we use to transition into MediaPlayer::HaveEnoughData.
    
    * platform/graphics/qt/MediaPlayerPrivateQt.cpp:
    * platform/graphics/qt/MediaPlayerPrivateQt.h:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@65494 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 2339919..67543fe 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,16 @@
+2010-08-17  Tor Arne Vestbø  <tor.arne.vestbo at nokia.com>
+
+        Reviewed by Antonio Gomes.
+
+        [Qt] Pre-roll media when loading media elements
+
+        This ensures we get correct size-hints from QtMultimedia, as well as
+        the media states Buffering and Buffered instead of Loading and Loaded,
+        which we use to transition into MediaPlayer::HaveEnoughData.
+
+        * platform/graphics/qt/MediaPlayerPrivateQt.cpp:
+        * platform/graphics/qt/MediaPlayerPrivateQt.h:
+
 2010-08-16  Tor Arne Vestbø  <tor.arne.vestbo at nokia.com>
 
         Reviewed by Kenneth Rohde Christiansen.
diff --git a/WebCore/platform/graphics/qt/MediaPlayerPrivateQt.cpp b/WebCore/platform/graphics/qt/MediaPlayerPrivateQt.cpp
index 525aaf4..dd0aad2 100644
--- a/WebCore/platform/graphics/qt/MediaPlayerPrivateQt.cpp
+++ b/WebCore/platform/graphics/qt/MediaPlayerPrivateQt.cpp
@@ -25,6 +25,7 @@
 #include "GraphicsContext.h"
 #include "HTMLMediaElement.h"
 #include "HTMLVideoElement.h"
+#include "NotImplemented.h"
 #include "TimeRanges.h"
 #include "Widget.h"
 #include "qwebframe.h"
@@ -106,6 +107,8 @@ MediaPlayerPrivate::MediaPlayerPrivate(MediaPlayer* player)
             this, SLOT(stateChanged(QMediaPlayer::State)));
     connect(m_mediaPlayer, SIGNAL(error(QMediaPlayer::Error)),
             this, SLOT(handleError(QMediaPlayer::Error)));
+    connect(m_mediaPlayer, SIGNAL(bufferStatusChanged(int)),
+            this, SLOT(bufferStatusChanged(int)));
     connect(m_mediaPlayer, SIGNAL(durationChanged(qint64)),
             this, SLOT(durationChanged(qint64)));
     connect(m_mediaPlayer, SIGNAL(positionChanged(qint64)),
@@ -208,6 +211,13 @@ void MediaPlayerPrivate::load(const String& url)
     // engine which does.
     m_mediaPlayer->setMuted(element->muted());
     m_mediaPlayer->setVolume(static_cast<int>(element->volume() * 100.0));
+
+    // Setting a media source will start loading the media, but we need
+    // to pre-roll as well to get video size-hints and buffer-status
+    if (element->paused())
+        m_mediaPlayer->pause();
+    else
+        m_mediaPlayer->play();
 }
 
 void MediaPlayerPrivate::cancelLoad()
@@ -322,24 +332,11 @@ float MediaPlayerPrivate::maxTimeSeekable() const
 
 unsigned MediaPlayerPrivate::bytesLoaded() const
 {
-    unsigned percentage = m_mediaPlayer->bufferStatus();
-
-    if (percentage == 100) {
-        if (m_networkState != MediaPlayer::Idle) {
-            m_networkState = MediaPlayer::Idle;
-            m_player->networkStateChanged();
-        }
-        if (m_readyState != MediaPlayer::HaveEnoughData) {
-            m_readyState = MediaPlayer::HaveEnoughData;
-            m_player->readyStateChanged();
-        }
-    }
-
     QLatin1String bytesLoadedKey("bytes-loaded");
     if (m_mediaPlayer->availableExtendedMetaData().contains(bytesLoadedKey))
         return m_mediaPlayer->extendedMetaData(bytesLoadedKey).toInt();
 
-    return percentage;
+    return m_mediaPlayer->bufferStatus();
 }
 
 unsigned MediaPlayerPrivate::totalBytes() const
@@ -439,6 +436,11 @@ void MediaPlayerPrivate::positionChanged(qint64)
     }
 }
 
+void MediaPlayerPrivate::bufferStatusChanged(int)
+{
+    notImplemented();
+}
+
 void MediaPlayerPrivate::durationChanged(qint64)
 {
     m_player->durationChanged();
diff --git a/WebCore/platform/graphics/qt/MediaPlayerPrivateQt.h b/WebCore/platform/graphics/qt/MediaPlayerPrivateQt.h
index d72404c..8c0e1dd 100644
--- a/WebCore/platform/graphics/qt/MediaPlayerPrivateQt.h
+++ b/WebCore/platform/graphics/qt/MediaPlayerPrivateQt.h
@@ -103,6 +103,7 @@ private slots:
     void seekTimeout();
     void positionChanged(qint64);
     void durationChanged(qint64);
+    void bufferStatusChanged(int);
     void volumeChanged(int);
     void mutedChanged(bool);
     void repaint();

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list