Diff
Modified: trunk/Source/WebCore/CMakeLists.txt (222514 => 222515)
--- trunk/Source/WebCore/CMakeLists.txt 2017-09-26 19:14:08 UTC (rev 222514)
+++ trunk/Source/WebCore/CMakeLists.txt 2017-09-26 19:57:30 UTC (rev 222515)
@@ -2303,8 +2303,6 @@
page/scrolling/ThreadedScrollingTree.cpp
platform/CalculationValue.cpp
- platform/Clock.cpp
- platform/ClockGeneric.cpp
platform/ContentType.cpp
platform/ContextMenu.cpp
platform/ContextMenuItem.cpp
Modified: trunk/Source/WebCore/ChangeLog (222514 => 222515)
--- trunk/Source/WebCore/ChangeLog 2017-09-26 19:14:08 UTC (rev 222514)
+++ trunk/Source/WebCore/ChangeLog 2017-09-26 19:57:30 UTC (rev 222515)
@@ -1,3 +1,25 @@
+2017-09-26 Yoshiaki Jitsukawa <[email protected]>
+
+ [PAL] Move Clock into PAL
+ https://bugs.webkit.org/show_bug.cgi?id=174342
+
+ Reviewed by Myles C. Maxfield.
+
+ No new tests. No change in behavior.
+
+ * CMakeLists.txt:
+ * WebCore.xcodeproj/project.pbxproj:
+ * html/MediaController.cpp:
+ (MediaController::MediaController):
+ * html/MediaController.h:
+ * platform/Clock.cpp: Removed.
+ * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
+ * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
+ * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
+ (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::MediaPlayerPrivateMediaStreamAVFObjC):
+ * platform/mac/PlatformClockCA.cpp: Removed. PlatformClockCA is no longer used.
+ * platform/mac/PlatformClockCA.h: Removed.
+
2017-09-26 Basuke Suzuki <[email protected]>
[Curl] Change member variable of CurlHandle to use std::unique_ptr
Modified: trunk/Source/WebCore/PAL/ChangeLog (222514 => 222515)
--- trunk/Source/WebCore/PAL/ChangeLog 2017-09-26 19:14:08 UTC (rev 222514)
+++ trunk/Source/WebCore/PAL/ChangeLog 2017-09-26 19:57:30 UTC (rev 222515)
@@ -1,3 +1,33 @@
+2017-09-26 Yoshiaki Jitsukawa <[email protected]>
+
+ [PAL] Move Clock into PAL
+ https://bugs.webkit.org/show_bug.cgi?id=174342
+
+ Reviewed by Myles C. Maxfield.
+
+ * PAL.xcodeproj/project.pbxproj:
+ * pal/PlatformGTK.cmake:
+ * pal/PlatformWin.cmake:
+ * pal/system/Clock.h: Renamed from Source/WebCore/platform/Clock.h.
+ * pal/system/ClockGeneric.cpp: Renamed from Source/WebCore/platform/ClockGeneric.cpp.
+ (PAL::Clock::create):
+ * pal/system/ClockGeneric.h: Renamed from Source/WebCore/platform/ClockGeneric.h.
+ * pal/system/mac/ClockCM.h: Renamed from Source/WebCore/platform/mac/PlatformClockCM.h.
+ * pal/system/mac/ClockCM.mm: Renamed from Source/WebCore/platform/mac/PlatformClockCM.mm.
+ (Clock::create):
+ (ClockCM::ClockCM):
+ (ClockCM::initializeWithTimingSource):
+ (ClockCM::setCurrentTime):
+ (ClockCM::currentTime const):
+ (ClockCM::setCurrentMediaTime):
+ (ClockCM::currentMediaTime const):
+ (ClockCM::setPlayRate):
+ (ClockCM::start):
+ (ClockCM::stop):
+
+ * pal/cf/CoreMediaSoftLink.cpp:
+ * pal/cf/CoreMediaSoftLink.h:
+ Add requrired functions.
2017-09-26 Zan Dobersek <[email protected]>
[GCrypt] Only report libgcrypt errors when logging is enabled
Modified: trunk/Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj (222514 => 222515)
--- trunk/Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj 2017-09-26 19:14:08 UTC (rev 222514)
+++ trunk/Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj 2017-09-26 19:57:30 UTC (rev 222515)
@@ -71,6 +71,9 @@
0C5AF9201F43A4C7002EAC02 /* QuickLookSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C5AF9161F43A4C7002EAC02 /* QuickLookSPI.h */; };
0C5AF9211F43A4C7002EAC02 /* SQLite3SPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C5AF9171F43A4C7002EAC02 /* SQLite3SPI.h */; };
0C5AF9221F43A4C7002EAC02 /* UIKitSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C5AF9181F43A4C7002EAC02 /* UIKitSPI.h */; };
+ 0C5FFF0C1F78D990009EFF1A /* Clock.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C5FFF0B1F78D98F009EFF1A /* Clock.h */; };
+ 0C5FFF0F1F78D9DA009EFF1A /* ClockCM.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0C5FFF0D1F78D9D8009EFF1A /* ClockCM.mm */; };
+ 0C5FFF101F78D9DA009EFF1A /* ClockCM.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C5FFF0E1F78D9DA009EFF1A /* ClockCM.h */; };
0C7785891F45130F00F4EBB6 /* AVFoundationSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C7785701F45130F00F4EBB6 /* AVFoundationSPI.h */; };
0C77858A1F45130F00F4EBB6 /* DataDetectorsSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C7785711F45130F00F4EBB6 /* DataDetectorsSPI.h */; };
0C77858B1F45130F00F4EBB6 /* LookupSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C7785721F45130F00F4EBB6 /* LookupSPI.h */; };
@@ -198,6 +201,9 @@
0C5AF9161F43A4C7002EAC02 /* QuickLookSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = QuickLookSPI.h; sourceTree = "<group>"; };
0C5AF9171F43A4C7002EAC02 /* SQLite3SPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SQLite3SPI.h; sourceTree = "<group>"; };
0C5AF9181F43A4C7002EAC02 /* UIKitSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIKitSPI.h; sourceTree = "<group>"; };
+ 0C5FFF0B1F78D98F009EFF1A /* Clock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Clock.h; sourceTree = "<group>"; };
+ 0C5FFF0D1F78D9D8009EFF1A /* ClockCM.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ClockCM.mm; sourceTree = "<group>"; };
+ 0C5FFF0E1F78D9DA009EFF1A /* ClockCM.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ClockCM.h; sourceTree = "<group>"; };
0C7785701F45130F00F4EBB6 /* AVFoundationSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AVFoundationSPI.h; sourceTree = "<group>"; };
0C7785711F45130F00F4EBB6 /* DataDetectorsSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DataDetectorsSPI.h; sourceTree = "<group>"; };
0C7785721F45130F00F4EBB6 /* LookupSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LookupSPI.h; sourceTree = "<group>"; };
@@ -516,6 +522,7 @@
children = (
A3AB6E5D1F3D1E28009C14B1 /* cocoa */,
A3788EA01F05B7E200679425 /* mac */,
+ 0C5FFF0B1F78D98F009EFF1A /* Clock.h */,
A3AB6E511F3D1DC5009C14B1 /* SleepDisabler.cpp */,
A3AB6E531F3D1DDB009C14B1 /* SleepDisabler.h */,
A3788E9B1F05B78200679425 /* Sound.cpp */,
@@ -529,6 +536,8 @@
A3788EA01F05B7E200679425 /* mac */ = {
isa = PBXGroup;
children = (
+ 0C5FFF0E1F78D9DA009EFF1A /* ClockCM.h */,
+ 0C5FFF0D1F78D9D8009EFF1A /* ClockCM.mm */,
A1175B561F6B470500C4B9F0 /* DefaultSearchProvider.cpp */,
A1175B551F6B470500C4B9F0 /* DefaultSearchProvider.h */,
A1175B4C1F6B337300C4B9F0 /* PopupMenu.h */,
@@ -565,6 +574,8 @@
0C2DA06F1F33CA8400DBC317 /* CFNetworkSPI.h in Headers */,
0C2DA13F1F3BEB4900DBC317 /* CFNSURLConnectionSPI.h in Headers */,
0C2DA0701F33CA8400DBC317 /* CFUtilitiesSPI.h in Headers */,
+ 0C5FFF0C1F78D990009EFF1A /* Clock.h in Headers */,
+ 0C5FFF101F78D9DA009EFF1A /* ClockCM.h in Headers */,
1C09D0581E31C57E00725F18 /* config.h in Headers */,
0C2DA0711F33CA8400DBC317 /* CoreAudioSPI.h in Headers */,
0C2DA11E1F3BE9E000DBC317 /* CoreGraphicsSPI.h in Headers */,
@@ -744,6 +755,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
+ 0C5FFF0F1F78D9DA009EFF1A /* ClockCM.mm in Sources */,
0CF99CA81F738437007EE793 /* CoreMediaSoftLink.cpp in Sources */,
1C09D0561E31C46500725F18 /* CryptoDigestCommonCrypto.cpp in Sources */,
A1175B581F6B470500C4B9F0 /* DefaultSearchProvider.cpp in Sources */,
Modified: trunk/Source/WebCore/PAL/pal/PlatformGTK.cmake (222514 => 222515)
--- trunk/Source/WebCore/PAL/pal/PlatformGTK.cmake 2017-09-26 19:14:08 UTC (rev 222514)
+++ trunk/Source/WebCore/PAL/pal/PlatformGTK.cmake 2017-09-26 19:57:30 UTC (rev 222515)
@@ -1,6 +1,8 @@
list(APPEND PAL_SOURCES
crypto/gcrypt/CryptoDigestGCrypt.cpp
+ system/ClockGeneric.cpp
+
system/gtk/SoundGtk.cpp
text/KillRing.cpp
Modified: trunk/Source/WebCore/PAL/pal/PlatformWPE.cmake (222514 => 222515)
--- trunk/Source/WebCore/PAL/pal/PlatformWPE.cmake 2017-09-26 19:14:08 UTC (rev 222514)
+++ trunk/Source/WebCore/PAL/pal/PlatformWPE.cmake 2017-09-26 19:57:30 UTC (rev 222515)
@@ -1,6 +1,7 @@
list(APPEND PAL_SOURCES
crypto/gcrypt/CryptoDigestGCrypt.cpp
+ system/ClockGeneric.cpp
system/Sound.cpp
text/KillRing.cpp
Modified: trunk/Source/WebCore/PAL/pal/PlatformWin.cmake (222514 => 222515)
--- trunk/Source/WebCore/PAL/pal/PlatformWin.cmake 2017-09-26 19:14:08 UTC (rev 222514)
+++ trunk/Source/WebCore/PAL/pal/PlatformWin.cmake 2017-09-26 19:57:30 UTC (rev 222515)
@@ -1,6 +1,8 @@
list(APPEND PAL_SOURCES
crypto/win/CryptoDigestWin.cpp
+ system/ClockGeneric.cpp
+
system/win/SoundWin.cpp
text/KillRing.cpp
Modified: trunk/Source/WebCore/PAL/pal/cf/CoreMediaSoftLink.cpp (222514 => 222515)
--- trunk/Source/WebCore/PAL/pal/cf/CoreMediaSoftLink.cpp 2017-09-26 19:14:08 UTC (rev 222514)
+++ trunk/Source/WebCore/PAL/pal/cf/CoreMediaSoftLink.cpp 2017-09-26 19:57:30 UTC (rev 222515)
@@ -33,7 +33,23 @@
SOFT_LINK_FRAMEWORK_FOR_SOURCE(PAL, CoreMedia)
+SOFT_LINK_FUNCTION_FOR_SOURCE(PAL, CoreMedia, CMTimeGetSeconds, Float64, (CMTime time), (time))
SOFT_LINK_FUNCTION_FOR_SOURCE(PAL, CoreMedia, CMTimeMake, CMTime, (int64_t value, int32_t timescale), (value, timescale))
SOFT_LINK_FUNCTION_FOR_SOURCE(PAL, CoreMedia, CMTimeMakeWithSeconds, CMTime, (Float64 seconds, int32_t preferredTimeScale), (seconds, preferredTimeScale))
+#if PLATFORM(COCOA)
+SOFT_LINK_FUNCTION_FOR_SOURCE(PAL, CoreMedia, CMTimebaseCreateWithMasterClock, OSStatus, (CFAllocatorRef allocator, CMClockRef masterClock, CMTimebaseRef *timebaseOut), (allocator, masterClock, timebaseOut))
+SOFT_LINK_FUNCTION_FOR_SOURCE(PAL, CoreMedia, CMTimebaseGetTime, CMTime, (CMTimebaseRef timebase), (timebase))
+SOFT_LINK_FUNCTION_FOR_SOURCE(PAL, CoreMedia, CMTimebaseSetRate, OSStatus, (CMTimebaseRef timebase, Float64 rate), (timebase, rate))
+SOFT_LINK_FUNCTION_FOR_SOURCE(PAL, CoreMedia, CMTimebaseSetTime, OSStatus, (CMTimebaseRef timebase, CMTime time), (timebase, time))
+#endif // PLATFORM(COCOA)
+
+#if PLATFORM(IOS)
+SOFT_LINK_FUNCTION_FOR_SOURCE(PAL, CoreMedia, CMAudioClockCreate, OSStatus, (CFAllocatorRef allocator, CMClockRef *clockOut), (allocator, clockOut))
+#endif // PLATFORM(IOS)
+
+#if PLATFORM(MAC)
+SOFT_LINK_FUNCTION_FOR_SOURCE(PAL, CoreMedia, CMAudioDeviceClockCreate, OSStatus, (CFAllocatorRef allocator, CFStringRef deviceUID, CMClockRef *clockOut), (allocator, deviceUID, clockOut))
+#endif // PLATFORM(MAC)
+
#endif // USE(AVFOUNDATION)
Modified: trunk/Source/WebCore/PAL/pal/cf/CoreMediaSoftLink.h (222514 => 222515)
--- trunk/Source/WebCore/PAL/pal/cf/CoreMediaSoftLink.h 2017-09-26 19:14:08 UTC (rev 222514)
+++ trunk/Source/WebCore/PAL/pal/cf/CoreMediaSoftLink.h 2017-09-26 19:57:30 UTC (rev 222515)
@@ -33,9 +33,32 @@
SOFT_LINK_FRAMEWORK_FOR_HEADER(PAL, CoreMedia)
+SOFT_LINK_FUNCTION_FOR_HEADER(PAL, CoreMedia, CMTimeGetSeconds, Float64, (CMTime time), (time))
+#define CMTimeGetSeconds softLink_CoreMedia_CMTimeGetSeconds
SOFT_LINK_FUNCTION_FOR_HEADER(PAL, CoreMedia, CMTimeMake, CMTime, (int64_t value, int32_t timescale), (value, timescale))
#define CMTimeMake softLink_CoreMedia_CMTimeMake
SOFT_LINK_FUNCTION_FOR_HEADER(PAL, CoreMedia, CMTimeMakeWithSeconds, CMTime, (Float64 seconds, int32_t preferredTimeScale), (seconds, preferredTimeScale))
#define CMTimeMakeWithSeconds softLink_CoreMedia_CMTimeMakeWithSeconds
+#if PLATFORM(COCOA)
+SOFT_LINK_FUNCTION_FOR_HEADER(PAL, CoreMedia, CMTimebaseCreateWithMasterClock, OSStatus, (CFAllocatorRef allocator, CMClockRef masterClock, CMTimebaseRef *timebaseOut), (allocator, masterClock, timebaseOut))
+#define CMTimebaseCreateWithMasterClock softLink_CoreMedia_CMTimebaseCreateWithMasterClock
+SOFT_LINK_FUNCTION_FOR_HEADER(PAL, CoreMedia, CMTimebaseGetTime, CMTime, (CMTimebaseRef timebase), (timebase))
+#define CMTimebaseGetTime softLink_CoreMedia_CMTimebaseGetTime
+SOFT_LINK_FUNCTION_FOR_HEADER(PAL, CoreMedia, CMTimebaseSetRate, OSStatus, (CMTimebaseRef timebase, Float64 rate), (timebase, rate))
+#define CMTimebaseSetRate softLink_CoreMedia_CMTimebaseSetRate
+SOFT_LINK_FUNCTION_FOR_HEADER(PAL, CoreMedia, CMTimebaseSetTime, OSStatus, (CMTimebaseRef timebase, CMTime time), (timebase, time))
+#define CMTimebaseSetTime softLink_CoreMedia_CMTimebaseSetTime
+#endif // PLATFORM(COCOA)
+
+#if PLATFORM(IOS)
+SOFT_LINK_FUNCTION_FOR_HEADER(PAL, CoreMedia, CMAudioClockCreate, OSStatus, (CFAllocatorRef allocator, CMClockRef *clockOut), (allocator, clockOut))
+#define CMAudioClockCreate softLink_CoreMedia_CMAudioClockCreate
+#endif // PLATFORM(IOS)
+
+#if PLATFORM(MAC)
+SOFT_LINK_FUNCTION_FOR_HEADER(PAL, CoreMedia, CMAudioDeviceClockCreate, OSStatus, (CFAllocatorRef allocator, CFStringRef deviceUID, CMClockRef *clockOut), (allocator, deviceUID, clockOut))
+#define CMAudioDeviceClockCreate softLink_CoreMedia_CMAudioDeviceClockCreate
+#endif // PLATFORM(MAC)
+
#endif // USE(AVFOUNDATION)
Copied: trunk/Source/WebCore/PAL/pal/system/Clock.h (from rev 222512, trunk/Source/WebCore/platform/Clock.h) (0 => 222515)
--- trunk/Source/WebCore/PAL/pal/system/Clock.h (rev 0)
+++ trunk/Source/WebCore/PAL/pal/system/Clock.h 2017-09-26 19:57:30 UTC (rev 222515)
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2011 Apple Inc. All rights reserved.
+ * Copyright (C) 2017 Sony Interactive Entertainment Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include <memory>
+
+namespace PAL {
+
+class Clock {
+public:
+ static std::unique_ptr<Clock> create();
+ virtual ~Clock() = default;
+
+ virtual void setCurrentTime(double) = 0;
+ virtual double currentTime() const = 0;
+
+ virtual void setPlayRate(double) = 0;
+ virtual double playRate() const = 0;
+
+ virtual void start() = 0;
+ virtual void stop() = 0;
+ virtual bool isRunning() const = 0;
+
+protected:
+ Clock() = default;
+};
+
+}
Copied: trunk/Source/WebCore/PAL/pal/system/ClockGeneric.cpp (from rev 222512, trunk/Source/WebCore/platform/ClockGeneric.cpp) (0 => 222515)
--- trunk/Source/WebCore/PAL/pal/system/ClockGeneric.cpp (rev 0)
+++ trunk/Source/WebCore/PAL/pal/system/ClockGeneric.cpp 2017-09-26 19:57:30 UTC (rev 222515)
@@ -0,0 +1,91 @@
+/*
+ * Copyright (C) 2011 Apple Inc. All rights reserved.
+ * Copyright (C) 2017 Sony Interactive Entertainment Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "ClockGeneric.h"
+
+#include <wtf/CurrentTime.h>
+
+namespace PAL {
+
+std::unique_ptr<Clock> Clock::create()
+{
+ return std::make_unique<ClockGeneric>();
+}
+
+ClockGeneric::ClockGeneric()
+ : m_running(false)
+ , m_rate(1)
+ , m_offset(0)
+{
+ m_startTime = m_lastTime = now();
+}
+
+void ClockGeneric::setCurrentTime(double time)
+{
+ m_startTime = m_lastTime = now();
+ m_offset = time;
+}
+
+double ClockGeneric::currentTime() const
+{
+ if (m_running)
+ m_lastTime = now();
+ return ((m_lastTime - m_startTime) * m_rate) + m_offset;
+}
+
+void ClockGeneric::setPlayRate(double rate)
+{
+ m_offset = currentTime();
+ m_lastTime = m_startTime = now();
+ m_rate = rate;
+}
+
+void ClockGeneric::start()
+{
+ if (m_running)
+ return;
+
+ m_lastTime = m_startTime = now();
+ m_running = true;
+}
+
+void ClockGeneric::stop()
+{
+ if (!m_running)
+ return;
+
+ m_offset = currentTime();
+ m_lastTime = m_startTime = now();
+ m_running = false;
+}
+
+double ClockGeneric::now() const
+{
+ return monotonicallyIncreasingTime();
+}
+
+}
Copied: trunk/Source/WebCore/PAL/pal/system/ClockGeneric.h (from rev 222512, trunk/Source/WebCore/platform/ClockGeneric.h) (0 => 222515)
--- trunk/Source/WebCore/PAL/pal/system/ClockGeneric.h (rev 0)
+++ trunk/Source/WebCore/PAL/pal/system/ClockGeneric.h 2017-09-26 19:57:30 UTC (rev 222515)
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2011 Apple Inc. All rights reserved.
+ * Copyright (C) 2017 Sony Interactive Entertainment Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include "Clock.h"
+
+namespace PAL {
+
+class ClockGeneric final : public Clock {
+public:
+ ClockGeneric();
+
+private:
+ void setCurrentTime(double) override;
+ double currentTime() const override;
+
+ void setPlayRate(double) override;
+ double playRate() const override { return m_rate; }
+
+ void start() override;
+ void stop() override;
+ bool isRunning() const override { return m_running; }
+
+ double now() const;
+
+ bool m_running;
+ double m_rate;
+ double m_offset;
+ double m_startTime;
+ mutable double m_lastTime;
+};
+
+}
Copied: trunk/Source/WebCore/PAL/pal/system/mac/ClockCM.h (from rev 222512, trunk/Source/WebCore/platform/mac/PlatformClockCM.h) (0 => 222515)
--- trunk/Source/WebCore/PAL/pal/system/mac/ClockCM.h (rev 0)
+++ trunk/Source/WebCore/PAL/pal/system/mac/ClockCM.h 2017-09-26 19:57:30 UTC (rev 222515)
@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2012 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if USE(COREMEDIA)
+
+#include "../Clock.h"
+#include <wtf/MediaTime.h>
+#include <wtf/RetainPtr.h>
+
+typedef struct OpaqueCMTimebase* CMTimebaseRef;
+typedef struct OpaqueCMClock* CMClockRef;
+
+namespace PAL {
+
+class ClockCM final : public Clock {
+public:
+ ClockCM();
+ ClockCM(CMClockRef);
+
+ void setCurrentTime(double) override;
+ double currentTime() const override;
+
+ void setCurrentMediaTime(const MediaTime&);
+ MediaTime currentMediaTime() const;
+
+ void setPlayRate(double) override;
+ double playRate() const override { return m_rate; }
+
+ void start() override;
+ void stop() override;
+ bool isRunning() const override { return m_running; }
+
+ CMTimebaseRef timebase() const { return m_timebase.get(); }
+
+private:
+ void initializeWithTimingSource(CMClockRef);
+
+ RetainPtr<CMTimebaseRef> m_timebase;
+ double m_rate;
+ bool m_running;
+};
+
+}
+
+#endif
Copied: trunk/Source/WebCore/PAL/pal/system/mac/ClockCM.mm (from rev 222512, trunk/Source/WebCore/platform/mac/PlatformClockCM.mm) (0 => 222515)
--- trunk/Source/WebCore/PAL/pal/system/mac/ClockCM.mm (rev 0)
+++ trunk/Source/WebCore/PAL/pal/system/mac/ClockCM.mm 2017-09-26 19:57:30 UTC (rev 222515)
@@ -0,0 +1,122 @@
+/*
+ * Copyright (C) 2012, 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "config.h"
+
+#if USE(COREMEDIA)
+#import "ClockCM.h"
+
+#import <pal/avfoundation/MediaTimeAVFoundation.h>
+
+#import "CoreMediaSoftLink.h"
+
+using namespace PAL;
+
+// A default time scale of 1000 allows milli-second CMTime precision without scaling the timebase.
+static const int32_t DefaultTimeScale = 1000;
+
+std::unique_ptr<Clock> Clock::create()
+{
+ return std::make_unique<ClockCM>();
+}
+
+ClockCM::ClockCM()
+ : m_timebase(0)
+ , m_rate(1)
+ , m_running(false)
+{
+ CMClockRef rawClockPtr = 0;
+#if PLATFORM(IOS)
+ CMAudioClockCreate(kCFAllocatorDefault, &rawClockPtr);
+#else
+ CMAudioDeviceClockCreate(kCFAllocatorDefault, NULL, &rawClockPtr);
+#endif
+ RetainPtr<CMClockRef> clock = adoptCF(rawClockPtr);
+ initializeWithTimingSource(clock.get());
+}
+
+ClockCM::ClockCM(CMClockRef clock)
+ : m_timebase(0)
+ , m_running(false)
+{
+ initializeWithTimingSource(clock);
+}
+
+void ClockCM::initializeWithTimingSource(CMClockRef clock)
+{
+ CMTimebaseRef rawTimebasePtr = 0;
+ CMTimebaseCreateWithMasterClock(kCFAllocatorDefault, clock, &rawTimebasePtr);
+ m_timebase = adoptCF(rawTimebasePtr);
+}
+
+void ClockCM::setCurrentTime(double time)
+{
+ CMTime cmTime = CMTimeMakeWithSeconds(time, DefaultTimeScale);
+ CMTimebaseSetTime(m_timebase.get(), cmTime);
+}
+
+double ClockCM::currentTime() const
+{
+ CMTime cmTime = CMTimebaseGetTime(m_timebase.get());
+ return CMTimeGetSeconds(cmTime);
+}
+
+void ClockCM::setCurrentMediaTime(const MediaTime& time)
+{
+ CMTimebaseSetTime(m_timebase.get(), PAL::toCMTime(time));
+}
+
+MediaTime ClockCM::currentMediaTime() const
+{
+ return PAL::toMediaTime(CMTimebaseGetTime(m_timebase.get()));
+}
+
+void ClockCM::setPlayRate(double rate)
+{
+ if (m_rate == rate)
+ return;
+
+ m_rate = rate;
+ if (m_running)
+ CMTimebaseSetRate(m_timebase.get(), rate);
+}
+
+void ClockCM::start()
+{
+ if (m_running)
+ return;
+ m_running = true;
+ CMTimebaseSetRate(m_timebase.get(), m_rate);
+}
+
+void ClockCM::stop()
+{
+ if (!m_running)
+ return;
+ m_running = false;
+ CMTimebaseSetRate(m_timebase.get(), 0);
+}
+
+#endif
Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (222514 => 222515)
--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2017-09-26 19:14:08 UTC (rev 222514)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2017-09-26 19:57:30 UTC (rev 222515)
@@ -6376,7 +6376,6 @@
CDA98E0416039E1A00FEA3B1 /* JSWebKitMediaKeys.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDA98DCE1601597900FEA3B1 /* JSWebKitMediaKeys.cpp */; };
CDA98E0616039E1F00FEA3B1 /* JSWebKitMediaKeySession.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDA98DD01601597900FEA3B1 /* JSWebKitMediaKeySession.cpp */; };
CDA98E0B1603CD6000FEA3B1 /* LegacyCDM.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDA98E091603CD5900FEA3B1 /* LegacyCDM.cpp */; };
- CDAA8D0A14D71B2E0061EA60 /* PlatformClockCM.mm in Sources */ = {isa = PBXBuildFile; fileRef = CDAA8D0814D385600061EA60 /* PlatformClockCM.mm */; };
CDAB6D2817C7DE6C00C60B34 /* MediaControlsHost.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDAB6D2617C7DE6C00C60B34 /* MediaControlsHost.cpp */; };
CDAB6D2917C7DE6C00C60B34 /* MediaControlsHost.h in Headers */ = {isa = PBXBuildFile; fileRef = CDAB6D2717C7DE6C00C60B34 /* MediaControlsHost.h */; };
CDAB6D2D17C814EE00C60B34 /* JSMediaControlsHost.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDAB6D2B17C814EE00C60B34 /* JSMediaControlsHost.cpp */; };
@@ -6437,9 +6436,6 @@
CDE8B5ED1A69777300B4B66A /* LegacyCDMPrivateClearKey.h in Headers */ = {isa = PBXBuildFile; fileRef = CDE8B5EB1A69777300B4B66A /* LegacyCDMPrivateClearKey.h */; };
CDE8B5F01A69778B00B4B66A /* LegacyCDMSessionClearKey.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDE8B5EE1A69778B00B4B66A /* LegacyCDMSessionClearKey.cpp */; };
CDE8B5F11A69778B00B4B66A /* LegacyCDMSessionClearKey.h in Headers */ = {isa = PBXBuildFile; fileRef = CDE8B5EF1A69778B00B4B66A /* LegacyCDMSessionClearKey.h */; };
- CDEA763014608A53008B31F1 /* PlatformClockCA.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDEA762E146084DE008B31F1 /* PlatformClockCA.cpp */; };
- CDEA76341460B56F008B31F1 /* ClockGeneric.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDEA76321460AE29008B31F1 /* ClockGeneric.cpp */; };
- CDEA76351460B71A008B31F1 /* Clock.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDEA76331460B462008B31F1 /* Clock.cpp */; };
CDEA7C841276230400B846DD /* RenderFullScreen.h in Headers */ = {isa = PBXBuildFile; fileRef = CDEA7C821276230400B846DD /* RenderFullScreen.h */; };
CDEA7C851276230400B846DD /* RenderFullScreen.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDEA7C831276230400B846DD /* RenderFullScreen.cpp */; };
CDECA89A1EDF447D00DCB08B /* AVAssetTrackUtilities.mm in Sources */ = {isa = PBXBuildFile; fileRef = CDECA8981EDF447D00DCB08B /* AVAssetTrackUtilities.mm */; };
@@ -15132,8 +15128,6 @@
CDA98E091603CD5900FEA3B1 /* LegacyCDM.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = LegacyCDM.cpp; sourceTree = "<group>"; };
CDA98E0A1603CD5900FEA3B1 /* LegacyCDM.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LegacyCDM.h; sourceTree = "<group>"; };
CDA98E0C1603CF3C00FEA3B1 /* LegacyCDMPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LegacyCDMPrivate.h; sourceTree = "<group>"; };
- CDAA8D0714D385600061EA60 /* PlatformClockCM.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformClockCM.h; sourceTree = "<group>"; };
- CDAA8D0814D385600061EA60 /* PlatformClockCM.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PlatformClockCM.mm; sourceTree = "<group>"; };
CDAAF45D1869094E003C1717 /* mediaControlsiOS.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.css; path = mediaControlsiOS.css; sourceTree = "<group>"; };
CDAB6D2517C7DE5700C60B34 /* MediaControlsHost.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = MediaControlsHost.idl; sourceTree = "<group>"; };
CDAB6D2617C7DE6C00C60B34 /* MediaControlsHost.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaControlsHost.cpp; sourceTree = "<group>"; };
@@ -15209,12 +15203,6 @@
CDE8B5EB1A69777300B4B66A /* LegacyCDMPrivateClearKey.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LegacyCDMPrivateClearKey.h; sourceTree = "<group>"; };
CDE8B5EE1A69778B00B4B66A /* LegacyCDMSessionClearKey.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LegacyCDMSessionClearKey.cpp; sourceTree = "<group>"; };
CDE8B5EF1A69778B00B4B66A /* LegacyCDMSessionClearKey.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LegacyCDMSessionClearKey.h; sourceTree = "<group>"; };
- CDEA762C14608224008B31F1 /* Clock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Clock.h; sourceTree = "<group>"; };
- CDEA762E146084DE008B31F1 /* PlatformClockCA.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformClockCA.cpp; sourceTree = "<group>"; };
- CDEA762F146084EE008B31F1 /* PlatformClockCA.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformClockCA.h; sourceTree = "<group>"; };
- CDEA76311460AE1B008B31F1 /* ClockGeneric.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ClockGeneric.h; sourceTree = "<group>"; };
- CDEA76321460AE29008B31F1 /* ClockGeneric.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ClockGeneric.cpp; sourceTree = "<group>"; };
- CDEA76331460B462008B31F1 /* Clock.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Clock.cpp; sourceTree = "<group>"; };
CDEA7C821276230400B846DD /* RenderFullScreen.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderFullScreen.h; sourceTree = "<group>"; };
CDEA7C831276230400B846DD /* RenderFullScreen.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderFullScreen.cpp; sourceTree = "<group>"; };
CDECA8981EDF447D00DCB08B /* AVAssetTrackUtilities.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = AVAssetTrackUtilities.mm; sourceTree = "<group>"; };
@@ -19571,10 +19559,6 @@
4B2709810AF2E5E00065127F /* PasteboardMac.mm */,
1AF5E4E11E5779B1004A1F01 /* PasteboardWriter.h */,
1AF5E4E01E5779B1004A1F01 /* PasteboardWriter.mm */,
- CDEA762E146084DE008B31F1 /* PlatformClockCA.cpp */,
- CDEA762F146084EE008B31F1 /* PlatformClockCA.h */,
- CDAA8D0714D385600061EA60 /* PlatformClockCM.h */,
- CDAA8D0814D385600061EA60 /* PlatformClockCM.mm */,
BCAA486E14A052530088FAC4 /* PlatformEventFactoryMac.h */,
BCAA486D14A052530088FAC4 /* PlatformEventFactoryMac.mm */,
C5F765BA14E1ECF4006C899B /* PlatformPasteboardMac.mm */,
@@ -24575,10 +24559,6 @@
B2C3D9EC0D006C1D00EF6F26 /* text */,
49AE2D94134EE5F90072920A /* CalculationValue.cpp */,
49AE2D95134EE5F90072920A /* CalculationValue.h */,
- CDEA76331460B462008B31F1 /* Clock.cpp */,
- CDEA762C14608224008B31F1 /* Clock.h */,
- CDEA76321460AE29008B31F1 /* ClockGeneric.cpp */,
- CDEA76311460AE1B008B31F1 /* ClockGeneric.h */,
C330A22113EC196B0000B45B /* ColorChooser.h */,
C37CDEBC149EF2030042090D /* ColorChooserClient.h */,
BCC8CFCA0986CD2400140BF2 /* ColorData.gperf */,
@@ -31449,8 +31429,6 @@
8348BFAB1B85729800912F36 /* ClassCollection.cpp in Sources */,
85031B3F0A44EFC700F992E0 /* ClipboardEvent.cpp in Sources */,
580371611A66F00A00BAF519 /* ClipRect.cpp in Sources */,
- CDEA76351460B71A008B31F1 /* Clock.cpp in Sources */,
- CDEA76341460B56F008B31F1 /* ClockGeneric.cpp in Sources */,
9BD8A95A18BEFC7600987E9A /* CollectionIndexCache.cpp in Sources */,
B27535660B053814002CE64F /* Color.cpp in Sources */,
0FCF33240F2B9715004B6795 /* ColorCG.cpp in Sources */,
@@ -33555,8 +33533,6 @@
0F13164016ED0CDE0035CC04 /* PlatformCAFiltersCocoa.mm in Sources */,
2D70BA1518074F860001908A /* PlatformCALayer.cpp in Sources */,
4958782212A57DDF007238AC /* PlatformCALayerCocoa.mm in Sources */,
- CDEA763014608A53008B31F1 /* PlatformClockCA.cpp in Sources */,
- CDAA8D0A14D71B2E0061EA60 /* PlatformClockCM.mm in Sources */,
26601EC014B3B9AD0012C0FE /* PlatformEventFactoryIOS.mm in Sources */,
BCAA486F14A052530088FAC4 /* PlatformEventFactoryMac.mm in Sources */,
F544F78815CFB2A800AF33A8 /* PlatformLocale.cpp in Sources */,
Modified: trunk/Source/WebCore/html/MediaController.cpp (222514 => 222515)
--- trunk/Source/WebCore/html/MediaController.cpp 2017-09-26 19:14:08 UTC (rev 222514)
+++ trunk/Source/WebCore/html/MediaController.cpp 2017-09-26 19:57:30 UTC (rev 222515)
@@ -28,10 +28,10 @@
#if ENABLE(VIDEO)
#include "MediaController.h"
-#include "Clock.h"
#include "EventNames.h"
#include "HTMLMediaElement.h"
#include "TimeRanges.h"
+#include <pal/system/Clock.h>
#include <wtf/CurrentTime.h>
#include <wtf/NeverDestroyed.h>
#include <wtf/StdLibExtras.h>
@@ -55,7 +55,7 @@
, m_asyncEventTimer(*this, &MediaController::asyncEventTimerFired)
, m_clearPositionTimer(*this, &MediaController::clearPositionTimerFired)
, m_closedCaptionsVisible(false)
- , m_clock(Clock::create())
+ , m_clock(PAL::Clock::create())
, m_scriptExecutionContext(context)
, m_timeupdateTimer(*this, &MediaController::scheduleTimeupdateEvent)
{
Modified: trunk/Source/WebCore/html/MediaController.h (222514 => 222515)
--- trunk/Source/WebCore/html/MediaController.h 2017-09-26 19:14:08 UTC (rev 222514)
+++ trunk/Source/WebCore/html/MediaController.h 2017-09-26 19:57:30 UTC (rev 222515)
@@ -33,9 +33,12 @@
#include "Timer.h"
#include <wtf/Vector.h>
+namespace PAL {
+class Clock;
+}
+
namespace WebCore {
-class Clock;
class HTMLMediaElement;
class MediaController final : public RefCounted<MediaController>, public MediaControllerInterface, public EventTargetWithInlineData {
@@ -142,7 +145,7 @@
mutable Timer m_clearPositionTimer;
String m_mediaGroup;
bool m_closedCaptionsVisible;
- std::unique_ptr<Clock> m_clock;
+ std::unique_ptr<PAL::Clock> m_clock;
ScriptExecutionContext& m_scriptExecutionContext;
Timer m_timeupdateTimer;
MonotonicTime m_previousTimeupdateTime;
Deleted: trunk/Source/WebCore/platform/Clock.cpp (222514 => 222515)
--- trunk/Source/WebCore/platform/Clock.cpp 2017-09-26 19:14:08 UTC (rev 222514)
+++ trunk/Source/WebCore/platform/Clock.cpp 2017-09-26 19:57:30 UTC (rev 222515)
@@ -1,48 +0,0 @@
-/*
- * Copyright (C) 2011 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "Clock.h"
-
-#if USE(COREMEDIA)
- #include "PlatformClockCM.h"
-#elif USE(COREAUDIO)
- #include "PlatformClockCA.h"
-#else
- #include "ClockGeneric.h"
-#endif
-
-using namespace WebCore;
-
-std::unique_ptr<Clock> Clock::create()
-{
-#if USE(COREMEDIA)
- return std::make_unique<PlatformClockCM>();
-#elif USE(COREAUDIO)
- return std::make_unique<PlatformClockCA>();
-#else
- return std::make_unique<ClockGeneric>();
-#endif
-}
Deleted: trunk/Source/WebCore/platform/Clock.h (222514 => 222515)
--- trunk/Source/WebCore/platform/Clock.h 2017-09-26 19:14:08 UTC (rev 222514)
+++ trunk/Source/WebCore/platform/Clock.h 2017-09-26 19:57:30 UTC (rev 222515)
@@ -1,54 +0,0 @@
-/*
- * Copyright (C) 2011 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef Clock_h
-#define Clock_h
-
-#include <memory>
-
-namespace WebCore {
-
-class Clock {
-public:
- static std::unique_ptr<Clock> create();
- virtual ~Clock() { }
-
- virtual void setCurrentTime(double) = 0;
- virtual double currentTime() const = 0;
-
- virtual void setPlayRate(double) = 0;
- virtual double playRate() const = 0;
-
- virtual void start() = 0;
- virtual void stop() = 0;
- virtual bool isRunning() const = 0;
-
-protected:
- Clock() { }
-};
-
-}
-
-#endif
Deleted: trunk/Source/WebCore/platform/ClockGeneric.cpp (222514 => 222515)
--- trunk/Source/WebCore/platform/ClockGeneric.cpp 2017-09-26 19:14:08 UTC (rev 222514)
+++ trunk/Source/WebCore/platform/ClockGeneric.cpp 2017-09-26 19:57:30 UTC (rev 222515)
@@ -1,83 +0,0 @@
-/*
- * Copyright (C) 2011 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "ClockGeneric.h"
-
-#include <wtf/CurrentTime.h>
-
-using namespace WebCore;
-
-ClockGeneric::ClockGeneric()
- : m_running(false)
- , m_rate(1)
- , m_offset(0)
-{
- m_startTime = m_lastTime = now();
-}
-
-void ClockGeneric::setCurrentTime(double time)
-{
- m_startTime = m_lastTime = now();
- m_offset = time;
-}
-
-double ClockGeneric::currentTime() const
-{
- if (m_running)
- m_lastTime = now();
- return ((m_lastTime - m_startTime) * m_rate) + m_offset;
-}
-
-void ClockGeneric::setPlayRate(double rate)
-{
- m_offset = currentTime();
- m_lastTime = m_startTime = now();
- m_rate = rate;
-}
-
-void ClockGeneric::start()
-{
- if (m_running)
- return;
-
- m_lastTime = m_startTime = now();
- m_running = true;
-}
-
-void ClockGeneric::stop()
-{
- if (!m_running)
- return;
-
- m_offset = currentTime();
- m_lastTime = m_startTime = now();
- m_running = false;
-}
-
-double ClockGeneric::now() const
-{
- return monotonicallyIncreasingTime();
-}
Deleted: trunk/Source/WebCore/platform/ClockGeneric.h (222514 => 222515)
--- trunk/Source/WebCore/platform/ClockGeneric.h 2017-09-26 19:14:08 UTC (rev 222514)
+++ trunk/Source/WebCore/platform/ClockGeneric.h 2017-09-26 19:57:30 UTC (rev 222515)
@@ -1,59 +0,0 @@
-/*
- * Copyright (C) 2011 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef ClockGeneric_h
-#define ClockGeneric_h
-
-#include "Clock.h"
-
-namespace WebCore {
-
-class ClockGeneric final : public Clock {
-public:
- ClockGeneric();
-
-private:
- void setCurrentTime(double) override;
- double currentTime() const override;
-
- void setPlayRate(double) override;
- double playRate() const override { return m_rate; }
-
- void start() override;
- void stop() override;
- bool isRunning() const override { return m_running; }
-
- double now() const;
-
- bool m_running;
- double m_rate;
- double m_offset;
- double m_startTime;
- mutable double m_lastTime;
-};
-
-}
-
-#endif
Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm (222514 => 222515)
--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm 2017-09-26 19:14:08 UTC (rev 222514)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm 2017-09-26 19:57:30 UTC (rev 222515)
@@ -38,7 +38,6 @@
#import "MediaSourcePrivateAVFObjC.h"
#import "MediaSourcePrivateClient.h"
#import "PixelBufferConformerCV.h"
-#import "PlatformClockCM.h"
#import "TextTrackRepresentation.h"
#import "TextureCacheCV.h"
#import "VideoTextureCopierCV.h"
Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h (222514 => 222515)
--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h 2017-09-26 19:14:08 UTC (rev 222514)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h 2017-09-26 19:57:30 UTC (rev 222515)
@@ -44,11 +44,14 @@
OBJC_CLASS WebAVSampleBufferStatusChangeListener;
typedef struct opaqueCMSampleBuffer *CMSampleBufferRef;
+namespace PAL {
+class Clock;
+}
+
namespace WebCore {
class AudioTrackPrivateMediaStreamCocoa;
class AVVideoCaptureSource;
-class Clock;
class MediaSourcePrivateClient;
class PixelBufferConformerCV;
class VideoTrackPrivateMediaStream;
@@ -229,7 +232,7 @@
RetainPtr<WebAVSampleBufferStatusChangeListener> m_statusChangeListener;
RetainPtr<AVSampleBufferDisplayLayer> m_sampleBufferDisplayLayer;
RetainPtr<PlatformLayer> m_backgroundLayer;
- std::unique_ptr<Clock> m_clock;
+ std::unique_ptr<PAL::Clock> m_clock;
MediaTime m_pausedTime;
Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm (222514 => 222515)
--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm 2017-09-26 19:14:08 UTC (rev 222514)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm 2017-09-26 19:57:30 UTC (rev 222515)
@@ -29,7 +29,6 @@
#if ENABLE(MEDIA_STREAM) && USE(AVFOUNDATION)
#import "AudioTrackPrivateMediaStreamCocoa.h"
-#import "Clock.h"
#import "GraphicsContextCG.h"
#import "Logging.h"
#import "MediaStreamPrivate.h"
@@ -41,6 +40,7 @@
#import <objc_runtime.h>
#import <pal/avfoundation/MediaTimeAVFoundation.h>
#import <pal/spi/mac/AVFoundationSPI.h>
+#import <pal/system/Clock.h>
#import <wtf/Function.h>
#import <wtf/MainThread.h>
#import <wtf/NeverDestroyed.h>
@@ -189,7 +189,7 @@
MediaPlayerPrivateMediaStreamAVFObjC::MediaPlayerPrivateMediaStreamAVFObjC(MediaPlayer* player)
: m_player(player)
, m_statusChangeListener(adoptNS([[WebAVSampleBufferStatusChangeListener alloc] initWithParent:this]))
- , m_clock(Clock::create())
+ , m_clock(PAL::Clock::create())
#if PLATFORM(IOS) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))
, m_videoFullscreenLayerManager(VideoFullscreenLayerManager::create())
#endif
Deleted: trunk/Source/WebCore/platform/mac/PlatformClockCA.cpp (222514 => 222515)
--- trunk/Source/WebCore/platform/mac/PlatformClockCA.cpp 2017-09-26 19:14:08 UTC (rev 222514)
+++ trunk/Source/WebCore/platform/mac/PlatformClockCA.cpp 2017-09-26 19:57:30 UTC (rev 222515)
@@ -1,121 +0,0 @@
-/*
- * Copyright (C) 2011 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-
-#if USE(COREAUDIO)
-
-#include "PlatformClockCA.h"
-
-#include <AudioToolbox/CoreAudioClock.h>
-#include <CoreAudio/AudioHardware.h>
-
-using namespace WebCore;
-
-PlatformClockCA::PlatformClockCA()
- : m_clock(0)
- , m_running(false)
-{
- CAClockNew(0, &m_clock);
- UInt32 timebase = kCAClockTimebase_AudioDevice;
- UInt32 timebaseSize = sizeof(timebase);
- CAClockSetProperty(m_clock, kCAClockProperty_InternalTimebase, timebaseSize, &timebase);
-
- AudioObjectID defaultAudioOutput = 0;
- UInt32 defaultAudioOutputSize = sizeof(defaultAudioOutput);
-
- AudioObjectPropertyAddress address;
- address.mSelector = kAudioHardwarePropertyDefaultOutputDevice;
- address.mScope = kAudioObjectPropertyScopeGlobal;
- address.mElement = kAudioObjectPropertyElementMaster;
-
- AudioObjectGetPropertyData(kAudioObjectSystemObject, &address, 0, 0, &defaultAudioOutputSize, &defaultAudioOutput);
- CAClockSetProperty(m_clock, kCAClockProperty_TimebaseSource, defaultAudioOutputSize, &defaultAudioOutput);
-}
-
-PlatformClockCA::~PlatformClockCA()
-{
- CAClockDispose(m_clock);
-}
-
-void PlatformClockCA::setCurrentTime(double time)
-{
- if (m_running)
- CAClockStop(m_clock);
- CAClockTime caTime;
- caTime.format = kCAClockTimeFormat_Seconds;
- caTime.time.seconds = time;
- CAClockSetCurrentTime(m_clock, &caTime);
- if (m_running)
- CAClockStart(m_clock);
-}
-
-double PlatformClockCA::currentTime() const
-{
- CAClockTime caTime;
-
- // CAClock does not return the correct current time when stopped. Instead, query for
- // what is the start time, i.e. what the current time will be when started.
- if (m_running) {
- if (CAClockGetCurrentTime(m_clock, kCAClockTimeFormat_Seconds, &caTime) == noErr)
- return caTime.time.seconds;
- } else {
- if (CAClockGetStartTime(m_clock, kCAClockTimeFormat_Seconds, &caTime) == noErr)
- return caTime.time.seconds;
- }
- return 0;
-}
-
-void PlatformClockCA::setPlayRate(double rate)
-{
- CAClockSetPlayRate(m_clock, rate);
-}
-
-double PlatformClockCA::PlatformClockCA::playRate() const
-{
- double rate = 0;
- if (CAClockGetPlayRate(m_clock, &rate) == noErr)
- return rate;
- return 0;
-}
-
-void PlatformClockCA::start()
-{
- if (m_running)
- return;
- m_running = true;
- CAClockStart(m_clock);
-}
-
-void PlatformClockCA::stop()
-{
- if (!m_running)
- return;
- m_running = false;
- CAClockStop(m_clock);
-}
-
-
-#endif
Deleted: trunk/Source/WebCore/platform/mac/PlatformClockCA.h (222514 => 222515)
--- trunk/Source/WebCore/platform/mac/PlatformClockCA.h 2017-09-26 19:14:08 UTC (rev 222514)
+++ trunk/Source/WebCore/platform/mac/PlatformClockCA.h 2017-09-26 19:57:30 UTC (rev 222515)
@@ -1,61 +0,0 @@
-/*
- * Copyright (C) 2011 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef PlatformClockCA_h
-#define PlatformClockCA_h
-
-#if USE(COREAUDIO)
-
-#include "Clock.h"
-
-typedef struct OpaqueCAClock *CAClockRef;
-
-namespace WebCore {
-
-class PlatformClockCA final : public Clock {
-public:
- PlatformClockCA();
- virtual ~PlatformClockCA();
-
-private:
- void setCurrentTime(double) override;
- double currentTime() const override;
-
- void setPlayRate(double) override;
- double playRate() const override;
-
- void start() override;
- void stop() override;
- bool isRunning() const override { return m_running; }
-
- CAClockRef m_clock;
- bool m_running;
-};
-
-}
-
-#endif
-
-#endif
Deleted: trunk/Source/WebCore/platform/mac/PlatformClockCM.h (222514 => 222515)
--- trunk/Source/WebCore/platform/mac/PlatformClockCM.h 2017-09-26 19:14:08 UTC (rev 222514)
+++ trunk/Source/WebCore/platform/mac/PlatformClockCM.h 2017-09-26 19:57:30 UTC (rev 222515)
@@ -1,72 +0,0 @@
-/*
- * Copyright (C) 2012 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef PlatformClockCM_h
-#define PlatformClockCM_h
-
-#if USE(COREMEDIA)
-
-#include "Clock.h"
-#include <wtf/MediaTime.h>
-#include <wtf/RetainPtr.h>
-
-typedef struct OpaqueCMTimebase* CMTimebaseRef;
-typedef struct OpaqueCMClock* CMClockRef;
-
-namespace WebCore {
-
-class PlatformClockCM final : public Clock {
-public:
- PlatformClockCM();
- PlatformClockCM(CMClockRef);
-
- void setCurrentTime(double) override;
- double currentTime() const override;
-
- void setCurrentMediaTime(const MediaTime&);
- MediaTime currentMediaTime() const;
-
- void setPlayRate(double) override;
- double playRate() const override { return m_rate; }
-
- void start() override;
- void stop() override;
- bool isRunning() const override { return m_running; }
-
- CMTimebaseRef timebase() const { return m_timebase.get(); }
-
-private:
- void initializeWithTimingSource(CMClockRef);
-
- RetainPtr<CMTimebaseRef> m_timebase;
- double m_rate;
- bool m_running;
-};
-
-}
-
-#endif
-
-#endif
Deleted: trunk/Source/WebCore/platform/mac/PlatformClockCM.mm (222514 => 222515)
--- trunk/Source/WebCore/platform/mac/PlatformClockCM.mm 2017-09-26 19:14:08 UTC (rev 222514)
+++ trunk/Source/WebCore/platform/mac/PlatformClockCM.mm 2017-09-26 19:57:30 UTC (rev 222515)
@@ -1,118 +0,0 @@
-/*
- * Copyright (C) 2012, 2015 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#import "config.h"
-
-#if USE(COREMEDIA)
-
-#import "PlatformClockCM.h"
-
-#import <pal/avfoundation/MediaTimeAVFoundation.h>
-
-#import "CoreMediaSoftLink.h"
-
-using namespace WebCore;
-
-// A default time scale of 1000 allows milli-second CMTime precision without scaling the timebase.
-static const int32_t DefaultTimeScale = 1000;
-
-PlatformClockCM::PlatformClockCM()
- : m_timebase(0)
- , m_rate(1)
- , m_running(false)
-{
- CMClockRef rawClockPtr = 0;
-#if PLATFORM(IOS)
- CMAudioClockCreate(kCFAllocatorDefault, &rawClockPtr);
-#else
- CMAudioDeviceClockCreate(kCFAllocatorDefault, NULL, &rawClockPtr);
-#endif
- RetainPtr<CMClockRef> clock = adoptCF(rawClockPtr);
- initializeWithTimingSource(clock.get());
-}
-
-PlatformClockCM::PlatformClockCM(CMClockRef clock)
- : m_timebase(0)
- , m_running(false)
-{
- initializeWithTimingSource(clock);
-}
-
-void PlatformClockCM::initializeWithTimingSource(CMClockRef clock)
-{
- CMTimebaseRef rawTimebasePtr = 0;
- CMTimebaseCreateWithMasterClock(kCFAllocatorDefault, clock, &rawTimebasePtr);
- m_timebase = adoptCF(rawTimebasePtr);
-}
-
-void PlatformClockCM::setCurrentTime(double time)
-{
- CMTime cmTime = CMTimeMakeWithSeconds(time, DefaultTimeScale);
- CMTimebaseSetTime(m_timebase.get(), cmTime);
-}
-
-double PlatformClockCM::currentTime() const
-{
- CMTime cmTime = CMTimebaseGetTime(m_timebase.get());
- return CMTimeGetSeconds(cmTime);
-}
-
-void PlatformClockCM::setCurrentMediaTime(const MediaTime& time)
-{
- CMTimebaseSetTime(m_timebase.get(), PAL::toCMTime(time));
-}
-
-MediaTime PlatformClockCM::currentMediaTime() const
-{
- return PAL::toMediaTime(CMTimebaseGetTime(m_timebase.get()));
-}
-
-void PlatformClockCM::setPlayRate(double rate)
-{
- if (m_rate == rate)
- return;
-
- m_rate = rate;
- if (m_running)
- CMTimebaseSetRate(m_timebase.get(), rate);
-}
-
-void PlatformClockCM::start()
-{
- if (m_running)
- return;
- m_running = true;
- CMTimebaseSetRate(m_timebase.get(), m_rate);
-}
-
-void PlatformClockCM::stop()
-{
- if (!m_running)
- return;
- m_running = false;
- CMTimebaseSetRate(m_timebase.get(), 0);
-}
-
-#endif