Index: chrome/renderer/media/chrome_key_systems.cc |
diff --git a/chrome/renderer/media/chrome_key_systems.cc b/chrome/renderer/media/chrome_key_systems.cc |
index 634e83dc06a168a361659e4d4a5d410fe4d524e4..8066299221d3e66579b5ac2ddc704b1c3e8eb900 100644 |
--- a/chrome/renderer/media/chrome_key_systems.cc |
+++ b/chrome/renderer/media/chrome_key_systems.cc |
@@ -5,6 +5,8 @@ |
#include "chrome/renderer/media/chrome_key_systems.h" |
#include "base/logging.h" |
+#include "chrome/common/render_messages.h" |
+#include "content/public/renderer/render_thread.h" |
#include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR. |
@@ -51,13 +53,6 @@ static void AddWidevineForCodecs( |
0xA3, 0xC8, 0x27, 0xDC, 0xD5, 0x1D, 0x21, 0xED }; |
#endif |
-#if defined(WIDEVINE_CDM_MIN_GLIBC_VERSION) |
- Version glibc_version(gnu_get_libc_version()); |
- DCHECK(glibc_version.IsValid()); |
- if (glibc_version.IsOlderThan(WIDEVINE_CDM_MIN_GLIBC_VERSION)) |
- return; |
-#endif // defined(WIDEVINE_CDM_MIN_GLIBC_VERSION) |
- |
KeySystemInfo info(kWidevineKeySystem); |
if (supported_codecs & WEBM_VP8_AND_VORBIS) { |
@@ -87,9 +82,30 @@ static void AddWidevineForCodecs( |
} |
#if defined(ENABLE_PEPPER_CDMS) |
+static bool IsPepperCdmAvailable(const std::string& pepper_type) { |
+ bool is_available = false; |
scherkus (not reviewing)
2013/09/11 22:34:41
do you want cache this value?
ddorwin
2013/09/16 17:17:58
It's not really necessary. This should only happen
scherkus (not reviewing)
2013/09/16 17:42:05
seems fine as is
|
+ content::RenderThread::Get()->Send( |
+ new ChromeViewHostMsg_IsSupportingPluginAvailable(pepper_type, |
+ &is_available)); |
+ |
+ return is_available; |
+} |
+ |
// Supported types are determined at compile time. |
static void AddPepperBasedWidevine( |
std::vector<KeySystemInfo>* concrete_key_systems) { |
+#if defined(WIDEVINE_CDM_MIN_GLIBC_VERSION) |
+ Version glibc_version(gnu_get_libc_version()); |
+ DCHECK(glibc_version.IsValid()); |
+ if (glibc_version.IsOlderThan(WIDEVINE_CDM_MIN_GLIBC_VERSION)) |
+ return; |
+#endif // defined(WIDEVINE_CDM_MIN_GLIBC_VERSION) |
+ |
+ if (!IsPepperCdmAvailable(kWidevineCdmPluginMimeType)) { |
+ DVLOG(1) << "Widevine CDM is not currently available."; |
+ return; |
+ } |
+ |
SupportedCodecs supported_codecs = WEBM_VP8_AND_VORBIS; |
#if defined(USE_PROPRIETARY_CODECS) |