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

Unified Diff: components/html_viewer/html_document.cc

Issue 840473002: media: Support creation and SetCdm() for mojo based CDM. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase only; compiles but needs more polish... Created 5 years, 7 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
« no previous file with comments | « no previous file | components/html_viewer/setup.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/html_viewer/html_document.cc
diff --git a/components/html_viewer/html_document.cc b/components/html_viewer/html_document.cc
index bb7163763313ae216db3b56b7cddf7e395c96cf5..d2345339353725a1d89ad007c88bcd5ad73931b2 100644
--- a/components/html_viewer/html_document.cc
+++ b/components/html_viewer/html_document.cc
@@ -24,6 +24,8 @@
#include "media/blink/webencryptedmediaclient_impl.h"
#include "media/cdm/default_cdm_factory.h"
#include "media/filters/default_media_permission.h"
+#include "media/mojo/interfaces/content_decryption_module_factory.mojom.h"
+#include "media/mojo/services/mojo_cdm_factory.h"
#include "mojo/application/public/cpp/application_impl.h"
#include "mojo/application/public/cpp/connect.h"
#include "mojo/application/public/interfaces/shell.mojom.h"
@@ -392,8 +394,21 @@ media::MediaPermission* HTMLDocument::GetMediaPermission() {
}
media::CdmFactory* HTMLDocument::GetCdmFactory() {
- if (!cdm_factory_)
- cdm_factory_.reset(new media::DefaultCdmFactory());
+ if (!cdm_factory_) {
+ if (setup_->enable_mojo_media_renderer()) {
+ ServiceProviderPtr media_service_provider;
+ mojo::URLRequestPtr request(mojo::URLRequest::New());
+ request->url = mojo::String::From("mojo:media");
+ shell_->ConnectToApplication(request.Pass(),
+ GetProxy(&media_service_provider), nullptr);
+ mojo::ContentDecryptionModuleFactoryPtr cdm_factory_ptr;
+ mojo::ConnectToService(media_service_provider.get(), &cdm_factory_ptr);
+ cdm_factory_.reset(new media::MojoCdmFactory(cdm_factory_ptr.Pass()));
+ } else {
+ cdm_factory_.reset(new media::DefaultCdmFactory());
+ }
+ }
+
return cdm_factory_.get();
}
« no previous file with comments | « no previous file | components/html_viewer/setup.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698