RESOLVED FIXED 178713
[iOS] MediaPlayer::isAvailable() takes ~150 ms during web process initialization
https://bugs.webkit.org/show_bug.cgi?id=178713
Summary [iOS] MediaPlayer::isAvailable() takes ~150 ms during web process initialization
Wenson Hsieh
Reported 2017-10-23 23:48:55 PDT
Attachments
Patch (1.79 KB, patch)
2017-10-23 23:56 PDT, Wenson Hsieh
eric.carlson: review-
Patch (1.73 KB, patch)
2017-10-24 09:48 PDT, Wenson Hsieh
no flags
Wenson Hsieh
Comment 1 2017-10-23 23:56:08 PDT
Eric Carlson
Comment 2 2017-10-24 08:51:17 PDT
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.
Wenson Hsieh
Comment 3 2017-10-24 09:01:08 PDT
(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!
Wenson Hsieh
Comment 4 2017-10-24 09:42:35 PDT
(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).
Wenson Hsieh
Comment 5 2017-10-24 09:48:41 PDT
WebKit Commit Bot
Comment 6 2017-10-24 10:38:48 PDT
Comment on attachment 324679 [details] Patch Clearing flags on attachment: 324679 Committed r223897: <https://trac.webkit.org/changeset/223897>
WebKit Commit Bot
Comment 7 2017-10-24 10:38:49 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.