Skip to content

Commit

Permalink
REGRESSION (Safari 17 beta): [MSE] Can no longer play .FLAC inside MP4
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=260491
rdar://114276660

Reviewed by Eric Carlson.

In iOS 17 and macOS Sonoma, -[AVURLAsset isPlayableExtendedMIMEType:] is much more restrictive when
reporting which codec types are supported. Previously, any CoreMedia FourCC code was listed as
playable when paired with an ISO BMFF container type such as "video/mp4". Now, only those codec
strings listed with the MP4 registration authority are considered valid. Since the official MP4RA
string for the Flac audio codec is "fLaC", this means that whereas `audio/mp4; codecs="flac"` would
previously succeed, those queries will now fail.

While it is technically "correct" to reject the "flac" codec string when paired with ISO BMFF, there
are a number of pages which are currently broken due to this change, so transform "flac" to "fLaC"
at the WebCore layer.

Additionally, while MIME container types are case-insensitive, the codec parameters on those
container types are case-sensitive, so every Hash container where WebKit caches media MIME types
must be changed from ASCIICaseInsensitiveHash to the default StringHash. This prevents both false
positives and false negatives if the correct or incorrectly-cased versions are queried first.

* LayoutTests/media/media-can-play-case-sensitive-flac-expected.txt: Added.
* LayoutTests/media/media-can-play-case-sensitive-flac.html: Added.
* LayoutTests/media/media-can-play-type-case-sensitive-expected.txt: Added.
* LayoutTests/media/media-can-play-type-case-sensitive.html: Added.
* Source/WebCore/platform/MIMETypeRegistry.cpp:
(WebCore::MIMETypeRegistry::supportedMediaMIMETypes):
* Source/WebCore/platform/MIMETypeRegistry.h:
* Source/WebCore/platform/graphics/MIMETypeCache.cpp:
(WebCore::MIMETypeCache::supportedTypes):
(WebCore::MIMETypeCache::canDecodeType):
(WebCore::MIMETypeCache::addSupportedTypes):
(WebCore::MIMETypeCache::initializeCache):
* Source/WebCore/platform/graphics/MIMETypeCache.h:
* Source/WebCore/platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::getSupportedTypes):
* Source/WebCore/platform/graphics/MediaPlayer.h:
* Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
(WebCore::MediaPlayerPrivateAVFoundation::staticMIMETypeList):
* Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
* Source/WebCore/platform/graphics/avfoundation/objc/AVAssetMIMETypeCache.h:
* Source/WebCore/platform/graphics/avfoundation/objc/AVAssetMIMETypeCache.mm:
(WebCore::AVAssetMIMETypeCache::canDecodeExtendedType):
(WebCore::AVAssetMIMETypeCache::initializeCache):
* Source/WebCore/platform/graphics/avfoundation/objc/AVStreamDataParserMIMETypeCache.h:
* Source/WebCore/platform/graphics/avfoundation/objc/AVStreamDataParserMIMETypeCache.mm:
(WebCore::AVStreamDataParserMIMETypeCache::supportedTypes):
(WebCore::AVStreamDataParserMIMETypeCache::initializeCache):
* Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::getSupportedTypes):
* Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
* Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::getSupportedTypes):
* Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
* Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::getSupportedTypes):
* Source/WebCore/platform/graphics/cocoa/MediaPlayerPrivateWebM.h:
* Source/WebCore/platform/graphics/cocoa/MediaPlayerPrivateWebM.mm:
(WebCore::mimeTypeCache):
(WebCore::MediaPlayerPrivateWebM::getSupportedTypes):
* Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.cpp:
(WebCore::mimeTypeCache):
(WebCore::MockMediaPlayerMediaSource::getSupportedTypes):
* Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.h:
* Source/WebKit/GPUProcess/media/RemoteMediaPlayerManagerProxy.cpp:
(WebKit::RemoteMediaPlayerManagerProxy::getSupportedTypes):
* Source/WebKit/WebProcess/GPU/media/RemoteMediaPlayerMIMETypeCache.cpp:
(WebKit::RemoteMediaPlayerMIMETypeCache::supportedTypes):
* Source/WebKit/WebProcess/GPU/media/RemoteMediaPlayerMIMETypeCache.h:
* Source/WebKit/WebProcess/GPU/media/RemoteMediaPlayerManager.cpp:
(WebKit::RemoteMediaPlayerManager::getSupportedTypes):
* Source/WebKit/WebProcess/GPU/media/RemoteMediaPlayerManager.h:
* Source/WebKitLegacy/mac/WebView/WebHTMLRepresentation.mm:
(createNSArray): Deleted.

