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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/logging.h" | 12 #include "base/logging.h" |
13 #include "base/strings/string16.h" | 13 #include "base/strings/string16.h" |
14 #include "base/strings/string_split.h" | 14 #include "base/strings/string_split.h" |
15 #include "base/strings/utf_string_conversions.h" | 15 #include "base/strings/utf_string_conversions.h" |
16 #include "build/build_config.h" | 16 #include "build/build_config.h" |
17 #include "chrome/common/render_messages.h" | 17 #include "chrome/common/render_messages.h" |
18 #include "components/cdm/renderer/external_clear_key_key_system_properties.h" | 18 #include "components/cdm/renderer/external_clear_key_key_system_properties.h" |
19 #include "components/cdm/renderer/widevine_key_system_properties.h" | 19 #include "components/cdm/renderer/widevine_key_system_properties.h" |
20 #include "content/public/renderer/render_thread.h" | 20 #include "content/public/renderer/render_thread.h" |
21 #include "media/base/eme_constants.h" | 21 #include "media/base/eme_constants.h" |
22 #include "media/base/key_system_properties.h" | 22 #include "media/base/key_system_properties.h" |
| 23 #include "ppapi/features/features.h" |
23 | 24 |
24 #if defined(OS_ANDROID) | 25 #if defined(OS_ANDROID) |
25 #include "components/cdm/renderer/android_key_systems.h" | 26 #include "components/cdm/renderer/android_key_systems.h" |
26 #endif | 27 #endif |
27 | 28 |
28 #if defined(ENABLE_PEPPER_CDMS) | 29 #if BUILDFLAG(ENABLE_PEPPER_CDMS) |
29 #include "base/feature_list.h" | 30 #include "base/feature_list.h" |
30 #include "media/base/media_switches.h" | 31 #include "media/base/media_switches.h" |
31 #endif | 32 #endif |
32 | 33 |
33 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR. | 34 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR. |
34 | 35 |
35 // The following must be after widevine_cdm_version.h. | 36 // The following must be after widevine_cdm_version.h. |
36 | 37 |
37 #if defined(WIDEVINE_CDM_AVAILABLE) && defined(WIDEVINE_CDM_MIN_GLIBC_VERSION) | 38 #if defined(WIDEVINE_CDM_AVAILABLE) && defined(WIDEVINE_CDM_MIN_GLIBC_VERSION) |
38 #include <gnu/libc-version.h> | 39 #include <gnu/libc-version.h> |
39 #include "base/version.h" | 40 #include "base/version.h" |
40 #endif | 41 #endif |
41 | 42 |
42 using media::KeySystemProperties; | 43 using media::KeySystemProperties; |
43 using media::SupportedCodecs; | 44 using media::SupportedCodecs; |
44 | 45 |
45 #if defined(ENABLE_PEPPER_CDMS) | 46 #if BUILDFLAG(ENABLE_PEPPER_CDMS) |
46 static bool IsPepperCdmAvailable( | 47 static bool IsPepperCdmAvailable( |
47 const std::string& pepper_type, | 48 const std::string& pepper_type, |
48 std::vector<base::string16>* additional_param_names, | 49 std::vector<base::string16>* additional_param_names, |
49 std::vector<base::string16>* additional_param_values) { | 50 std::vector<base::string16>* additional_param_values) { |
50 bool is_available = false; | 51 bool is_available = false; |
51 content::RenderThread::Get()->Send( | 52 content::RenderThread::Get()->Send( |
52 new ChromeViewHostMsg_IsInternalPluginAvailableForMimeType( | 53 new ChromeViewHostMsg_IsInternalPluginAvailableForMimeType( |
53 pepper_type, | 54 pepper_type, |
54 &is_available, | 55 &is_available, |
55 additional_param_names, | 56 additional_param_names, |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 Robustness::SW_SECURE_CRYPTO, // Maximum audio robustness. | 207 Robustness::SW_SECURE_CRYPTO, // Maximum audio robustness. |
207 Robustness::SW_SECURE_DECODE, // Maximum video robustness. | 208 Robustness::SW_SECURE_DECODE, // Maximum video robustness. |
208 media::EmeSessionTypeSupport::NOT_SUPPORTED, // persistent-license. | 209 media::EmeSessionTypeSupport::NOT_SUPPORTED, // persistent-license. |
209 media::EmeSessionTypeSupport:: | 210 media::EmeSessionTypeSupport:: |
210 NOT_SUPPORTED, // persistent-release-message. | 211 NOT_SUPPORTED, // persistent-release-message. |
211 media::EmeFeatureSupport::REQUESTABLE, // Persistent state. | 212 media::EmeFeatureSupport::REQUESTABLE, // Persistent state. |
212 media::EmeFeatureSupport::NOT_SUPPORTED)); // Distinctive identifier. | 213 media::EmeFeatureSupport::NOT_SUPPORTED)); // Distinctive identifier. |
213 #endif // defined(OS_CHROMEOS) | 214 #endif // defined(OS_CHROMEOS) |
214 } | 215 } |
215 #endif // defined(WIDEVINE_CDM_AVAILABLE) | 216 #endif // defined(WIDEVINE_CDM_AVAILABLE) |
216 #endif // defined(ENABLE_PEPPER_CDMS) | 217 #endif // BUILDFLAG(ENABLE_PEPPER_CDMS) |
217 | 218 |
218 void AddChromeKeySystems( | 219 void AddChromeKeySystems( |
219 std::vector<std::unique_ptr<KeySystemProperties>>* key_systems_properties) { | 220 std::vector<std::unique_ptr<KeySystemProperties>>* key_systems_properties) { |
220 #if defined(ENABLE_PEPPER_CDMS) | 221 #if BUILDFLAG(ENABLE_PEPPER_CDMS) |
221 if (base::FeatureList::IsEnabled(media::kExternalClearKeyForTesting)) | 222 if (base::FeatureList::IsEnabled(media::kExternalClearKeyForTesting)) |
222 AddExternalClearKey(key_systems_properties); | 223 AddExternalClearKey(key_systems_properties); |
223 | 224 |
224 #if defined(WIDEVINE_CDM_AVAILABLE) | 225 #if defined(WIDEVINE_CDM_AVAILABLE) |
225 AddPepperBasedWidevine(key_systems_properties); | 226 AddPepperBasedWidevine(key_systems_properties); |
226 #endif // defined(WIDEVINE_CDM_AVAILABLE) | 227 #endif // defined(WIDEVINE_CDM_AVAILABLE) |
227 | 228 |
228 #endif // defined(ENABLE_PEPPER_CDMS) | 229 #endif // BUILDFLAG(ENABLE_PEPPER_CDMS) |
229 | 230 |
230 #if defined(OS_ANDROID) | 231 #if defined(OS_ANDROID) |
231 cdm::AddAndroidWidevine(key_systems_properties); | 232 cdm::AddAndroidWidevine(key_systems_properties); |
232 #endif // defined(OS_ANDROID) | 233 #endif // defined(OS_ANDROID) |
233 } | 234 } |
OLD | NEW |