Chromium Code Reviews| 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 |