Bug 65725 - Soft link against AVFoundationCF and CoreMedia
Summary: Soft link against AVFoundationCF and CoreMedia
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC All
: P2 Normal
Assignee: Jeff Miller
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2011-08-04 15:24 PDT by Jeff Miller
Modified: 2011-08-18 15:57 PDT (History)
4 users (show)

See Also:


Attachments
Don't soft link to libdispatch (2.37 KB, patch)
2011-08-17 16:22 PDT, Jeff Miller
no flags Details | Formatted Diff | Diff
Soft link against AVFoundationCF and CoreMedia (27.77 KB, patch)
2011-08-18 15:19 PDT, Jeff Miller
eric.carlson: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jeff Miller 2011-08-04 15:24:47 PDT
MediaPlayerPrivateAVFoundationCF.cpp currently pulls in AVCF using #pragma comment(lib), it should soft link to the routines it needs instead.  Even though we delay load AVCF and related DLLS (see <http://trac.webkit.org/changeset/92035>), because we statically link against the libraries the DLLs are loaded at startup, which likely impacts performance.  There's no need to load these until we encounter a media element and even then only if AVFoundation is enabled.
Comment 1 Jeff Miller 2011-08-04 15:25:08 PDT
<rdar://problem/9900224>
Comment 2 Jeff Miller 2011-08-05 18:12:14 PDT
Unfortunately, all of these functions are declared as __declspec(dllimport), and the existing SOFT_LINK() macro doesn't handle this. For example, if the DLL exports a function named "foo()", the name of the function implemented by SOFT_LINK() has to be called __imp__foo, but we have to use GetProcAddress("foo").  I'll have to create a new flavor of the SOFT_LINK() macro for this.  I'll also need a new macro to get at global variables, e.g. __declspec(dllimport) int fooBar.
Comment 3 Jeff Miller 2011-08-17 15:16:58 PDT
I don't think soft linking to libdispatch is helpful, since the libdispatch DLL doesn't appear to be delay loaded.  I verified using Process Explorer that even with AVFoundation support off, libdispatch.dll is loaded in the web process.  I'm guessing that something else in AAS requires it. Updating bug title to reflect this.
Comment 4 Jeff Miller 2011-08-17 16:22:20 PDT
Created attachment 104271 [details]
Don't soft link to libdispatch
Comment 5 Jeff Miller 2011-08-17 16:33:22 PDT
Don't soft link to libdispatch - r93260
<http://trac.webkit.org/changeset/93260>
Comment 6 Jeff Miller 2011-08-18 15:19:31 PDT
Created attachment 104407 [details]
Soft link against AVFoundationCF and CoreMedia

Soft link against AVFoundationCF and CoreMedia
Comment 7 WebKit Review Bot 2011-08-18 15:22:52 PDT
Attachment 104407 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1

Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:55:  Alphabetical sorting problem.  [build/include_order] [4]
Source/WebCore/platform/win/SoftLinking.h:95:  Extra space before ( in function call  [whitespace/parens] [4]
Total errors found: 2 in 6 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 8 Jeff Miller 2011-08-18 15:37:08 PDT
Comment on attachment 104407 [details]
Soft link against AVFoundationCF and CoreMedia

View in context: https://bugs.webkit.org/attachment.cgi?id=104407&action=review

>> Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:55
>> +#include "AVFoundationCFSoftLinking.h"
> 
> Alphabetical sorting problem.  [build/include_order] [4]

As noted in the comment above, this is intentional.

>> Source/WebCore/platform/win/SoftLinking.h:95

> 
> Extra space before ( in function call  [whitespace/parens] [4]

False positive, but this is a complex macro so I'm not sure there's a way to fix this in check-webkit-style.
Comment 9 Jeff Miller 2011-08-18 15:57:09 PDT
Committed r93363: <http://trac.webkit.org/changeset/93363>