diff options
author | alokp <alokp@chromium.org> | 2016-02-03 14:55:54 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-02-03 22:57:06 +0000 |
commit | aa2fdfb700402dc9ad4016519b967b3ca86210f1 (patch) | |
tree | 68e794ef0b8aa51d0f01b681217d515600ee0fe1 /chromecast | |
parent | ccbf2c957e8f11cb640b653459e252c584a11901 (diff) | |
download | chromium_src-aa2fdfb700402dc9ad4016519b967b3ca86210f1.zip chromium_src-aa2fdfb700402dc9ad4016519b967b3ca86210f1.tar.gz chromium_src-aa2fdfb700402dc9ad4016519b967b3ca86210f1.tar.bz2 |
[Chromecast] Hook up mojo media pipeline.
The pipeline backend is no-op as of this patch.
BUG=571155
Review URL: https://codereview.chromium.org/1649933002
Cr-Commit-Position: refs/heads/master@{#373374}
Diffstat (limited to 'chromecast')
-rw-r--r-- | chromecast/browser/BUILD.gn | 9 | ||||
-rw-r--r-- | chromecast/browser/DEPS | 1 | ||||
-rw-r--r-- | chromecast/browser/cast_content_browser_client.cc | 16 | ||||
-rw-r--r-- | chromecast/browser/cast_content_browser_client.h | 4 | ||||
-rw-r--r-- | chromecast/media/BUILD.gn | 5 | ||||
-rw-r--r-- | chromecast/media/DEPS | 1 | ||||
-rw-r--r-- | chromecast/media/mojo/BUILD.gn | 18 | ||||
-rw-r--r-- | chromecast/media/mojo/cast_mojo_media_client.cc | 32 |
8 files changed, 70 insertions, 16 deletions
diff --git a/chromecast/browser/BUILD.gn b/chromecast/browser/BUILD.gn index 597033e..6b9c34d 100644 --- a/chromecast/browser/BUILD.gn +++ b/chromecast/browser/BUILD.gn @@ -3,7 +3,6 @@ # found in the LICENSE file. import("//chromecast/chromecast.gni") -import("//media/media_options.gni") import("//testing/test.gni") import("//build/config/ui.gni") @@ -132,14 +131,6 @@ source_set("browser") { ] } - if (enable_mojo_media != "none") { - configs += [ "//media/mojo/services:enable_mojo_media_config" ] - } - - if (enable_mojo_media == "utility") { - deps += [ "//media/mojo/services:application" ] - } - if (use_ozone) { deps += [ "//ui/ozone" ] } diff --git a/chromecast/browser/DEPS b/chromecast/browser/DEPS index c983df0..d0c1e78 100644 --- a/chromecast/browser/DEPS +++ b/chromecast/browser/DEPS @@ -15,5 +15,6 @@ include_rules = [ "+gpu/command_buffer/service/gpu_switches.h", "+media/audio", "+media/base", + "+media/mojo", "+ui/ozone/platform/cast/overlay_manager_cast.h", ] diff --git a/chromecast/browser/cast_content_browser_client.cc b/chromecast/browser/cast_content_browser_client.cc index b490317..aea55a6 100644 --- a/chromecast/browser/cast_content_browser_client.cc +++ b/chromecast/browser/cast_content_browser_client.cc @@ -51,6 +51,11 @@ #include "net/url_request/url_request_context_getter.h" #include "ui/gl/gl_switches.h" +#if defined(ENABLE_MOJO_MEDIA_IN_BROWSER_PROCESS) +// nogncheck because of conditional dependency. +#include "media/mojo/services/mojo_media_application.h" // nogncheck +#endif // ENABLE_MOJO_MEDIA_IN_BROWSER_PROCESS + #if defined(OS_ANDROID) #include "components/crash/content/browser/crash_dump_manager_android.h" #include "components/external_video_surface/browser/android/external_video_surface_container_impl.h" @@ -349,11 +354,12 @@ bool CastContentBrowserClient::CanCreateWindow( return false; } -void CastContentBrowserClient::RegisterUnsandboxedOutOfProcessMojoApplications( - std::map<GURL, base::string16>* apps) { -#if defined(ENABLE_MOJO_MEDIA_IN_UTILITY_PROCESS) - apps->insert(std::make_pair(GURL("mojo:media"), - base::ASCIIToUTF16("Media App"))); +void CastContentBrowserClient::RegisterInProcessMojoApplications( + StaticMojoApplicationMap* apps) { +#if defined(ENABLE_MOJO_MEDIA_IN_BROWSER_PROCESS) + apps->insert( + std::make_pair(GURL("mojo:media"), + base::Bind(::media::MojoMediaApplication::CreateApp))); #endif } diff --git a/chromecast/browser/cast_content_browser_client.h b/chromecast/browser/cast_content_browser_client.h index 815f20e..967edcd 100644 --- a/chromecast/browser/cast_content_browser_client.h +++ b/chromecast/browser/cast_content_browser_client.h @@ -137,8 +137,8 @@ class CastContentBrowserClient : public content::ContentBrowserClient { int opener_render_view_id, int opener_render_frame_id, bool* no_javascript_access) override; - void RegisterUnsandboxedOutOfProcessMojoApplications( - std::map<GURL, base::string16>* apps) override; + void RegisterInProcessMojoApplications( + StaticMojoApplicationMap* apps) override; #if defined(OS_ANDROID) void GetAdditionalMappedFilesForChildProcess( const base::CommandLine& command_line, diff --git a/chromecast/media/BUILD.gn b/chromecast/media/BUILD.gn index 832ea64..d576394 100644 --- a/chromecast/media/BUILD.gn +++ b/chromecast/media/BUILD.gn @@ -3,6 +3,7 @@ # found in the LICENSE file. import("//chromecast/chromecast.gni") +import("//media/media_options.gni") import("//testing/test.gni") group("media") { @@ -12,6 +13,10 @@ group("media") { "//chromecast/media/cdm", "//chromecast/media/cma", ] + + if (enable_mojo_media == "browser") { + public_deps += [ "//chromecast/media/mojo" ] + } } test("cast_media_unittests") { diff --git a/chromecast/media/DEPS b/chromecast/media/DEPS index 48932c6..b3eb387 100644 --- a/chromecast/media/DEPS +++ b/chromecast/media/DEPS @@ -3,5 +3,6 @@ include_rules = [ "+media/audio", "+media/base", "+media/cdm", + "+media/mojo", "+media/renderers", ] diff --git a/chromecast/media/mojo/BUILD.gn b/chromecast/media/mojo/BUILD.gn new file mode 100644 index 0000000..f197973 --- /dev/null +++ b/chromecast/media/mojo/BUILD.gn @@ -0,0 +1,18 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//media/media_options.gni") + +# We support mojo media service hosted in the browser process only. +assert(enable_mojo_media == "browser") + +source_set("mojo") { + sources = [ + "cast_mojo_media_client.cc", + ] + + public_deps = [ + "//media/mojo/services:application", + ] +} diff --git a/chromecast/media/mojo/cast_mojo_media_client.cc b/chromecast/media/mojo/cast_mojo_media_client.cc new file mode 100644 index 0000000..e239269 --- /dev/null +++ b/chromecast/media/mojo/cast_mojo_media_client.cc @@ -0,0 +1,32 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "media/mojo/services/mojo_media_application.h" + +#include "media/mojo/services/mojo_media_client.h" + +namespace { +class CastMojoMediaClient : public ::media::MojoMediaClient { + public: + CastMojoMediaClient() {} + ~CastMojoMediaClient() override {} + + // MojoMediaClient overrides. + void Initialize() override {} + scoped_ptr<::media::RendererFactory> CreateRendererFactory( + const scoped_refptr<::media::MediaLog>& media_log) override { + return scoped_ptr<::media::RendererFactory>(); + } + + private: + DISALLOW_COPY_AND_ASSIGN(CastMojoMediaClient); +}; +} // namespace + +namespace media { +// static +scoped_ptr<MojoMediaClient> MojoMediaClient::Create() { + return make_scoped_ptr(new CastMojoMediaClient()); +} +} // namespace media |