Bug 150669 - MediaPlayer::getSupportedTypes only returns types from the last engine registered
Summary: MediaPlayer::getSupportedTypes only returns types from the last engine regist...
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Eric Carlson
Depends on:
Reported: 2015-10-29 06:40 PDT by Eric Carlson
Modified: 2015-10-29 10:59 PDT (History)
3 users (show)

See Also:

Proposed patch. (1.47 KB, patch)
2015-10-29 06:46 PDT, Eric Carlson
no flags Details | Formatted Diff | Diff
Updated patch (1.48 KB, patch)
2015-10-29 07:46 PDT, Eric Carlson
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Carlson 2015-10-29 06:40:02 PDT
MediaPlayer::getSupportedTypes is used by MIMETypeRegistry::initializeSupportedMediaMIMETypes to build a static list of all media MIME types supported by a port. MediaPlayer::getSupportedTypes takes a HashSet<String>&, which it passes to ever registered media engine's getSupportedTypes factory method, which of course means that each call overwrites the values added by the previous engine. 

This works as long as every registered media engine supports the same set of MIME types, or the last engine registered is a superset of them all. r191721 added a MediaStream engine to the Mac port. This engine happens to get registered last, so MediaPlayer::getSupportedTypes returns an empty hash set.
Comment 1 Eric Carlson 2015-10-29 06:46:08 PDT
Created attachment 264313 [details]
Proposed patch.
Comment 2 WebKit Commit Bot 2015-10-29 06:47:10 PDT
Attachment 264313 [details] did not pass style-queue:

ERROR: Source/WebCore/ChangeLog:8:  You should remove the 'No new tests' and either add and list tests, or explain why no new tests were possible.  [changelog/nonewtests] [5]
Total errors found: 1 in 2 files

If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Eric Carlson 2015-10-29 07:46:01 PDT
Created attachment 264316 [details]
Updated patch
Comment 4 WebKit Commit Bot 2015-10-29 10:59:26 PDT
Comment on attachment 264316 [details]
Updated patch

Clearing flags on attachment: 264316

Committed r191734: <http://trac.webkit.org/changeset/191734>
Comment 5 WebKit Commit Bot 2015-10-29 10:59:29 PDT
All reviewed patches have been landed.  Closing bug.