Canonical link: https://commits.webkit.org/267250@main
  • Loading branch information
jernoble committed Aug 24, 2023
1 parent 117399a commit 73b6e9f
Show file tree
Hide file tree
Showing 45 changed files with 146 additions and 83 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Tests that both flac and fLaC are reported as playable in a mp4 container.
EXPECTED (mediaElement.canPlayType('audio/mp4; codecs="flac"') == 'probably') OK
EXPECTED (mediaElement.canPlayType('audio/mp4; codecs="fLaC"') == 'probably') OK
EXPECTED (mediaElement.canPlayType('audio/mp4; codecs="FlAc"') == '') OK
END OF TEST

21 changes: 21 additions & 0 deletions LayoutTests/media/media-can-play-case-sensitive-flac.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>media-can-play-type-case-sensitive</title>
<script src="video-test.js"></script>
<script>
window.addEventListener('load', event => {
mediaElement = document.createElement('video');
testExpected(`mediaElement.canPlayType('audio/mp4; codecs="flac"')`, 'probably');
testExpected(`mediaElement.canPlayType('audio/mp4; codecs="fLaC"')`, 'probably');
testExpected(`mediaElement.canPlayType('audio/mp4; codecs="FlAc"')`, '');
endTest();
});
</script>
</head>
<body>
<div>Tests that both <code>flac</code> and <code>fLaC</code> are reported as playable in a mp4 container.</div>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Tests that subsequent tests of incorrectly cased codecs do not incorrectly report they are supported
RUN(mediaElement.canPlayType('audio/mp4; codecs="fLaC"'))
EXPECTED (mediaElement.canPlayType('audio/mp4; codecs="FlAc"') == '') OK
RUN(mediaElement.canPlayType('video/mp4; codecs="avc1"'))
EXPECTED (mediaElement.canPlayType('video/mp4; codecs="AvC1"') == '') OK
RUN(mediaElement.canPlayType('video/ogg; codecs="vorbis"'))
EXPECTED (mediaElement.canPlayType('video/ogg; codecs="vOrBiS"') == '') OK
END OF TEST

24 changes: 24 additions & 0 deletions LayoutTests/media/media-can-play-type-case-sensitive.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>media-can-play-type-case-sensitive</title>
<script src="video-test.js"></script>
<script>
window.addEventListener('load', event => {
mediaElement = document.createElement('video');
run(`mediaElement.canPlayType('audio/mp4; codecs="fLaC"')`);
testExpected(`mediaElement.canPlayType('audio/mp4; codecs="FlAc"')`, '');
run(`mediaElement.canPlayType('video/mp4; codecs="avc1"')`);
testExpected(`mediaElement.canPlayType('video/mp4; codecs="AvC1"')`, '');
run(`mediaElement.canPlayType('video/ogg; codecs="vorbis"')`);
testExpected(`mediaElement.canPlayType('video/ogg; codecs="vOrBiS"')`, '');
endTest();
});
</script>
</head>
<body>
<div>Tests that subsequent tests of incorrectly cased codecs do not incorrectly report they are supported</div>
</body>
</html>
2 changes: 2 additions & 0 deletions LayoutTests/platform/glib/TestExpectations
Original file line number Diff line number Diff line change
Expand Up @@ -3423,6 +3423,8 @@ imported/w3c/web-platform-tests/html/canvas/offscreen/text/fontVariantCaps-1.htm
imported/w3c/web-platform-tests/html/canvas/offscreen/text/fontVariantCaps-3.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/html/canvas/offscreen/text/fontVariantCaps-4.html [ ImageOnlyFailure ]

webkit.org/b/260625 media/media-can-play-case-sensitive-flac.html [ Failure ]
webkit.org/b/260625 media/media-can-play-type-case-sensitive.html [ Failure ]

# End: Common failures between GTK and WPE.

