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

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: 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/android/media_drm_bridge.cc ('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..59fa3dabb2cb7ced55148ae471811cec4173141d 100644
--- a/media/blink/key_system_config_selector.cc
+++ b/media/blink/key_system_config_selector.cc
@@ -277,12 +277,18 @@ 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);
+ // AesDecryptor decrypts the stream in the demuxer before it reaches the
+ // decoder so check whether the media format is supported when clear.
media::SupportsType support_result =
- media::IsSupportedEncryptedMediaFormat(container_mime_type, codec_vector);
+ use_aes_decryptor
+ ? media::IsSupportedMediaFormat(container_mime_type, codec_vector)
+ : media::IsSupportedEncryptedMediaFormat(container_mime_type,
+ codec_vector);
xhwang 2016/03/02 06:57:08 drop media:: here and everywhere else since we are
ddorwin 2016/03/02 21:11:53 Done.
switch (support_result) {
case media::IsSupported:
return true;
@@ -309,8 +315,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
« media/base/android/media_drm_bridge.cc ('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