Move more CoreMedia soft-linked functions to CoreMediaSoftLink.{cpp,h}
authorddkilzer@apple.com <ddkilzer@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 19 Feb 2015 22:42:28 +0000 (22:42 +0000)
committerddkilzer@apple.com <ddkilzer@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 19 Feb 2015 22:42:28 +0000 (22:42 +0000)
<http://webkit.org/b/141791>

Reviewed by Alexey Proskuryakov.

* Configurations/WebCore.unexp:
- Remove five more symbols.

* Modules/plugins/QuickTimePluginReplacement.mm:
- Remove all local soft-links and include CoreMediaSoftLink.h.
  Note that SOFT_LINK_FRAMEWORK_OPTIONAL() should not have been
  used here since we didn't use the optional function soft-link
  method.

* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.vcxproj/WebCoreCFNetwork.props:
* WebCore.xcodeproj/project.pbxproj:
- Add CoreMediaSPI.h to the project.

* platform/cf/CoreMediaSoftLink.cpp:
* platform/cf/CoreMediaSoftLink.h:
- Add three cross-platform symbols, five Cocoa-only symbols, and
  two Windows-only symbols (based on current usage, not
  availability on each platform).
- Include CoreMediaSPI.h header.
- Include <CoreMedia/CoreMedia.h> instead of just CMTime.h.

* platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
- Remove all CoreMedia soft-linked functions.  Constants remain.

* platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
- Remove one CoreMedia soft-linked method.

* platform/graphics/avfoundation/MediaTimeAVFoundation.cpp:
- Remove all CoreMedia soft-linked funtions.  With this change,
  we are already realizing space savings for duplicate
  SOFT_LINK_FRAMEWORK() calls.  (On Windows, there was code
  generated for many unused functions included by
  CoreMediaSoftLinking.h.)

* platform/graphics/avfoundation/cf/CoreMediaSoftLinking.h:
- Remove all CoreMedia soft-linked funtions.  Constants remain.

* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
- Remove duplicate header included by CoreMediaSoftLink.h.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
- Remove all CoreMedia soft-linked funtions.  Constants remain.

* platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
- Remove three CoreMedia soft-linked methods.

* platform/mac/PlatformClockCM.mm:
- Remove two CoreMedia soft-linked methods.

* platform/mac/SerializedPlatformRepresentationMac.mm:
- Remove only CoreMedia soft-linked funtion.  It wasn't even
  used.

* platform/mediastream/mac/AVVideoCaptureSource.mm:
- Remove two CoreMedia soft-linked method.

* platform/spi/cf/CoreMediaSPI.h:
- Add for SPI from CMNotificationCenter.h.

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

20 files changed:
Source/WebCore/ChangeLog
Source/WebCore/Configurations/WebCore.unexp
Source/WebCore/Modules/plugins/QuickTimePluginReplacement.mm
Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters
Source/WebCore/WebCore.vcxproj/WebCoreCFNetwork.props
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/platform/cf/CoreMediaSoftLink.cpp
Source/WebCore/platform/cf/CoreMediaSoftLink.h
Source/WebCore/platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm
Source/WebCore/platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp
Source/WebCore/platform/graphics/avfoundation/MediaTimeAVFoundation.cpp
Source/WebCore/platform/graphics/avfoundation/cf/CoreMediaSoftLinking.h
Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm
Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm
Source/WebCore/platform/mac/PlatformClockCM.mm
Source/WebCore/platform/mac/SerializedPlatformRepresentationMac.mm
Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.mm
Source/WebCore/platform/spi/cf/CoreMediaSPI.h [new file with mode: 0644]