Expand Down
4 changes: 2 additions & 2 deletions Source/WebCore/platform/MIMETypeRegistry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,10 +231,10 @@ HashSet<String, ASCIICaseInsensitiveHash>& MIMETypeRegistry::supportedNonImageMI
return types;
}

const HashSet<String, ASCIICaseInsensitiveHash>& MIMETypeRegistry::supportedMediaMIMETypes()
const HashSet<String>& MIMETypeRegistry::supportedMediaMIMETypes()
{
static NeverDestroyed types = [] {
HashSet<String, ASCIICaseInsensitiveHash> types;
HashSet<String> types;
#if ENABLE(VIDEO)
MediaPlayer::getSupportedTypes(types);
#endif
Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/platform/MIMETypeRegistry.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ class MIMETypeRegistry {
WEBCORE_EXPORT static FixedVector<ASCIILiteral> supportedImageMIMETypes();
static HashSet<String, ASCIICaseInsensitiveHash>& additionalSupportedImageMIMETypes();
WEBCORE_EXPORT static HashSet<String, ASCIICaseInsensitiveHash>& supportedNonImageMIMETypes();
WEBCORE_EXPORT static const HashSet<String, ASCIICaseInsensitiveHash>& supportedMediaMIMETypes();
WEBCORE_EXPORT static const HashSet<String>& supportedMediaMIMETypes();
WEBCORE_EXPORT static FixedVector<ASCIILiteral> pdfMIMETypes();
WEBCORE_EXPORT static FixedVector<ASCIILiteral> unsupportedTextMIMETypes();
WEBCORE_EXPORT static FixedVector<ASCIILiteral> usdMIMETypes();
Expand Down
10 changes: 5 additions & 5 deletions Source/WebCore/platform/graphics/MIMETypeCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@

namespace WebCore {

HashSet<String, ASCIICaseInsensitiveHash>& MIMETypeCache::supportedTypes()
HashSet<String>& MIMETypeCache::supportedTypes()
{
if (!m_supportedTypes) {
m_supportedTypes = HashSet<String, ASCIICaseInsensitiveHash> { };
m_supportedTypes = HashSet<String> { };
initializeCache(*m_supportedTypes);
}

Expand Down Expand Up @@ -88,7 +88,7 @@ MediaPlayerEnums::SupportsType MIMETypeCache::canDecodeType(const String& mimeTy
} while (0);

if (!m_cachedResults)
m_cachedResults = HashMap<String, MediaPlayerEnums::SupportsType, ASCIICaseInsensitiveHash>();
m_cachedResults = HashMap<String, MediaPlayerEnums::SupportsType>();
m_cachedResults->add(mimeType, result);

return result;
Expand All @@ -97,7 +97,7 @@ MediaPlayerEnums::SupportsType MIMETypeCache::canDecodeType(const String& mimeTy
void MIMETypeCache::addSupportedTypes(const Vector<String>& newTypes)
{
if (!m_supportedTypes)
m_supportedTypes = HashSet<String, ASCIICaseInsensitiveHash> { };
m_supportedTypes = HashSet<String> { };

for (auto& type : newTypes)
m_supportedTypes->add(type);
Expand All @@ -123,7 +123,7 @@ bool MIMETypeCache::isEmpty() const
return m_supportedTypes && m_supportedTypes->isEmpty();
}

void MIMETypeCache::initializeCache(HashSet<String, ASCIICaseInsensitiveHash>&)
void MIMETypeCache::initializeCache(HashSet<String>&)
{
}

Expand Down
8 changes: 4 additions & 4 deletions Source/WebCore/platform/graphics/MIMETypeCache.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class WEBCORE_EXPORT MIMETypeCache {

virtual bool isAvailable() const;
virtual MediaPlayerEnums::SupportsType canDecodeType(const String&);
virtual HashSet<String, ASCIICaseInsensitiveHash>& supportedTypes();
virtual HashSet<String>& supportedTypes();

bool isEmpty() const;
bool supportsContainerType(const String&);
Expand All @@ -54,13 +54,13 @@ class WEBCORE_EXPORT MIMETypeCache {
private:
virtual bool isStaticContainerType(StringView);
virtual bool isUnsupportedContainerType(const String&);
virtual void initializeCache(HashSet<String, ASCIICaseInsensitiveHash>&);
virtual void initializeCache(HashSet<String>&);
virtual bool canDecodeExtendedType(const ContentType&);

bool shouldOverrideExtendedType(const ContentType&);

std::optional<HashSet<String, ASCIICaseInsensitiveHash>> m_supportedTypes;
std::optional<HashMap<String, MediaPlayerEnums::SupportsType, ASCIICaseInsensitiveHash>> m_cachedResults;
std::optional<HashSet<String>> m_supportedTypes;
std::optional<HashMap<String, MediaPlayerEnums::SupportsType>> m_cachedResults;
};

} // namespace WebCore
4 changes: 2 additions & 2 deletions Source/WebCore/platform/graphics/MediaPlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1185,10 +1185,10 @@ MediaPlayer::SupportsType MediaPlayer::supportsType(const MediaEngineSupportPara
return engine->supportsTypeAndCodecs(parameters);
}

void MediaPlayer::getSupportedTypes(HashSet<String, ASCIICaseInsensitiveHash>& types)
void MediaPlayer::getSupportedTypes(HashSet<String>& types)
{
for (auto& engine : installedMediaEngines()) {
HashSet<String, ASCIICaseInsensitiveHash> engineTypes;
HashSet<String> engineTypes;
engine->getSupportedTypes(engineTypes);
types.add(engineTypes.begin(), engineTypes.end());
}
Expand Down
4 changes: 2 additions & 2 deletions Source/WebCore/platform/graphics/MediaPlayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ class WEBCORE_EXPORT MediaPlayer : public MediaPlayerEnums, public ThreadSafeRef
using MediaPlayerEnums::SupportsType;
static const MediaPlayerFactory* mediaEngine(MediaPlayerEnums::MediaEngineIdentifier);
static SupportsType supportsType(const MediaEngineSupportParameters&);
static void getSupportedTypes(HashSet<String, ASCIICaseInsensitiveHash>&);
static void getSupportedTypes(HashSet<String>&);
static bool isAvailable();
static HashSet<SecurityOriginData> originsInMediaCache(const String& path);
static void clearMediaCache(const String& path, WallTime modifiedSince);
Expand Down Expand Up @@ -781,7 +781,7 @@ class MediaPlayerFactory {

virtual MediaPlayerEnums::MediaEngineIdentifier identifier() const = 0;
virtual std::unique_ptr<MediaPlayerPrivateInterface> createMediaEnginePlayer(MediaPlayer*) const = 0;
virtual void getSupportedTypes(HashSet<String, ASCIICaseInsensitiveHash>&) const = 0;
virtual void getSupportedTypes(HashSet<String>&) const = 0;
virtual MediaPlayer::SupportsType supportsTypeAndCodecs(const MediaEngineSupportParameters&) const = 0;

virtual HashSet<SecurityOriginData> originsInMediaCache(const String&) const { return { }; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1115,9 +1115,9 @@ WTFLogChannel& MediaPlayerPrivateAVFoundation::logChannel() const
}
#endif

const HashSet<String, ASCIICaseInsensitiveHash>& MediaPlayerPrivateAVFoundation::staticMIMETypeList()
const HashSet<String>& MediaPlayerPrivateAVFoundation::staticMIMETypeList()
{
static NeverDestroyed cache = HashSet<String, ASCIICaseInsensitiveHash> {
static NeverDestroyed cache = HashSet<String> {
"application/vnd.apple.mpegurl"_s,
"application/x-mpegurl"_s,
"audio/3gpp"_s,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ class MediaPlayerPrivateAVFoundation : public CanMakeWeakPtr<MediaPlayerPrivateA
virtual bool isHLS() const { return false; }

static bool isUnsupportedMIMEType(const String&);
static const HashSet<String, ASCIICaseInsensitiveHash>& staticMIMETypeList();
static const HashSet<String>& staticMIMETypeList();

void updateStates();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class WEBCORE_EXPORT AVAssetMIMETypeCache final : public MIMETypeCache {
bool isStaticContainerType(StringView) final;
bool isUnsupportedContainerType(const String&) final;
bool canDecodeExtendedType(const ContentType&) final;
void initializeCache(HashSet<String, ASCIICaseInsensitiveHash>&) final;
void initializeCache(HashSet<String>&) final;

CacheMIMETypesCallback m_cacheTypeCallback;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,9 @@ static bool isMultichannelOpusAvailable()
}
#endif

bool AVAssetMIMETypeCache::canDecodeExtendedType(const ContentType& type)
bool AVAssetMIMETypeCache::canDecodeExtendedType(const ContentType& typeParameter)
{
ContentType type = typeParameter;
#if ENABLE(VIDEO) && USE(AVFOUNDATION)
#if ENABLE(OPUS)
// Disclaim support for 'opus' if multi-channel decode is not available.
Expand All @@ -102,6 +103,12 @@ static bool isMultichannelOpusAvailable()
return false;
#endif

// Some platforms will disclaim support for 'flac', and only support the MP4RA registered `fLaC`
// codec string for flac, so convert the former to the latter before querying.
if ((type.containerType() == "video/mp4"_s || type.containerType() == "audio/mp4"_s)
&& type.codecs().contains("flac"_s))
type = ContentType(makeStringByReplacingAll(type.raw(), "flac"_s, "fLaC"_s));

ASSERT(isAvailable());

#if HAVE(AVURLASSET_ISPLAYABLEEXTENDEDMIMETYPEWITHOPTIONS)
Expand Down Expand Up @@ -188,7 +195,7 @@ static bool isMultichannelOpusAvailable()
m_cacheTypeCallback(types);
}

void AVAssetMIMETypeCache::initializeCache(HashSet<String, ASCIICaseInsensitiveHash>& cache)
void AVAssetMIMETypeCache::initializeCache(HashSet<String>& cache)
{
#if ENABLE(VIDEO) && USE(AVFOUNDATION)
if (!isAvailable())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@ class WEBCORE_EXPORT AVStreamDataParserMIMETypeCache final : public MIMETypeCach

bool isAvailable() const final;
MediaPlayerEnums::SupportsType canDecodeType(const String&) final;
HashSet<String, ASCIICaseInsensitiveHash>& supportedTypes() final;
HashSet<String>& supportedTypes() final;

private:
friend NeverDestroyed<AVStreamDataParserMIMETypeCache>;
AVStreamDataParserMIMETypeCache() = default;

bool canDecodeExtendedType(const ContentType&) final;
void initializeCache(HashSet<String, ASCIICaseInsensitiveHash>&) final;
void initializeCache(HashSet<String>&) final;
};

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ + (BOOL)canParseExtendedMIMEType:(NSString *)extendedMIMEType;
return MediaPlayerEnums::SupportsType::IsNotSupported;
}

HashSet<String, ASCIICaseInsensitiveHash>& AVStreamDataParserMIMETypeCache::supportedTypes()
HashSet<String>& AVStreamDataParserMIMETypeCache::supportedTypes()
{
if (isAvailable())
return MIMETypeCache::supportedTypes();
Expand Down Expand Up @@ -108,7 +108,7 @@ + (BOOL)canParseExtendedMIMEType:(NSString *)extendedMIMEType;
return false;
}

void AVStreamDataParserMIMETypeCache::initializeCache(HashSet<String, ASCIICaseInsensitiveHash>& cache)
void AVStreamDataParserMIMETypeCache::initializeCache(HashSet<String>& cache)
{
#if ENABLE(VIDEO) && USE(AVFOUNDATION)
if (!isAvailable())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ class MediaPlayerPrivateAVFoundationObjC final : public MediaPlayerPrivateAVFoun
// engine support
class Factory;
static bool isAvailable();
static void getSupportedTypes(HashSet<String, ASCIICaseInsensitiveHash>& types);
static void getSupportedTypes(HashSet<String>& types);
static MediaPlayer::SupportsType supportsTypeAndCodecs(const MediaEngineSupportParameters&);
static bool supportsKeySystem(const String& keySystem, const String& mimeType);
static HashSet<SecurityOriginData> originsInMediaCache(const String&);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ static void registerFormatReaderIfNecessary()
return makeUnique<MediaPlayerPrivateAVFoundationObjC>(player);
}

void getSupportedTypes(HashSet<String, ASCIICaseInsensitiveHash>& types) const final
void getSupportedTypes(HashSet<String>& types) const final
{
return MediaPlayerPrivateAVFoundationObjC::getSupportedTypes(types);
}
Expand Down Expand Up @@ -2043,7 +2043,7 @@ static URL conformFragmentIdentifierForURL(const URL& url)
return image;
}

void MediaPlayerPrivateAVFoundationObjC::getSupportedTypes(HashSet<String, ASCIICaseInsensitiveHash>& supportedTypes)
void MediaPlayerPrivateAVFoundationObjC::getSupportedTypes(HashSet<String>& supportedTypes)
{
supportedTypes = AVAssetMIMETypeCache::singleton().supportedTypes();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class MediaPlayerPrivateMediaSourceAVFObjC

// MediaPlayer Factory Methods
static bool isAvailable();
static void getSupportedTypes(HashSet<String, ASCIICaseInsensitiveHash>& types);
static void getSupportedTypes(HashSet<String>& types);
static MediaPlayer::SupportsType supportsTypeAndCodecs(const MediaEngineSupportParameters&);

ALLOW_NEW_API_WITHOUT_GUARDS_BEGIN
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ static void timebaseEffectiveRateChangedCallback(CFNotificationCenterRef, void*
return makeUnique<MediaPlayerPrivateMediaSourceAVFObjC>(player);
}

void getSupportedTypes(HashSet<String, ASCIICaseInsensitiveHash>& types) const final
void getSupportedTypes(HashSet<String>& types) const final
{
return MediaPlayerPrivateMediaSourceAVFObjC::getSupportedTypes(types);
}
Expand Down Expand Up @@ -263,7 +263,7 @@ void getSupportedTypes(HashSet<String, ASCIICaseInsensitiveHash>& types) const f
&& class_getInstanceMethod(PAL::getAVSampleBufferAudioRendererClass(), @selector(setMuted:));
}

void MediaPlayerPrivateMediaSourceAVFObjC::getSupportedTypes(HashSet<String, ASCIICaseInsensitiveHash>& types)
void MediaPlayerPrivateMediaSourceAVFObjC::getSupportedTypes(HashSet<String>& types)
{
types = AVStreamDataParserMIMETypeCache::singleton().supportedTypes();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class MediaPlayerPrivateMediaStreamAVFObjC final

// MediaPlayer Factory Methods
static bool isAvailable();
static void getSupportedTypes(HashSet<String, ASCIICaseInsensitiveHash>& types);
static void getSupportedTypes(HashSet<String>& types);
static MediaPlayer::SupportsType supportsType(const MediaEngineSupportParameters&);

MediaPlayer::NetworkState networkState() const override;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(N
return makeUnique<MediaPlayerPrivateMediaStreamAVFObjC>(player);
}

void getSupportedTypes(HashSet<String, ASCIICaseInsensitiveHash>& types) const final
void getSupportedTypes(HashSet<String>& types) const final
{
return MediaPlayerPrivateMediaStreamAVFObjC::getSupportedTypes(types);
}
Expand All @@ -222,7 +222,7 @@ void getSupportedTypes(HashSet<String, ASCIICaseInsensitiveHash>& types) const f
return PAL::isAVFoundationFrameworkAvailable() && PAL::isCoreMediaFrameworkAvailable() && PAL::getAVSampleBufferDisplayLayerClass();
}

void MediaPlayerPrivateMediaStreamAVFObjC::getSupportedTypes(HashSet<String, ASCIICaseInsensitiveHash>& types)
void MediaPlayerPrivateMediaStreamAVFObjC::getSupportedTypes(HashSet<String>& types)
{
// FIXME: Is it really correct to list no supported types?
types.clear();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ class MediaPlayerPrivateWebM

friend class MediaPlayerFactoryWebM;
static bool isAvailable();
static void getSupportedTypes(HashSet<String, ASCIICaseInsensitiveHash>&);
static void getSupportedTypes(HashSet<String>&);
static MediaPlayer::SupportsType supportsType(const MediaEngineSupportParameters&);

ThreadSafeWeakPtr<MediaPlayer> m_player;
Expand Down
Loading

0 comments on commit 73b6e9f

Please sign in to comment.