Diff
Modified: trunk/Source/WebCore/ChangeLog (222325 => 222326)
--- trunk/Source/WebCore/ChangeLog 2017-09-21 17:12:24 UTC (rev 222325)
+++ trunk/Source/WebCore/ChangeLog 2017-09-21 17:33:52 UTC (rev 222326)
@@ -1,3 +1,85 @@
+2017-09-21 Yoshiaki Jitsukawa <[email protected]>
+
+ [PAL] Move MediaTimeAVFoundation into PAL
+ https://bugs.webkit.org/show_bug.cgi?id=177222
+
+ Reviewed by Myles C. Maxfield.
+
+ No new tests. No change in behavior..
+
+ * Configurations/WebCore.unexp:
+ * PlatformAppleWin.cmake:
+ * WebCore.xcodeproj/project.pbxproj:
+ * platform/audio/mac/AudioSampleDataSource.mm:
+ (WebCore::AudioSampleDataSource::pushSamples):
+ * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
+ (WebCore::AudioSourceProviderAVFObjC::process):
+ * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
+ (WebCore::InbandTextTrackPrivateAVF::readNativeSampleBuffer):
+ * platform/graphics/avfoundation/MediaSampleAVFObjC.h:
+ * platform/graphics/avfoundation/cf/InbandTextTrackPrivateAVCF.cpp:
+ * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
+ (WebCore::MediaPlayerPrivateAVFoundationCF::platformDuration const):
+ (WebCore::MediaPlayerPrivateAVFoundationCF::currentMediaTime const):
+ (WebCore::MediaPlayerPrivateAVFoundationCF::platformBufferedTimeRanges const):
+ (WebCore::MediaPlayerPrivateAVFoundationCF::platformMinTimeSeekable const):
+ (WebCore::MediaPlayerPrivateAVFoundationCF::platformMaxTimeSeekable const):
+ (WebCore::MediaPlayerPrivateAVFoundationCF::platformMaxTimeLoaded const):
+ (WebCore::AVFWrapper::seekToTime):
+ (WebCore::AVFWrapper::legibleOutputCallback):
+ (WebCore::AVFWrapper::createImageForTimeInRect):
+ * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
+ (WebCore::ImageDecoderAVFObjC::readSampleMetadata):
+ (WebCore::ImageDecoderAVFObjC::storeSampleBuffer):
+ (WebCore::ImageDecoderAVFObjC::createFrameImageAtIndex):
+ * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
+ (WebCore::MediaPlayerPrivateAVFoundationObjC::platformDuration const):
+ (WebCore::MediaPlayerPrivateAVFoundationObjC::currentMediaTime const):
+ (WebCore::MediaPlayerPrivateAVFoundationObjC::seekToTime):
+ (WebCore::MediaPlayerPrivateAVFoundationObjC::platformBufferedTimeRanges const):
+ (WebCore::MediaPlayerPrivateAVFoundationObjC::platformMinTimeSeekable const):
+ (WebCore::MediaPlayerPrivateAVFoundationObjC::platformMaxTimeSeekable const):
+ (WebCore::MediaPlayerPrivateAVFoundationObjC::platformMaxTimeLoaded const):
+ (WebCore::MediaPlayerPrivateAVFoundationObjC::metadataDidArrive):
+ (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
+ (-[WebCoreAVFMovieObserver legibleOutput:didOutputAttributedStrings:nativeSampleBuffers:forItemTime:]):
+ * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
+ (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC):
+ (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::currentMediaTime const):
+ (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekInternal):
+ (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::durationChanged):
+ (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::sizeWillChangeAtTime):
+ * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
+ (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::calculateTimelineOffset):
+ * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm:
+ (WebCore::MediaSampleAVFObjC::presentationTime const):
+ (WebCore::MediaSampleAVFObjC::outputPresentationTime const):
+ (WebCore::MediaSampleAVFObjC::decodeTime const):
+ (WebCore::MediaSampleAVFObjC::duration const):
+ (WebCore::MediaSampleAVFObjC::outputDuration const):
+ (WebCore::MediaSampleAVFObjC::offsetTimestampsBy):
+ (WebCore::MediaSampleAVFObjC::setTimestamps):
+ (WebCore::MediaSampleAVFObjC::divide):
+ * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
+ (WebCore::SourceBufferPrivateAVFObjC::didParseStreamDataAsAsset):
+ * platform/graphics/cocoa/WebCoreDecompressionSession.mm:
+ (WebCore::WebCoreDecompressionSession::handleDecompressionOutput):
+ (WebCore::WebCoreDecompressionSession::automaticDequeue):
+ (WebCore::WebCoreDecompressionSession::enqueueDecodedSample):
+ (WebCore::WebCoreDecompressionSession::imageForTime):
+ * platform/mac/PlatformClockCM.mm:
+ (PlatformClockCM::setCurrentMediaTime):
+ (PlatformClockCM::currentMediaTime const):
+ * platform/mac/PlaybackSessionInterfaceMac.mm:
+ (WebCore::timeRangesToArray):
+ * platform/mac/VideoFullscreenInterfaceMac.mm:
+ * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
+ * platform/mediastream/mac/MockRealtimeAudioSourceMac.mm:
+ (WebCore::MockRealtimeAudioSourceMac::emitSampleBuffers):
+ * platform/mediastream/mac/RealtimeIncomingAudioSource.cpp:
+ (WebCore::RealtimeIncomingAudioSource::OnData):
+ * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm:
+
2017-09-21 Alex Christensen <[email protected]>
Fix ASAN build after r222306
Modified: trunk/Source/WebCore/Configurations/WebCore.unexp (222325 => 222326)
--- trunk/Source/WebCore/Configurations/WebCore.unexp 2017-09-21 17:12:24 UTC (rev 222325)
+++ trunk/Source/WebCore/Configurations/WebCore.unexp 2017-09-21 17:33:52 UTC (rev 222326)
@@ -59,3 +59,14 @@
__ZTVN9Inspector17ScriptDebugServer4TaskE
# Source/_javascript_Core/inspector/agents/InspectorDebuggerAgent.h
__ZTVN9Inspector22InspectorDebuggerAgent8ListenerE
+
+# Member functions of an exported C++ class in WTF
+
+# Source/WTF/wtf/MediaTime.h
+__ZNK3WTF9MediaTime14hasBeenRoundedEv
+__ZNK3WTF9MediaTime14hasDoubleValueEv
+__ZNK3WTF9MediaTime18isNegativeInfiniteEv
+__ZNK3WTF9MediaTime18isPositiveInfiniteEv
+__ZNK3WTF9MediaTime7isValidEv
+__ZNK3WTF9MediaTime9timeScaleEv
+__ZNK3WTF9MediaTime9timeValueEv
Modified: trunk/Source/WebCore/PAL/ChangeLog (222325 => 222326)
--- trunk/Source/WebCore/PAL/ChangeLog 2017-09-21 17:12:24 UTC (rev 222325)
+++ trunk/Source/WebCore/PAL/ChangeLog 2017-09-21 17:33:52 UTC (rev 222326)
@@ -1,3 +1,25 @@
+2017-09-21 Yoshiaki Jitsukawa <[email protected]>
+
+ [PAL] Move MediaTimeAVFoundation into PAL
+ https://bugs.webkit.org/show_bug.cgi?id=177222
+
+ Reviewed by Myles C. Maxfield.
+
+ * config.h:
+ Include PALHeaderDetection.h.
+ Define AVFOUNDATION-releavant definitions.
+
+ * pal/PlatformWin.cmake:
+ Add PAL dereived sources directory to include paths.
+
+ * PAL.xcodeproj/project.pbxproj:
+ * pal/CMakeLists.txt:
+ * pal/PlatformAppleWin.cmake:
+ * pal/avfoundation/MediaTimeAVFoundation.cpp: Renamed from Source/WebCore/platform/graphics/avfoundation/MediaTimeAVFoundation.cpp.
+ * pal/avfoundation/MediaTimeAVFoundation.h: Renamed from Source/WebCore/platform/graphics/avfoundation/MediaTimeAVFoundation.h.
+ * pal/cf/CoreMediaSoftLink.cpp: Added.
+ * pal/cf/CoreMediaSoftLink.h: Added.
+
2017-09-20 Antti Koivisto <[email protected]>
Remove DOM and styling support for CSS Regions
Modified: trunk/Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj (222325 => 222326)
--- trunk/Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj 2017-09-21 17:12:24 UTC (rev 222325)
+++ trunk/Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj 2017-09-21 17:33:52 UTC (rev 222326)
@@ -23,6 +23,7 @@
/* Begin PBXBuildFile section */
0708AC331F4C874B001F788F /* Logger.h in Headers */ = {isa = PBXBuildFile; fileRef = 0708AC321F4C874A001F788F /* Logger.h */; };
07377ADC1F5777D90027F16D /* LoggerHelper.h in Headers */ = {isa = PBXBuildFile; fileRef = 07377ADB1F5777D70027F16D /* LoggerHelper.h */; };
+ 0C00CFD41F68CE4600AAC26D /* MediaTimeAVFoundation.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C00CFD21F68CE4600AAC26D /* MediaTimeAVFoundation.h */; };
0C2D9E731EEF5AF600DBC317 /* ExportMacros.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C2D9E721EEF5AF600DBC317 /* ExportMacros.h */; };
0C2DA06D1F33CA8400DBC317 /* CFLocaleSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C2DA0671F33CA8400DBC317 /* CFLocaleSPI.h */; };
0C2DA06E1F33CA8400DBC317 /* CFNetworkConnectionCacheSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C2DA0681F33CA8400DBC317 /* CFNetworkConnectionCacheSPI.h */; };
@@ -95,6 +96,9 @@
0C77859F1F45130F00F4EBB6 /* QTKitSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C7785861F45130F00F4EBB6 /* QTKitSPI.h */; };
0C7785A01F45130F00F4EBB6 /* QuickLookMacSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C7785871F45130F00F4EBB6 /* QuickLookMacSPI.h */; };
0C7785A11F45130F00F4EBB6 /* TUCallSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C7785881F45130F00F4EBB6 /* TUCallSPI.h */; };
+ 0CF99CA41F736375007EE793 /* MediaTimeAVFoundation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0C00CFD11F68CE4600AAC26D /* MediaTimeAVFoundation.cpp */; };
+ 0CF99CA81F738437007EE793 /* CoreMediaSoftLink.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0CF99CA61F738436007EE793 /* CoreMediaSoftLink.cpp */; };
+ 0CF99CA91F738437007EE793 /* CoreMediaSoftLink.h in Headers */ = {isa = PBXBuildFile; fileRef = 0CF99CA71F738437007EE793 /* CoreMediaSoftLink.h */; };
1C09D0531E31C44100725F18 /* CryptoDigest.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C09D0521E31C44100725F18 /* CryptoDigest.h */; };
1C09D0561E31C46500725F18 /* CryptoDigestCommonCrypto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1C09D0551E31C46500725F18 /* CryptoDigestCommonCrypto.cpp */; };
1C09D0581E31C57E00725F18 /* config.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C09D0571E31C57E00725F18 /* config.h */; };
@@ -145,6 +149,8 @@
/* Begin PBXFileReference section */
0708AC321F4C874A001F788F /* Logger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Logger.h; sourceTree = "<group>"; };
07377ADB1F5777D70027F16D /* LoggerHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LoggerHelper.h; sourceTree = "<group>"; };
+ 0C00CFD11F68CE4600AAC26D /* MediaTimeAVFoundation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MediaTimeAVFoundation.cpp; path = avfoundation/MediaTimeAVFoundation.cpp; sourceTree = "<group>"; };
+ 0C00CFD21F68CE4600AAC26D /* MediaTimeAVFoundation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MediaTimeAVFoundation.h; path = avfoundation/MediaTimeAVFoundation.h; sourceTree = "<group>"; };
0C2D9E721EEF5AF600DBC317 /* ExportMacros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ExportMacros.h; sourceTree = "<group>"; };
0C2DA0671F33CA8400DBC317 /* CFLocaleSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CFLocaleSPI.h; sourceTree = "<group>"; };
0C2DA0681F33CA8400DBC317 /* CFNetworkConnectionCacheSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CFNetworkConnectionCacheSPI.h; sourceTree = "<group>"; };
@@ -217,6 +223,8 @@
0C7785861F45130F00F4EBB6 /* QTKitSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = QTKitSPI.h; sourceTree = "<group>"; };
0C7785871F45130F00F4EBB6 /* QuickLookMacSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = QuickLookMacSPI.h; sourceTree = "<group>"; };
0C7785881F45130F00F4EBB6 /* TUCallSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TUCallSPI.h; sourceTree = "<group>"; };
+ 0CF99CA61F738436007EE793 /* CoreMediaSoftLink.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CoreMediaSoftLink.cpp; path = pal/cf/CoreMediaSoftLink.cpp; sourceTree = SOURCE_ROOT; };
+ 0CF99CA71F738437007EE793 /* CoreMediaSoftLink.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CoreMediaSoftLink.h; path = pal/cf/CoreMediaSoftLink.h; sourceTree = SOURCE_ROOT; };
1C09D03D1E31C32800725F18 /* libPAL.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPAL.a; sourceTree = BUILT_PRODUCTS_DIR; };
1C09D0521E31C44100725F18 /* CryptoDigest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoDigest.h; sourceTree = "<group>"; };
1C09D0551E31C46500725F18 /* CryptoDigestCommonCrypto.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CryptoDigestCommonCrypto.cpp; path = commoncrypto/CryptoDigestCommonCrypto.cpp; sourceTree = "<group>"; };
@@ -272,6 +280,15 @@
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
+ 0C00CFCC1F68CE2300AAC26D /* avfoundation */ = {
+ isa = PBXGroup;
+ children = (
+ 0C00CFD11F68CE4600AAC26D /* MediaTimeAVFoundation.cpp */,
+ 0C00CFD21F68CE4600AAC26D /* MediaTimeAVFoundation.h */,
+ );
+ name = avfoundation;
+ sourceTree = "<group>";
+ };
0C2DA0651F33CA3300DBC317 /* spi */ = {
isa = PBXGroup;
children = (
@@ -400,6 +417,16 @@
path = mac;
sourceTree = "<group>";
};
+ 0CF99CA51F73841C007EE793 /* cf */ = {
+ isa = PBXGroup;
+ children = (
+ 0CF99CA61F738436007EE793 /* CoreMediaSoftLink.cpp */,
+ 0CF99CA71F738437007EE793 /* CoreMediaSoftLink.h */,
+ );
+ name = cf;
+ path = "New Group";
+ sourceTree = "<group>";
+ };
1C09D0341E31C32800725F18 = {
isa = PBXGroup;
children = (
@@ -421,6 +448,8 @@
1C09D03F1E31C32800725F18 /* pal */ = {
isa = PBXGroup;
children = (
+ 0C00CFCC1F68CE2300AAC26D /* avfoundation */,
+ 0CF99CA51F73841C007EE793 /* cf */,
1C09D0511E31C41200725F18 /* crypto */,
0C2DA0651F33CA3300DBC317 /* spi */,
A3788E9F1F05B7CE00679425 /* system */,
@@ -539,6 +568,7 @@
1C09D0581E31C57E00725F18 /* config.h in Headers */,
0C2DA0711F33CA8400DBC317 /* CoreAudioSPI.h in Headers */,
0C2DA11E1F3BE9E000DBC317 /* CoreGraphicsSPI.h in Headers */,
+ 0CF99CA91F738437007EE793 /* CoreMediaSoftLink.h in Headers */,
0C2DA0721F33CA8400DBC317 /* CoreMediaSPI.h in Headers */,
0C2DA1401F3BEB4900DBC317 /* CoreTextSPI.h in Headers */,
0C5AF9191F43A4C7002EAC02 /* CoreUISPI.h in Headers */,
@@ -567,6 +597,7 @@
0C2DA1481F3BEB4900DBC317 /* MachVMSPI.h in Headers */,
0C5AF91D1F43A4C7002EAC02 /* MediaPlayerSPI.h in Headers */,
0C77858C1F45130F00F4EBB6 /* MediaRemoteSPI.h in Headers */,
+ 0C00CFD41F68CE4600AAC26D /* MediaTimeAVFoundation.h in Headers */,
A1F55DCF1F5528EC00EDB75F /* MetadataSPI.h in Headers */,
0C5AF91E1F43A4C7002EAC02 /* MobileGestaltSPI.h in Headers */,
0C2DA1491F3BEB4900DBC317 /* NEFilterSourceSPI.h in Headers */,
@@ -713,10 +744,12 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
+ 0CF99CA81F738437007EE793 /* CoreMediaSoftLink.cpp in Sources */,
1C09D0561E31C46500725F18 /* CryptoDigestCommonCrypto.cpp in Sources */,
A1175B581F6B470500C4B9F0 /* DefaultSearchProvider.cpp in Sources */,
A30D41221F0DD0EA00B71954 /* KillRing.cpp in Sources */,
A30D41251F0DD12D00B71954 /* KillRingMac.mm in Sources */,
+ 0CF99CA41F736375007EE793 /* MediaTimeAVFoundation.cpp in Sources */,
A1175B4F1F6B337300C4B9F0 /* PopupMenu.mm in Sources */,
A3C66CDC1F462D6A009E6EE9 /* SessionID.cpp in Sources */,
A3AB6E521F3D1DC5009C14B1 /* SleepDisabler.cpp in Sources */,
Modified: trunk/Source/WebCore/PAL/config.h (222325 => 222326)
--- trunk/Source/WebCore/PAL/config.h 2017-09-21 17:12:24 UTC (rev 222325)
+++ trunk/Source/WebCore/PAL/config.h 2017-09-21 17:33:52 UTC (rev 222326)
@@ -23,6 +23,12 @@
#include "cmakeconfig.h"
#endif
+#include <wtf/Platform.h>
+
+#if PLATFORM(WIN)
+#include <PALHeaderDetection.h>
+#endif
+
#include <pal/ExportMacros.h>
#ifdef __cplusplus
@@ -38,3 +44,15 @@
#endif
#include <wtf/DisallowCType.h>
+
+#if PLATFORM(WIN) && USE(CG) && HAVE(AVCF)
+#define USE_AVFOUNDATION 1
+
+#if HAVE(AVCF_LEGIBLE_OUTPUT)
+#define USE_AVFOUNDATION 1
+#define HAVE_AVFOUNDATION_MEDIA_SELECTION_GROUP 1
+#define HAVE_AVFOUNDATION_LEGIBLE_OUTPUT_SUPPORT 1
+#define HAVE_MEDIA_ACCESSIBILITY_FRAMEWORK 1
+#endif
+
+#endif
Modified: trunk/Source/WebCore/PAL/pal/CMakeLists.txt (222325 => 222326)
--- trunk/Source/WebCore/PAL/pal/CMakeLists.txt 2017-09-21 17:12:24 UTC (rev 222325)
+++ trunk/Source/WebCore/PAL/pal/CMakeLists.txt 2017-09-21 17:33:52 UTC (rev 222326)
@@ -17,7 +17,7 @@
)
set(PAL_LIBRARIES
- WTF
+ PRIVATE WTF
)
WEBKIT_FRAMEWORK_DECLARE(PAL)
Modified: trunk/Source/WebCore/PAL/pal/PlatformAppleWin.cmake (222325 => 222326)
--- trunk/Source/WebCore/PAL/pal/PlatformAppleWin.cmake 2017-09-21 17:12:24 UTC (rev 222325)
+++ trunk/Source/WebCore/PAL/pal/PlatformAppleWin.cmake 2017-09-21 17:33:52 UTC (rev 222326)
@@ -8,3 +8,13 @@
spi/cg
)
endif ()
+
+list(APPEND PAL_SOURCES
+ avfoundation/MediaTimeAVFoundation.cpp
+
+ cf/CoreMediaSoftLink.cpp
+)
+
+list(APPEND PAL_PRIVATE_INCLUDE_DIRECTORIES
+ "${PAL_DIR}/pal/cf"
+)
Modified: trunk/Source/WebCore/PAL/pal/PlatformWin.cmake (222325 => 222326)
--- trunk/Source/WebCore/PAL/pal/PlatformWin.cmake 2017-09-21 17:12:24 UTC (rev 222325)
+++ trunk/Source/WebCore/PAL/pal/PlatformWin.cmake 2017-09-21 17:33:52 UTC (rev 222326)
@@ -9,6 +9,7 @@
list(APPEND PAL_INCLUDE_DIRECTORIES
"${CMAKE_BINARY_DIR}"
"${CMAKE_BINARY_DIR}/../include/private"
+ "${DERIVED_SOURCES_PAL_DIR}"
)
list(APPEND PAL_FORWARDING_HEADERS_DIRECTORIES .)
Copied: trunk/Source/WebCore/PAL/pal/avfoundation/MediaTimeAVFoundation.cpp (from rev 222325, trunk/Source/WebCore/platform/graphics/avfoundation/MediaTimeAVFoundation.cpp) (0 => 222326)
--- trunk/Source/WebCore/PAL/pal/avfoundation/MediaTimeAVFoundation.cpp (rev 0)
+++ trunk/Source/WebCore/PAL/pal/avfoundation/MediaTimeAVFoundation.cpp 2017-09-21 17:33:52 UTC (rev 222326)
@@ -0,0 +1,80 @@
+/*
+ * Copyright (C) 2013-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.
+ */
+
+#include "config.h"
+#include "MediaTimeAVFoundation.h"
+
+#if USE(AVFOUNDATION)
+
+#include "CoreMediaSoftLink.h"
+
+namespace PAL {
+
+static bool CMTimeHasFlags(const CMTime& cmTime, uint32_t flags)
+{
+ return (cmTime.flags & flags) == flags;
+}
+
+MediaTime toMediaTime(const CMTime& cmTime)
+{
+ uint32_t flags = 0;
+ if (CMTimeHasFlags(cmTime, kCMTimeFlags_Valid))
+ flags |= MediaTime::Valid;
+ if (CMTimeHasFlags(cmTime, kCMTimeFlags_Valid | kCMTimeFlags_HasBeenRounded))
+ flags |= MediaTime::HasBeenRounded;
+ if (CMTimeHasFlags(cmTime, kCMTimeFlags_Valid | kCMTimeFlags_PositiveInfinity))
+ flags |= MediaTime::PositiveInfinite;
+ if (CMTimeHasFlags(cmTime, kCMTimeFlags_Valid | kCMTimeFlags_NegativeInfinity))
+ flags |= MediaTime::NegativeInfinite;
+ if (CMTimeHasFlags(cmTime, kCMTimeFlags_Valid | kCMTimeFlags_Indefinite))
+ flags |= MediaTime::Indefinite;
+
+ return MediaTime(cmTime.value, cmTime.timescale, flags);
+}
+
+CMTime toCMTime(const MediaTime& mediaTime)
+{
+ CMTime time;
+
+ if (mediaTime.hasDoubleValue())
+ time = CMTimeMakeWithSeconds(mediaTime.toDouble(), mediaTime.timeScale());
+ else
+ time = CMTimeMake(mediaTime.timeValue(), mediaTime.timeScale());
+
+ if (mediaTime.isValid())
+ time.flags |= kCMTimeFlags_Valid;
+ if (mediaTime.hasBeenRounded())
+ time.flags |= kCMTimeFlags_HasBeenRounded;
+ if (mediaTime.isPositiveInfinite())
+ time.flags |= kCMTimeFlags_PositiveInfinity;
+ if (mediaTime.isNegativeInfinite())
+ time.flags |= kCMTimeFlags_NegativeInfinity;
+
+ return time;
+}
+
+}
+
+#endif
Copied: trunk/Source/WebCore/PAL/pal/avfoundation/MediaTimeAVFoundation.h (from rev 222325, trunk/Source/WebCore/platform/graphics/avfoundation/MediaTimeAVFoundation.h) (0 => 222326)
--- trunk/Source/WebCore/PAL/pal/avfoundation/MediaTimeAVFoundation.h (rev 0)
+++ trunk/Source/WebCore/PAL/pal/avfoundation/MediaTimeAVFoundation.h 2017-09-21 17:33:52 UTC (rev 222326)
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2013 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(AVFOUNDATION)
+
+#include <CoreMedia/CMTime.h>
+#include <wtf/MediaTime.h>
+
+namespace PAL {
+
+PAL_EXPORT CMTime toCMTime(const MediaTime&);
+PAL_EXPORT MediaTime toMediaTime(const CMTime&);
+
+}
+
+#endif
Added: trunk/Source/WebCore/PAL/pal/cf/CoreMediaSoftLink.cpp (0 => 222326)
--- trunk/Source/WebCore/PAL/pal/cf/CoreMediaSoftLink.cpp (rev 0)
+++ trunk/Source/WebCore/PAL/pal/cf/CoreMediaSoftLink.cpp 2017-09-21 17:33:52 UTC (rev 222326)
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2015 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"
+
+#if USE(AVFOUNDATION)
+// FIXME: Should be USE(COREMEDIA), but this isn't currently defined on Windows.
+
+#include <pal/spi/cf/CoreMediaSPI.h>
+#include <wtf/SoftLinking.h>
+
+SOFT_LINK_FRAMEWORK_FOR_SOURCE(PAL, CoreMedia)
+
+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))
+
+#endif // USE(AVFOUNDATION)
Added: trunk/Source/WebCore/PAL/pal/cf/CoreMediaSoftLink.h (0 => 222326)
--- trunk/Source/WebCore/PAL/pal/cf/CoreMediaSoftLink.h (rev 0)
+++ trunk/Source/WebCore/PAL/pal/cf/CoreMediaSoftLink.h 2017-09-21 17:33:52 UTC (rev 222326)
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2015 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
+
+#if USE(AVFOUNDATION)
+// FIXME: Should be USE(COREMEDIA), but this isn't currently defined on Windows.
+
+#include <pal/spi/cf/CoreMediaSPI.h>
+#include <wtf/SoftLinking.h>
+
+SOFT_LINK_FRAMEWORK_FOR_HEADER(PAL, CoreMedia)
+
+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
+
+#endif // USE(AVFOUNDATION)
Modified: trunk/Source/WebCore/PlatformAppleWin.cmake (222325 => 222326)
--- trunk/Source/WebCore/PlatformAppleWin.cmake 2017-09-21 17:12:24 UTC (rev 222325)
+++ trunk/Source/WebCore/PlatformAppleWin.cmake 2017-09-21 17:33:52 UTC (rev 222326)
@@ -37,7 +37,6 @@
platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.cpp
platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp
platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp
- platform/graphics/avfoundation/MediaTimeAVFoundation.cpp
platform/graphics/avfoundation/WebMediaSessionManagerMac.cpp
platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.cpp
Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (222325 => 222326)
--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2017-09-21 17:12:24 UTC (rev 222325)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2017-09-21 17:33:52 UTC (rev 222326)
@@ -6321,8 +6321,6 @@
CD62FB961AF018E70012ED7D /* GenericTaskQueue.h in Headers */ = {isa = PBXBuildFile; fileRef = CD62FB941AF018E70012ED7D /* GenericTaskQueue.h */; settings = {ATTRIBUTES = (Private, ); }; };
CD641EB31818F5ED00EE4C41 /* MediaSourcePrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = CD641EB11818F5ED00EE4C41 /* MediaSourcePrivate.h */; };
CD641EB41818F5ED00EE4C41 /* SourceBufferPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = CD641EB21818F5ED00EE4C41 /* SourceBufferPrivate.h */; };
- CD641EBF1819B36000EE4C41 /* MediaTimeAVFoundation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD641EBD1819B35900EE4C41 /* MediaTimeAVFoundation.cpp */; };
- CD641EC01819B36000EE4C41 /* MediaTimeAVFoundation.h in Headers */ = {isa = PBXBuildFile; fileRef = CD641EBE1819B35900EE4C41 /* MediaTimeAVFoundation.h */; };
CD669D681D23364B004D1866 /* MediaSessionManagerCocoa.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD669D661D232DFF004D1866 /* MediaSessionManagerCocoa.cpp */; };
CD7D33431C7A123F00041293 /* PixelBufferConformerCV.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD7D33411C7A123F00041293 /* PixelBufferConformerCV.cpp */; };
CD7D33441C7A123F00041293 /* PixelBufferConformerCV.h in Headers */ = {isa = PBXBuildFile; fileRef = CD7D33421C7A123F00041293 /* PixelBufferConformerCV.h */; };
@@ -15062,8 +15060,6 @@
CD62FB941AF018E70012ED7D /* GenericTaskQueue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GenericTaskQueue.h; sourceTree = "<group>"; };
CD641EB11818F5ED00EE4C41 /* MediaSourcePrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaSourcePrivate.h; sourceTree = "<group>"; };
CD641EB21818F5ED00EE4C41 /* SourceBufferPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SourceBufferPrivate.h; sourceTree = "<group>"; };
- CD641EBD1819B35900EE4C41 /* MediaTimeAVFoundation.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = MediaTimeAVFoundation.cpp; sourceTree = "<group>"; };
- CD641EBE1819B35900EE4C41 /* MediaTimeAVFoundation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MediaTimeAVFoundation.h; sourceTree = "<group>"; };
CD641EC7181ED60100EE4C41 /* MediaSample.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MediaSample.h; sourceTree = "<group>"; };
CD669D661D232DFF004D1866 /* MediaSessionManagerCocoa.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MediaSessionManagerCocoa.cpp; path = cocoa/MediaSessionManagerCocoa.cpp; sourceTree = "<group>"; };
CD669D671D232E10004D1866 /* MediaSessionManagerMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaSessionManagerMac.h; sourceTree = "<group>"; };
@@ -16643,8 +16639,6 @@
076F0D0A12B8192700C26AA4 /* MediaPlayerPrivateAVFoundation.h */,
CDBEAEAB19D92B6C00BEBA88 /* MediaSelectionGroupAVFObjC.h */,
CDBEAEAA19D92B6C00BEBA88 /* MediaSelectionGroupAVFObjC.mm */,
- CD641EBD1819B35900EE4C41 /* MediaTimeAVFoundation.cpp */,
- CD641EBE1819B35900EE4C41 /* MediaTimeAVFoundation.h */,
CD336F6317FA0A4D00DDDCD0 /* VideoTrackPrivateAVF.h */,
0709D7901AE5557E004E42F8 /* WebMediaSessionManagerMac.cpp */,
0709D7911AE5557E004E42F8 /* WebMediaSessionManagerMac.h */,
@@ -29316,7 +29310,6 @@
078E091817D14D1C00420AA1 /* MediaStreamTrack.h in Headers */,
078E091917D14D1C00420AA1 /* MediaStreamTrackEvent.h in Headers */,
07FFDE69181AED420072D409 /* MediaStreamTrackPrivate.h in Headers */,
- CD641EC01819B36000EE4C41 /* MediaTimeAVFoundation.h in Headers */,
CD60C0C7193E87C7003C656B /* MediaTimeQTKit.h in Headers */,
932CC0B71DFFD158004C0F9F /* MediaTrackConstraints.h in Headers */,
07C1C0E21BFB600100BD2256 /* MediaTrackSupportedConstraints.h in Headers */,
@@ -33378,7 +33371,6 @@
078E090217D14CEE00420AA1 /* MediaStreamTrack.cpp in Sources */,
078E090317D14CEE00420AA1 /* MediaStreamTrackEvent.cpp in Sources */,
07FFDE68181AED420072D409 /* MediaStreamTrackPrivate.cpp in Sources */,
- CD641EBF1819B36000EE4C41 /* MediaTimeAVFoundation.cpp in Sources */,
CD60C0C6193E87C7003C656B /* MediaTimeQTKit.mm in Sources */,
932CC0F71DFFDA1F004C0F9F /* MediaTrackConstraints.cpp in Sources */,
51E1BAC21BD8064E0055D81F /* MemoryBackingStoreTransaction.cpp in Sources */,
Modified: trunk/Source/WebCore/platform/audio/mac/AudioSampleDataSource.mm (222325 => 222326)
--- trunk/Source/WebCore/platform/audio/mac/AudioSampleDataSource.mm 2017-09-21 17:12:24 UTC (rev 222325)
+++ trunk/Source/WebCore/platform/audio/mac/AudioSampleDataSource.mm 2017-09-21 17:33:52 UTC (rev 222326)
@@ -31,11 +31,11 @@
#include "CAAudioStreamDescription.h"
#include "CARingBuffer.h"
#include "Logging.h"
-#include "MediaTimeAVFoundation.h"
#include <AudioToolbox/AudioConverter.h>
#include <mach/mach.h>
#include <mach/mach_time.h>
#include <mutex>
+#include <pal/avfoundation/MediaTimeAVFoundation.h>
#include <syslog.h>
#include <wtf/CurrentTime.h>
#include <wtf/StringPrintStream.h>
@@ -192,7 +192,7 @@
ASSERT(m_ringBuffer);
WebAudioBufferList list(*m_inputDescription, sampleBuffer);
- pushSamplesInternal(list, toMediaTime(CMSampleBufferGetPresentationTimeStamp(sampleBuffer)), CMSampleBufferGetNumSamples(sampleBuffer));
+ pushSamplesInternal(list, PAL::toMediaTime(CMSampleBufferGetPresentationTimeStamp(sampleBuffer)), CMSampleBufferGetNumSamples(sampleBuffer));
}
void AudioSampleDataSource::pushSamples(const MediaTime& sampleTime, const PlatformAudioData& audioData, size_t sampleCount)
Modified: trunk/Source/WebCore/platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm (222325 => 222326)
--- trunk/Source/WebCore/platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm 2017-09-21 17:12:24 UTC (rev 222325)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm 2017-09-21 17:33:52 UTC (rev 222326)
@@ -33,7 +33,6 @@
#import "AudioSourceProviderClient.h"
#import "CARingBuffer.h"
#import "Logging.h"
-#import "MediaTimeAVFoundation.h"
#import <AVFoundation/AVAssetTrack.h>
#import <AVFoundation/AVAudioMix.h>
#import <AVFoundation/AVMediaFormat.h>
@@ -40,6 +39,7 @@
#import <AVFoundation/AVPlayerItem.h>
#import <mutex>
#import <objc/runtime.h>
+#import <pal/avfoundation/MediaTimeAVFoundation.h>
#import <wtf/Lock.h>
#import <wtf/MainThread.h>
@@ -367,13 +367,13 @@
if (status != noErr || !itemCount)
return;
- MediaTime rangeStart = toMediaTime(rangeOut.start);
- MediaTime rangeDuration = toMediaTime(rangeOut.duration);
+ MediaTime rangeStart = PAL::toMediaTime(rangeOut.start);
+ MediaTime rangeDuration = PAL::toMediaTime(rangeOut.duration);
if (rangeStart.isInvalid())
return;
- MediaTime currentTime = toMediaTime(CMTimebaseGetTime([m_avPlayerItem timebase]));
+ MediaTime currentTime = PAL::toMediaTime(CMTimebaseGetTime([m_avPlayerItem timebase]));
if (currentTime.isInvalid())
return;
Modified: trunk/Source/WebCore/platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp (222325 => 222326)
--- trunk/Source/WebCore/platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp 2017-09-21 17:12:24 UTC (rev 222325)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp 2017-09-21 17:33:52 UTC (rev 222326)
@@ -32,17 +32,16 @@
#include "InbandTextTrackPrivateClient.h"
#include "Logging.h"
#include "MediaPlayer.h"
-#include "MediaTimeAVFoundation.h"
+#include <pal/avfoundation/MediaTimeAVFoundation.h>
#include <runtime/ArrayBuffer.h>
#include <runtime/DataView.h>
#include <runtime/Int8Array.h>
#include <wtf/MediaTime.h>
+#include <wtf/StringPrintStream.h>
#include <wtf/text/CString.h>
#include <wtf/text/StringBuilder.h>
#include <wtf/text/WTFString.h>
#include <wtf/unicode/CharacterNames.h>
-#include <wtf/StringPrintStream.h>
-
#include "CoreMediaSoftLink.h"
namespace WebCore {
@@ -555,7 +554,7 @@
return false;
}
- duration = toMediaTime(timingInfo.duration);
+ duration = PAL::toMediaTime(timingInfo.duration);
CMBlockBufferRef blockBuffer = CMSampleBufferGetDataBuffer(sampleBuffer);
size_t bufferLength = CMBlockBufferGetDataLength(blockBuffer);
Modified: trunk/Source/WebCore/platform/graphics/avfoundation/MediaSampleAVFObjC.h (222325 => 222326)
--- trunk/Source/WebCore/platform/graphics/avfoundation/MediaSampleAVFObjC.h 2017-09-21 17:12:24 UTC (rev 222325)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/MediaSampleAVFObjC.h 2017-09-21 17:33:52 UTC (rev 222326)
@@ -26,7 +26,7 @@
#pragma once
#include "MediaSample.h"
-#include "MediaTimeAVFoundation.h"
+#include <pal/avfoundation/MediaTimeAVFoundation.h>
#include <runtime/Uint8ClampedArray.h>
#include <wtf/Forward.h>
Deleted: trunk/Source/WebCore/platform/graphics/avfoundation/MediaTimeAVFoundation.cpp (222325 => 222326)
--- trunk/Source/WebCore/platform/graphics/avfoundation/MediaTimeAVFoundation.cpp 2017-09-21 17:12:24 UTC (rev 222325)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/MediaTimeAVFoundation.cpp 2017-09-21 17:33:52 UTC (rev 222326)
@@ -1,80 +0,0 @@
-/*
- * Copyright (C) 2013-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.
- */
-
-#include "config.h"
-#include "MediaTimeAVFoundation.h"
-
-#if USE(AVFOUNDATION)
-
-#include "CoreMediaSoftLink.h"
-
-namespace WebCore {
-
-static bool CMTimeHasFlags(const CMTime& cmTime, uint32_t flags)
-{
- return (cmTime.flags & flags) == flags;
-}
-
-MediaTime toMediaTime(const CMTime& cmTime)
-{
- uint32_t flags = 0;
- if (CMTimeHasFlags(cmTime, kCMTimeFlags_Valid))
- flags |= MediaTime::Valid;
- if (CMTimeHasFlags(cmTime, kCMTimeFlags_Valid | kCMTimeFlags_HasBeenRounded))
- flags |= MediaTime::HasBeenRounded;
- if (CMTimeHasFlags(cmTime, kCMTimeFlags_Valid | kCMTimeFlags_PositiveInfinity))
- flags |= MediaTime::PositiveInfinite;
- if (CMTimeHasFlags(cmTime, kCMTimeFlags_Valid | kCMTimeFlags_NegativeInfinity))
- flags |= MediaTime::NegativeInfinite;
- if (CMTimeHasFlags(cmTime, kCMTimeFlags_Valid | kCMTimeFlags_Indefinite))
- flags |= MediaTime::Indefinite;
-
- return MediaTime(cmTime.value, cmTime.timescale, flags);
-}
-
-CMTime toCMTime(const MediaTime& mediaTime)
-{
- CMTime time;
-
- if (mediaTime.hasDoubleValue())
- time = CMTimeMakeWithSeconds(mediaTime.toDouble(), mediaTime.timeScale());
- else
- time = CMTimeMake(mediaTime.timeValue(), mediaTime.timeScale());
-
- if (mediaTime.isValid())
- time.flags |= kCMTimeFlags_Valid;
- if (mediaTime.hasBeenRounded())
- time.flags |= kCMTimeFlags_HasBeenRounded;
- if (mediaTime.isPositiveInfinite())
- time.flags |= kCMTimeFlags_PositiveInfinity;
- if (mediaTime.isNegativeInfinite())
- time.flags |= kCMTimeFlags_NegativeInfinity;
-
- return time;
-}
-
-}
-
-#endif
Deleted: trunk/Source/WebCore/platform/graphics/avfoundation/MediaTimeAVFoundation.h (222325 => 222326)
--- trunk/Source/WebCore/platform/graphics/avfoundation/MediaTimeAVFoundation.h 2017-09-21 17:12:24 UTC (rev 222325)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/MediaTimeAVFoundation.h 2017-09-21 17:33:52 UTC (rev 222326)
@@ -1,43 +0,0 @@
-/*
- * Copyright (C) 2013 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 MediaTimeAVFoundation_h
-#define MediaTimeAVFoundation_h
-
-#if USE(AVFOUNDATION)
-
-#include <CoreMedia/CMTime.h>
-#include <wtf/MediaTime.h>
-
-namespace WebCore {
-
-CMTime toCMTime(const MediaTime&);
-MediaTime toMediaTime(const CMTime&);
-
-}
-
-#endif
-
-#endif
Modified: trunk/Source/WebCore/platform/graphics/avfoundation/cf/InbandTextTrackPrivateAVCF.cpp (222325 => 222326)
--- trunk/Source/WebCore/platform/graphics/avfoundation/cf/InbandTextTrackPrivateAVCF.cpp 2017-09-21 17:12:24 UTC (rev 222325)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/cf/InbandTextTrackPrivateAVCF.cpp 2017-09-21 17:33:52 UTC (rev 222326)
@@ -34,8 +34,8 @@
#include "InbandTextTrackPrivate.h"
#include "InbandTextTrackPrivateAVF.h"
#include "Logging.h"
-#include "MediaTimeAVFoundation.h"
#include <_javascript_Core/ArrayBuffer.h>
+#include <pal/avfoundation/MediaTimeAVFoundation.h>
#include <wtf/SoftLinking.h>
#include <AVFoundationCF/AVCFPlayerItemLegibleOutput.h>
Modified: trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp (222325 => 222326)
--- trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp 2017-09-21 17:12:24 UTC (rev 222325)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp 2017-09-21 17:33:52 UTC (rev 222326)
@@ -41,13 +41,13 @@
#else
#include "InbandTextTrackPrivateLegacyAVCF.h"
#endif
-#include "MediaTimeAVFoundation.h"
-#include "URL.h"
#include "Logging.h"
#include "PlatformCALayerClient.h"
#include "PlatformCALayerWin.h"
#include "TimeRanges.h"
+#include "URL.h"
#include "WebCoreAVCFResourceLoader.h"
+#include <pal/avfoundation/MediaTimeAVFoundation.h>
#include <AVFoundationCF/AVCFPlayerItem.h>
#if HAVE(AVFOUNDATION_LEGIBLE_OUTPUT_SUPPORT)
@@ -592,7 +592,7 @@
cmDuration = AVCFAssetGetDuration(avAsset(m_avfWrapper));
if (CMTIME_IS_NUMERIC(cmDuration))
- return toMediaTime(cmDuration);
+ return PAL::toMediaTime(cmDuration);
if (CMTIME_IS_INDEFINITE(cmDuration))
return MediaTime::positiveInfiniteTime();
@@ -608,7 +608,7 @@
CMTime itemTime = AVCFPlayerItemGetCurrentTime(avPlayerItem(m_avfWrapper));
if (CMTIME_IS_NUMERIC(itemTime))
- return max(toMediaTime(itemTime), MediaTime::zeroTime());
+ return max(PAL::toMediaTime(itemTime), MediaTime::zeroTime());
return MediaTime::zeroTime();
}
@@ -694,8 +694,8 @@
CMTime duration = CMTimeMakeFromDictionary(static_cast<CFDictionaryRef>(CFDictionaryGetValue(range, CMTimeRangeDurationKey())));
if (timeRangeIsValidAndNotEmpty(start, duration)) {
- MediaTime rangeStart = toMediaTime(start);
- MediaTime rangeEnd = rangeStart + toMediaTime(duration);
+ MediaTime rangeStart = PAL::toMediaTime(start);
+ MediaTime rangeEnd = rangeStart + PAL::toMediaTime(duration);
timeRanges->add(rangeStart, rangeEnd);
}
}
@@ -720,7 +720,7 @@
continue;
hasValidRange = true;
- MediaTime startOfRange = toMediaTime(start);
+ MediaTime startOfRange = PAL::toMediaTime(start);
if (minTimeSeekable > startOfRange)
minTimeSeekable = startOfRange;
}
@@ -745,7 +745,7 @@
if (!timeRangeIsValidAndNotEmpty(start, duration))
continue;
- MediaTime endOfRange = toMediaTime(CMTimeAdd(start, duration));
+ MediaTime endOfRange = PAL::toMediaTime(CMTimeAdd(start, duration));
if (maxTimeSeekable < endOfRange)
maxTimeSeekable = endOfRange;
}
@@ -771,7 +771,7 @@
if (!timeRangeIsValidAndNotEmpty(start, duration))
continue;
- MediaTime endOfRange = toMediaTime(CMTimeAdd(start, duration));
+ MediaTime endOfRange = PAL::toMediaTime(CMTimeAdd(start, duration));
if (maxTimeLoaded < endOfRange)
maxTimeLoaded = endOfRange;
}
@@ -1795,9 +1795,9 @@
void AVFWrapper::seekToTime(const MediaTime& time, const MediaTime& negativeTolerance, const MediaTime& positiveTolerance)
{
ASSERT(avPlayerItem());
- CMTime cmTime = toCMTime(time);
- CMTime cmBefore = toCMTime(negativeTolerance);
- CMTime cmAfter = toCMTime(positiveTolerance);
+ CMTime cmTime = PAL::toCMTime(time);
+ CMTime cmBefore = PAL::toCMTime(negativeTolerance);
+ CMTime cmAfter = PAL::toCMTime(positiveTolerance);
AVCFPlayerItemSeekToTimeWithToleranceAndCompletionCallback(avPlayerItem(), cmTime, cmBefore, cmAfter, &seekCompletedCallback, callbackContext());
}
@@ -1851,7 +1851,7 @@
ASSERT(legibleOutput == self->m_legibleOutput);
- auto legibleOutputData = std::make_unique<LegibleOutputData>(attributedStrings, nativeSampleBuffers, toMediaTime(itemTime), context);
+ auto legibleOutputData = std::make_unique<LegibleOutputData>(attributedStrings, nativeSampleBuffers, PAL::toMediaTime(itemTime), context);
dispatch_async_f(dispatch_get_main_queue(), legibleOutputData.release(), processCue);
}
@@ -2063,7 +2063,7 @@
#endif
AVCFAssetImageGeneratorSetMaximumSize(m_imageGenerator.get(), CGSize(rect.size()));
- RetainPtr<CGImageRef> rawimage = adoptCF(AVCFAssetImageGeneratorCopyCGImageAtTime(m_imageGenerator.get(), toCMTime(time), 0, 0));
+ RetainPtr<CGImageRef> rawimage = adoptCF(AVCFAssetImageGeneratorCopyCGImageAtTime(m_imageGenerator.get(), PAL::toCMTime(time), 0, 0));
RetainPtr<CGImageRef> image = adoptCF(CGImageCreateCopyWithColorSpace(rawimage.get(), adoptCF(CGColorSpaceCreateDeviceRGB()).get()));
#if !LOG_DISABLED
Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm (222325 => 222326)
--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm 2017-09-21 17:12:24 UTC (rev 222325)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm 2017-09-21 17:33:52 UTC (rev 222326)
@@ -33,7 +33,6 @@
#import "FloatRect.h"
#import "FloatSize.h"
#import "MIMETypeRegistry.h"
-#import "MediaTimeAVFoundation.h"
#import "SharedBuffer.h"
#import "UTIUtilities.h"
#import "WebCoreDecompressionSession.h"
@@ -45,6 +44,7 @@
#import <AVFoundation/AVTime.h>
#import <VideoToolbox/VTUtilities.h>
#import <map>
+#import <pal/avfoundation/MediaTimeAVFoundation.h>
#import <wtf/MainThread.h>
#import <wtf/MediaTime.h>
#import <wtf/NeverDestroyed.h>
@@ -338,8 +338,8 @@
for (size_t index = 0; index < static_cast<size_t>(sampleCount); ++index) {
auto& sampleData = m_sampleData[index];
sampleData.duration = Seconds(CMTimeGetSeconds([cursor currentSampleDuration]));
- sampleData.decodeTime = toMediaTime([cursor decodeTimeStamp]);
- sampleData.presentationTime = toMediaTime([cursor presentationTimeStamp]);
+ sampleData.decodeTime = PAL::toMediaTime([cursor decodeTimeStamp]);
+ sampleData.presentationTime = PAL::toMediaTime([cursor presentationTimeStamp]);
auto request = adoptNS([allocAVSampleBufferRequestInstance() initWithStartCursor:cursor.get()]);
sampleData.sample = adoptCF([m_generator createSampleBufferForRequest:request.get()]);
m_presentationTimeToIndex.insert(std::make_pair(sampleData.presentationTime, index));
@@ -368,7 +368,7 @@
if (!pixelBuffer)
return false;
- auto presentationTime = toMediaTime(CMSampleBufferGetPresentationTimeStamp(sampleBuffer));
+ auto presentationTime = PAL::toMediaTime(CMSampleBufferGetPresentationTimeStamp(sampleBuffer));
auto indexIter = m_presentationTimeToIndex.find(presentationTime);
if (m_rotation && !m_rotation.value().isIdentity()) {
@@ -547,7 +547,7 @@
if (!m_cursor)
m_cursor = [m_track makeSampleCursorAtFirstSampleInDecodeOrder];
- auto frameCursor = [m_track makeSampleCursorWithPresentationTimeStamp:toCMTime(sampleData.presentationTime)];
+ auto frameCursor = [m_track makeSampleCursorWithPresentationTimeStamp:PAL::toCMTime(sampleData.presentationTime)];
if ([frameCursor comparePositionInDecodeOrderWithPositionOfCursor:m_cursor.get()] == NSOrderedAscending) {
// Rewind cursor to the last sync sample to begin decoding
m_cursor = [frameCursor copy];
@@ -566,7 +566,7 @@
if ([frameCursor comparePositionInDecodeOrderWithPositionOfCursor:m_cursor.get()] == NSOrderedAscending)
return nullptr;
- auto presentationTime = toMediaTime(m_cursor.get().presentationTimeStamp);
+ auto presentationTime = PAL::toMediaTime(m_cursor.get().presentationTimeStamp);
auto indexIter = m_presentationTimeToIndex.find(presentationTime);
advanceCursor();
Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm (222325 => 222326)
--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm 2017-09-21 17:12:24 UTC (rev 222325)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm 2017-09-21 17:33:52 UTC (rev 222326)
@@ -48,7 +48,6 @@
#import "MediaPlaybackTargetMac.h"
#import "MediaPlaybackTargetMock.h"
#import "MediaSelectionGroupAVFObjC.h"
-#import "MediaTimeAVFoundation.h"
#import "OutOfBandTextTrackPrivateAVF.h"
#import "PixelBufferConformerCV.h"
#import "PlatformTimeRanges.h"
@@ -68,6 +67,7 @@
#import <functional>
#import <map>
#import <objc/runtime.h>
+#import <pal/avfoundation/MediaTimeAVFoundation.h>
#import <pal/spi/cocoa/QuartzCoreSPI.h>
#import <pal/spi/mac/AVFoundationSPI.h>
#import <runtime/DataView.h>
@@ -1366,7 +1366,7 @@
cmDuration = [m_avAsset.get() duration];
if (CMTIME_IS_NUMERIC(cmDuration))
- return toMediaTime(cmDuration);
+ return PAL::toMediaTime(cmDuration);
if (CMTIME_IS_INDEFINITE(cmDuration))
return MediaTime::positiveInfiniteTime();
@@ -1382,7 +1382,7 @@
CMTime itemTime = [m_avPlayerItem.get() currentTime];
if (CMTIME_IS_NUMERIC(itemTime))
- return std::max(toMediaTime(itemTime), MediaTime::zeroTime());
+ return std::max(PAL::toMediaTime(itemTime), MediaTime::zeroTime());
return MediaTime::zeroTime();
}
@@ -1395,9 +1395,9 @@
if (m_metadataTrack)
m_metadataTrack->flushPartialCues();
- CMTime cmTime = toCMTime(time);
- CMTime cmBefore = toCMTime(negativeTolerance);
- CMTime cmAfter = toCMTime(positiveTolerance);
+ CMTime cmTime = PAL::toCMTime(time);
+ CMTime cmBefore = PAL::toCMTime(negativeTolerance);
+ CMTime cmAfter = PAL::toCMTime(positiveTolerance);
// [AVPlayerItem seekToTime] will throw an exception if toleranceBefore is negative.
if (CMTimeCompare(cmBefore, kCMTimeZero) < 0)
@@ -1506,7 +1506,7 @@
for (NSValue *thisRangeValue in m_cachedLoadedRanges.get()) {
CMTimeRange timeRange = [thisRangeValue CMTimeRangeValue];
if (CMTIMERANGE_IS_VALID(timeRange) && !CMTIMERANGE_IS_EMPTY(timeRange))
- timeRanges->add(toMediaTime(timeRange.start), toMediaTime(CMTimeRangeGetEnd(timeRange)));
+ timeRanges->add(PAL::toMediaTime(timeRange.start), PAL::toMediaTime(CMTimeRangeGetEnd(timeRange)));
}
return timeRanges;
}
@@ -1524,7 +1524,7 @@
continue;
hasValidRange = true;
- MediaTime startOfRange = toMediaTime(timeRange.start);
+ MediaTime startOfRange = PAL::toMediaTime(timeRange.start);
if (minTimeSeekable > startOfRange)
minTimeSeekable = startOfRange;
}
@@ -1542,7 +1542,7 @@
if (!CMTIMERANGE_IS_VALID(timeRange) || CMTIMERANGE_IS_EMPTY(timeRange))
continue;
- MediaTime endOfRange = toMediaTime(CMTimeRangeGetEnd(timeRange));
+ MediaTime endOfRange = PAL::toMediaTime(CMTimeRangeGetEnd(timeRange));
if (maxTimeSeekable < endOfRange)
maxTimeSeekable = endOfRange;
}
@@ -1560,7 +1560,7 @@
if (!CMTIMERANGE_IS_VALID(timeRange) || CMTIMERANGE_IS_EMPTY(timeRange))
continue;
- MediaTime endOfRange = toMediaTime(CMTimeRangeGetEnd(timeRange));
+ MediaTime endOfRange = PAL::toMediaTime(CMTimeRangeGetEnd(timeRange));
if (maxTimeLoaded < endOfRange)
maxTimeLoaded = endOfRange;
}
@@ -3183,7 +3183,7 @@
// Set the duration of all incomplete cues before adding new ones.
MediaTime earliestStartTime = MediaTime::positiveInfiniteTime();
for (AVMetadataItemType *item in m_currentMetaData.get()) {
- MediaTime start = std::max(toMediaTime(item.time), MediaTime::zeroTime());
+ MediaTime start = std::max(PAL::toMediaTime(item.time), MediaTime::zeroTime());
if (start < earliestStartTime)
earliestStartTime = start;
}
@@ -3190,10 +3190,10 @@
m_metadataTrack->updatePendingCueEndTimes(earliestStartTime);
for (AVMetadataItemType *item in m_currentMetaData.get()) {
- MediaTime start = std::max(toMediaTime(item.time), MediaTime::zeroTime());
+ MediaTime start = std::max(PAL::toMediaTime(item.time), MediaTime::zeroTime());
MediaTime end = MediaTime::positiveInfiniteTime();
if (CMTIME_IS_VALID(item.duration))
- end = start + toMediaTime(item.duration);
+ end = start + PAL::toMediaTime(item.duration);
AtomicString type = nullAtom();
if (item.keySpace)
@@ -3456,12 +3456,12 @@
else if ([keyPath isEqualToString:@"presentationSize"])
function = std::bind(&MediaPlayerPrivateAVFoundationObjC::presentationSizeDidChange, m_callback, FloatSize([newValue sizeValue]));
else if ([keyPath isEqualToString:@"duration"])
- function = std::bind(&MediaPlayerPrivateAVFoundationObjC::durationDidChange, m_callback, toMediaTime([newValue CMTimeValue]));
+ function = std::bind(&MediaPlayerPrivateAVFoundationObjC::durationDidChange, m_callback, PAL::toMediaTime([newValue CMTimeValue]));
else if ([keyPath isEqualToString:@"timedMetadata"] && newValue) {
MediaTime now;
CMTime itemTime = [(AVPlayerItemType *)object currentTime];
if (CMTIME_IS_NUMERIC(itemTime))
- now = std::max(toMediaTime(itemTime), MediaTime::zeroTime());
+ now = std::max(PAL::toMediaTime(itemTime), MediaTime::zeroTime());
function = std::bind(&MediaPlayerPrivateAVFoundationObjC::metadataDidArrive, m_callback, RetainPtr<NSArray>(newValue), now);
shouldLogValue = false;
} else if ([keyPath isEqualToString:@"canPlayFastReverse"])
@@ -3490,7 +3490,7 @@
if (shouldLogValue) {
if ([keyPath isEqualToString:@"duration"])
- m_callback->logger().debug(m_callback->logChannel(), identifier, "did change '", [keyPath UTF8String], "' to ", toMediaTime([newValue CMTimeValue]));
+ m_callback->logger().debug(m_callback->logChannel(), identifier, "did change '", [keyPath UTF8String], "' to ", PAL::toMediaTime([newValue CMTimeValue]));
else {
RetainPtr<NSString> valueString = adoptNS([[NSString alloc] initWithFormat:@"%@", newValue]);
m_callback->logger().debug(m_callback->logChannel(), identifier, "did change '", [keyPath UTF8String], "' to ", [valueString.get() UTF8String]);
@@ -3530,7 +3530,7 @@
MediaPlayerPrivateAVFoundationObjC* callback = protectedSelf->m_callback;
if (!callback)
return;
- MediaTime time = std::max(toMediaTime(itemTime), MediaTime::zeroTime());
+ MediaTime time = std::max(PAL::toMediaTime(itemTime), MediaTime::zeroTime());
callback->processCue(protectedStrings.get(), protectedNativeSamples.get(), time);
});
}
Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm (222325 => 222326)
--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm 2017-09-21 17:12:24 UTC (rev 222325)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm 2017-09-21 17:33:52 UTC (rev 222326)
@@ -37,7 +37,6 @@
#import "Logging.h"
#import "MediaSourcePrivateAVFObjC.h"
#import "MediaSourcePrivateClient.h"
-#import "MediaTimeAVFoundation.h"
#import "PixelBufferConformerCV.h"
#import "PlatformClockCM.h"
#import "TextTrackRepresentation.h"
@@ -49,6 +48,7 @@
#import <AVFoundation/AVTime.h>
#import <QuartzCore/CALayer.h>
#import <objc_runtime.h>
+#import <pal/avfoundation/MediaTimeAVFoundation.h>
#import <pal/spi/mac/AVFoundationSPI.h>
#import <wtf/Deque.h>
#import <wtf/MainThread.h>
@@ -147,7 +147,7 @@
// addPeriodicTimeObserverForInterval: throws an exception if you pass a non-numeric CMTime, so just use
// an arbitrarily large time value of once an hour:
__block auto weakThis = createWeakPtr();
- m_timeJumpedObserver = [m_synchronizer addPeriodicTimeObserverForInterval:toCMTime(MediaTime::createWithDouble(3600)) queue:dispatch_get_main_queue() usingBlock:^(CMTime time) {
+ m_timeJumpedObserver = [m_synchronizer addPeriodicTimeObserverForInterval:PAL::toCMTime(MediaTime::createWithDouble(3600)) queue:dispatch_get_main_queue() usingBlock:^(CMTime time) {
#if LOG_DISABLED
UNUSED_PARAM(time);
#endif
@@ -156,7 +156,7 @@
return;
if (m_seeking && !m_pendingSeek) {
- LOG(MediaSource, "MediaPlayerPrivateMediaSourceAVFObjC::m_timeJumpedObserver(%p) - time(%s)", weakThis.get(), toString(toMediaTime(time)).utf8().data());
+ LOG(MediaSource, "MediaPlayerPrivateMediaSourceAVFObjC::m_timeJumpedObserver(%p) - time(%s)", weakThis.get(), toString(PAL::toMediaTime(time)).utf8().data());
m_seeking = false;
if (shouldBePlaying())
@@ -388,7 +388,7 @@
MediaTime MediaPlayerPrivateMediaSourceAVFObjC::currentMediaTime() const
{
- MediaTime synchronizerTime = toMediaTime(CMTimebaseGetTime([m_synchronizer timebase]));
+ MediaTime synchronizerTime = PAL::toMediaTime(CMTimebaseGetTime([m_synchronizer timebase]));
if (synchronizerTime < MediaTime::zeroTime())
return MediaTime::zeroTime();
if (synchronizerTime < m_lastSeekTime)
@@ -436,11 +436,11 @@
LOG(MediaSource, "MediaPlayerPrivateMediaSourceAVFObjC::seekInternal(%p) - seekTime(%s)", this, toString(m_lastSeekTime).utf8().data());
- MediaTime synchronizerTime = toMediaTime(CMTimebaseGetTime([m_synchronizer timebase]));
+ MediaTime synchronizerTime = PAL::toMediaTime(CMTimebaseGetTime([m_synchronizer timebase]));
bool doesNotRequireSeek = synchronizerTime == m_lastSeekTime;
m_mediaSourcePrivate->willSeek();
- [m_synchronizer setRate:0 time:toCMTime(m_lastSeekTime)];
+ [m_synchronizer setRate:0 time:PAL::toCMTime(m_lastSeekTime)];
m_mediaSourcePrivate->seekToTime(m_lastSeekTime);
// In cases where the destination seek time precisely matches the synchronizer's existing time
@@ -859,7 +859,7 @@
MediaTime duration = m_mediaSourcePrivate->duration();
auto weakThis = createWeakPtr();
- NSArray* times = @[[NSValue valueWithCMTime:toCMTime(duration)]];
+ NSArray* times = @[[NSValue valueWithCMTime:PAL::toCMTime(duration)]];
LOG(MediaSource, "MediaPlayerPrivateMediaSourceAVFObjC::durationChanged(%p) - duration = %s", this, toString(duration).utf8().data());
@@ -873,7 +873,7 @@
weakThis->pauseInternal();
if (now < duration) {
LOG(MediaSource, " ERROR: boundary time observer called before duration!", weakThis.get());
- [weakThis->m_synchronizer setRate:0 time:toCMTime(duration)];
+ [weakThis->m_synchronizer setRate:0 time:PAL::toCMTime(duration)];
}
weakThis->m_player->timeChanged();
@@ -891,7 +891,7 @@
void MediaPlayerPrivateMediaSourceAVFObjC::sizeWillChangeAtTime(const MediaTime& time, const FloatSize& size)
{
auto weakThis = m_sizeChangeObserverWeakPtrFactory.createWeakPtr();
- NSArray* times = @[[NSValue valueWithCMTime:toCMTime(time)]];
+ NSArray* times = @[[NSValue valueWithCMTime:PAL::toCMTime(time)]];
RetainPtr<id> observer = [m_synchronizer addBoundaryTimeObserverForTimes:times queue:dispatch_get_main_queue() usingBlock:[this, weakThis, size] {
if (!weakThis)
return;
Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm (222325 => 222326)
--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm 2017-09-21 17:12:24 UTC (rev 222325)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm 2017-09-21 17:33:52 UTC (rev 222326)
@@ -33,7 +33,6 @@
#import "GraphicsContextCG.h"
#import "Logging.h"
#import "MediaStreamPrivate.h"
-#import "MediaTimeAVFoundation.h"
#import "PixelBufferConformerCV.h"
#import "VideoTrackPrivateMediaStream.h"
#import <AVFoundation/AVSampleBufferDisplayLayer.h>
@@ -40,6 +39,7 @@
#import <QuartzCore/CALayer.h>
#import <QuartzCore/CATransaction.h>
#import <objc_runtime.h>
+#import <pal/avfoundation/MediaTimeAVFoundation.h>
#import <pal/spi/mac/AVFoundationSPI.h>
#import <wtf/Function.h>
#import <wtf/MainThread.h>
@@ -304,7 +304,7 @@
sampleTime = sample.presentationTime();
MediaTime timelineOffset = streamTime() - sampleTime + MediaTime::createWithDouble(latency);
if (timelineOffset.timeScale() != sampleTime.timeScale())
- timelineOffset = toMediaTime(CMTimeConvertScale(toCMTime(timelineOffset), sampleTime.timeScale(), kCMTimeRoundingMethod_Default));
+ timelineOffset = PAL::toMediaTime(CMTimeConvertScale(PAL::toCMTime(timelineOffset), sampleTime.timeScale(), kCMTimeRoundingMethod_Default));
return timelineOffset;
}
Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm (222325 => 222326)
--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm 2017-09-21 17:12:24 UTC (rev 222325)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm 2017-09-21 17:33:52 UTC (rev 222326)
@@ -74,27 +74,27 @@
MediaTime MediaSampleAVFObjC::presentationTime() const
{
- return toMediaTime(CMSampleBufferGetPresentationTimeStamp(m_sample.get()));
+ return PAL::toMediaTime(CMSampleBufferGetPresentationTimeStamp(m_sample.get()));
}
MediaTime MediaSampleAVFObjC::outputPresentationTime() const
{
- return toMediaTime(CMSampleBufferGetOutputPresentationTimeStamp(m_sample.get()));
+ return PAL::toMediaTime(CMSampleBufferGetOutputPresentationTimeStamp(m_sample.get()));
}
MediaTime MediaSampleAVFObjC::decodeTime() const
{
- return toMediaTime(CMSampleBufferGetDecodeTimeStamp(m_sample.get()));
+ return PAL::toMediaTime(CMSampleBufferGetDecodeTimeStamp(m_sample.get()));
}
MediaTime MediaSampleAVFObjC::duration() const
{
- return toMediaTime(CMSampleBufferGetDuration(m_sample.get()));
+ return PAL::toMediaTime(CMSampleBufferGetDuration(m_sample.get()));
}
MediaTime MediaSampleAVFObjC::outputDuration() const
{
- return toMediaTime(CMSampleBufferGetOutputDuration(m_sample.get()));
+ return PAL::toMediaTime(CMSampleBufferGetOutputDuration(m_sample.get()));
}
size_t MediaSampleAVFObjC::sizeInBytes() const
@@ -176,8 +176,8 @@
return;
for (auto& timing : timingInfoArray) {
- timing.presentationTimeStamp = toCMTime(toMediaTime(timing.presentationTimeStamp) + offset);
- timing.decodeTimeStamp = toCMTime(toMediaTime(timing.decodeTimeStamp) + offset);
+ timing.presentationTimeStamp = PAL::toCMTime(PAL::toMediaTime(timing.presentationTimeStamp) + offset);
+ timing.decodeTimeStamp = PAL::toCMTime(PAL::toMediaTime(timing.decodeTimeStamp) + offset);
}
CMSampleBufferRef newSample;
@@ -199,8 +199,8 @@
return;
for (auto& timing : timingInfoArray) {
- timing.presentationTimeStamp = toCMTime(presentationTimestamp);
- timing.decodeTimeStamp = toCMTime(decodeTimestamp);
+ timing.presentationTimeStamp = PAL::toCMTime(presentationTimestamp);
+ timing.decodeTimeStamp = PAL::toCMTime(decodeTimestamp);
}
CMSampleBufferRef newSample;
@@ -229,7 +229,7 @@
CFIndex samplesBeforePresentationTime = 0;
CMSampleBufferCallBlockForEachSample(m_sample.get(), [&] (CMSampleBufferRef sampleBuffer, CMItemCount) -> OSStatus {
- if (toMediaTime(CMSampleBufferGetPresentationTimeStamp(sampleBuffer)) >= presentationTime)
+ if (PAL::toMediaTime(CMSampleBufferGetPresentationTimeStamp(sampleBuffer)) >= presentationTime)
return 1;
++samplesBeforePresentationTime;
return noErr;
Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm (222325 => 222326)
--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm 2017-09-21 17:12:24 UTC (rev 222325)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm 2017-09-21 17:33:52 UTC (rev 222326)
@@ -39,7 +39,6 @@
#import "MediaSample.h"
#import "MediaSampleAVFObjC.h"
#import "MediaSourcePrivateAVFObjC.h"
-#import "MediaTimeAVFoundation.h"
#import "NotImplemented.h"
#import "SourceBufferPrivateClient.h"
#import "TimeRanges.h"
@@ -49,6 +48,7 @@
#import <QuartzCore/CALayer.h>
#import <map>
#import <objc/runtime.h>
+#import <pal/avfoundation/MediaTimeAVFoundation.h>
#import <pal/spi/mac/AVFoundationSPI.h>
#import <runtime/TypedArrayInlines.h>
#import <wtf/BlockObjCExceptions.h>
@@ -526,10 +526,10 @@
SourceBufferPrivateClient::InitializationSegment segment;
if ([m_asset respondsToSelector:@selector(overallDurationHint)])
- segment.duration = toMediaTime([m_asset overallDurationHint]);
+ segment.duration = PAL::toMediaTime([m_asset overallDurationHint]);
if (segment.duration.isInvalid() || segment.duration == MediaTime::zeroTime())
- segment.duration = toMediaTime([m_asset duration]);
+ segment.duration = PAL::toMediaTime([m_asset duration]);
for (AVAssetTrack* track in [m_asset tracks]) {
if ([track hasMediaCharacteristic:AVMediaCharacteristicLegible]) {
Modified: trunk/Source/WebCore/platform/graphics/cocoa/WebCoreDecompressionSession.mm (222325 => 222326)
--- trunk/Source/WebCore/platform/graphics/cocoa/WebCoreDecompressionSession.mm 2017-09-21 17:12:24 UTC (rev 222325)
+++ trunk/Source/WebCore/platform/graphics/cocoa/WebCoreDecompressionSession.mm 2017-09-21 17:33:52 UTC (rev 222326)
@@ -29,10 +29,10 @@
#if USE(VIDEOTOOLBOX)
#import "Logging.h"
-#import "MediaTimeAVFoundation.h"
#import "PixelBufferConformerCV.h"
#import <CoreMedia/CMBufferQueue.h>
#import <CoreMedia/CMFormatDescription.h>
+#import <pal/avfoundation/MediaTimeAVFoundation.h>
#import <wtf/MainThread.h>
#import <wtf/MediaTime.h>
#import <wtf/StringPrintStream.h>
@@ -306,7 +306,7 @@
auto currentTime = CMTimebaseGetTime(m_timebase.get());
auto currentRate = CMTimebaseGetRate(m_timebase.get());
if (currentRate > 0 && CMTimeCompare(presentationTimeStamp, currentTime) < 0)
- m_totalFrameDelay += toMediaTime(CMTimeSubtract(currentTime, presentationTimeStamp));
+ m_totalFrameDelay += PAL::toMediaTime(CMTimeSubtract(currentTime, presentationTimeStamp));
}
dispatch_async(m_enqueingQueue.get(), [protectedThis = makeRefPtr(this), status, imageSampleBuffer = adoptCF(rawImageSampleBuffer), infoFlags, displaying] {
@@ -334,7 +334,7 @@
if (!m_timebase)
return;
- auto time = toMediaTime(CMTimebaseGetTime(m_timebase.get()));
+ auto time = PAL::toMediaTime(CMTimebaseGetTime(m_timebase.get()));
LOG(Media, "WebCoreDecompressionSession::automaticDequeue(%p) - purging all samples before time(%s)", this, toString(time).utf8().data());
MediaTime nextFireTime = MediaTime::positiveInfiniteTime();
@@ -341,8 +341,8 @@
bool releasedImageBuffers = false;
while (CMSampleBufferRef firstSample = (CMSampleBufferRef)CMBufferQueueGetHead(m_producerQueue.get())) {
- MediaTime presentationTimestamp = toMediaTime(CMSampleBufferGetPresentationTimeStamp(firstSample));
- MediaTime duration = toMediaTime(CMSampleBufferGetDuration(firstSample));
+ MediaTime presentationTimestamp = PAL::toMediaTime(CMSampleBufferGetPresentationTimeStamp(firstSample));
+ MediaTime duration = PAL::toMediaTime(CMSampleBufferGetDuration(firstSample));
MediaTime presentationEndTimestamp = presentationTimestamp + duration;
if (time > presentationEndTimestamp) {
CFRelease(CMBufferQueueDequeueAndRetain(m_producerQueue.get()));
@@ -351,8 +351,8 @@
}
#if !LOG_DISABLED
- auto begin = toMediaTime(CMBufferQueueGetFirstPresentationTimeStamp(m_producerQueue.get()));
- auto end = toMediaTime(CMBufferQueueGetEndPresentationTimeStamp(m_producerQueue.get()));
+ auto begin = PAL::toMediaTime(CMBufferQueueGetFirstPresentationTimeStamp(m_producerQueue.get()));
+ auto end = PAL::toMediaTime(CMBufferQueueGetEndPresentationTimeStamp(m_producerQueue.get()));
LOG(Media, "WebCoreDecompressionSession::automaticDequeue(%p) - queue(%s -> %s)", this, toString(begin).utf8().data(), toString(end).utf8().data());
#endif
@@ -364,7 +364,7 @@
maybeBecomeReadyForMoreMediaData();
LOG(Media, "WebCoreDecompressionSession::automaticDequeue(%p) - queue empty", this, toString(time).utf8().data());
- CMTimebaseSetTimerDispatchSourceNextFireTime(m_timebase.get(), m_timerSource.get(), toCMTime(nextFireTime), 0);
+ CMTimebaseSetTimerDispatchSourceNextFireTime(m_timebase.get(), m_timerSource.get(), PAL::toCMTime(nextFireTime), 0);
}
void WebCoreDecompressionSession::enqueueDecodedSample(CMSampleBufferRef sample, bool displaying)
@@ -382,9 +382,9 @@
CMBufferQueueEnqueue(m_producerQueue.get(), sample);
#if !LOG_DISABLED
- auto begin = toMediaTime(CMBufferQueueGetFirstPresentationTimeStamp(m_producerQueue.get()));
- auto end = toMediaTime(CMBufferQueueGetEndPresentationTimeStamp(m_producerQueue.get()));
- auto presentationTime = toMediaTime(CMSampleBufferGetPresentationTimeStamp(sample));
+ auto begin = PAL::toMediaTime(CMBufferQueueGetFirstPresentationTimeStamp(m_producerQueue.get()));
+ auto end = PAL::toMediaTime(CMBufferQueueGetEndPresentationTimeStamp(m_producerQueue.get()));
+ auto presentationTime = PAL::toMediaTime(CMSampleBufferGetPresentationTimeStamp(sample));
LOG(Media, "WebCoreDecompressionSession::enqueueDecodedSample(%p) - presentationTime(%s), framesBeingDecoded(%d), producerQueue(%s -> %s)", this, toString(presentationTime).utf8().data(), m_framesBeingDecoded, toString(begin).utf8().data(), toString(end).utf8().data());
#endif
@@ -395,9 +395,9 @@
return;
if (m_timebase) {
- auto currentTime = toMediaTime(CMTimebaseGetTime(m_timebase.get()));
- auto presentationStartTime = toMediaTime(CMSampleBufferGetPresentationTimeStamp(sample));
- auto presentationEndTime = presentationStartTime + toMediaTime(CMSampleBufferGetDuration(sample));
+ auto currentTime = PAL::toMediaTime(CMTimebaseGetTime(m_timebase.get()));
+ auto presentationStartTime = PAL::toMediaTime(CMSampleBufferGetPresentationTimeStamp(sample));
+ auto presentationEndTime = presentationStartTime + PAL::toMediaTime(CMSampleBufferGetDuration(sample));
if (currentTime < presentationStartTime || currentTime >= presentationEndTime)
return;
}
@@ -454,8 +454,8 @@
bool allowEarlier = flags == WebCoreDecompressionSession::AllowEarlier;
bool allowLater = flags == WebCoreDecompressionSession::AllowLater;
- MediaTime startTime = toMediaTime(CMBufferQueueGetFirstPresentationTimeStamp(m_producerQueue.get()));
- MediaTime endTime = toMediaTime(CMBufferQueueGetEndPresentationTimeStamp(m_producerQueue.get()));
+ MediaTime startTime = PAL::toMediaTime(CMBufferQueueGetFirstPresentationTimeStamp(m_producerQueue.get()));
+ MediaTime endTime = PAL::toMediaTime(CMBufferQueueGetEndPresentationTimeStamp(m_producerQueue.get()));
if (!allowLater && time < startTime) {
LOG(Media, "WebCoreDecompressionSession::imageForTime(%p) - time(%s) too early for queue(%s -> %s)", this, toString(time).utf8().data(), toString(startTime).utf8().data(), toString(endTime).utf8().data());
return nullptr;
@@ -464,8 +464,8 @@
bool releasedImageBuffers = false;
while (CMSampleBufferRef firstSample = (CMSampleBufferRef)CMBufferQueueGetHead(m_producerQueue.get())) {
- MediaTime presentationTimestamp = toMediaTime(CMSampleBufferGetPresentationTimeStamp(firstSample));
- MediaTime duration = toMediaTime(CMSampleBufferGetDuration(firstSample));
+ MediaTime presentationTimestamp = PAL::toMediaTime(CMSampleBufferGetPresentationTimeStamp(firstSample));
+ MediaTime duration = PAL::toMediaTime(CMSampleBufferGetDuration(firstSample));
MediaTime presentationEndTimestamp = presentationTimestamp + duration;
if (!allowLater && presentationTimestamp > time)
return nullptr;
Modified: trunk/Source/WebCore/platform/mac/PlatformClockCM.mm (222325 => 222326)
--- trunk/Source/WebCore/platform/mac/PlatformClockCM.mm 2017-09-21 17:12:24 UTC (rev 222325)
+++ trunk/Source/WebCore/platform/mac/PlatformClockCM.mm 2017-09-21 17:33:52 UTC (rev 222326)
@@ -29,7 +29,7 @@
#import "PlatformClockCM.h"
-#import "MediaTimeAVFoundation.h"
+#import <pal/avfoundation/MediaTimeAVFoundation.h>
#import "CoreMediaSoftLink.h"
@@ -81,12 +81,12 @@
void PlatformClockCM::setCurrentMediaTime(const MediaTime& time)
{
- CMTimebaseSetTime(m_timebase.get(), toCMTime(time));
+ CMTimebaseSetTime(m_timebase.get(), PAL::toCMTime(time));
}
MediaTime PlatformClockCM::currentMediaTime() const
{
- return toMediaTime(CMTimebaseGetTime(m_timebase.get()));
+ return PAL::toMediaTime(CMTimebaseGetTime(m_timebase.get()));
}
void PlatformClockCM::setPlayRate(double rate)
Modified: trunk/Source/WebCore/platform/mac/PlaybackSessionInterfaceMac.mm (222325 => 222326)
--- trunk/Source/WebCore/platform/mac/PlaybackSessionInterfaceMac.mm 2017-09-21 17:12:24 UTC (rev 222325)
+++ trunk/Source/WebCore/platform/mac/PlaybackSessionInterfaceMac.mm 2017-09-21 17:33:52 UTC (rev 222326)
@@ -30,11 +30,11 @@
#import "IntRect.h"
#import "MediaSelectionOption.h"
-#import "MediaTimeAVFoundation.h"
#import "PlaybackSessionModel.h"
#import "TimeRanges.h"
#import "WebPlaybackControlsManager.h"
#import <AVFoundation/AVTime.h>
+#import <pal/avfoundation/MediaTimeAVFoundation.h>
#import <pal/spi/cocoa/AVKitSPI.h>
#import "CoreMediaSoftLink.h"
@@ -122,7 +122,7 @@
for (unsigned i = 0; i < timeRanges.length(); i++) {
const PlatformTimeRanges& ranges = timeRanges.ranges();
- CMTimeRange range = CMTimeRangeMake(toCMTime(ranges.start(i)), toCMTime(ranges.end(i)));
+ CMTimeRange range = CMTimeRangeMake(PAL::toCMTime(ranges.start(i)), PAL::toCMTime(ranges.end(i)));
[rangeArray addObject:[NSValue valueWithCMTimeRange:range]];
}
Modified: trunk/Source/WebCore/platform/mac/VideoFullscreenInterfaceMac.mm (222325 => 222326)
--- trunk/Source/WebCore/platform/mac/VideoFullscreenInterfaceMac.mm 2017-09-21 17:12:24 UTC (rev 222325)
+++ trunk/Source/WebCore/platform/mac/VideoFullscreenInterfaceMac.mm 2017-09-21 17:33:52 UTC (rev 222326)
@@ -30,7 +30,6 @@
#import "IntRect.h"
#import "Logging.h"
-#import "MediaTimeAVFoundation.h"
#import "PlaybackSessionInterfaceMac.h"
#import "TimeRanges.h"
#import "VideoFullscreenChangeObserver.h"
@@ -37,6 +36,7 @@
#import "VideoFullscreenModel.h"
#import "WebPlaybackControlsManager.h"
#import <AVFoundation/AVTime.h>
+#import <pal/avfoundation/MediaTimeAVFoundation.h>
#import <pal/spi/cocoa/AVKitSPI.h>
#import <pal/spi/mac/PIPSPI.h>
Modified: trunk/Source/WebCore/platform/mediastream/mac/CoreAudioCaptureSource.cpp (222325 => 222326)
--- trunk/Source/WebCore/platform/mediastream/mac/CoreAudioCaptureSource.cpp 2017-09-21 17:12:24 UTC (rev 222325)
+++ trunk/Source/WebCore/platform/mediastream/mac/CoreAudioCaptureSource.cpp 2017-09-21 17:33:52 UTC (rev 222326)
@@ -37,7 +37,6 @@
#include "CoreAudioCaptureDeviceManager.h"
#include "CoreAudioCaptureSourceIOS.h"
#include "Logging.h"
-#include "MediaTimeAVFoundation.h"
#include "Timer.h"
#include "WebAudioSourceProviderAVFObjC.h"
#include <AudioToolbox/AudioConverter.h>
@@ -44,6 +43,7 @@
#include <AudioUnit/AudioUnit.h>
#include <CoreMedia/CMSync.h>
#include <mach/mach_time.h>
+#include <pal/avfoundation/MediaTimeAVFoundation.h>
#include <pal/spi/cf/CoreAudioSPI.h>
#include <sys/time.h>
#include <wtf/MainThread.h>
Modified: trunk/Source/WebCore/platform/mediastream/mac/MockRealtimeAudioSourceMac.mm (222325 => 222326)
--- trunk/Source/WebCore/platform/mediastream/mac/MockRealtimeAudioSourceMac.mm 2017-09-21 17:12:24 UTC (rev 222325)
+++ trunk/Source/WebCore/platform/mediastream/mac/MockRealtimeAudioSourceMac.mm 2017-09-21 17:33:52 UTC (rev 222326)
@@ -106,7 +106,7 @@
CMTime startTime = CMTimeMake(m_samplesEmitted, sampleRate());
m_samplesEmitted += frameCount;
- audioSamplesAvailable(toMediaTime(startTime), *m_audioBufferList, CAAudioStreamDescription(m_streamFormat), frameCount);
+ audioSamplesAvailable(PAL::toMediaTime(startTime), *m_audioBufferList, CAAudioStreamDescription(m_streamFormat), frameCount);
}
void MockRealtimeAudioSourceMac::reconfigure()
Modified: trunk/Source/WebCore/platform/mediastream/mac/RealtimeIncomingAudioSource.cpp (222325 => 222326)
--- trunk/Source/WebCore/platform/mediastream/mac/RealtimeIncomingAudioSource.cpp 2017-09-21 17:12:24 UTC (rev 222325)
+++ trunk/Source/WebCore/platform/mediastream/mac/RealtimeIncomingAudioSource.cpp 2017-09-21 17:33:52 UTC (rev 222326)
@@ -36,9 +36,9 @@
#include "AudioStreamDescription.h"
#include "CAAudioStreamDescription.h"
#include "LibWebRTCAudioFormat.h"
-#include "MediaTimeAVFoundation.h"
#include "WebAudioBufferList.h"
#include "WebAudioSourceProviderAVFObjC.h"
+#include <pal/avfoundation/MediaTimeAVFoundation.h>
#include "CoreMediaSoftLink.h"
@@ -83,7 +83,7 @@
ASSERT(sampleRate == 48000);
CMTime startTime = CMTimeMake(m_numberOfFrames, sampleRate);
- auto mediaTime = toMediaTime(startTime);
+ auto mediaTime = PAL::toMediaTime(startTime);
m_numberOfFrames += numberOfFrames;
AudioStreamBasicDescription newDescription = streamDescription(sampleRate, numberOfChannels);
Modified: trunk/Source/WebCore/platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm (222325 => 222326)
--- trunk/Source/WebCore/platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm 2017-09-21 17:12:24 UTC (rev 222325)
+++ trunk/Source/WebCore/platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm 2017-09-21 17:33:52 UTC (rev 222326)
@@ -33,7 +33,6 @@
#import "AudioSampleDataSource.h"
#import "AudioSourceProviderClient.h"
#import "Logging.h"
-#import "MediaTimeAVFoundation.h"
#import "WebAudioBufferList.h"
#import <objc/runtime.h>
#import <wtf/MainThread.h>