index 0c25014..b28883b 100644 (file)
@@ -1,3 +1,71 @@
+2015-02-19  David Kilzer  <ddkilzer@apple.com>
+
+        Move more CoreMedia soft-linked functions to CoreMediaSoftLink.{cpp,h}
+        <http://webkit.org/b/141791>
+
+        Reviewed by Alexey Proskuryakov.
+
+        * Configurations/WebCore.unexp:
+        - Remove five more symbols.
+
+        * Modules/plugins/QuickTimePluginReplacement.mm:
+        - Remove all local soft-links and include CoreMediaSoftLink.h.
+          Note that SOFT_LINK_FRAMEWORK_OPTIONAL() should not have been
+          used here since we didn't use the optional function soft-link
+          method.
+
+        * WebCore.vcxproj/WebCore.vcxproj.filters:
+        * WebCore.vcxproj/WebCoreCFNetwork.props:
+        * WebCore.xcodeproj/project.pbxproj:
+        - Add CoreMediaSPI.h to the project.
+
+        * platform/cf/CoreMediaSoftLink.cpp:
+        * platform/cf/CoreMediaSoftLink.h:
+        - Add three cross-platform symbols, five Cocoa-only symbols, and
+          two Windows-only symbols (based on current usage, not
+          availability on each platform).
+        - Include CoreMediaSPI.h header.
+        - Include <CoreMedia/CoreMedia.h> instead of just CMTime.h.
+
+        * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
+        - Remove all CoreMedia soft-linked functions.  Constants remain.
+
+        * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
+        - Remove one CoreMedia soft-linked method.
+
+        * platform/graphics/avfoundation/MediaTimeAVFoundation.cpp:
+        - Remove all CoreMedia soft-linked funtions.  With this change,
+          we are already realizing space savings for duplicate
+          SOFT_LINK_FRAMEWORK() calls.  (On Windows, there was code
+          generated for many unused functions included by
+          CoreMediaSoftLinking.h.)
+
+        * platform/graphics/avfoundation/cf/CoreMediaSoftLinking.h:
+        - Remove all CoreMedia soft-linked funtions.  Constants remain.
+
+        * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
+        - Remove duplicate header included by CoreMediaSoftLink.h.
+
+        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
+        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
+        - Remove all CoreMedia soft-linked funtions.  Constants remain.
+
+        * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
+        - Remove three CoreMedia soft-linked methods.
+
+        * platform/mac/PlatformClockCM.mm:
+        - Remove two CoreMedia soft-linked methods.
+
+        * platform/mac/SerializedPlatformRepresentationMac.mm:
+        - Remove only CoreMedia soft-linked funtion.  It wasn't even
+          used.
+
+        * platform/mediastream/mac/AVVideoCaptureSource.mm:
+        - Remove two CoreMedia soft-linked method.
+
+        * platform/spi/cf/CoreMediaSPI.h:
+        - Add for SPI from CMNotificationCenter.h.
+
 2015-02-19  David Hyatt  <hyatt@apple.com>
 
         Columns are splitting unsplittable content.
index 9c80904..5787c67 100644 (file)
@@ -28,13 +28,11 @@ __ZTVNSt3__119basic_ostringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE
 # Source/WebCore/platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm
 _AudioConverterConvertComplexBuffer
 _AudioConverterNew
-_CMTimebaseGetTime
 _MTAudioProcessingTapGetSourceAudio
 _MTAudioProcessingTapGetStorage
 
 # Source/WebCore/platform/mac/PlatformClockCM.mm
 _CMAudioDeviceClockCreate
-_CMTimeGetSeconds
 _CMTimebaseCreateWithMasterClock
 _CMTimebaseSetRate
 _CMTimebaseSetTime
@@ -47,13 +45,6 @@ _CMSampleBufferGetDataBuffer
 _CMSampleBufferGetFormatDescription
 _CMSampleBufferGetSampleTimingInfo
 
-# Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.mm
-_CMTimeCompare
-_CMTimeMake
-
-# Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm
-_CMTimeRangeGetEnd
-
 # Source/WebCore/page/CaptionUserPreferencesMediaAF.cpp
 _MACaptionAppearanceAddSelectedLanguage
 _MACaptionAppearanceCopyBackgroundColor
index 2b5c755..183c479 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2013-2014 Apple Inc. All rights reserved.
+ * 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
@@ -29,6 +29,7 @@
 
 #import "QuickTimePluginReplacement.h"
 
+#import "CoreMediaSoftLink.h"
 #import "Event.h"
 #import "HTMLPlugInElement.h"
 #import "HTMLVideoElement.h"
 #import "UserAgentScripts.h"
 #import <objc/runtime.h>
 #import <AVFoundation/AVFoundation.h>
-#import <CoreMedia/CoreMedia.h>
 #import <Foundation/NSString.h>
 #import <JavaScriptCore/JavaScriptCore.h>
 #import <JavaScriptCore/APICast.h>
 #import <wtf/text/Base64.h>
 
-SOFT_LINK_FRAMEWORK_OPTIONAL(CoreMedia)
-SOFT_LINK(CoreMedia, CMTimeCopyAsDictionary, CFDictionaryRef, (CMTime time, CFAllocatorRef allocator), (time, allocator))
-
 typedef AVMetadataItem AVMetadataItemType;
 SOFT_LINK_FRAMEWORK_OPTIONAL(AVFoundation)
 SOFT_LINK_CLASS(AVFoundation, AVMetadataItem)
index 2783145..0be9d62 100644 (file)
     <ClInclude Include="..\platform\spi\cg\CoreGraphicsSPI.h">
       <Filter>platform\spi\cg</Filter>
     </ClInclude>
