Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2623)

Unified Diff: content/renderer/media/crypto/key_systems.cc

Issue 253593002: Componentize EncryptedMediaMessageFilter and rename it CdmMessageFilter. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed jam's comments. Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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)
« content/public/renderer/key_system_info.h ('K') | « content/public/renderer/key_system_info.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698