Bug 218788

Summary: [Media in GPU Process] Update RemoteMediaPlayerMIMETypeCache to add the support for AVFoundationMSE media engine
Product: WebKit Reporter: Peng Liu <peng.liu6>
Component: MediaAssignee: Peng Liu <peng.liu6>
Status: RESOLVED FIXED    
Severity: Normal CC: eric.carlson, ews-watchlist, glenn, jer.noble, philipj, sergio, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
WIP patch
none
Patch
eric.carlson: review+
Patch for landing none

Description Peng Liu 2020-11-10 21:57:01 PST
Update RemoteMediaPlayerMIMETypeCache to add the support for AVFoundationMSE media engine
Comment 1 Peng Liu 2020-11-10 22:00:06 PST
Created attachment 413781 [details]
WIP patch
Comment 2 Peng Liu 2020-11-11 10:56:49 PST
Created attachment 413840 [details]
Patch
Comment 3 Peng Liu 2020-11-11 11:02:35 PST
Comment on attachment 413840 [details]
Patch

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

> Source/WebKit/WebProcess/GPU/media/RemoteMediaPlayerManager.cpp:-125
> -void RemoteMediaPlayerManager::initialize(const WebProcessCreationParameters& parameters)

Eric, do we need to keep this function?
Comment 4 Eric Carlson 2020-11-11 12:02:28 PST
Comment on attachment 413840 [details]
Patch

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

> Source/WebKit/WebProcess/GPU/media/RemoteMediaPlayerMIMETypeCache.cpp:59
> +        for (auto& type : types)
> +            m_supportedTypesCache.add(type);

You can call addSupportedTypes().

>> Source/WebKit/WebProcess/GPU/media/RemoteMediaPlayerManager.cpp:-125
>> -void RemoteMediaPlayerManager::initialize(const WebProcessCreationParameters& parameters)
> 
> Eric, do we need to keep this function?

We definitely want to cache WebProcessCreationParameters.mediaMIMETypes so we don't have to ask AVFoundation for MIME types more than once in the life of the host application.
Comment 5 Peng Liu 2020-11-11 12:18:14 PST
Comment on attachment 413840 [details]
Patch

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

>> Source/WebKit/WebProcess/GPU/media/RemoteMediaPlayerMIMETypeCache.cpp:59
>> +            m_supportedTypesCache.add(type);
> 
> You can call addSupportedTypes().

Right! Will fix it.

>>> Source/WebKit/WebProcess/GPU/media/RemoteMediaPlayerManager.cpp:-125
>>> -void RemoteMediaPlayerManager::initialize(const WebProcessCreationParameters& parameters)
>> 
>> Eric, do we need to keep this function?
> 
> We definitely want to cache WebProcessCreationParameters.mediaMIMETypes so we don't have to ask AVFoundation for MIME types more than once in the life of the host application.

I see! Does parameters.mediaMIMETypes includes supported MIME types of AVFoundation media engine only, or for all other media engines?
Comment 6 Peng Liu 2020-11-11 15:51:52 PST
Created attachment 413879 [details]
Patch for landing
Comment 7 EWS 2020-11-11 17:48:29 PST
Committed r269711: <https://trac.webkit.org/changeset/269711>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 413879 [details].
Comment 8 Radar WebKit Bug Importer 2020-11-11 17:49:19 PST
<rdar://problem/71307417>