+    <ClInclude Include="..\platform\spi\cf\CoreMediaSPI.h">
+      <Filter>platform\spi\cf</Filter>
+    </ClInclude>
     <ClInclude Include="..\platform\sql\SQLiteDatabase.h">
       <Filter>platform\sql</Filter>
     </ClInclude>
index 773a258..222acaa 100644 (file)
@@ -5,7 +5,7 @@
   </PropertyGroup>
   <ItemDefinitionGroup>
     <ClCompile>
-      <AdditionalIncludeDirectories>$(ProjectDir)..\platform\network\cf;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>$(ProjectDir)..\platform\network\cf;$(ProjectDir)..\platform\spi\cf;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
     </ClCompile>
   </ItemDefinitionGroup>
 </Project>
\ No newline at end of file
index c2cfeae..d2a591b 100644 (file)
                443817FF1A91B2F8006E04F2 /* CoreMediaSoftLink.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 443817FD1A91B2F8006E04F2 /* CoreMediaSoftLink.cpp */; };
                443818001A91B2F8006E04F2 /* CoreMediaSoftLink.h in Headers */ = {isa = PBXBuildFile; fileRef = 443817FE1A91B2F8006E04F2 /* CoreMediaSoftLink.h */; };
                443F04270E75C8FB007E5407 /* NetworkStateNotifierIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 443F04260E75C8FB007E5407 /* NetworkStateNotifierIOS.mm */; };
+               4449A4051A964B0000B64AD5 /* CoreMediaSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 4449A4041A964B0000B64AD5 /* CoreMediaSPI.h */; };
                444D4E230F708B2E003158E0 /* WebCoreURLResponseIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 444D4E210F708B2E003158E0 /* WebCoreURLResponseIOS.mm */; };
                4476531B133170990006B789 /* SSLKeyGeneratorIOS.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4476531A133170990006B789 /* SSLKeyGeneratorIOS.cpp */; };
                447958041643B49A001E0A7F /* ParsedContentType.h in Headers */ = {isa = PBXBuildFile; fileRef = 447958031643B47B001E0A7F /* ParsedContentType.h */; settings = {ATTRIBUTES = (Private, ); }; };
                443817FD1A91B2F8006E04F2 /* CoreMediaSoftLink.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CoreMediaSoftLink.cpp; sourceTree = "<group>"; };
                443817FE1A91B2F8006E04F2 /* CoreMediaSoftLink.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CoreMediaSoftLink.h; sourceTree = "<group>"; };
                443F04260E75C8FB007E5407 /* NetworkStateNotifierIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NetworkStateNotifierIOS.mm; sourceTree = "<group>"; };
+               4449A4041A964B0000B64AD5 /* CoreMediaSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CoreMediaSPI.h; sourceTree = "<group>"; };
                444D4E210F708B2E003158E0 /* WebCoreURLResponseIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebCoreURLResponseIOS.mm; sourceTree = "<group>"; };
                4476531A133170990006B789 /* SSLKeyGeneratorIOS.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SSLKeyGeneratorIOS.cpp; path = ios/SSLKeyGeneratorIOS.cpp; sourceTree = "<group>"; };
                447958021643B47B001E0A7F /* ParsedContentType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ParsedContentType.cpp; sourceTree = "<group>"; };
                                65086DA719AC1719009AF46B /* CFLocaleSPI.h */,
                                CE8245EF19B671BA00AC0122 /* CFNetworkConnectionCacheSPI.h */,
                                CE12525A1A1C018200864480 /* CFNetworkSPI.h */,
+                               4449A4041A964B0000B64AD5 /* CoreMediaSPI.h */,
                        );
                        path = cf;
                        sourceTree = "<group>";
                                9746AF2114F4DDE6003E7A71 /* Coordinates.h in Headers */,
                                CE1252371A15BDBE00864480 /* CoreGraphicsSPI.h in Headers */,
                                443818001A91B2F8006E04F2 /* CoreMediaSoftLink.h in Headers */,
+                               4449A4051A964B0000B64AD5 /* CoreMediaSPI.h in Headers */,
                                1C6466251A12C38E0094603C /* CoreTextSPI.h in Headers */,
                                862F129E18C1576F005C54AF /* CountedUserActivity.h in Headers */,
                                A80E6D040A1989CA007FB8C5 /* Counter.h in Headers */,
index 210569a..5d66cd3 100644 (file)
 
 #if USE(AVFOUNDATION)
 
+#include "CoreMediaSPI.h"
 #include "SoftLinking.h"
-#include <CoreMedia/CMTime.h>
+#include <CoreMedia/CoreMedia.h>
 
 namespace WebCore {
 SOFT_LINK_FRAMEWORK(CoreMedia)
 }
 
