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

eric.carlson at apple.com eric.carlson at apple.com
Wed Dec 22 15:20:33 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 501c3c946b90df2a524d225e65793e9fc6914c7b
Author: eric.carlson at apple.com <eric.carlson at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Nov 1 18:18:43 2010 +0000

    2010-11-01  Eric Carlson  <eric.carlson at apple.com>
    
            Reviewed by Adam Roben.
    
            Seeking by very small increment doesn't generate 'seeked' event
            https://bugs.webkit.org/show_bug.cgi?id=48530
    
            Test: media/video-seek-by-small-increment.html
    
            * html/HTMLMediaElement.cpp:
            (WebCore::HTMLMediaElement::seek): Ask the media engine for its closest time value so we can
            avoid asking it to seek to the current time.
    
            * platform/graphics/MediaPlayer.cpp:
            (WebCore::MediaPlayer::mediaTimeForTimeValue): New.
            * platform/graphics/MediaPlayer.h:
            * platform/graphics/MediaPlayerPrivate.h:
            (WebCore::MediaPlayerPrivateInterface::mediaTimeForTimeValue): Ditto.
    
            * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
            * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
            (WebCore::MediaPlayerPrivate::mediaTimeForTimeValue): Return the closest value in the movie's time scale.
    
            * platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp:
            (WebCore::MediaPlayerPrivateQuickTimeVisualContext::mediaTimeForTimeValue): Ditto
            * platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.h:
    
            * platform/graphics/win/QTMovie.cpp:
            (QTMovie::timeScale): Return the movie's time scale.
            * platform/graphics/win/QTMovie.h:
    
    2010-11-01  Eric Carlson  <eric.carlson at apple.com>
    
            Reviewed by Adam Roben.
    
            Seeking by very small increment doesn't generate 'seeked' event
            https://bugs.webkit.org/show_bug.cgi?id=48530
    
            * media/video-seek-by-small-increment-expected.txt: Added.
            * media/video-seek-by-small-increment.html: Added.
    
            * platform/qt/Skipped: Skip new test as it fails.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@71039 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index ac1aad7..c57a031 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,15 @@
+2010-11-01  Eric Carlson  <eric.carlson at apple.com>
+
+        Reviewed by Adam Roben.
+
+        Seeking by very small increment doesn't generate 'seeked' event
+        https://bugs.webkit.org/show_bug.cgi?id=48530
+
+        * media/video-seek-by-small-increment-expected.txt: Added.
+        * media/video-seek-by-small-increment.html: Added.
+
+        * platform/qt/Skipped: Skip new test as it fails (http://webkit.org/b/48617).
+
 2010-11-01  Mihai Parparita  <mihaip at chromium.org>
         
         Update the pixel expectations for fast/block/margin-collapse for the Mac port.
diff --git a/LayoutTests/media/video-seek-by-small-increment-expected.txt b/LayoutTests/media/video-seek-by-small-increment-expected.txt
new file mode 100644
index 0000000..1370458
--- /dev/null
+++ b/LayoutTests/media/video-seek-by-small-increment-expected.txt
@@ -0,0 +1,38 @@
+Test seeking by very small increments.
+
+EVENT(canplaythrough)
+
+** Seeking by 0.0004
+EVENT(seeking)
+EVENT(seeked)
+
+** Seeking by 0.0002
+EVENT(seeking)
+EVENT(seeked)
+
+** Seeking by 0.0001
+EVENT(seeking)
+EVENT(seeked)
+
+** Seeking by 0.00005
+EVENT(seeking)
+EVENT(seeked)
+
+** Seeking by 0.000025
+EVENT(seeking)
+EVENT(seeked)
+
+** Seeking by 0.0000125
+EVENT(seeking)
+EVENT(seeked)
+
+** Seeking by 0.00000625
+EVENT(seeking)
+EVENT(seeked)
+
+** Seeking by 0.000003125
+EVENT(seeking)
+EVENT(seeked)
+
+END OF TEST
+
diff --git a/LayoutTests/media/video-seek-by-small-increment.html b/LayoutTests/media/video-seek-by-small-increment.html
new file mode 100644
index 0000000..12aa8dd
--- /dev/null
+++ b/LayoutTests/media/video-seek-by-small-increment.html
@@ -0,0 +1,58 @@
+<!DOCTYPE HTML>
+<html>
+    <head>
+        <script src=media-file.js></script>
+        <script src=video-test.js></script>
+
+        <script>
+            var seekedEventCount = 0;
+            var increment = 0;
+
+            function seekIncrement()
+            {
+                // We want to verify that seeking by an increment smaller than the test movie's time scale
+                // (the smallest unit of time in that file) succeeds. test.mp4 has a time scale of 2500, 
+                // 0.0004 seconds, so start with that and decrease by half each time.
+                if (!increment)
+                    increment = 0.0004;
+                else
+                    increment /= 2;
+                return increment;
+            }
+
+            function seeked()
+            {
+                if (++seekedEventCount == 8) {
+                    consoleWrite("");
+                    endTest();
+                    return;
+                }
+                attemptSeek();
+            }
+
+            function attemptSeek()
+            {
+                var increment = seekIncrement();
+                consoleWrite("<br>** Seeking by " + increment);
+                video.currentTime += increment;
+            }
+
+            function start()
+            {
+                findMediaElement();
+                video.src = findMediaFile("video", "content/test");
+
+                waitForEvent('canplaythrough', attemptSeek);
+                waitForEvent('seeked', seeked);
+                waitForEvent('seeking');
+                waitForEvent('play');
+                waitForEvent('pause');
+            }
+        </script>
+    </head>
+    <body>
+        <video controls></video>
+        <p>Test seeking by very small increments.</p>
+        <script>start()</script>
+    </body>
+</html>
diff --git a/LayoutTests/platform/qt/Skipped b/LayoutTests/platform/qt/Skipped
index 5b52ed6..3c72739 100644
--- a/LayoutTests/platform/qt/Skipped
+++ b/LayoutTests/platform/qt/Skipped
@@ -678,6 +678,9 @@ media/video-does-not-loop.html
 # https://bugs.webkit.org/show_bug.cgi?id=45093
 media/media-can-play-mpeg4-video.html
 
+# https://bugs.webkit.org/show_bug.cgi?id=48617
+media/video-seek-by-small-increment.html
+
 # ============================================================================= #
 # Crashing tests due to re-enabled Phonon support in Buildbot's Qt              #
 # Skip these until a proper solution for the Phonon related crashes found.      #
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index aa76371..ea759e2 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,34 @@
+2010-11-01  Eric Carlson  <eric.carlson at apple.com>
+
+        Reviewed by Adam Roben.
+
+        Seeking by very small increment doesn't generate 'seeked' event
+        https://bugs.webkit.org/show_bug.cgi?id=48530
+
+        Test: media/video-seek-by-small-increment.html
+
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::seek): Ask the media engine for its closest time value so we can
+        avoid asking it to seek to the current time.
+
+        * platform/graphics/MediaPlayer.cpp:
+        (WebCore::MediaPlayer::mediaTimeForTimeValue): New.
+        * platform/graphics/MediaPlayer.h:
+        * platform/graphics/MediaPlayerPrivate.h:
+        (WebCore::MediaPlayerPrivateInterface::mediaTimeForTimeValue): Ditto.
+
+        * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
+        * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
+        (WebCore::MediaPlayerPrivate::mediaTimeForTimeValue): Return the closest value in the movie's time scale.
+
+        * platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp:
+        (WebCore::MediaPlayerPrivateQuickTimeVisualContext::mediaTimeForTimeValue): Ditto
+        * platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.h:
+
+        * platform/graphics/win/QTMovie.cpp:
+        (QTMovie::timeScale): Return the movie's time scale.
+        * platform/graphics/win/QTMovie.h:
+
 2010-11-01  Pavel Feldman  <pfeldman at chromium.org>
 
         Not reviewed: Chromium build fix. Adding missing transitive dependency.
diff --git a/WebCore/html/HTMLMediaElement.cpp b/WebCore/html/HTMLMediaElement.cpp
index daabc27..30bd31d 100644
--- a/WebCore/html/HTMLMediaElement.cpp
+++ b/WebCore/html/HTMLMediaElement.cpp
@@ -1113,6 +1113,18 @@ void HTMLMediaElement::seek(float time, ExceptionCode& ec)
     float earliestTime = m_player->startTime();
     time = max(time, earliestTime);
 
+    // Ask the media engine for the time value in the movie's time scale before comparing with current time. This
+    // is necessary because if the seek time is not equal to currentTime but the delta is less than the movie's
+    // time scale, we will ask the media engine to "seek" to the current movie time, which may be a noop and
+    // not generate a timechanged callback. This means m_seeking will never be cleared and we will never 
+    // fire a 'seeked' event.
+#if !LOG_DISABLED
+    float mediaTime = m_player->mediaTimeForTimeValue(time);
+    if (time != mediaTime)
+        LOG(Media, "HTMLMediaElement::seek(%f) - media timeline equivalent is %f", time, mediaTime);
+#endif
+    time = m_player->mediaTimeForTimeValue(time);
+
     // 7 - If the (possibly now changed) new playback position is not in one of the ranges given in the 
     // seekable attribute, then let it be the position in one of the ranges given in the seekable attribute 
     // that is the nearest to the new playback position. ... If there are no ranges given in the seekable
diff --git a/WebCore/platform/graphics/MediaPlayer.cpp b/WebCore/platform/graphics/MediaPlayer.cpp
index 2a9e64e..4e3e88e 100644
--- a/WebCore/platform/graphics/MediaPlayer.cpp
+++ b/WebCore/platform/graphics/MediaPlayer.cpp
@@ -643,6 +643,11 @@ MediaPlayer::MovieLoadType MediaPlayer::movieLoadType() const
     return m_private->movieLoadType();
 }
 
