Summary: | [iOS] MediaPlayer::isAvailable() takes ~150 ms during web process initialization | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Wenson Hsieh <wenson_hsieh> | ||||||
Component: | WebCore Misc. | Assignee: | Wenson Hsieh <wenson_hsieh> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | commit-queue, eric.carlson, jer.noble, thorton | ||||||
Priority: | P2 | Keywords: | InRadar | ||||||
Version: | WebKit Nightly Build | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Attachments: |
|
Description
Wenson Hsieh
2017-10-23 23:48:55 PDT
Created attachment 324651 [details]
Patch
Comment on attachment 324651 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=324651&action=review > Source/WebCore/platform/graphics/MediaPlayer.cpp:961 > +#if USE(AVFOUNDATION) > + if (DeprecatedGlobalSettings::isAVFoundationEnabled()) > + return true; > +#endif The AVFoundation and CoreMedia frameworks are not installed on a recovery partition, so this will cause HTMLMediaElement to be in the DOM but MediaPlayerPrivateAVFoundationObjC::registerMediaEngine will fail so <audio> and <video> elements won't work. You might make MediaPlayerPrivateAVFoundationObjC::isAvailable() public and call it here instead. (In reply to Eric Carlson from comment #2) > Comment on attachment 324651 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=324651&action=review > > > Source/WebCore/platform/graphics/MediaPlayer.cpp:961 > > +#if USE(AVFOUNDATION) > > + if (DeprecatedGlobalSettings::isAVFoundationEnabled()) > > + return true; > > +#endif > > The AVFoundation and CoreMedia frameworks are not installed on a recovery > partition, so this will cause HTMLMediaElement to be in the DOM but > MediaPlayerPrivateAVFoundationObjC::registerMediaEngine will fail so <audio> > and <video> elements won't work. You might make > MediaPlayerPrivateAVFoundationObjC::isAvailable() public and call it here > instead. Ah, ok...I suspected there might be a case where this would fail :/ My goal is to avoid invoking MediaPlayerPrivateAVFoundationObjC::isAvailable() altogether, since that tries to dlopen() AVFoundation...I'll see if there's another way to address this. Thanks! (In reply to Wenson Hsieh from comment #3) > (In reply to Eric Carlson from comment #2) > > Comment on attachment 324651 [details] > > Patch > > > > View in context: > > https://bugs.webkit.org/attachment.cgi?id=324651&action=review > > > > > Source/WebCore/platform/graphics/MediaPlayer.cpp:961 > > > +#if USE(AVFOUNDATION) > > > + if (DeprecatedGlobalSettings::isAVFoundationEnabled()) > > > + return true; > > > +#endif > > > > The AVFoundation and CoreMedia frameworks are not installed on a recovery > > partition, so this will cause HTMLMediaElement to be in the DOM but > > MediaPlayerPrivateAVFoundationObjC::registerMediaEngine will fail so <audio> > > and <video> elements won't work. You might make > > MediaPlayerPrivateAVFoundationObjC::isAvailable() public and call it here > > instead. > > Ah, ok...I suspected there might be a case where this would fail :/ > > My goal is to avoid invoking > MediaPlayerPrivateAVFoundationObjC::isAvailable() altogether, since that > tries to dlopen() AVFoundation...I'll see if there's another way to address > this. Thanks! Spoke to Eric in person -- while AVFoundation and CoreMedia may not exist in recovery partitions, this is only the case on Mac. On iOS, it is generally safe to assume that AVFoundation and CoreMedia exist (otherwise, many other system apps and frameworks would fail anyways). Since this early return is desired for improving performance on iOS-based platforms in the first place, we can just guard it with PLATFORM(IOS). Created attachment 324679 [details]
Patch
Comment on attachment 324679 [details] Patch Clearing flags on attachment: 324679 Committed r223897: <https://trac.webkit.org/changeset/223897> All reviewed patches have been landed. Closing bug. |