+SOFT_LINK_FUNCTION_IMPL(CoreMedia, CMTimeCompare, int32_t, (CMTime time1, CMTime time2), (time1, time2))
+SOFT_LINK_FUNCTION_IMPL(CoreMedia, CMTimeGetSeconds, Float64, (CMTime time), (time))
+SOFT_LINK_FUNCTION_IMPL(CoreMedia, CMTimeMake, CMTime, (int64_t value, int32_t timescale), (value, timescale))
 SOFT_LINK_FUNCTION_IMPL(CoreMedia, CMTimeMakeWithSeconds, CMTime, (Float64 seconds, int32_t preferredTimeScale), (seconds, preferredTimeScale))
+SOFT_LINK_FUNCTION_IMPL(CoreMedia, CMTimeRangeGetEnd, CMTime, (CMTimeRange range), (range))
+
+#if PLATFORM(COCOA)
+SOFT_LINK_FUNCTION_IMPL(CoreMedia, CMNotificationCenterGetDefaultLocalCenter, CMNotificationCenterRef, (void), ());
+SOFT_LINK_FUNCTION_IMPL(CoreMedia, CMNotificationCenterAddListener, OSStatus, (CMNotificationCenterRef center, const void* listener, CMNotificationCallback callback, CFStringRef notification, const void* object, UInt32 flags), (center, listener, callback, notification, object, flags))
+SOFT_LINK_FUNCTION_IMPL(CoreMedia, CMNotificationCenterRemoveListener, OSStatus, (CMNotificationCenterRef center, const void* listener, CMNotificationCallback callback, CFStringRef notification, const void* object), (center, listener, callback, notification, object))
+SOFT_LINK_FUNCTION_IMPL(CoreMedia, CMTimebaseGetTime, CMTime, (CMTimebaseRef timebase), (timebase))
+SOFT_LINK_FUNCTION_IMPL(CoreMedia, CMTimeCopyAsDictionary, CFDictionaryRef, (CMTime time, CFAllocatorRef allocator), (time, allocator))
+#endif // PLATFORM(COCOA)
+
+#if PLATFORM(WIN)
+SOFT_LINK_FUNCTION_IMPL(CoreMedia, CMTimeAdd, CMTime, (CMTime addend1, CMTime addend2), (addend1, addend2))
+SOFT_LINK_FUNCTION_IMPL(CoreMedia, CMTimeMakeFromDictionary, CMTime, (CFDictionaryRef dict), (dict))
+#endif // PLATFORM(WIN)
 
 #endif // USE(AVFOUNDATION)
index a97d4ad..ec489f8 100644 (file)
 
 #if USE(AVFOUNDATION)
 
+#include "CoreMediaSPI.h"
 #include "SoftLinking.h"
-#include <CoreMedia/CMTime.h>
+#include <CoreMedia/CoreMedia.h>
 
+SOFT_LINK_FUNCTION_DECL(CMTimeCompare, int32_t, (CMTime time1, CMTime time2), (time1, time2))
+#define CMTimeCompare softLink_CMTimeCompare
+SOFT_LINK_FUNCTION_DECL(CMTimeGetSeconds, Float64, (CMTime time), (time))
+#define CMTimeGetSeconds softLink_CMTimeGetSeconds
+SOFT_LINK_FUNCTION_DECL(CMTimeMake, CMTime, (int64_t value, int32_t timescale), (value, timescale))
+#define CMTimeMake softLink_CMTimeMake
 SOFT_LINK_FUNCTION_DECL(CMTimeMakeWithSeconds, CMTime, (Float64 seconds, int32_t preferredTimeScale), (seconds, preferredTimeScale))
 #define CMTimeMakeWithSeconds softLink_CMTimeMakeWithSeconds
