Title: [93363] trunk/Source/WebCore
Revision
93363
Author
je...@apple.com
Date
2011-08-18 15:57:04 -0700 (Thu, 18 Aug 2011)

Log Message

Soft link against AVFoundationCF and CoreMedia
https://bugs.webkit.org/show_bug.cgi?id=65725
        
Add new macros to SoftLinking.h to support soft-linking to functions and variables decorated with __declspec(dllimport),
and use them to soft-link to AVFoundationCF and CoreMedia. I verified that the WebProcess doesn't load these DLLs
until a media element is used.

Reviewed by Eric Carlson.

No new tests as no change in functionality.

* WebCore.vcproj/WebCore.vcproj: Added AVFoundationCFSoftLinking.h and CoreMediaSoftLinking.h.
* WebCore.vcproj/WebCoreMediaQT.vsprops: Removed DelayLoadDLLs linker option which is no longer needed.
* platform/graphics/avfoundation/cf/AVFoundationCFSoftLinking.h: Added.
* platform/graphics/avfoundation/cf/CoreMediaSoftLinking.h: Added.
* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp: Stop linking against AVFoundationCF.lib and CoreMedia.lib and include AVFoundationCFSoftLinking.h and CoreMediaSoftLinking.h.
* platform/win/SoftLinking.h: Added SOFT_LINK_DLL_IMPORT() and SOFT_LINK_VARIABLE_DLL_IMPORT() macros.

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (93362 => 93363)


--- trunk/Source/WebCore/ChangeLog	2011-08-18 22:49:44 UTC (rev 93362)
+++ trunk/Source/WebCore/ChangeLog	2011-08-18 22:57:04 UTC (rev 93363)
@@ -1,3 +1,23 @@
+2011-08-18  Jeff Miller  <je...@apple.com>
+
+        Soft link against AVFoundationCF and CoreMedia
+        https://bugs.webkit.org/show_bug.cgi?id=65725
+        
+        Add new macros to SoftLinking.h to support soft-linking to functions and variables decorated with __declspec(dllimport),
+        and use them to soft-link to AVFoundationCF and CoreMedia. I verified that the WebProcess doesn't load these DLLs
+        until a media element is used.
+
+        Reviewed by Eric Carlson.
+
+        No new tests as no change in functionality.
+
+        * WebCore.vcproj/WebCore.vcproj: Added AVFoundationCFSoftLinking.h and CoreMediaSoftLinking.h.
+        * WebCore.vcproj/WebCoreMediaQT.vsprops: Removed DelayLoadDLLs linker option which is no longer needed.
+        * platform/graphics/avfoundation/cf/AVFoundationCFSoftLinking.h: Added.
+        * platform/graphics/avfoundation/cf/CoreMediaSoftLinking.h: Added.
+        * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp: Stop linking against AVFoundationCF.lib and CoreMedia.lib and include AVFoundationCFSoftLinking.h and CoreMediaSoftLinking.h.
+        * platform/win/SoftLinking.h: Added SOFT_LINK_DLL_IMPORT() and SOFT_LINK_VARIABLE_DLL_IMPORT() macros.
+
 2011-08-18  Sailesh Agrawal  <s...@chromium.org>
 
         Chromium Mac: Show scrollbar when doing search

Modified: trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj (93362 => 93363)


--- trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj	2011-08-18 22:49:44 UTC (rev 93362)
+++ trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj	2011-08-18 22:57:04 UTC (rev 93363)
@@ -30307,6 +30307,14 @@
 						Name="cf"
 						>
 						<File
+							RelativePath="..\platform\graphics\avfoundation\cf\AVFoundationCFSoftLinking.h"
+							>
+						</File>
+						<File
+							RelativePath="..\platform\graphics\avfoundation\cf\CoreMediaSoftLinking.h"
+							>
+						</File>
+						<File
 							RelativePath="..\platform\graphics\avfoundation\cf\MediaPlayerPrivateAVFoundationCF.cpp"
 							>
 						</File>

Modified: trunk/Source/WebCore/WebCore.vcproj/WebCoreMediaQT.vsprops (93362 => 93363)


