Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(928)

Unified Diff: media/blink/key_system_config_selector.cc

Issue 1747073003: EME on Android: Improve accuracy of Key System availability. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: feedback Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« media/base/media.h ('K') | « media/base/mime_util_internal.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/blink/key_system_config_selector.cc
diff --git a/media/blink/key_system_config_selector.cc b/media/blink/key_system_config_selector.cc
index 766feda6aae3fdbc3952a5f5f4528f6beae65cd6..885049c83872d0e5f80ec16863f6b8a501777af0 100644
--- a/media/blink/key_system_config_selector.cc
+++ b/media/blink/key_system_config_selector.cc
@@ -277,20 +277,25 @@ KeySystemConfigSelector::KeySystemConfigSelector(
KeySystemConfigSelector::~KeySystemConfigSelector() {
}
-bool IsSupportedClearMediaFormat(const std::string& container_mime_type,
- const std::string& codecs) {
+bool IsSupportedMediaFormat(const std::string& container_mime_type,
+ const std::string& codecs,
+ bool use_aes_decryptor) {
std::vector<std::string> codec_vector;
- media::ParseCodecString(codecs, &codec_vector, false);
- media::SupportsType support_result =
- media::IsSupportedEncryptedMediaFormat(container_mime_type, codec_vector);
+ ParseCodecString(codecs, &codec_vector, false);
+ // AesDecryptor decrypts the stream in the demuxer before it reaches the
+ // decoder so check whether the media format is supported when clear.
+ SupportsType support_result =
+ use_aes_decryptor
+ ? IsSupportedMediaFormat(container_mime_type, codec_vector)
+ : IsSupportedEncryptedMediaFormat(container_mime_type, codec_vector);
switch (support_result) {
- case media::IsSupported:
+ case IsSupported:
return true;
- case media::MayBeSupported:
+ case MayBeSupported:
// If no codecs were specified, the best possible result is
// MayBeSupported, indicating support for the container.
return codec_vector.empty();
- case media::IsNotSupported:
+ case IsNotSupported:
return false;
}
NOTREACHED();
@@ -309,8 +314,10 @@ bool KeySystemConfigSelector::IsSupportedContentType(
// is done primarily to validate extended codecs, but it also ensures that the
// CDM cannot support codecs that Chrome does not (which could complicate the
// robustness algorithm).
- if (!IsSupportedClearMediaFormat(container_mime_type, codecs))
+ if (!IsSupportedMediaFormat(container_mime_type, codecs,
+ CanUseAesDecryptor(key_system))) {
return false;
+ }
// TODO(servolk): Converting |container_mime_type| to lower-case could be
// moved to KeySystemsImpl::GetContentTypeConfigRule, plus we could add some
@@ -321,7 +328,7 @@ bool KeySystemConfigSelector::IsSupportedContentType(
// This check does not handle extended codecs, so extended codec information
// is stripped (extended codec information was checked above).
std::vector<std::string> stripped_codec_vector;
- media::ParseCodecString(codecs, &stripped_codec_vector, true);
+ ParseCodecString(codecs, &stripped_codec_vector, true);
EmeConfigRule codecs_rule = key_systems_->GetContentTypeConfigRule(
key_system, media_type, container_lower, stripped_codec_vector);
if (!config_state->IsRuleSupported(codecs_rule))
« media/base/media.h ('K') | « media/base/mime_util_internal.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698