+SOFT_LINK_FUNCTION_DECL(CMTimeRangeGetEnd, CMTime, (CMTimeRange range), (range))
+#define CMTimeRangeGetEnd softLink_CMTimeRangeGetEnd
+
+#if PLATFORM(COCOA)
+
+SOFT_LINK_FUNCTION_DECL(CMNotificationCenterGetDefaultLocalCenter, CMNotificationCenterRef, (void), ());
+#define CMNotificationCenterGetDefaultLocalCenter softLink_CMNotificationCenterGetDefaultLocalCenter
+SOFT_LINK_FUNCTION_DECL(CMNotificationCenterAddListener, OSStatus, (CMNotificationCenterRef center, const void* listener, CMNotificationCallback callback, CFStringRef notification, const void* object, UInt32 flags), (center, listener, callback, notification, object, flags))
+#define CMNotificationCenterAddListener softLink_CMNotificationCenterAddListener
+SOFT_LINK_FUNCTION_DECL(CMNotificationCenterRemoveListener, OSStatus, (CMNotificationCenterRef center, const void* listener, CMNotificationCallback callback, CFStringRef notification, const void* object), (center, listener, callback, notification, object))
+#define CMNotificationCenterRemoveListener softLink_CMNotificationCenterRemoveListener
+SOFT_LINK_FUNCTION_DECL(CMTimebaseGetTime, CMTime, (CMTimebaseRef timebase), (timebase))
+#define CMTimebaseGetTime softLink_CMTimebaseGetTime
+SOFT_LINK_FUNCTION_DECL(CMTimeCopyAsDictionary, CFDictionaryRef, (CMTime time, CFAllocatorRef allocator), (time, allocator))
+#define CMTimeCopyAsDictionary softLink_CMTimeCopyAsDictionary
+
+#endif // PLATFORM(COCOA)
+
+#if PLATFORM(WIN)
+
+SOFT_LINK_FUNCTION_DECL(CMTimeAdd, CMTime, (CMTime addend1, CMTime addend2), (addend1, addend2))
+#define CMTimeAdd softLink_CMTimeAdd
+SOFT_LINK_FUNCTION_DECL(CMTimeMakeFromDictionary, CMTime, (CFDictionaryRef dict), (dict))
+#define CMTimeMakeFromDictionary softLink_CMTimeMakeFromDictionary
+
+#endif // PLATFORM(WIN)
 
 #endif // USE(AVFOUNDATION)
 
index 581f656..93318bf 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014, 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
@@ -32,6 +32,7 @@
 #import "AudioChannel.h"
 #import "AudioSourceProviderClient.h"
 #import "CARingBuffer.h"
+#import "CoreMediaSoftLink.h"
 #import "Logging.h"
 #import "MediaTimeAVFoundation.h"
 #import "SoftLinking.h"
@@ -56,15 +57,6 @@ SOFT_LINK_CLASS(AVFoundation, AVPlayerItem)
 SOFT_LINK_CLASS(AVFoundation, AVMutableAudioMix)
 SOFT_LINK_CLASS(AVFoundation, AVMutableAudioMixInputParameters)
 
-typedef struct opaqueCMNotificationCenter *CMNotificationCenterRef;
-typedef void (*CMNotificationCallback)(CMNotificationCenterRef inCenter, const void *inListener, CFStringRef inNotificationName, const void *inNotifyingObject, CFTypeRef inNotificationPayload);
-
-SOFT_LINK(CoreMedia, CMNotificationCenterGetDefaultLocalCenter, CMNotificationCenterRef, (void), ());
-SOFT_LINK(CoreMedia, CMNotificationCenterAddListener, OSStatus, (CMNotificationCenterRef center, const void* listener, CMNotificationCallback callback, CFStringRef notification, const void* object, UInt32 flags), (center, listener, callback, notification, object, flags))
-SOFT_LINK(CoreMedia, CMNotificationCenterRemoveListener, OSStatus, (CMNotificationCenterRef center, const void* listener, CMNotificationCallback callback, CFStringRef notification, const void* object), (center, listener, callback, notification, object))
-SOFT_LINK(CoreMedia, CMTimebaseGetTime, CMTime, (CMTimebaseRef timebase), (timebase))
-SOFT_LINK(CoreMedia, CMTimebaseGetEffectiveRate, Float64, (CMTimebaseRef timebase), (timebase))
-
 SOFT_LINK_CONSTANT(CoreMedia, kCMTimebaseNotification_EffectiveRateChanged, CFStringRef)
 SOFT_LINK_CONSTANT(CoreMedia, kCMTimebaseNotification_TimeJumped, CFStringRef)
 #define kCMTimebaseNotification_EffectiveRateChanged getkCMTimebaseNotification_EffectiveRateChanged()
index ad6bad9..3347312 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2012-2014 Apple Inc. All rights reserved.
+ * 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
@@ -95,8 +95,6 @@ extern "C" {
 }
 #endif
 
-SOFT_LINK_DLL_IMPORT(CoreMedia, CMTimeGetSeconds, Float64, __cdecl, (CMTime time), (time))
-#define CMTimeGetSeconds softLink_CMTimeGetSeconds
 SOFT_LINK_DLL_IMPORT(CoreMedia, CMSampleBufferGetDataBuffer, CMBlockBufferRef, __cdecl, (CMSampleBufferRef sbuf), (sbuf))
 #define CMSampleBufferGetDataBuffer softLink_CMSampleBufferGetDataBuffer
 SOFT_LINK_DLL_IMPORT(CoreMedia, CMBlockBufferCopyDataBytes, OSStatus, __cdecl, (CMBlockBufferRef theSourceBuffer, size_t offsetToData, size_t dataLength, void* destination), (theSourceBuffer, offsetToData, dataLength, destination))
