Skip to content

Commit 77dd123

Browse files
committed
[EME] Check support for full content type (including codecs)
https://bugs.webkit.org/show_bug.cgi?id=310709 Reviewed by NOBODY (OOPS!). When evaluating media capabilities for requestMediaKeySystemAccess, we use pass ParsedContentType's m_mimeType to the MediaSource, which omits parameters of the MIME type like codecs. The right field to use here is m_contentType, so MediaSource can check support against the full MIME type, rather than just its container type. * Source/WebCore/platform/encryptedmedia/CDMPrivate.cpp: (WebCore::CDMPrivate::getSupportedCapabilitiesForAudioVideoType): * Source/WebCore/platform/network/ParsedContentType.h: (WebCore::ParsedContentType::contentType const): Added, returns m_contentType. Original author: Andrzej Surdej <Andrzej_Surdej@comcast.com> See: WebPlatformForEmbedded/WPEWebKit#1643
1 parent 7e2a2b0 commit 77dd123

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

Source/WebCore/platform/encryptedmedia/CDMPrivate.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ std::optional<Vector<CDMMediaCapability>> CDMPrivate::getSupportedCapabilitiesFo
422422
// 3.13. If the user agent and implementation definitely support playback of encrypted media data for the
423423
// combination of container, media types, robustness and local accumulated configuration in combination
424424
// with restrictions:
425-
MediaEngineSupportParameters parameters { .type = ContentType(contentType->mimeType()) };
425+
MediaEngineSupportParameters parameters { .type = ContentType(contentType->contentType()) };
426426
if (MediaPlayer::supportsType(parameters) == MediaPlayer::SupportsType::IsNotSupported) {
427427
// Try with Media Source:
428428
parameters.platformType = PlatformMediaDecodingType::MediaSource;

Source/WebCore/platform/network/ParsedContentType.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ class ParsedContentType {
4444
ParsedContentType(ParsedContentType&&) = default;
4545

4646
String mimeType() const { return m_mimeType; }
47+
String contentType() const { return m_contentType; }
4748
String charset() const;
4849
void setCharset(String&&);
4950

0 commit comments

Comments
 (0)