[WinCairo][MediaFoundation] Implement float versions of MediaPlayer methods.
authorpeavo@outlook.com <peavo@outlook.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 14 Mar 2016 20:55:18 +0000 (20:55 +0000)
committerpeavo@outlook.com <peavo@outlook.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 14 Mar 2016 20:55:18 +0000 (20:55 +0000)
https://bugs.webkit.org/show_bug.cgi?id=155357

Reviewed by Brent Fulgham.

It is better to implement the float versions of some of the MediaPlayer methods,
since the default implementation of the double versions is to call the float version.
Also added override keyword to overridden methods.

* platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
(WebCore::MediaPlayerPrivateMediaFoundation::seeking):
(WebCore::MediaPlayerPrivateMediaFoundation::seek):
(WebCore::MediaPlayerPrivateMediaFoundation::setRate):
(WebCore::MediaPlayerPrivateMediaFoundation::duration):
(WebCore::MediaPlayerPrivateMediaFoundation::currentTime):
(WebCore::MediaPlayerPrivateMediaFoundation::seekDouble): Deleted.
(WebCore::MediaPlayerPrivateMediaFoundation::setRateDouble): Deleted.
(WebCore::MediaPlayerPrivateMediaFoundation::durationDouble): Deleted.
* platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198155 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp
Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.h

index b236d1f..1afa08f 100644 (file)
@@ -1,3 +1,25 @@
+2016-03-14  Per Arne Vollan  <peavo@outlook.com>
+
+        [WinCairo][MediaFoundation] Implement float versions of MediaPlayer methods.
+        https://bugs.webkit.org/show_bug.cgi?id=155357
+
+        Reviewed by Brent Fulgham.
+
+        It is better to implement the float versions of some of the MediaPlayer methods,
+        since the default implementation of the double versions is to call the float version.
+        Also added override keyword to overridden methods.
+
+        * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
+        (WebCore::MediaPlayerPrivateMediaFoundation::seeking):
+        (WebCore::MediaPlayerPrivateMediaFoundation::seek):
+        (WebCore::MediaPlayerPrivateMediaFoundation::setRate):
+        (WebCore::MediaPlayerPrivateMediaFoundation::duration):
+        (WebCore::MediaPlayerPrivateMediaFoundation::currentTime):
+        (WebCore::MediaPlayerPrivateMediaFoundation::seekDouble): Deleted.
+        (WebCore::MediaPlayerPrivateMediaFoundation::setRateDouble): Deleted.
+        (WebCore::MediaPlayerPrivateMediaFoundation::durationDouble): Deleted.
+        * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
+
 2016-03-14  Tim Horton  <timothy_horton@apple.com>
 
         Revert r194125 and r194186: We're going to fix this a different way.
index 9821293..684f55b 100644 (file)
@@ -230,7 +230,7 @@ bool MediaPlayerPrivateMediaFoundation::seeking() const
     return false;
 }
 
-void MediaPlayerPrivateMediaFoundation::seekDouble(double time)
+void MediaPlayerPrivateMediaFoundation::seek(float time)
 {
     PROPVARIANT propVariant;
     PropVariantInit(&propVariant);
@@ -244,7 +244,7 @@ void MediaPlayerPrivateMediaFoundation::seekDouble(double time)
     m_player->timeChanged();
 }
 
-void MediaPlayerPrivateMediaFoundation::setRateDouble(double rate)
+void MediaPlayerPrivateMediaFoundation::setRate(float rate)
 {
     COMPtr<IMFRateControl> rateControl;
 
@@ -258,7 +258,7 @@ void MediaPlayerPrivateMediaFoundation::setRateDouble(double rate)
     rateControl->SetRate(reduceSamplesInStream, rate);
 }
 
-double MediaPlayerPrivateMediaFoundation::durationDouble() const
+float MediaPlayerPrivateMediaFoundation::duration() const
 {
     if (!m_mediaSource)
         return 0;
@@ -272,7 +272,7 @@ double MediaPlayerPrivateMediaFoundation::durationDouble() const
         duration = 0;
     descriptor->Release();
     
-    return static_cast<double>(duration) / tenMegahertz;
+    return static_cast<float>(duration) / tenMegahertz;
 }
 
 float MediaPlayerPrivateMediaFoundation::currentTime() const
index ec3eee8..15f6617 100644 (file)
@@ -57,47 +57,47 @@ public:
     static MediaPlayer::SupportsType supportsType(const MediaEngineSupportParameters&);
     static bool isAvailable();
 
-    virtual void load(const String& url);
-    virtual void cancelLoad();
+    void load(const String& url) override;
+    void cancelLoad() override;
 
-    virtual void play();
-    virtual void pause();
+    void play() override;
+    void pause() override;
 
-    virtual bool supportsFullscreen() const;
+    bool supportsFullscreen() const override;
 
-    virtual FloatSize naturalSize() const;
+    FloatSize naturalSize() const override;
 
-    virtual bool hasVideo() const;
-    virtual bool hasAudio() const;
+    bool hasVideo() const override;
+    bool hasAudio() const override;
 
-    virtual void setVisible(bool);
+    void setVisible(bool) override;
 
-    virtual bool seeking() const;
-    void seekDouble(double) override;
+    bool seeking() const override;
+    void seek(float) override;
 
-    void setRateDouble(double) override;
+    void setRate(float) override;
 
-    double durationDouble() const override;
+    float duration() const override;
 
     float currentTime() const override;
 
-    virtual bool paused() const;
+    bool paused() const override;
 
     void setVolume(float) override;
 
     bool supportsMuting() const override;
     void setMuted(bool) override;
 
-    virtual MediaPlayer::NetworkState networkState() const;
-    virtual MediaPlayer::ReadyState readyState() const;
+    MediaPlayer::NetworkState networkState() const override;
+    MediaPlayer::ReadyState readyState() const override;
 
     float maxTimeSeekable() const override;
 
-    virtual std::unique_ptr<PlatformTimeRanges> buffered() const;
+    std::unique_ptr<PlatformTimeRanges> buffered() const override;
 
-    virtual bool didLoadingProgress() const;
+    bool didLoadingProgress() const override;
 
-    virtual void setSize(const IntSize&);
+    void setSize(const IntSize&) override;
 
     void paint(GraphicsContext&, const FloatRect&) override;