Changeset 70814 in webkit
- Timestamp:
- Oct 28, 2010 2:46:48 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r70813 r70814 1 2010-10-28 Eric Carlson <eric.carlson@apple.com> 2 3 Reviewed by Adam Roben. 4 5 Seeking by very small increment doesn't generate 'seeked' event 6 https://bugs.webkit.org/show_bug.cgi?id=48530 7 8 * media/video-seek-by-small-increment-expected.txt: Added. 9 * media/video-seek-by-small-increment.html: Added. 10 1 11 2010-10-28 David Hyatt <hyatt@apple.com> 2 12 -
trunk/WebCore/ChangeLog
r70813 r70814 1 2010-10-28 Eric Carlson <eric.carlson@apple.com> 2 3 Reviewed by Adam Roben. 4 5 Seeking by very small increment doesn't generate 'seeked' event 6 https://bugs.webkit.org/show_bug.cgi?id=48530 7 8 Test: media/video-seek-by-small-increment.html 9 10 * html/HTMLMediaElement.cpp: 11 (WebCore::HTMLMediaElement::seek): Ask the media engine for its closest time value so we can 12 avoid asking it to seek to the current time. 13 14 * platform/graphics/MediaPlayer.cpp: 15 (WebCore::MediaPlayer::mediaTimeForTimeValue): New. 16 * platform/graphics/MediaPlayer.h: 17 * platform/graphics/MediaPlayerPrivate.h: 18 (WebCore::MediaPlayerPrivateInterface::mediaTimeForTimeValue): Ditto. 19 20 * platform/graphics/mac/MediaPlayerPrivateQTKit.h: 21 * platform/graphics/mac/MediaPlayerPrivateQTKit.mm: 22 (WebCore::MediaPlayerPrivate::mediaTimeForTimeValue): Return the closest value in the movie's time scale. 23 24 * platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp: 25 (WebCore::MediaPlayerPrivateQuickTimeVisualContext::mediaTimeForTimeValue): Ditto 26 * platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.h: 27 28 * platform/graphics/win/QTMovie.cpp: 29 (QTMovie::timeScale): Return the movie's time scale. 30 * platform/graphics/win/QTMovie.h: 31 1 32 2010-10-28 David Hyatt <hyatt@apple.com> 2 33 -
trunk/WebCore/html/HTMLMediaElement.cpp
r70065 r70814 1114 1114 time = max(time, earliestTime); 1115 1115 1116 // Ask the media engine for the time value in the movie's time scale before comparing with current time. This 1117 // is necessary because if the seek time is not equal to currentTime but the delta is less than the movie's 1118 // time scale, we will ask the media engine to "seek" to the current movie time, which may be a noop and 1119 // not generate a timechanged callback. This means m_seeking will never be cleared and we will never 1120 // fire a 'seeked' event. 1121 #if !LOG_DISABLED 1122 float mediaTime = m_player->mediaTimeForTimeValue(time); 1123 if (time != mediaTime) 1124 LOG(Media, "HTMLMediaElement::seek(%f) - media timeline equivalent is %f", time, mediaTime); 1125 #endif 1126 time = m_player->mediaTimeForTimeValue(time); 1127 1116 1128 // 7 - If the (possibly now changed) new playback position is not in one of the ranges given in the 1117 1129 // seekable attribute, then let it be the position in one of the ranges given in the seekable attribute -
trunk/WebCore/platform/graphics/MediaPlayer.cpp
r68526 r70814 644 644 } 645 645 646 float MediaPlayer::mediaTimeForTimeValue(float timeValue) const 647 { 648 return m_private->mediaTimeForTimeValue(timeValue); 649 } 650 646 651 // Client callbacks. 647 652 void MediaPlayer::networkStateChanged() -
trunk/WebCore/platform/graphics/MediaPlayer.h
r66961 r70814 275 275 bool hasSingleSecurityOrigin() const; 276 276 277 float mediaTimeForTimeValue(float) const; 278 277 279 private: 278 280 MediaPlayer(MediaPlayerClient*); -
trunk/WebCore/platform/graphics/MediaPlayerPrivate.h
r65021 r70814 126 126 virtual void prepareForRendering() { } 127 127 128 // Time value in the movie's time scale. It is only necessary to override this if the media 129 // engine uses rational numbers to represent media time. 130 virtual float mediaTimeForTimeValue(float timeValue) const { return timeValue; } 131 128 132 }; 129 133 -
trunk/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.h
r64884 r70814 174 174 bool isReadyForVideoSetup() const; 175 175 176 virtual float mediaTimeForTimeValue(float) const; 177 176 178 MediaPlayer* m_player; 177 179 RetainPtr<QTMovie> m_qtMovie; -
trunk/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm
r66652 r70814 1541 1541 } 1542 1542 1543 float MediaPlayerPrivate::mediaTimeForTimeValue(float timeValue) const 1544 { 1545 if (!metaDataAvailable()) 1546 return timeValue; 1547 1548 QTTime qttime = createQTTime(timeValue); 1549 return static_cast<float>(qttime.timeValue) / qttime.timeScale; 1550 } 1551 1543 1552 } // namespace WebCore 1544 1553 -
trunk/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp
r70641 r70814 1054 1054 } 1055 1055 1056 float MediaPlayerPrivateQuickTimeVisualContext::mediaTimeForTimeValue(float timeValue) const 1057 { 1058 long timeScale; 1059 if (m_readyState < MediaPlayer::HaveMetadata || !(timeScale = m_movie->timeScale())) 1060 return timeValue; 1061 1062 long mediaTimeValue = static_cast<long>(timeValue * timeScale); 1063 return static_cast<float>(mediaTimeValue) / timeScale; 1064 } 1065 1056 1066 MediaPlayerPrivateQuickTimeVisualContext::MediaRenderingMode MediaPlayerPrivateQuickTimeVisualContext::currentRenderingMode() const 1057 1067 { -
trunk/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.h
r70252 r70814 174 174 void retrieveAndResetMovieTransform(); 175 175 176 virtual float mediaTimeForTimeValue(float) const; 177 176 178 MediaPlayer* m_player; 177 179 RefPtr<QTMovie> m_movie; -
trunk/WebCore/platform/graphics/win/QTMovie.cpp
r67330 r70814 739 739 } 740 740 741 long QTMovie::timeScale() const 742 { 743 if (!m_private->m_movie) 744 return 0; 745 746 return GetMovieTimeScale(m_private->m_movie); 747 } 748 741 749 static void initializeSupportedTypes() 742 750 { -
trunk/WebCore/platform/graphics/win/QTMovie.h
r67330 r70814 116 116 Movie getMovieHandle() const; 117 117 118 long timeScale() const; 119 118 120 private: 119 121 QTMoviePrivate* m_private;
Note: See TracChangeset
for help on using the changeset viewer.