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

Unified Diff: content/renderer/media/webcontentdecryptionmodule_impl.cc

Issue 193523002: Encrypted Media: Implement IPC based SetCdm(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comments addressed Created 6 years, 9 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/webcontentdecryptionmodule_impl.cc
diff --git a/content/renderer/media/webcontentdecryptionmodule_impl.cc b/content/renderer/media/webcontentdecryptionmodule_impl.cc
index 7b2131b6354349ea5dfa8ec1a2a012d3e0f05bb0..f48522773d1814504cfe4060164aa7c8b5f55b09 100644
--- a/content/renderer/media/webcontentdecryptionmodule_impl.cc
+++ b/content/renderer/media/webcontentdecryptionmodule_impl.cc
@@ -17,6 +17,8 @@
#if defined(ENABLE_PEPPER_CDMS)
#include "content/renderer/media/crypto/pepper_cdm_wrapper_impl.h"
+#elif defined(OS_ANDROID)
+#include "content/renderer/media/android/renderer_media_player_manager.h"
#endif
namespace content {
@@ -31,25 +33,36 @@ WebContentDecryptionModuleImpl* WebContentDecryptionModuleImpl::Create(
}
scoped_refptr<CdmSessionAdapter> adapter(new CdmSessionAdapter());
- if (!adapter->Initialize(
+
+#if defined(OS_ANDROID)
+ int cdm_id = RendererMediaPlayerManager::kInvalidCdmId;
+ if (adapter->Initialize(&cdm_id, UTF16ToASCII(key_system)))
+ return new WebContentDecryptionModuleImpl(adapter, cdm_id);
+#else // defined(OS_ANDROID)
+ if (adapter->Initialize(
#if defined(ENABLE_PEPPER_CDMS)
// TODO(jrummell): Figure out how to get a WebFrame from Blink (or
// something equivalent) so the plugin can actually get created.
// http://crbug.com/250049
base::Bind(&PepperCdmWrapperImpl::Create,
static_cast<blink::WebFrame*>(NULL)),
-#endif
+#endif // defined(ENABLE_PEPPER_CDMS)
UTF16ToASCII(key_system))) {
- return NULL;
+ return new WebContentDecryptionModuleImpl(adapter);
}
-
- return new WebContentDecryptionModuleImpl(adapter);
+#endif // defined(OS_ANDROID)
+ return NULL;
}
+#if defined(OS_ANDROID)
+WebContentDecryptionModuleImpl::WebContentDecryptionModuleImpl(
+ scoped_refptr<CdmSessionAdapter> adapter, int cdm_id)
+ : adapter_(adapter), cdm_id_(cdm_id) {}
+#else
WebContentDecryptionModuleImpl::WebContentDecryptionModuleImpl(
scoped_refptr<CdmSessionAdapter> adapter)
- : adapter_(adapter) {
-}
+ : adapter_(adapter) {}
+#endif
xhwang 2014/03/12 01:20:11 This code (l.37-65) is really messy with #ifdefs.
ddorwin 2014/03/18 22:51:08 How much smaller is the diff if we track this in t
xhwang 2014/03/25 21:49:50 ifdef'ed individual parameters where possible.
WebContentDecryptionModuleImpl::~WebContentDecryptionModuleImpl() {
}
@@ -65,4 +78,10 @@ media::Decryptor* WebContentDecryptionModuleImpl::GetDecryptor() {
return adapter_->GetDecryptor();
}
+#if defined(OS_ANDROID)
+int WebContentDecryptionModuleImpl::GetCdmId() {
+ return cdm_id_;
+}
+#endif // defined(OS_ANDROID)
+
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698