index 99b9869..d773626 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2013 Apple Inc. All rights reserved.
+ * 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
 
 #include "CoreMediaSoftLink.h"
 
-#if PLATFORM(WIN)
-#include <CoreMedia/CoreMedia.h>
-#include "CoreMediaSoftLinking.h"
-#else
-#include "SoftLinking.h"
-SOFT_LINK_FRAMEWORK(CoreMedia)
-SOFT_LINK(CoreMedia, CMTimeMake, CMTime, (int64_t value, int32_t timescale), (value, timescale))
-#endif
-
 namespace WebCore {
 
 static bool CMTimeHasFlags(const CMTime& cmTime, uint32_t flags)
index ac0315c..851eb90 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2011 Apple Inc. All rights reserved.
+ * Copyright (C) 2011, 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
@@ -33,26 +33,6 @@ SOFT_LINK_DEBUG_LIBRARY(CoreMedia)
 SOFT_LINK_LIBRARY(CoreMedia)
 #endif
 
-// Functions
-
-SOFT_LINK_DLL_IMPORT(CoreMedia, CMTimeAdd, CMTime, __cdecl, (CMTime addend1, CMTime addend2), (addend1, addend2))
-#define CMTimeAdd softLink_CMTimeAdd
-
-SOFT_LINK_DLL_IMPORT(CoreMedia, CMTimeCompare, int32_t, __cdecl, (CMTime time1, CMTime time2), (time1, time2))
-#define CMTimeCompare softLink_CMTimeCompare
-
-SOFT_LINK_DLL_IMPORT(CoreMedia, CMTimeGetSeconds, Float64, __cdecl, (CMTime time), (time))
-#define CMTimeGetSeconds softLink_CMTimeGetSeconds
-
-SOFT_LINK_DLL_IMPORT(CoreMedia, CMTimeMake, CMTime, __cdecl, (int64_t value, int32_t timescale), (value, timescale))
-#define CMTimeMake softLink_CMTimeMake
-
-SOFT_LINK_DLL_IMPORT(CoreMedia, CMTimeMakeFromDictionary, CMTime, __cdecl, (CFDictionaryRef dict), (dict))
-#define CMTimeMakeFromDictionary softLink_CMTimeMakeFromDictionary
-
-SOFT_LINK_DLL_IMPORT(CoreMedia, CMTimeRangeGetEnd, CMTime, __cdecl, (CMTimeRange range), (range))
-#define CMTimeRangeGetEnd softLink_CMTimeRangeGetEnd
-
 // Variables
 
 SOFT_LINK_VARIABLE_DLL_IMPORT(CoreMedia, kCMTimeZero, const CMTime);
index f7feb5f..3698b4e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2011-2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2011-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
@@ -58,7 +58,6 @@
 #include <AVFoundationCF/AVCFAssetResourceLoader.h>
 #endif
 #include <AVFoundationCF/AVFoundationCF.h>
-#include <CoreMedia/CoreMedia.h>
 #include <d3d9.h>
 #include <delayimp.h>
 #include <dispatch/dispatch.h>
index 43371fd..55f617d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2011-2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2011-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
@@ -88,7 +88,6 @@
 #import <Foundation/NSGeometry.h>
 #import <QuartzCore/CoreImage.h>
 #endif
-#import <CoreMedia/CoreMedia.h>
 
 #if USE(VIDEOTOOLBOX)
 #import <CoreVideo/CoreVideo.h>
@@ -155,10 +154,6 @@ SOFT_LINK_FRAMEWORK_OPTIONAL(CoreVideo)
 SOFT_LINK_FRAMEWORK_OPTIONAL(VideoToolbox)
 #endif
 
-SOFT_LINK(CoreMedia, CMTimeCompare, int32_t, (CMTime time1, CMTime time2), (time1, time2))
-SOFT_LINK(CoreMedia, CMTimeGetSeconds, Float64, (CMTime time), (time))
-SOFT_LINK(CoreMedia, CMTimeRangeGetEnd, CMTime, (CMTimeRange range), (range))
-
 SOFT_LINK(CoreVideo, CVPixelBufferGetWidth, size_t, (CVPixelBufferRef pixelBuffer), (pixelBuffer))
 SOFT_LINK(CoreVideo, CVPixelBufferGetHeight, size_t, (CVPixelBufferRef pixelBuffer), (pixelBuffer))
 SOFT_LINK(CoreVideo, CVPixelBufferGetBaseAddress, void*, (CVPixelBufferRef pixelBuffer), (pixelBuffer))
index f8ba233..3e94844 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2013 Apple Inc. All rights reserved.
+ * 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
@@ -29,6 +29,7 @@
 #if ENABLE(MEDIA_SOURCE) && USE(AVFOUNDATION)
 
 #import "CDMSessionMediaSourceAVFObjC.h"
+#import "CoreMediaSoftLink.h"
 #import "FileSystem.h"
 #import "Logging.h"
 #import "MediaSourcePrivateAVFObjC.h"
@@ -61,15 +62,6 @@ SOFT_LINK_CLASS_OPTIONAL(AVFoundation, AVStreamDataParser)
 SOFT_LINK_CLASS_OPTIONAL(AVFoundation, AVStreamSession);
 SOFT_LINK_CLASS_OPTIONAL(AVFoundation, AVVideoPerformanceMetrics)
 
-typedef struct opaqueCMNotificationCenter *CMNotificationCenterRef;
-typedef void (*CMNotificationCallback)(CMNotificationCenterRef inCenter, const void *inListener, CFStringRef inNotificationName, const void *inNotifyingObject, CFTypeRef inNotificationPayload);
-
-SOFT_LINK(CoreMedia, CMNotificationCenterGetDefaultLocalCenter, CMNotificationCenterRef, (void), ());
-SOFT_LINK(CoreMedia, CMNotificationCenterAddListener, OSStatus, (CMNotificationCenterRef center, const void* listener, CMNotificationCallback callback, CFStringRef notification, const void* object, UInt32 flags), (center, listener, callback, notification, object, flags))
-SOFT_LINK(CoreMedia, CMNotificationCenterRemoveListener, OSStatus, (CMNotificationCenterRef center, const void* listener, CMNotificationCallback callback, CFStringRef notification, const void* object), (center, listener, callback, notification, object))
-SOFT_LINK(CoreMedia, CMTimeGetSeconds, Float64, (CMTime time), (time))
-SOFT_LINK(CoreMedia, CMTimebaseGetTime, CMTime, (CMTimebaseRef timebase), (timebase))
-
 SOFT_LINK_CONSTANT(CoreMedia, kCMTimebaseNotification_EffectiveRateChanged, CFStringRef)
 #define kCMTimebaseNotification_EffectiveRateChanged getkCMTimebaseNotification_EffectiveRateChanged()
 
index ed33e48..3d0fe0d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014, 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
@@ -37,7 +37,6 @@
 #import "WebCoreSystemInterface.h"
 #import "WebVideoFullscreenModel.h"
 #import <AVFoundation/AVTime.h>
-#import <CoreMedia/CMTime.h>
 #import <UIKit/UIKit.h>
 #import <WebCore/RuntimeApplicationChecksIOS.h>
 #import <WebCore/SoftLinking.h>
@@ -66,10 +65,7 @@ SOFT_LINK_CLASS(UIKit, UIViewController)
 SOFT_LINK_CLASS(UIKit, UIColor)
 
 SOFT_LINK_FRAMEWORK(CoreMedia)
-SOFT_LINK(CoreMedia, CMTimeGetSeconds, Float64, (CMTime time), (time))
-SOFT_LINK(CoreMedia, CMTimeMake, CMTime, (int64_t value, int32_t timescale), (value, timescale))
 SOFT_LINK(CoreMedia, CMTimeRangeContainsTime, Boolean, (CMTimeRange range, CMTime time), (range, time))
-SOFT_LINK(CoreMedia, CMTimeRangeGetEnd, CMTime, (CMTimeRange range), (range))
 SOFT_LINK(CoreMedia, CMTimeRangeMake, CMTimeRange, (CMTime start, CMTime duration), (start, duration))
 SOFT_LINK(CoreMedia, CMTimeSubtract, CMTime, (CMTime minuend, CMTime subtrahend), (minuend, subtrahend))
 SOFT_LINK(CoreMedia, CMTimeMaximum, CMTime, (CMTime time1, CMTime time2), (time1, time2))
index 2341183..7e20bf2 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2012 Apple Inc.  All rights reserved.
+ * 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
@@ -47,9 +47,7 @@ SOFT_LINK(CoreMedia, CMAudioDeviceClockCreate, OSStatus, (CFAllocatorRef allocat
 #endif
 SOFT_LINK(CoreMedia, CMTimebaseCreateWithMasterClock, OSStatus, (CFAllocatorRef allocator, CMClockRef masterClock, CMTimebaseRef *timebaseOut), (allocator, masterClock, timebaseOut))
 SOFT_LINK(CoreMedia, CMTimebaseSetTime, OSStatus, (CMTimebaseRef timebase, CMTime time), (timebase, time))
-SOFT_LINK(CoreMedia, CMTimebaseGetTime, CMTime, (CMTimebaseRef timebase), (timebase))
 SOFT_LINK(CoreMedia, CMTimebaseSetRate, OSStatus, (CMTimebaseRef timebase, Float64 rate), (timebase, rate))
-SOFT_LINK(CoreMedia, CMTimeGetSeconds, Float64, (CMTime time), (time))
 
 using namespace WebCore;
 
index 5cce2ac..a6f6961 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014, 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
@@ -34,7 +34,6 @@
 #import <runtime/ArrayBuffer.h>
 #import <runtime/JSArrayBuffer.h>
 #import <AVFoundation/AVFoundation.h>
-#import <CoreMedia/CoreMedia.h>
 #import <Foundation/NSString.h>
 #import <JavaScriptCore/APICast.h>
 #import <JavaScriptCore/JavaScriptCore.h>
@@ -42,9 +41,6 @@
 #import <JavaScriptCore/JSObjectRef.h>
 #import <wtf/text/Base64.h>
 
-SOFT_LINK_FRAMEWORK_OPTIONAL(CoreMedia)
-SOFT_LINK(CoreMedia, CMTimeCopyAsDictionary, CFDictionaryRef, (CMTime time, CFAllocatorRef allocator), (time, allocator))
-
 typedef AVMetadataItem AVMetadataItemType;
 SOFT_LINK_FRAMEWORK_OPTIONAL(AVFoundation)
 SOFT_LINK_CLASS(AVFoundation, AVMetadataItem)
index a429b9d..f1a7bf0 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2013 Apple Inc. All rights reserved.
+ * 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
@@ -31,6 +31,7 @@
 
 #import "AVCaptureDeviceManager.h"
 #import "BlockExceptions.h"
+#import "CoreMediaSoftLink.h"
 #import "Logging.h"
 #import "MediaConstraints.h"
 #import "MediaStreamSourceStates.h"
@@ -75,8 +76,6 @@ SOFT_LINK_POINTER(AVFoundation, AVCaptureSessionPresetLow, NSString *)
 
 SOFT_LINK(CoreMedia, CMSampleBufferGetFormatDescription, CMFormatDescriptionRef, (CMSampleBufferRef sbuf), (sbuf));
 SOFT_LINK(CoreMedia, CMSampleBufferGetPresentationTimeStamp, CMTime, (CMSampleBufferRef sbuf), (sbuf));
-SOFT_LINK(CoreMedia, CMTimeCompare, int32_t, (CMTime time1, CMTime time2), (time1, time2))
-SOFT_LINK(CoreMedia, CMTimeMake, CMTime, (int64_t value, int32_t timescale), (value, timescale))
 SOFT_LINK(CoreMedia, CMVideoFormatDescriptionGetDimensions, CMVideoDimensions, (CMVideoFormatDescriptionRef videoDesc), (videoDesc));
 
 namespace WebCore {
diff --git a/Source/WebCore/platform/spi/cf/CoreMediaSPI.h b/Source/WebCore/platform/spi/cf/CoreMediaSPI.h
new file mode 100644 (file)
index 0000000..871df3a
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 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.
+ */
+
+#ifndef CoreMediaSPI_h
+#define CoreMediaSPI_h
+
+#if PLATFORM(COCOA)
+
+#if USE(APPLE_INTERNAL_SDK)
+#import <CoreMedia/CMNotificationCenter.h>
+#else
+typedef struct opaqueCMNotificationCenter *CMNotificationCenterRef;
+typedef void (*CMNotificationCallback)(CMNotificationCenterRef inCenter, const void *inListener, CFStringRef inNotificationName, const void *inNotifyingObject, CFTypeRef inNotificationPayload);
+#endif
+
+WTF_EXTERN_C_BEGIN
+CMNotificationCenterRef CMNotificationCenterGetDefaultLocalCenter(void);
+OSStatus CMNotificationCenterAddListener(CMNotificationCenterRef inCenter, const void *inListener, CMNotificationCallback inCallBack, CFStringRef inNotificationName, const void *inObjectToObserve, UInt32 inFlags);
+OSStatus CMNotificationCenterRemoveListener(CMNotificationCenterRef inCenter, const void *inListener, CMNotificationCallback inCallBack, CFStringRef inNotificationName, const void *inObject);
+WTF_EXTERN_C_END
+
+#endif // PLATFORM(COCOA)
+
+#endif // CoreMediaSPI_h