[Mac] Add helper methods to convert CMTime <--> MediaTime
[WebKit-https.git] / Source / WebCore / platform / mac / PlatformClockCM.h
index f36250c221d582a77aad937f6113101192565a7b..9ee49a76afc98b30b96fc9074ac5d5c67377cd07 100644 (file)
@@ -29,6 +29,7 @@
 #if USE(COREMEDIA)
 
 #include "Clock.h"
+#include <wtf/MediaTime.h>
 #include <wtf/RetainPtr.h>
 
 typedef struct OpaqueCMTimebase* CMTimebaseRef;
@@ -41,12 +42,12 @@ public:
     PlatformClockCM();
     PlatformClockCM(CMClockRef);
 
-private:
-    void initializeWithTimingSource(CMClockRef);
-
     virtual void setCurrentTime(double) OVERRIDE;
     virtual double currentTime() const OVERRIDE;
 
+    void setCurrentMediaTime(const MediaTime&);
+    MediaTime currentMediaTime() const;
+
     virtual void setPlayRate(double) OVERRIDE;
     virtual double playRate() const OVERRIDE { return m_rate; }
 
@@ -54,6 +55,9 @@ private:
     virtual void stop() OVERRIDE;
     virtual bool isRunning() const OVERRIDE { return m_running; }
 
+private:
+    void initializeWithTimingSource(CMClockRef);
+
     RetainPtr<CMTimebaseRef> m_timebase;
     double m_rate;
     bool m_running;