+float MediaPlayer::mediaTimeForTimeValue(float timeValue) const
+{
+    return m_private->mediaTimeForTimeValue(timeValue);
+}
+
 // Client callbacks.
 void MediaPlayer::networkStateChanged()
 {
diff --git a/WebCore/platform/graphics/MediaPlayer.h b/WebCore/platform/graphics/MediaPlayer.h
index c2d0a00..150c6ca 100644
--- a/WebCore/platform/graphics/MediaPlayer.h
+++ b/WebCore/platform/graphics/MediaPlayer.h
@@ -274,6 +274,8 @@ public:
 
     bool hasSingleSecurityOrigin() const;
 
+    float mediaTimeForTimeValue(float) const;
+
 private:
     MediaPlayer(MediaPlayerClient*);
 
diff --git a/WebCore/platform/graphics/MediaPlayerPrivate.h b/WebCore/platform/graphics/MediaPlayerPrivate.h
index a8d9b86..6a74714 100644
--- a/WebCore/platform/graphics/MediaPlayerPrivate.h
+++ b/WebCore/platform/graphics/MediaPlayerPrivate.h
@@ -125,6 +125,10 @@ public:
 
     virtual void prepareForRendering() { }
 
+    // Time value in the movie's time scale. It is only necessary to override this if the media
+    // engine uses rational numbers to represent media time.
+    virtual float mediaTimeForTimeValue(float timeValue) const { return timeValue; }
+
 };
 
 }
diff --git a/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.h b/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.h
index 3895a00..876bc16 100644
--- a/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.h
+++ b/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.h
@@ -173,6 +173,8 @@ private:
 
     bool isReadyForVideoSetup() const;
     
+    virtual float mediaTimeForTimeValue(float) const;
+
     MediaPlayer* m_player;
     RetainPtr<QTMovie> m_qtMovie;
     RetainPtr<QTMovieView> m_qtMovieView;
diff --git a/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm b/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm
index 7b0e7af..06c7924 100644
--- a/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm
+++ b/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm
@@ -1540,6 +1540,15 @@ void MediaPlayerPrivate::setPreload(MediaPlayer::Preload preload)
         resumeLoad();
 }
 
+float MediaPlayerPrivate::mediaTimeForTimeValue(float timeValue) const
+{
+    if (!metaDataAvailable())
+        return timeValue;
+
+    QTTime qttime = createQTTime(timeValue);
+    return static_cast<float>(qttime.timeValue) / qttime.timeScale;
+}
+
 } // namespace WebCore
 
 @implementation WebCoreMovieObserver
diff --git a/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp b/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp
index 5544229..34a8817 100644
--- a/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp
+++ b/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp
@@ -1053,6 +1053,16 @@ void MediaPlayerPrivateQuickTimeVisualContext::setPreload(MediaPlayer::Preload p
         resumeLoad();
 }
 
+float MediaPlayerPrivateQuickTimeVisualContext::mediaTimeForTimeValue(float timeValue) const
+{
+    long timeScale;
+    if (m_readyState < MediaPlayer::HaveMetadata || !(timeScale = m_movie->timeScale()))
+        return timeValue;
+
+    long mediaTimeValue = static_cast<long>(timeValue * timeScale);
+    return static_cast<float>(mediaTimeValue) / timeScale;
+}
+
 MediaPlayerPrivateQuickTimeVisualContext::MediaRenderingMode MediaPlayerPrivateQuickTimeVisualContext::currentRenderingMode() const
 {
     if (!m_movie)
diff --git a/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.h b/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.h
index 109fd0b..43d5bd5 100644
--- a/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.h
+++ b/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.h
@@ -173,6 +173,8 @@ private:
 
     void retrieveAndResetMovieTransform();
 
+    virtual float mediaTimeForTimeValue(float) const;
+
     MediaPlayer* m_player;
     RefPtr<QTMovie> m_movie;
 #if USE(ACCELERATED_COMPOSITING)
diff --git a/WebCore/platform/graphics/win/QTMovie.cpp b/WebCore/platform/graphics/win/QTMovie.cpp
index 375d8c2..e425bf8 100644
--- a/WebCore/platform/graphics/win/QTMovie.cpp
+++ b/WebCore/platform/graphics/win/QTMovie.cpp
@@ -738,6 +738,14 @@ void QTMovie::setClosedCaptionsVisible(bool visible)
     QTSetTrackProperty(ccTrack, closedCaptionTrackType, closedCaptionDisplayPropertyID, sizeof(doDisplay), &doDisplay);
 }
 
+long QTMovie::timeScale() const 
+{
+    if (!m_private->m_movie)
+        return 0;
+
+    return GetMovieTimeScale(m_private->m_movie);
+}
+
 static void initializeSupportedTypes() 
 {
     if (gSupportedTypes)
diff --git a/WebCore/platform/graphics/win/QTMovie.h b/WebCore/platform/graphics/win/QTMovie.h
index e205b68..5e4c4e7 100644
--- a/WebCore/platform/graphics/win/QTMovie.h
+++ b/WebCore/platform/graphics/win/QTMovie.h
@@ -115,6 +115,8 @@ public:
 
     Movie getMovieHandle() const;
 
+    long timeScale() const;
+
 private:
     QTMoviePrivate* m_private;
     friend class QTMoviePrivate;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list