Commit 7ef6838a authored by jer.noble@apple.com's avatar jer.noble@apple.com

2011-04-06 Jer Noble <jer.noble@apple.com>

        Reviewed by Eric Carlson.

        MediaPlayerPrivateAVFoundation does not change rate due to setRate().
        https://bugs.webkit.org/show_bug.cgi?id=57919

        * media/video-set-rate-from-pause-expected.txt: Added.
        * media/video-set-rate-from-pause.html: Added.
2011-04-06  Jer Noble  <jer.noble@apple.com>

        Reviewed by Eric Carlson.

        MediaPlayerPrivateAVFoundation does not change rate due to setRate().
        https://bugs.webkit.org/show_bug.cgi?id=57919

        Test: media/video-set-rate-from-pause.html

        The base class of MediaPlayerPrivateAVFoundation does not actually change the rate
        of the media; instead a subclass must do that work.  So when setRate() is called,
        inform a subclass through a new pure virtual updateRate() function that there's
        work to be done.

        * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
        (WebCore::MediaPlayerPrivateAVFoundation::setRate): Call updateRate()
        * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
        * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundationObjC.h:
        * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundationObjC.mm:
        (WebCore::MediaPlayerPrivateAVFoundationObjC::updateRate): Added.  Set the requested rate.

git-svn-id: svn://svn.chromium.org/blink/trunk@83134 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 3c7c546d
2011-04-06 Jer Noble <jer.noble@apple.com>
Reviewed by Eric Carlson.
MediaPlayerPrivateAVFoundation does not change rate due to setRate().
https://bugs.webkit.org/show_bug.cgi?id=57919
* media/video-set-rate-from-pause-expected.txt: Added.
* media/video-set-rate-from-pause.html: Added.
2011-04-06 Dan Bernstein <mitz@apple.com>
Correct results for the Geeza Pro metrics change.
Test that setting a non-zero rate causes an async timeupdate event.
EVENT(canplaythrough)
EVENT(play)
EVENT(timeupdate)
END OF TEST
<!DOCTYPE html>
<html>
<head>
<script src=media-file.js></script>
<script src=video-test.js></script>
<script>
function init() {
findMediaElement();
waitForEvent('canplaythrough', receivedCanPlayThrough);
video.src = findMediaFile("video", "content/test");
}
function receivedCanPlayThrough() {
waitForEvent('play', receivedPlay);
video.playbackRate = 0;
video.play();
}
function receivedPlay() {
waitForEventAndEnd('timeupdate');
video.playbackRate = 1;
}
</script>
</head>
<body onload="init()">
<video controls></video>
<p>Test that setting a non-zero rate causes an async timeupdate event.</p>
</body>
</html>
2011-04-06 Jer Noble <jer.noble@apple.com>
Reviewed by Eric Carlson.
MediaPlayerPrivateAVFoundation does not change rate due to setRate().
https://bugs.webkit.org/show_bug.cgi?id=57919
Test: media/video-set-rate-from-pause.html
The base class of MediaPlayerPrivateAVFoundation does not actually change the rate
of the media; instead a subclass must do that work. So when setRate() is called,
inform a subclass through a new pure virtual updateRate() function that there's
work to be done.
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
(WebCore::MediaPlayerPrivateAVFoundation::setRate): Call updateRate()
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundationObjC.h:
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::updateRate): Added. Set the requested rate.
2011-04-06 Dai Mikurube <dmikurube@chromium.org>
Reviewed by David Levin.
......@@ -285,6 +285,8 @@ void MediaPlayerPrivateAVFoundation::setRate(float rate)
{
LOG(Media, "MediaPlayerPrivateAVFoundation::setRate(%p) - seting to %f", this, rate);
m_requestedRate = rate;
updateRate();
}
bool MediaPlayerPrivateAVFoundation::paused() const
......
......@@ -170,6 +170,7 @@ protected:
virtual AVAssetStatus assetStatus() const = 0;
virtual void checkPlayability() = 0;
virtual void updateRate() = 0;
virtual float rate() const = 0;
virtual void seekToTime(float time) = 0;
virtual unsigned totalBytes() const = 0;
......
......@@ -93,6 +93,7 @@ private:
virtual MediaPlayerPrivateAVFoundation::AVAssetStatus assetStatus() const;
virtual void checkPlayability();
virtual void updateRate();
virtual float rate() const;
virtual void seekToTime(float time);
virtual unsigned totalBytes() const;
......
......@@ -437,6 +437,13 @@ void MediaPlayerPrivateAVFoundationObjC::setClosedCaptionsVisible(bool closedCap
[m_avPlayer.get() setClosedCaptionDisplayEnabled:closedCaptionsVisible];
}
void MediaPlayerPrivateAVFoundationObjC::updateRate()
{
setDelayCallbacks(true);
[m_avPlayer.get() setRate:requestedRate()];
setDelayCallbacks(false);
}
float MediaPlayerPrivateAVFoundationObjC::rate() const
{
if (!metaDataAvailable())
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment