Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/renderer/media/chrome_key_systems.h" | 5 #include "chrome/renderer/media/chrome_key_systems.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 149 &additional_param_values)) { | 149 &additional_param_values)) { |
| 150 DVLOG(1) << "Widevine CDM is not currently available."; | 150 DVLOG(1) << "Widevine CDM is not currently available."; |
| 151 return; | 151 return; |
| 152 } | 152 } |
| 153 | 153 |
| 154 std::vector<std::string> codecs; | 154 std::vector<std::string> codecs; |
| 155 GetSupportedCodecsForPepperCdm(additional_param_names, | 155 GetSupportedCodecsForPepperCdm(additional_param_names, |
| 156 additional_param_values, | 156 additional_param_values, |
| 157 &codecs); | 157 &codecs); |
| 158 | 158 |
| 159 SupportedCodecs supported_codecs = media::EME_CODEC_NONE; | 159 SupportedCodecs supported_codecs = media::EME_CODEC_NONE; |
|
jrummell
2014/11/25 21:37:12
nit: Should this be = EME_CODEC_WEBM_AUDIO_ALL, an
sandersd (OOO until July 31)
2014/11/25 21:46:40
No, a specific goal is to remove _ALL from use eve
| |
| 160 | |
| 161 // Audio codecs are always supported. | |
| 162 // TODO(sandersd): Distinguish these from those that are directly supported, | |
| 163 // as those may offer a higher level of protection. | |
| 164 supported_codecs |= media::EME_CODEC_WEBM_OPUS; | |
| 165 supported_codecs |= media::EME_CODEC_WEBM_VORBIS; | |
| 166 #if defined(USE_PROPRIETARY_CODECS) | |
| 167 supported_codecs |= media::EME_CODEC_MP4_AAC; | |
| 168 #endif // defined(USE_PROPRIETARY_CODECS) | |
| 169 | |
| 160 for (size_t i = 0; i < codecs.size(); ++i) { | 170 for (size_t i = 0; i < codecs.size(); ++i) { |
| 161 if (codecs[i] == kCdmSupportedCodecVorbis) | |
| 162 supported_codecs |= media::EME_CODEC_WEBM_VORBIS; | |
| 163 if (codecs[i] == kCdmSupportedCodecVp8) | 171 if (codecs[i] == kCdmSupportedCodecVp8) |
| 164 supported_codecs |= media::EME_CODEC_WEBM_VP8; | 172 supported_codecs |= media::EME_CODEC_WEBM_VP8; |
| 165 if (codecs[i] == kCdmSupportedCodecVp9) | 173 if (codecs[i] == kCdmSupportedCodecVp9) |
| 166 supported_codecs |= media::EME_CODEC_WEBM_VP9; | 174 supported_codecs |= media::EME_CODEC_WEBM_VP9; |
| 167 #if defined(USE_PROPRIETARY_CODECS) | 175 #if defined(USE_PROPRIETARY_CODECS) |
| 168 if (codecs[i] == kCdmSupportedCodecAac) | |
| 169 supported_codecs |= media::EME_CODEC_MP4_AAC; | |
| 170 if (codecs[i] == kCdmSupportedCodecAvc1) | 176 if (codecs[i] == kCdmSupportedCodecAvc1) |
| 171 supported_codecs |= media::EME_CODEC_MP4_AVC1; | 177 supported_codecs |= media::EME_CODEC_MP4_AVC1; |
| 172 #endif // defined(USE_PROPRIETARY_CODECS) | 178 #endif // defined(USE_PROPRIETARY_CODECS) |
| 173 } | 179 } |
| 174 | 180 |
| 175 cdm::AddWidevineWithCodecs(cdm::WIDEVINE, | 181 cdm::AddWidevineWithCodecs(cdm::WIDEVINE, |
| 176 supported_codecs, | 182 supported_codecs, |
| 177 concrete_key_systems); | 183 concrete_key_systems); |
| 178 } | 184 } |
| 179 #endif // defined(WIDEVINE_CDM_AVAILABLE) | 185 #endif // defined(WIDEVINE_CDM_AVAILABLE) |
| 180 #endif // defined(ENABLE_PEPPER_CDMS) | 186 #endif // defined(ENABLE_PEPPER_CDMS) |
| 181 | 187 |
| 182 void AddChromeKeySystems(std::vector<KeySystemInfo>* key_systems_info) { | 188 void AddChromeKeySystems(std::vector<KeySystemInfo>* key_systems_info) { |
| 183 #if defined(ENABLE_PEPPER_CDMS) | 189 #if defined(ENABLE_PEPPER_CDMS) |
| 184 AddExternalClearKey(key_systems_info); | 190 AddExternalClearKey(key_systems_info); |
| 185 | 191 |
| 186 #if defined(WIDEVINE_CDM_AVAILABLE) | 192 #if defined(WIDEVINE_CDM_AVAILABLE) |
| 187 AddPepperBasedWidevine(key_systems_info); | 193 AddPepperBasedWidevine(key_systems_info); |
| 188 #endif // defined(WIDEVINE_CDM_AVAILABLE) | 194 #endif // defined(WIDEVINE_CDM_AVAILABLE) |
| 189 #endif // defined(ENABLE_PEPPER_CDMS) | 195 #endif // defined(ENABLE_PEPPER_CDMS) |
| 190 | 196 |
| 191 #if defined(OS_ANDROID) | 197 #if defined(OS_ANDROID) |
| 192 cdm::AddAndroidWidevine(key_systems_info); | 198 cdm::AddAndroidWidevine(key_systems_info); |
| 193 #endif // defined(OS_ANDROID) | 199 #endif // defined(OS_ANDROID) |
| 194 } | 200 } |
| OLD | NEW |