summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--content/browser/BUILD.gn2
-rw-r--r--content/browser/mojo/mojo_shell_context.cc4
-rw-r--r--content/renderer/BUILD.gn2
-rw-r--r--content/renderer/render_frame_impl.cc8
-rw-r--r--content/renderer/render_frame_impl.h4
-rw-r--r--content/utility/BUILD.gn5
-rw-r--r--content/utility/DEPS1
-rw-r--r--content/utility/utility_process_control_impl.cc11
-rw-r--r--media/media_options.gni8
-rw-r--r--media/mojo/services/BUILD.gn21
10 files changed, 48 insertions, 18 deletions
diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn
index 2930e92..474f562 100644
--- a/content/browser/BUILD.gn
+++ b/content/browser/BUILD.gn
@@ -477,7 +477,7 @@ source_set("browser") {
deps += [ "//third_party/boringssl" ]
}
- if (enable_media_mojo_renderer) {
+ if (enable_mojo_media == "browser") {
deps += [ "//media/mojo/services:application" ]
}
diff --git a/content/browser/mojo/mojo_shell_context.cc b/content/browser/mojo/mojo_shell_context.cc
index 38763d3..be3a143 100644
--- a/content/browser/mojo/mojo_shell_context.cc
+++ b/content/browser/mojo/mojo_shell_context.cc
@@ -24,7 +24,7 @@
#include "third_party/mojo/src/mojo/public/cpp/bindings/interface_request.h"
#include "third_party/mojo/src/mojo/public/cpp/bindings/string.h"
-#if defined(ENABLE_MEDIA_MOJO_RENDERER)
+#if defined(ENABLE_MOJO_MEDIA_IN_BROWSER_PROCESS)
#include "media/mojo/services/mojo_media_application.h"
#endif
@@ -142,7 +142,7 @@ MojoShellContext::MojoShellContext()
entry.first);
}
-#if defined(ENABLE_MEDIA_MOJO_RENDERER)
+#if (ENABLE_MOJO_MEDIA_IN_BROWSER_PROCESS)
application_manager_->SetLoaderForURL(
scoped_ptr<mojo::shell::ApplicationLoader>(
new mojo::shell::StaticApplicationLoader(
diff --git a/content/renderer/BUILD.gn b/content/renderer/BUILD.gn
index e187c3f..9c8e19e 100644
--- a/content/renderer/BUILD.gn
+++ b/content/renderer/BUILD.gn
@@ -193,7 +193,7 @@ source_set("renderer") {
]
}
- if (enable_media_mojo_renderer) {
+ if (enable_mojo_media != "none") {
deps += [ "//media/mojo/services:proxy" ]
}
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index 779ef5d..27f63ad 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -179,7 +179,7 @@
#include "content/renderer/media/crypto/renderer_cdm_manager.h"
#endif
-#if defined(ENABLE_MEDIA_MOJO_RENDERER)
+#if defined(ENABLE_MOJO_MEDIA)
#include "media/mojo/services/mojo_cdm_factory.h"
#include "media/mojo/services/mojo_renderer_factory.h"
#include "mojo/application/public/interfaces/shell.mojom.h"
@@ -1982,7 +1982,7 @@ blink::WebMediaPlayer* RenderFrameImpl::createMediaPlayer(
base::Bind(&GetSharedMainThreadContext3D), GetMediaPermission(),
initial_cdm);
-#if defined(ENABLE_MEDIA_MOJO_RENDERER)
+#if defined(ENABLE_MOJO_MEDIA)
scoped_ptr<media::RendererFactory> media_renderer_factory(
new media::MojoRendererFactory(GetMediaServiceProvider()));
#else
@@ -1995,7 +1995,7 @@ blink::WebMediaPlayer* RenderFrameImpl::createMediaPlayer(
media_log, render_thread->GetGpuFactories(),
*render_thread->GetAudioHardwareConfig()));
}
-#endif // defined(ENABLE_MEDIA_MOJO_RENDERER)
+#endif // defined(ENABLE_MOJO_MEDIA)
return new media::WebMediaPlayerImpl(
frame, client, weak_factory_.GetWeakPtr(), media_renderer_factory.Pass(),
@@ -4943,7 +4943,7 @@ media::MediaPermission* RenderFrameImpl::GetMediaPermission() {
return media_permission_dispatcher_;
}
-#if defined(ENABLE_MEDIA_MOJO_RENDERER)
+#if defined(ENABLE_MOJO_MEDIA)
mojo::ServiceProvider* RenderFrameImpl::GetMediaServiceProvider() {
if (!media_service_provider_) {
mojo::InterfacePtr<mojo::Shell> shell_ptr;
diff --git a/content/renderer/render_frame_impl.h b/content/renderer/render_frame_impl.h
index 853d547..0776f0c 100644
--- a/content/renderer/render_frame_impl.h
+++ b/content/renderer/render_frame_impl.h
@@ -805,7 +805,7 @@ class CONTENT_EXPORT RenderFrameImpl
media::MediaPermission* GetMediaPermission();
-#if defined(ENABLE_MEDIA_MOJO_RENDERER)
+#if defined(ENABLE_MOJO_MEDIA)
mojo::ServiceProvider* GetMediaServiceProvider();
// Called when a connection error happened on |media_service_provider_|.
@@ -919,7 +919,7 @@ class CONTENT_EXPORT RenderFrameImpl
// The media permission dispatcher attached to this frame, lazily initialized.
MediaPermissionDispatcher* media_permission_dispatcher_;
-#if defined(ENABLE_MEDIA_MOJO_RENDERER)
+#if defined(ENABLE_MOJO_MEDIA)
// The media service provider attached to this frame, lazily initialized.
mojo::ServiceProviderPtr media_service_provider_;
#endif
diff --git a/content/utility/BUILD.gn b/content/utility/BUILD.gn
index 93dae8f..4c7f49d 100644
--- a/content/utility/BUILD.gn
+++ b/content/utility/BUILD.gn
@@ -3,6 +3,7 @@
# found in the LICENSE file.
import("//content/utility/utility.gni")
+import("//media/media_options.gni")
source_set("utility") {
# Only the public target should depend on this. All other targets (even
@@ -29,4 +30,8 @@ source_set("utility") {
"//third_party/mojo/src/mojo/public/cpp/bindings",
"//url",
]
+
+ if (enable_mojo_media == "utility") {
+ deps += [ "//media/mojo/services:application" ]
+ }
}
diff --git a/content/utility/DEPS b/content/utility/DEPS
index 8b49f0f..b714ae1 100644
--- a/content/utility/DEPS
+++ b/content/utility/DEPS
@@ -2,6 +2,7 @@ include_rules = [
"+components/scheduler/child",
"+content/child",
"+content/public/utility",
+ "+media/mojo/services",
"+mojo/application",
"+mojo/shell",
"+sandbox/win/src",
diff --git a/content/utility/utility_process_control_impl.cc b/content/utility/utility_process_control_impl.cc
index 5d12a2e..7dbe13d 100644
--- a/content/utility/utility_process_control_impl.cc
+++ b/content/utility/utility_process_control_impl.cc
@@ -12,6 +12,10 @@
#include "mojo/shell/static_application_loader.h"
#include "url/gurl.h"
+#if defined(ENABLE_MOJO_MEDIA_IN_UTILITY_PROCESS)
+#include "media/mojo/services/mojo_media_application.h"
+#endif
+
namespace content {
namespace {
@@ -30,6 +34,13 @@ UtilityProcessControlImpl::UtilityProcessControlImpl() {
url_to_loader_map_[entry.first] = new mojo::shell::StaticApplicationLoader(
entry.second, base::Bind(&QuitProcess));
}
+
+#if defined(ENABLE_MOJO_MEDIA_IN_UTILITY_PROCESS)
+ url_to_loader_map_[media::MojoMediaApplication::AppUrl()] =
+ new mojo::shell::StaticApplicationLoader(
+ base::Bind(&media::MojoMediaApplication::CreateApp),
+ base::Bind(&QuitProcess));
+#endif
}
UtilityProcessControlImpl::~UtilityProcessControlImpl() {
diff --git a/media/media_options.gni b/media/media_options.gni
index 746b541..cd7440a 100644
--- a/media/media_options.gni
+++ b/media/media_options.gni
@@ -45,8 +45,12 @@ declare_args() {
# default since it's not available on the normal Web Platform and costs money.
enable_mpeg2ts_stream_parser = false
- # Experiment to enable mojo based media renderer: http://crbug.com/431776
- enable_media_mojo_renderer = false
+ # Experiment to enable mojo media application: http://crbug.com/431776
+ # Valid options are:
+ # - "none": Do not use mojo media application.
+ # - "browser": Use mojo media application hosted in the browser process.
+ # - "utility": Use mojo media application hosted in the utility process.
+ enable_mojo_media = "none"
# TODO(GYP): This should be a platform define.
is_openbsd = false
diff --git a/media/mojo/services/BUILD.gn b/media/mojo/services/BUILD.gn
index e698999..84ead6d 100644
--- a/media/mojo/services/BUILD.gn
+++ b/media/mojo/services/BUILD.gn
@@ -13,9 +13,18 @@ import("//mojo/public/mojo_application.gni")
# - unittests: Unit tests for a particular class/file.
# - test: Tests for a particular app, e.g. media.
-config("enable_media_mojo_renderer_config") {
- if (enable_media_mojo_renderer) {
- defines = [ "ENABLE_MEDIA_MOJO_RENDERER" ]
+config("enable_mojo_media_config") {
+ assert(enable_mojo_media == "none" || enable_mojo_media == "browser" ||
+ enable_mojo_media == "utility")
+
+ if (enable_mojo_media != "none") {
+ defines = [ "ENABLE_MOJO_MEDIA" ]
+ }
+
+ if (enable_mojo_media == "browser") {
+ defines += [ "ENABLE_MOJO_MEDIA_IN_BROWSER_PROCESS" ]
+ } else if (enable_mojo_media == "utility") {
+ defines += [ "ENABLE_MOJO_MEDIA_IN_UTILITY_PROCESS" ]
}
}
@@ -53,7 +62,7 @@ source_set("proxy") {
"mojo_type_trait.h",
]
- public_configs = [ ":enable_media_mojo_renderer_config" ]
+ public_configs = [ ":enable_mojo_media_config" ]
deps = [
":converters",
@@ -121,7 +130,7 @@ source_set("renderer_service") {
"renderer_config_default.cc",
]
- public_configs = [ ":enable_media_mojo_renderer_config" ]
+ public_configs = [ ":enable_mojo_media_config" ]
deps = [
":renderer_service_generic",
@@ -137,7 +146,7 @@ source_set("application") {
"mojo_media_application.h",
]
- public_configs = [ ":enable_media_mojo_renderer_config" ]
+ public_configs = [ ":enable_mojo_media_config" ]
deps = [
":cdm_service",