--- trunk/Source/WebCore/WebCore.vcproj/WebCoreMediaQT.vsprops	2011-08-18 22:49:44 UTC (rev 93362)
+++ trunk/Source/WebCore/WebCore.vcproj/WebCoreMediaQT.vsprops	2011-08-18 22:57:04 UTC (rev 93363)
@@ -8,8 +8,4 @@
 		Name="VCCLCompilerTool"
 		AdditionalIncludeDirectories="&quot;$(WebKitLibrariesDir)\include\CoreAudio&quot;;&quot;$(WebKitLibrariesDir)\include\AVFoundation&quot;;&quot;$(ProjectDir)..\platform\graphics\avfoundation&quot;;&quot;$(ProjectDir)..\platform\graphics\avfoundation\cf&quot;"
 	/>
-	<Tool
-		Name="VCLinkerTool"
-		DelayLoadDLLs="AVFoundationCF.dll;CoreVideo$(WebKitConfigSuffix).dll;MediaToolbox$(WebKitConfigSuffix).dll"
-	/>
 </VisualStudioPropertySheet>

Added: trunk/Source/WebCore/platform/graphics/avfoundation/cf/AVFoundationCFSoftLinking.h (0 => 93363)


--- trunk/Source/WebCore/platform/graphics/avfoundation/cf/AVFoundationCFSoftLinking.h	                        (rev 0)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/cf/AVFoundationCFSoftLinking.h	2011-08-18 22:57:04 UTC (rev 93363)
@@ -0,0 +1,243 @@
+/*
+ * Copyright (C) 2011 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, 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 COMPUTER, 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 "SoftLinking.h"
+
+// Soft-link against AVFoundationCF functions and variables required by MediaPlayerPrivateAVFoundationCF.cpp.
+
+#ifdef DEBUG_ALL
+// FIXME: <rdar://problem/9898937> AVFoundationCF doesn't currently deliver a debug library.
+SOFT_LINK_LIBRARY(AVFoundationCF)
+#else
+SOFT_LINK_LIBRARY(AVFoundationCF)
+#endif
+
+// Functions
+
+SOFT_LINK_DLL_IMPORT(AVFoundationCF, AVCFAssetCancelLoading, void, __cdecl, (AVCFAssetRef asset), (asset))
+#define AVCFAssetCancelLoading softLink_AVCFAssetCancelLoading
+
+SOFT_LINK_DLL_IMPORT(AVFoundationCF, AVCFAssetCopyAssetTracks, CFArrayRef, __cdecl, (AVCFAssetRef asset), (asset))
+#define AVCFAssetCopyAssetTracks softLink_AVCFAssetCopyAssetTracks
+
+SOFT_LINK_DLL_IMPORT(AVFoundationCF, AVCFAssetCopyTracksWithMediaCharacteristic, CFArrayRef, __cdecl, (AVCFAssetRef asset, CFStringRef mediaCharacteristic), (asset, mediaCharacteristic))
+#define AVCFAssetCopyTracksWithMediaCharacteristic softLink_AVCFAssetCopyTracksWithMediaCharacteristic
+
+SOFT_LINK_DLL_IMPORT(AVFoundationCF, AVCFAssetCopyTracksWithMediaType, CFArrayRef, __cdecl, (AVCFAssetRef asset, CFStringRef mediaType), (asset, mediaType))
+#define AVCFAssetCopyTracksWithMediaType softLink_AVCFAssetCopyTracksWithMediaType
+
+SOFT_LINK_DLL_IMPORT(AVFoundationCF, AVCFAssetGetDuration, CMTime, __cdecl, (AVCFAssetRef asset), (asset))
+#define AVCFAssetGetDuration softLink_AVCFAssetGetDuration
+
+SOFT_LINK_DLL_IMPORT(AVFoundationCF, AVCFAssetGetNaturalSize, CGSize, __cdecl, (AVCFAssetRef asset), (asset))
+#define AVCFAssetGetNaturalSize softLink_AVCFAssetGetNaturalSize
+
+SOFT_LINK_DLL_IMPORT(AVFoundationCF, AVCFAssetGetPreferredTransform, CGAffineTransform, __cdecl, (AVCFAssetRef asset), (asset))
+#define AVCFAssetGetPreferredTransform softLink_AVCFAssetGetPreferredTransform
+
+SOFT_LINK_DLL_IMPORT(AVFoundationCF, AVCFAssetGetStatusOfValueForProperty, AVCFPropertyValueStatus, __cdecl, (AVCFAssetRef asset, CFStringRef property, CFErrorRef *errorOut), (asset, property, errorOut))
+#define AVCFAssetGetStatusOfValueForProperty softLink_AVCFAssetGetStatusOfValueForProperty
+
+SOFT_LINK_DLL_IMPORT(AVFoundationCF, AVCFAssetImageGeneratorCopyCGImageAtTime, CGImageRef, __cdecl, (AVCFAssetImageGeneratorRef generator, CMTime requestedTime, CMTime *actualTimeOut, CFErrorRef *errorOut), (generator, requestedTime, actualTimeOut, errorOut))
+#define AVCFAssetImageGeneratorCopyCGImageAtTime softLink_AVCFAssetImageGeneratorCopyCGImageAtTime
+
+SOFT_LINK_DLL_IMPORT(AVFoundationCF, AVCFAssetImageGeneratorCreateWithAsset, AVCFAssetImageGeneratorRef, __cdecl, (CFAllocatorRef allocator, AVCFAssetRef asset), (allocator, asset))
+#define AVCFAssetImageGeneratorCreateWithAsset softLink_AVCFAssetImageGeneratorCreateWithAsset
+
+SOFT_LINK_DLL_IMPORT(AVFoundationCF, AVCFAssetImageGeneratorSetApertureMode, void, __cdecl, (AVCFAssetImageGeneratorRef generator, CFStringRef mode), (generator, mode))
+#define AVCFAssetImageGeneratorSetApertureMode softLink_AVCFAssetImageGeneratorSetApertureMode
+
+SOFT_LINK_DLL_IMPORT(AVFoundationCF, AVCFAssetImageGeneratorSetAppliesPreferredTrackTransform, void, __cdecl, (AVCFAssetImageGeneratorRef generator, Boolean appliesTransfrom), (generator, appliesTransfrom))
+#define AVCFAssetImageGeneratorSetAppliesPreferredTrackTransform softLink_AVCFAssetImageGeneratorSetAppliesPreferredTrackTransform
+
+SOFT_LINK_DLL_IMPORT(AVFoundationCF, AVCFAssetImageGeneratorSetMaximumSize, void, __cdecl, (AVCFAssetImageGeneratorRef generator, CGSize maxSize), (generator, maxSize))
+#define AVCFAssetImageGeneratorSetMaximumSize softLink_AVCFAssetImageGeneratorSetMaximumSize
+
+SOFT_LINK_DLL_IMPORT(AVFoundationCF, AVCFAssetImageGeneratorSetRequestedTimeToleranceAfter, void, __cdecl, (AVCFAssetImageGeneratorRef generator, CMTime toleranceAfter), (generator, toleranceAfter))
+#define AVCFAssetImageGeneratorSetRequestedTimeToleranceAfter softLink_AVCFAssetImageGeneratorSetRequestedTimeToleranceAfter
+
+SOFT_LINK_DLL_IMPORT(AVFoundationCF, AVCFAssetImageGeneratorSetRequestedTimeToleranceBefore, void, __cdecl, (AVCFAssetImageGeneratorRef generator, CMTime toleranceBefore), (generator, toleranceBefore))
+#define AVCFAssetImageGeneratorSetRequestedTimeToleranceBefore softLink_AVCFAssetImageGeneratorSetRequestedTimeToleranceBefore
+
+SOFT_LINK_DLL_IMPORT(AVFoundationCF, AVCFAssetIsPlayable, Boolean, __cdecl, (AVCFAssetRef asset), (asset))
+#define AVCFAssetIsPlayable softLink_AVCFAssetIsPlayable
+
+SOFT_LINK_DLL_IMPORT(AVFoundationCF, AVCFAssetLoadValuesAsynchronouslyForProperties, void, __cdecl, (AVCFAssetRef asset, CFArrayRef properties, AVCFAssetLoadValuesCompletionCallback callback, void *clientContext), (asset, properties, callback, clientContext))
+#define AVCFAssetLoadValuesAsynchronouslyForProperties softLink_AVCFAssetLoadValuesAsynchronouslyForProperties
+
+SOFT_LINK_DLL_IMPORT(AVFoundationCF, AVCFAssetTrackGetMediaType, CFStringRef, __cdecl, (AVCFAssetTrackRef assetTrack), (assetTrack))
+#define AVCFAssetTrackGetMediaType softLink_AVCFAssetTrackGetMediaType
+
+SOFT_LINK_DLL_IMPORT(AVFoundationCF, AVCFAssetTrackGetNaturalSize, CGSize, __cdecl, (AVCFAssetTrackRef assetTrack), (assetTrack))
+#define AVCFAssetTrackGetNaturalSize softLink_AVCFAssetTrackGetNaturalSize
+
+SOFT_LINK_DLL_IMPORT(AVFoundationCF, AVCFAssetTrackGetPreferredTransform, CGAffineTransform, __cdecl, (AVCFAssetTrackRef assetTrack), (assetTrack))
+#define AVCFAssetTrackGetPreferredTransform softLink_AVCFAssetTrackGetPreferredTransform
+
+SOFT_LINK_DLL_IMPORT(AVFoundationCF, AVCFAssetTrackGetTotalSampleDataLength, int64_t, __cdecl, (AVCFAssetTrackRef assetTrack), (assetTrack))
+#define AVCFAssetTrackGetTotalSampleDataLength softLink_AVCFAssetTrackGetTotalSampleDataLength
+
+SOFT_LINK_DLL_IMPORT(AVFoundationCF, AVCFPlayerCreatePeriodicTimeObserverForInterval, AVCFPlayerObserverRef, __cdecl, (AVCFPlayerRef player, CMTime interval, dispatch_queue_t queue, AVCFPlayerPeriodicTimeObserverCallback callback, void *clientContext), (player, interval, queue, callback, clientContext))
+#define AVCFPlayerCreatePeriodicTimeObserverForInterval softLink_AVCFPlayerCreatePeriodicTimeObserverForInterval
+
+SOFT_LINK_DLL_IMPORT(AVFoundationCF, AVCFPlayerItemCreateWithAsset, AVCFPlayerItemRef, __cdecl, (CFAllocatorRef allocator, AVCFAssetRef asset, dispatch_queue_t notificationQueue), (allocator, asset, notificationQueue))
+#define AVCFPlayerItemCreateWithAsset softLink_AVCFPlayerItemCreateWithAsset
+
+SOFT_LINK_DLL_IMPORT(AVFoundationCF, AVCFPlayerCreateWithPlayerItemAndOptions, AVCFPlayerRef, __cdecl, (CFAllocatorRef allocator, AVCFPlayerItemRef playerItem, CFDictionaryRef options, dispatch_queue_t notificationQueue), (allocator, playerItem, options, notificationQueue))
+#define AVCFPlayerCreateWithPlayerItemAndOptions softLink_AVCFPlayerCreateWithPlayerItemAndOptions
+
+SOFT_LINK_DLL_IMPORT(AVFoundationCF, AVCFPlayerItemCopyLoadedTimeRanges, CFArrayRef, __cdecl, (AVCFPlayerItemRef playerItem), (playerItem))
+#define AVCFPlayerItemCopyLoadedTimeRanges softLink_AVCFPlayerItemCopyLoadedTimeRanges
+
+SOFT_LINK_DLL_IMPORT(AVFoundationCF, AVCFPlayerItemCopySeekableTimeRanges, CFArrayRef, __cdecl, (AVCFPlayerItemRef playerItem), (playerItem))
+#define AVCFPlayerItemCopySeekableTimeRanges softLink_AVCFPlayerItemCopySeekableTimeRanges
+
+SOFT_LINK_DLL_IMPORT(AVFoundationCF, AVCFPlayerItemCopyTracks, CFArrayRef, __cdecl, (AVCFPlayerItemRef playerItem), (playerItem))
+#define AVCFPlayerItemCopyTracks softLink_AVCFPlayerItemCopyTracks
+
+SOFT_LINK_DLL_IMPORT(AVFoundationCF, AVCFPlayerItemGetAsset, AVCFAssetRef, __cdecl, (AVCFPlayerItemRef playerItem), (playerItem))
+#define AVCFPlayerItemGetAsset softLink_AVCFPlayerItemGetAsset
+
+SOFT_LINK_DLL_IMPORT(AVFoundationCF, AVCFPlayerItemGetCurrentTime, CMTime, __cdecl, (AVCFPlayerItemRef playerItem), (playerItem))
+#define AVCFPlayerItemGetCurrentTime softLink_AVCFPlayerItemGetCurrentTime
+
+SOFT_LINK_DLL_IMPORT(AVFoundationCF, AVCFPlayerItemGetStatus, AVCFPlayerItemStatus, __cdecl, (AVCFPlayerItemRef playerItem, CFErrorRef *errorOut), (playerItem, errorOut))
+#define AVCFPlayerItemGetStatus softLink_AVCFPlayerItemGetStatus
+
+SOFT_LINK_DLL_IMPORT(AVFoundationCF, AVCFPlayerItemIsPlaybackBufferEmpty, Boolean, __cdecl, (AVCFPlayerItemRef playerItem), (playerItem))
+#define AVCFPlayerItemIsPlaybackBufferEmpty softLink_AVCFPlayerItemIsPlaybackBufferEmpty
+
+SOFT_LINK_DLL_IMPORT(AVFoundationCF, AVCFPlayerItemIsPlaybackBufferFull, Boolean, __cdecl, (AVCFPlayerItemRef playerItem), (playerItem))
+#define AVCFPlayerItemIsPlaybackBufferFull softLink_AVCFPlayerItemIsPlaybackBufferFull
+
+SOFT_LINK_DLL_IMPORT(AVFoundationCF, AVCFPlayerItemIsPlaybackLikelyToKeepUp, Boolean, __cdecl, (AVCFPlayerItemRef playerItem), (playerItem))
+#define AVCFPlayerItemIsPlaybackLikelyToKeepUp softLink_AVCFPlayerItemIsPlaybackLikelyToKeepUp
+
+SOFT_LINK_DLL_IMPORT(AVFoundationCF, AVCFPlayerItemSeekToTimeWithToleranceAndCompletionCallback, AVCFAssetRef, __cdecl, (AVCFPlayerItemRef playerItem, CMTime time, CMTime toleranceBefore, CMTime toleranceAfter, AVCFPlayerItemSeekCompletionCallback completionCallback, void *context), (playerItem, time, toleranceBefore, toleranceAfter, completionCallback, context))
+#define AVCFPlayerItemSeekToTimeWithToleranceAndCompletionCallback softLink_AVCFPlayerItemSeekToTimeWithToleranceAndCompletionCallback
+
+SOFT_LINK_DLL_IMPORT(AVFoundationCF, AVCFPlayerItemTrackCopyAssetTrack, AVCFAssetTrackRef, __cdecl, (AVCFPlayerItemTrackRef track), (track))
+#define AVCFPlayerItemTrackCopyAssetTrack softLink_AVCFPlayerItemTrackCopyAssetTrack
+
+SOFT_LINK_DLL_IMPORT(AVFoundationCF, AVCFPlayerItemTrackIsEnabled, Boolean, __cdecl, (AVCFPlayerItemTrackRef track), (track))
+#define AVCFPlayerItemTrackIsEnabled softLink_AVCFPlayerItemTrackIsEnabled
+
+SOFT_LINK_DLL_IMPORT(AVFoundationCF, AVCFPlayerGetRate, Float32, __cdecl, (AVCFPlayerRef player), (player))
+#define AVCFPlayerGetRate softLink_AVCFPlayerGetRate
+
+SOFT_LINK_DLL_IMPORT(AVFoundationCF, AVCFPlayerLayerCopyCACFLayer, CACFLayerRef, __cdecl, (AVCFPlayerLayerRef playerLayer), (playerLayer))
+#define AVCFPlayerLayerCopyCACFLayer softLink_AVCFPlayerLayerCopyCACFLayer
+
+SOFT_LINK_DLL_IMPORT(AVFoundationCF, AVCFPlayerLayerCreateWithAVCFPlayer, AVCFPlayerLayerRef, __cdecl, (CFAllocatorRef allocator, AVCFPlayerRef player, dispatch_queue_t notificationQueue), (allocator, player, notificationQueue))
+#define AVCFPlayerLayerCreateWithAVCFPlayer softLink_AVCFPlayerLayerCreateWithAVCFPlayer
+
+SOFT_LINK_DLL_IMPORT(AVFoundationCF, AVCFPlayerLayerIsReadyForDisplay, Boolean, __cdecl, (AVCFPlayerLayerRef playerLayer), (playerLayer))
+#define AVCFPlayerLayerIsReadyForDisplay softLink_AVCFPlayerLayerIsReadyForDisplay
+
+SOFT_LINK_DLL_IMPORT(AVFoundationCF, AVCFPlayerLayerSetPlayer, void, __cdecl, (AVCFPlayerLayerRef playerLayer, AVCFPlayerRef player), (playerLayer, player))
+#define AVCFPlayerLayerSetPlayer softLink_AVCFPlayerLayerSetPlayer
+
+SOFT_LINK_DLL_IMPORT(AVFoundationCF, AVCFPlayerRemoveObserver, OSStatus, __cdecl, (AVCFPlayerRef player, AVCFPlayerObserverRef observer), (player, observer))
+#define AVCFPlayerRemoveObserver softLink_AVCFPlayerRemoveObserver
+
+SOFT_LINK_DLL_IMPORT(AVFoundationCF, AVCFPlayerSetClosedCaptionDisplayEnabled, void, __cdecl, (AVCFPlayerRef player, Boolean enabled), (player, enabled))
+#define AVCFPlayerSetClosedCaptionDisplayEnabled softLink_AVCFPlayerSetClosedCaptionDisplayEnabled
+
+SOFT_LINK_DLL_IMPORT(AVFoundationCF, AVCFPlayerSetRate, void, __cdecl, (AVCFPlayerRef player, Float32 rate), (player, rate))
+#define AVCFPlayerSetRate softLink_AVCFPlayerSetRate
+
+SOFT_LINK_DLL_IMPORT(AVFoundationCF, AVCFPlayerSetVolume, void, __cdecl, (AVCFPlayerRef player, Float32 volume), (player, volume))
+#define AVCFPlayerSetVolume softLink_AVCFPlayerSetVolume
+
+SOFT_LINK_DLL_IMPORT(AVFoundationCF, AVCFURLAssetCreateWithURLAndOptions, AVCFURLAssetRef, __cdecl, (CFAllocatorRef allocator, CFURLRef URL, CFDictionaryRef options, dispatch_queue_t notificationQueue), (allocator, URL, options, notificationQueue))
+#define AVCFURLAssetCreateWithURLAndOptions softLink_AVCFURLAssetCreateWithURLAndOptions
+
+// Variables
+
+SOFT_LINK_VARIABLE_DLL_IMPORT(AVFoundationCF, AVCFAssetImageGeneratorApertureModeCleanAperture, const CFStringRef);
+#define AVCFAssetImageGeneratorApertureModeCleanAperture get_AVCFAssetImageGeneratorApertureModeCleanAperture()
+
+SOFT_LINK_VARIABLE_DLL_IMPORT(AVFoundationCF, AVCFAssetPropertyDuration, const CFStringRef);
+#define AVCFAssetPropertyDuration get_AVCFAssetPropertyDuration()
+
+SOFT_LINK_VARIABLE_DLL_IMPORT(AVFoundationCF, AVCFAssetPropertyNaturalSize, const CFStringRef);
+#define AVCFAssetPropertyNaturalSize get_AVCFAssetPropertyNaturalSize()
+
+SOFT_LINK_VARIABLE_DLL_IMPORT(AVFoundationCF, AVCFAssetPropertyPlayable, const CFStringRef);
+#define AVCFAssetPropertyPlayable get_AVCFAssetPropertyPlayable()
+
+SOFT_LINK_VARIABLE_DLL_IMPORT(AVFoundationCF, AVCFAssetPropertyPreferredRate, const CFStringRef);
+#define AVCFAssetPropertyPreferredRate get_AVCFAssetPropertyPreferredRate()
+
+SOFT_LINK_VARIABLE_DLL_IMPORT(AVFoundationCF, AVCFAssetPropertyPreferredTransform, const CFStringRef);
+#define AVCFAssetPropertyPreferredTransform get_AVCFAssetPropertyPreferredTransform()
+
+SOFT_LINK_VARIABLE_DLL_IMPORT(AVFoundationCF, AVCFAssetPropertyTracks, const CFStringRef);
+#define AVCFAssetPropertyTracks get_AVCFAssetPropertyTracks()
+
+SOFT_LINK_VARIABLE_DLL_IMPORT(AVFoundationCF, AVCFMediaCharacteristicAudible, const CFStringRef);
+#define AVCFMediaCharacteristicAudible get_AVCFMediaCharacteristicAudible()
+
+SOFT_LINK_VARIABLE_DLL_IMPORT(AVFoundationCF, AVCFMediaCharacteristicVisual, const CFStringRef);
+#define AVCFMediaCharacteristicVisual get_AVCFMediaCharacteristicVisual()
+
+SOFT_LINK_VARIABLE_DLL_IMPORT(AVFoundationCF, AVCFMediaTypeAudio, const CFStringRef);
+#define AVCFMediaTypeAudio get_AVCFMediaTypeAudio()
+
+SOFT_LINK_VARIABLE_DLL_IMPORT(AVFoundationCF, AVCFMediaTypeClosedCaption, const CFStringRef);
+#define AVCFMediaTypeClosedCaption get_AVCFMediaTypeClosedCaption()
+
+SOFT_LINK_VARIABLE_DLL_IMPORT(AVFoundationCF, AVCFMediaTypeVideo, const CFStringRef);
+#define AVCFMediaTypeVideo get_AVCFMediaTypeVideo()
+
+SOFT_LINK_VARIABLE_DLL_IMPORT(AVFoundationCF, AVCFPlayerItemDidPlayToEndTimeNotification, const CFStringRef);
+#define AVCFPlayerItemDidPlayToEndTimeNotification get_AVCFPlayerItemDidPlayToEndTimeNotification()
+
+SOFT_LINK_VARIABLE_DLL_IMPORT(AVFoundationCF, AVCFPlayerItemIsPlaybackBufferEmptyChangedNotification, const CFStringRef);
+#define AVCFPlayerItemIsPlaybackBufferEmptyChangedNotification get_AVCFPlayerItemIsPlaybackBufferEmptyChangedNotification()
+
+SOFT_LINK_VARIABLE_DLL_IMPORT(AVFoundationCF, AVCFPlayerItemIsPlaybackBufferFullChangedNotification, const CFStringRef);
+#define AVCFPlayerItemIsPlaybackBufferFullChangedNotification get_AVCFPlayerItemIsPlaybackBufferFullChangedNotification()
+
+SOFT_LINK_VARIABLE_DLL_IMPORT(AVFoundationCF, AVCFPlayerItemIsPlaybackLikelyToKeepUpChangedNotification, const CFStringRef);
+#define AVCFPlayerItemIsPlaybackLikelyToKeepUpChangedNotification get_AVCFPlayerItemIsPlaybackLikelyToKeepUpChangedNotification()
+
+SOFT_LINK_VARIABLE_DLL_IMPORT(AVFoundationCF, AVCFPlayerItemLoadedTimeRangesChangedNotification, const CFStringRef);
+#define AVCFPlayerItemLoadedTimeRangesChangedNotification get_AVCFPlayerItemLoadedTimeRangesChangedNotification()
+
+SOFT_LINK_VARIABLE_DLL_IMPORT(AVFoundationCF, AVCFPlayerItemPresentationSizeChangedNotification, const CFStringRef);
+#define AVCFPlayerItemPresentationSizeChangedNotification get_AVCFPlayerItemPresentationSizeChangedNotification()
+
+SOFT_LINK_VARIABLE_DLL_IMPORT(AVFoundationCF, AVCFPlayerItemSeekableTimeRangesChangedNotification, const CFStringRef);
+#define AVCFPlayerItemSeekableTimeRangesChangedNotification get_AVCFPlayerItemSeekableTimeRangesChangedNotification()
+
+SOFT_LINK_VARIABLE_DLL_IMPORT(AVFoundationCF, AVCFPlayerItemStatusChangedNotification, const CFStringRef);
+#define AVCFPlayerItemStatusChangedNotification get_AVCFPlayerItemStatusChangedNotification()
+
+SOFT_LINK_VARIABLE_DLL_IMPORT(AVFoundationCF, AVCFPlayerItemTracksChangedNotification, const CFStringRef);
+#define AVCFPlayerItemTracksChangedNotification get_AVCFPlayerItemTracksChangedNotification()
+
+SOFT_LINK_VARIABLE_DLL_IMPORT(AVFoundationCF, AVCFPlayerRateChangedNotification, const CFStringRef);
+#define AVCFPlayerRateChangedNotification get_AVCFPlayerRateChangedNotification()
Property changes on: trunk/Source/WebCore/platform/graphics/avfoundation/cf/AVFoundationCFSoftLinking.h
___________________________________________________________________

Added: svn:eol-style

Added: trunk/Source/WebCore/platform/graphics/avfoundation/cf/CoreMediaSoftLinking.h (0 => 93363)


--- trunk/Source/WebCore/platform/graphics/avfoundation/cf/CoreMediaSoftLinking.h	                        (rev 0)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/cf/CoreMediaSoftLinking.h	2011-08-18 22:57:04 UTC (rev 93363)
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2011 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, 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 COMPUTER, 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 "SoftLinking.h"
+
+// Soft-link against CoreMedia functions and variables required by MediaPlayerPrivateAVFoundationCF.cpp.
+
+#ifdef DEBUG_ALL
+SOFT_LINK_DEBUG_LIBRARY(CoreMedia)
+#else
+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, CMTimeMakeWithSeconds, CMTime, __cdecl, (Float64 seconds, int32_t preferredTimeScale), (seconds, preferredTimeScale))
+#define CMTimeMakeWithSeconds softLink_CMTimeMakeWithSeconds
+
+// Variables
+
+SOFT_LINK_VARIABLE_DLL_IMPORT(CoreMedia, kCMTimeZero, const CMTime);
+#define kCMTimeZero get_kCMTimeZero()
Property changes on: trunk/Source/WebCore/platform/graphics/avfoundation/cf/CoreMediaSoftLinking.h
___________________________________________________________________

Added: svn:eol-style

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp (93362 => 93363)


--- trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp	2011-08-18 22:49:44 UTC (rev 93362)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp	2011-08-18 22:57:04 UTC (rev 93363)
@@ -51,26 +51,13 @@
 #include <wtf/Threading.h>
 #include <wtf/UnusedParam.h>
 
-#ifdef DEBUG_ALL
-// FIXME: AVFoundationCF doesn't currently deliver a debug version.
-#pragma comment(lib, "AVFoundationCF.lib")
-#pragma comment(lib, "CoreMedia_debug.lib")
-#pragma comment(lib, "libdispatch_debug.lib")
+// The softlink header files must be included after the AVCF and CoreMedia header files.
+#include "AVFoundationCFSoftLinking.h"
+#include "CoreMediaSoftLinking.h"
 
-// Use the soft link macros so we can easily test for the existence of the dlls.
-// FIXME: AVFoundationCF doesn't currently deliver a debug version.
-SOFT_LINK_LIBRARY(AVFoundationCF)
-SOFT_LINK_DEBUG_LIBRARY(CoreMedia)
-#else
-#pragma comment(lib, "AVFoundationCF.lib")
-#pragma comment(lib, "CoreMedia.lib")
+// We don't bother softlinking against libdispatch since it's already been loaded by AAS.
 #pragma comment(lib, "libdispatch.lib")
 
-// Use the soft link macros so we can easily test for the existence of the dlls.
-SOFT_LINK_LIBRARY(AVFoundationCF)
-SOFT_LINK_LIBRARY(CoreMedia)
-#endif // DEBUG_ALL
-
 using namespace std;
 
 namespace WebCore {

Modified: trunk/Source/WebCore/platform/win/SoftLinking.h (93362 => 93363)


--- trunk/Source/WebCore/platform/win/SoftLinking.h	2011-08-18 22:49:44 UTC (rev 93362)
+++ trunk/Source/WebCore/platform/win/SoftLinking.h	2011-08-18 22:57:04 UTC (rev 93363)
@@ -79,4 +79,42 @@
         return ptr; \
     }\
 
+/*
+    In order to soft link against functions decorated with __declspec(dllimport), we prepend "softLink_" to the function names.
+    If you use SOFT_LINK_DLL_IMPORT(), you will also need to #define the function name to account for this, e.g.:
+    
+    SOFT_LINK_DLL_IMPORT(myLibrary, myFunction, ...)
+    #define myFunction softLink_myFunction
+*/ 
+#define SOFT_LINK_DLL_IMPORT(library, functionName, resultType, callingConvention, parameterDeclarations, parameterNames) \
+    static resultType callingConvention init##functionName parameterDeclarations; \
+    static resultType(callingConvention*softLink##functionName) parameterDeclarations = init##functionName; \
+    \
+    static resultType callingConvention init##functionName parameterDeclarations \
+    { \
+        softLink##functionName = reinterpret_cast<resultType (callingConvention*)parameterDeclarations>(SOFT_LINK_GETPROCADDRESS(library##Library(), #functionName)); \
+        ASSERT(softLink##functionName); \
+        return softLink##functionName parameterNames; \
+    }\
+    \
+    inline resultType softLink_##functionName parameterDeclarations \
+    {\
+        return softLink##functionName parameterNames; \
+    }
+
+/*
+    Variables exported by a DLL need to be accessed through a function.
+    If you use SOFT_LINK_VARIABLE_DLL_IMPORT(), you will also need to #define the variable name to account for this, e.g.:
+    
+    SOFT_LINK_VARIABLE_DLL_IMPORT(myLibrary, myVar, int)
+    #define myVar get_myVar()
+*/ 
+#define SOFT_LINK_VARIABLE_DLL_IMPORT(library, variableName, variableType) \
+    static variableType get_##variableName() \
+    { \
+        static variableType* ptr = reinterpret_cast<variableType*>(SOFT_LINK_GETPROCADDRESS(library##Library(), #variableName)); \
+        ASSERT(ptr); \
+        return *ptr; \
+    }\
+
 #endif // SoftLinking_h
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to