diff options
Diffstat (limited to 'webkit/glue')
-rw-r--r-- | webkit/glue/simple_webmimeregistry_impl.cc | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/webkit/glue/simple_webmimeregistry_impl.cc b/webkit/glue/simple_webmimeregistry_impl.cc index f12f48b..5dd227f 100644 --- a/webkit/glue/simple_webmimeregistry_impl.cc +++ b/webkit/glue/simple_webmimeregistry_impl.cc @@ -54,9 +54,28 @@ WebMimeRegistry::SupportsType SimpleWebMimeRegistryImpl::supportsMediaMIMEType( if (!net::IsSupportedMediaMimeType(ToASCIIOrEmpty(mime_type).c_str())) return IsNotSupported; + // Check list of strict codecs to see if it is supported. + if (net::IsStrictMediaMimeType(ToASCIIOrEmpty(mime_type).c_str())) { + // We support the container, but no codecs were specified. + if (codecs.isNull()) + return MayBeSupported; + + // Check if the codecs are a perfect match. + std::vector<std::string> strict_codecs; + net::ParseCodecString(ToASCIIOrEmpty(codecs).c_str(), + &strict_codecs, + false); + if (!net::IsSupportedStrictMediaMimeType(ToASCIIOrEmpty(mime_type).c_str(), + strict_codecs)) + return IsNotSupported; + + // Good to go! + return IsSupported; + } + // If we don't recognize the codec, it's possible we support it. std::vector<std::string> parsed_codecs; - net::ParseCodecString(ToASCIIOrEmpty(codecs).c_str(), &parsed_codecs); + net::ParseCodecString(ToASCIIOrEmpty(codecs).c_str(), &parsed_codecs, true); if (!net::AreSupportedMediaCodecs(parsed_codecs)) return MayBeSupported; |