Index: content/renderer/media/crypto/key_systems.cc |
diff --git a/content/renderer/media/crypto/key_systems.cc b/content/renderer/media/crypto/key_systems.cc |
index 724b829ca0a90514dc1f2314328f64d75c094ab4..51bc19329fbef87cbf27c9c489fb4bce5baafcac 100644 |
--- a/content/renderer/media/crypto/key_systems.cc |
+++ b/content/renderer/media/crypto/key_systems.cc |
@@ -14,9 +14,11 @@ |
#include "content/public/common/eme_codec.h" |
#include "content/public/renderer/content_renderer_client.h" |
#include "content/public/renderer/key_system_info.h" |
+#include "content/public/renderer/render_thread.h" |
#include "content/renderer/media/crypto/key_systems_support_uma.h" |
#if defined(OS_ANDROID) |
+#include "content/common/media/encrypted_media_messages_android.h" |
#include "media/base/android/media_codec_bridge.h" |
#endif |
@@ -74,6 +76,39 @@ static void AddClearKey(std::vector<KeySystemInfo>* concrete_key_systems) { |
concrete_key_systems->push_back(info); |
} |
+#if defined(OS_ANDROID) |
+static void AddAndroidWidevine( |
+ std::vector<KeySystemInfo>* concrete_key_systems) { |
+ static const char kKeySystemSuffixHrNonCompositing[] = ".hrnoncompositing"; |
Tom Sepez
2014/04/28 18:21:52
nit: kinda wish this constant wasn't buried so dee
|
+ SupportedKeySystemRequest request; |
+ SupportedKeySystemResponse response; |
+ |
+ request.key_system = kWidevineKeySystem; |
+ request.codecs = content::EME_CODEC_WEBM_ALL | content::EME_CODEC_MP4_ALL; |
+ content::RenderThread::Get()->Send( |
+ new ViewHostMsg_GetSupportedKeySystems(request, &response)); |
+ DCHECK(response.compositing_codecs & content::EME_CODEC_ALL) |
+ << "unrecognized codec"; |
+ DCHECK(response.non_compositing_codecs & content::EME_CODEC_ALL) |
+ << "unrecognized codec"; |
+ if (response.compositing_codecs != content::EME_CODEC_NONE) { |
+ concrete_key_systems->push_back(KeySystemInfo::Build( |
+ kWidevineKeySystem, |
+ true, // has_parent |
+ NULL, // suffix |
+ static_cast<SupportedCodecs>(response.compositing_codecs))); |
+ } |
+ |
+ if (response.non_compositing_codecs != content::EME_CODEC_NONE) { |
+ concrete_key_systems->push_back(KeySystemInfo::Build( |
+ kWidevineKeySystem, |
+ false, // has_parent |
+ kKeySystemSuffixHrNonCompositing, // suffix |
+ static_cast<SupportedCodecs>(response.non_compositing_codecs))); |
+ } |
+} |
+#endif |
+ |
class KeySystems { |
public: |
static KeySystems& GetInstance(); |
@@ -183,6 +218,9 @@ KeySystems::KeySystems() { |
// Clear Key is always supported. |
AddClearKey(&key_systems_info); |
AddConcreteSupportedKeySystems(key_systems_info); |
+#if defined(OS_ANDROID) |
+ AddAndroidWidevine(&key_systems_info); |
ddorwin
2014/04/28 18:47:45
Like desktop, this should be in chrome/, but on th
|
+#endif // defined(OS_ANDROID) |
#if defined(WIDEVINE_CDM_AVAILABLE) |
key_systems_support_uma_.AddKeySystemToReport(kWidevineKeySystem); |
#endif // defined(WIDEVINE_CDM_AVAILABLE) |