summaryrefslogtreecommitdiff
path: root/chromium/chromecast
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-03-11 11:32:04 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2020-03-18 13:40:17 +0000
commit31ccca0778db85c159634478b4ec7997f6704860 (patch)
tree3d33fc3afd9d5ec95541e1bbe074a9cf8da12a0e /chromium/chromecast
parent248b70b82a40964d5594eb04feca0fa36716185d (diff)
downloadqtwebengine-chromium-31ccca0778db85c159634478b4ec7997f6704860.tar.gz
BASELINE: Update Chromium to 80.0.3987.136
Change-Id: I98e1649aafae85ba3a83e67af00bb27ef301db7b Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
Diffstat (limited to 'chromium/chromecast')
-rw-r--r--chromium/chromecast/BUILD.gn21
-rw-r--r--chromium/chromecast/app/BUILD.gn1
-rw-r--r--chromium/chromecast/base/BUILD.gn3
-rw-r--r--chromium/chromecast/base/component/BUILD.gn1
-rw-r--r--chromium/chromecast/base/static_sequence/BUILD.gn46
-rw-r--r--chromium/chromecast/bindings/BUILD.gn4
-rw-r--r--chromium/chromecast/browser/BUILD.gn58
-rw-r--r--chromium/chromecast/browser/android/BUILD.gn6
-rw-r--r--chromium/chromecast/build/BUILD.gn33
-rw-r--r--chromium/chromecast/chromecast.gni8
-rw-r--r--chromium/chromecast/common/mojom/BUILD.gn1
-rw-r--r--chromium/chromecast/common/mojom/application_media_capabilities.mojom16
-rw-r--r--chromium/chromecast/common/mojom/application_media_capabilities.typemap20
-rw-r--r--chromium/chromecast/common/mojom/js_channel.mojom27
-rw-r--r--chromium/chromecast/external_mojo/external_service_support/BUILD.gn10
-rw-r--r--chromium/chromecast/gpu/BUILD.gn23
-rw-r--r--chromium/chromecast/graphics/BUILD.gn6
-rw-r--r--chromium/chromecast/media/audio/BUILD.gn9
-rw-r--r--chromium/chromecast/media/audio/capture_service/BUILD.gn3
-rw-r--r--chromium/chromecast/media/audio/mixer_service/BUILD.gn65
-rw-r--r--chromium/chromecast/media/audio/mixer_service/receiver/BUILD.gn18
-rw-r--r--chromium/chromecast/media/cma/backend/BUILD.gn13
-rw-r--r--chromium/chromecast/media/cma/backend/desktop/BUILD.gn26
-rw-r--r--chromium/chromecast/media/cma/backend/fuchsia/BUILD.gn4
-rw-r--r--chromium/chromecast/media/cma/backend/mixer/BUILD.gn53
-rw-r--r--chromium/chromecast/media/cma/backend/video/BUILD.gn7
-rw-r--r--chromium/chromecast/media/service/BUILD.gn4
-rw-r--r--chromium/chromecast/media/service/mojom/BUILD.gn17
-rw-r--r--chromium/chromecast/media/service/mojom/video_geometry_setter.mojom58
-rw-r--r--chromium/chromecast/net/BUILD.gn2
-rw-r--r--chromium/chromecast/public/media/BUILD.gn2
-rw-r--r--chromium/chromecast/renderer/BUILD.gn2
-rw-r--r--chromium/chromecast/typemaps.gni5
-rw-r--r--chromium/chromecast/ui/BUILD.gn50
-rw-r--r--chromium/chromecast/ui/mojom/BUILD.gn12
-rw-r--r--chromium/chromecast/ui/mojom/media_control_ui.mojom47
-rw-r--r--chromium/chromecast/ui/mojom/ui_service.mojom29
37 files changed, 629 insertions, 81 deletions
diff --git a/chromium/chromecast/BUILD.gn b/chromium/chromecast/BUILD.gn
index 27a18581906..d59796bdc16 100644
--- a/chromium/chromecast/BUILD.gn
+++ b/chromium/chromecast/BUILD.gn
@@ -25,7 +25,9 @@ declare_args() {
# Depends on all non-test targets that should be built by the Chromecast
# internal build infrastructure.
group("all") {
- deps = []
+ deps = [
+ "//chromecast/build:archive",
+ ]
if (is_android && chromecast_branding == "public") {
deps += [ ":cast_shell_apk" ]
}
@@ -53,6 +55,12 @@ group("all") {
config("cast_config") {
}
+config("iot_service") {
+ if (iot_service_rpath != "") {
+ ldflags = [ "-Wl,-rpath=${iot_service_rpath}" ]
+ }
+}
+
# A list of all public test() binaries. This is an organizational target that
# cannot be depended upon or built directly. Build cast_test_lists instead.
cast_test_group("cast_tests") {
@@ -91,7 +99,7 @@ cast_test_group("cast_tests") {
}
if (use_v4l2_codec) {
- tests += [ "//media/gpu:video_decode_accelerator_unittest" ]
+ tests += [ "//media/gpu:video_decode_accelerator_tests" ]
}
if (is_linux) {
@@ -269,7 +277,7 @@ cast_test_group("cast_tests") {
if (is_android_things) {
gtest_excludes += [
"FontUniqueNameLookupTest.TestMatchPostScriptNameTtc",
- "SiteInstanceTest.HasWrongProcessForURL",
+ "SiteInstanceTest.IsSuitableForURL",
]
}
if (target_os == "linux" && !is_cast_desktop_build) {
@@ -278,7 +286,7 @@ cast_test_group("cast_tests") {
# Disable RenderWidgetHostTest.Background because we disable the
# blacklist to enable WebGL (b/16142554)
gtest_excludes += [
- "DOMStorageDatabaseTest.TestCanOpenAndReadWebCoreDatabase",
+ "LegacyDomStorageDatabaseTest.TestCanOpenAndReadWebCoreDatabase",
"DesktopCaptureDeviceTest.Capture",
"GamepadProviderTest.PollingAccess",
"PepperGamepadHostTest.WaitForReply",
@@ -657,9 +665,12 @@ if (is_android) {
android_manifest = "$root_gen_dir/cast_shell_manifest/AndroidManifest.xml"
android_manifest_dep = "//chromecast/browser/android:cast_shell_manifest"
+ min_sdk_version = 21
+ target_sdk_version = 28
+
shared_libraries = [ "//chromecast/android:libcast_shell_android" ]
- locale_config_java_packages = [ "org.chromium.chromecast.shell" ]
+ product_config_java_packages = [ "org.chromium.chromecast.shell" ]
deps = [
":cast_shell_apk_assets",
diff --git a/chromium/chromecast/app/BUILD.gn b/chromium/chromecast/app/BUILD.gn
index e17f232086d..0fc0690ac93 100644
--- a/chromium/chromecast/app/BUILD.gn
+++ b/chromium/chromecast/app/BUILD.gn
@@ -19,6 +19,7 @@ cast_source_set("app") {
"//chromecast/base",
"//chromecast/browser",
"//chromecast/common",
+ "//chromecast/gpu",
"//chromecast/renderer",
"//chromecast/utility",
"//components/crash/core/common:crash_key",
diff --git a/chromium/chromecast/base/BUILD.gn b/chromium/chromecast/base/BUILD.gn
index 7af2a7fc2bc..127aa21fcd5 100644
--- a/chromium/chromecast/base/BUILD.gn
+++ b/chromium/chromecast/base/BUILD.gn
@@ -185,6 +185,7 @@ test("cast_base_unittests") {
":thread_health_checker",
"//base/test:run_all_unittests",
"//base/test:test_support",
+ "//chromecast/base/static_sequence:tests",
"//testing/gmock",
"//testing/gtest",
]
@@ -356,7 +357,6 @@ if (is_android) {
"$java_src_dir/org/chromium/chromecast/base/BiPredicate.java",
"$java_src_dir/org/chromium/chromecast/base/Both.java",
"$java_src_dir/org/chromium/chromecast/base/Controller.java",
- "$java_src_dir/org/chromium/chromecast/base/Consumer.java",
"$java_src_dir/org/chromium/chromecast/base/Function.java",
"$java_src_dir/org/chromium/chromecast/base/Itertools.java",
"$java_src_dir/org/chromium/chromecast/base/Observable.java",
@@ -367,7 +367,6 @@ if (is_android) {
"$java_src_dir/org/chromium/chromecast/base/Predicate.java",
"$java_src_dir/org/chromium/chromecast/base/Subscription.java",
"$java_src_dir/org/chromium/chromecast/base/Sequencer.java",
- "$java_src_dir/org/chromium/chromecast/base/Supplier.java",
"$java_src_dir/org/chromium/chromecast/base/Unit.java",
# TODO(sanfin): Move these files to another target.
diff --git a/chromium/chromecast/base/component/BUILD.gn b/chromium/chromecast/base/component/BUILD.gn
index b68c56af664..9f81f18c8e3 100644
--- a/chromium/chromecast/base/component/BUILD.gn
+++ b/chromium/chromecast/base/component/BUILD.gn
@@ -26,6 +26,7 @@ test("cast_component_unittests") {
":component",
"//base",
"//base/test:run_all_unittests",
+ "//base/test:test_support",
"//testing/gtest",
]
}
diff --git a/chromium/chromecast/base/static_sequence/BUILD.gn b/chromium/chromecast/base/static_sequence/BUILD.gn
new file mode 100644
index 00000000000..0233a969930
--- /dev/null
+++ b/chromium/chromecast/base/static_sequence/BUILD.gn
@@ -0,0 +1,46 @@
+# Copyright 2019 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("//build/nocompile.gni")
+import("//chromecast/chromecast.gni")
+
+cast_source_set("static_sequence") {
+ sources = [
+ "static_sequence.cc",
+ "static_sequence.h",
+ ]
+ deps = [
+ "//base",
+ ]
+}
+
+cast_source_set("tests") {
+ testonly = true
+ sources = [
+ "static_sequence_unittest.cc",
+ ]
+
+ deps = [
+ ":static_sequence",
+ "//base/test:test_support",
+ "//testing/gtest",
+ ]
+
+ if (enable_nocompile_tests) {
+ deps += [ ":nocompile_tests" ]
+ }
+}
+
+if (enable_nocompile_tests) {
+ nocompile_test("nocompile_tests") {
+ sources = [
+ "static_sequence_unittest.nc",
+ ]
+ deps = [
+ ":static_sequence",
+ "//base/test:run_all_unittests",
+ "//testing/gtest",
+ ]
+ }
+}
diff --git a/chromium/chromecast/bindings/BUILD.gn b/chromium/chromecast/bindings/BUILD.gn
index 0405012953a..a0cebfc504d 100644
--- a/chromium/chromecast/bindings/BUILD.gn
+++ b/chromium/chromecast/bindings/BUILD.gn
@@ -56,7 +56,7 @@ if (is_fuchsia) {
}
}
-if (is_linux) {
+if (is_linux || is_android) {
source_set("bindings_manager_cast") {
sources = [
"bindings_manager_cast.cc",
@@ -111,7 +111,7 @@ if (is_linux) {
source_set("browsertests") {
testonly = true
deps = []
- if (is_linux) {
+ if (is_linux || is_android) {
deps += [ "//chromecast/bindings:browsertests_cast" ]
}
}
diff --git a/chromium/chromecast/browser/BUILD.gn b/chromium/chromecast/browser/BUILD.gn
index bf06a5b9249..8417d9f95b7 100644
--- a/chromium/chromecast/browser/BUILD.gn
+++ b/chromium/chromecast/browser/BUILD.gn
@@ -40,6 +40,21 @@ cast_source_set("prefs") {
}
}
+cast_source_set("feature_list") {
+ sources = [
+ "cast_feature_list_creator.cc",
+ "cast_feature_list_creator.h",
+ ]
+ deps = [
+ ":prefs",
+ "//base",
+ "//chromecast/base",
+ "//chromecast/browser/metrics",
+ "//components/prefs",
+ "//components/proxy_config",
+ ]
+}
+
cast_source_set("browser") {
sources = [
"application_media_capabilities.cc",
@@ -56,12 +71,11 @@ cast_source_set("browser") {
"cast_browser_process.h",
"cast_content_browser_client.cc",
"cast_content_browser_client.h",
+ "cast_content_browser_client_receiver_bindings.cc",
"cast_content_gesture_handler.cc",
"cast_content_gesture_handler.h",
"cast_download_manager_delegate.cc",
"cast_download_manager_delegate.h",
- "cast_feature_list_creator.cc",
- "cast_feature_list_creator.h",
"cast_http_user_agent_settings.cc",
"cast_http_user_agent_settings.h",
"cast_media_blocker.cc",
@@ -88,8 +102,8 @@ cast_source_set("browser") {
"cast_system_memory_pressure_evaluator_adjuster.h",
"cast_web_contents_impl.cc",
"cast_web_contents_impl.h",
- "cast_web_contents_manager.cc",
- "cast_web_contents_manager.h",
+ "cast_web_service.cc",
+ "cast_web_service.h",
"cast_web_view_default.cc",
"cast_web_view_default.h",
"cast_web_view_factory.cc",
@@ -136,6 +150,7 @@ cast_source_set("browser") {
}
public_deps = [
+ ":feature_list",
":prefs",
":public",
"//chromecast/browser/metrics",
@@ -167,6 +182,7 @@ cast_source_set("browser") {
"//chromecast/media:libcast_media",
"//chromecast/media/base:video_plane_controller",
"//chromecast/media/service",
+ "//chromecast/media/service/mojom",
"//chromecast/net",
"//chromecast/service",
"//components/download/public/common:public",
@@ -210,6 +226,7 @@ cast_source_set("browser") {
"android/cast_content_window_android.cc",
"android/cast_content_window_android.h",
"android/cast_metrics_helper_android.cc",
+ "android/cast_web_service_android.cc",
]
deps += [
":jni_headers",
@@ -245,9 +262,13 @@ cast_source_set("browser") {
sources += [
"cast_content_window_aura.cc",
"cast_content_window_aura.h",
+ "cast_web_service_aura.cc",
]
- deps += [ "//ui/views:views" ]
+ deps += [
+ "//chromecast/ui:media_control_ui",
+ "//ui/views:views",
+ ]
}
if (!is_fuchsia) {
@@ -382,6 +403,18 @@ cast_source_set("browser") {
"exo/cast_wm_helper.h",
"exo/wayland_server_controller.cc",
"exo/wayland_server_controller.h",
+ "webview/cast_app_controller.cc",
+ "webview/cast_app_controller.h",
+ "webview/cast_app_rpc_instance.cc",
+ "webview/cast_app_rpc_instance.h",
+ "webview/js_channel_service.cc",
+ "webview/js_channel_service.h",
+ "webview/platform_views_grpc_service.cc",
+ "webview/platform_views_grpc_service.h",
+ "webview/platform_views_rpc_instance.cc",
+ "webview/platform_views_rpc_instance.h",
+ "webview/web_content_controller.cc",
+ "webview/web_content_controller.h",
"webview/webview_controller.cc",
"webview/webview_controller.h",
"webview/webview_grpc_service.cc",
@@ -390,14 +423,18 @@ cast_source_set("browser") {
"webview/webview_layout_manager.h",
"webview/webview_navigation_throttle.cc",
"webview/webview_navigation_throttle.h",
+ "webview/webview_rpc_instance.cc",
+ "webview/webview_rpc_instance.h",
"webview/webview_window_manager.cc",
"webview/webview_window_manager.h",
]
configs += [ "//third_party/grpc:grpc_config" ]
deps += [
+ ":web_contents_provider",
"//chromecast/browser/webview/proto",
"//components/exo",
"//components/exo/wayland",
+ "//content/public/browser",
"//services/viz/privileged/mojom/compositing",
"//ui/display/manager",
]
@@ -437,6 +474,7 @@ cast_source_set("public") {
deps = [
"//base",
"//chromecast/graphics",
+ "//chromecast/ui/mojom",
"//content/public/common",
"//ui/events",
"//url",
@@ -561,3 +599,13 @@ if (is_android) {
]
}
}
+
+cast_source_set("web_contents_provider") {
+ sources = [
+ "webview/web_contents_provider.h",
+ ]
+
+ deps = [
+ "//content/public/browser",
+ ]
+}
diff --git a/chromium/chromecast/browser/android/BUILD.gn b/chromium/chromecast/browser/android/BUILD.gn
index 7a071ae0ed4..fb7b0e648df 100644
--- a/chromium/chromecast/browser/android/BUILD.gn
+++ b/chromium/chromecast/browser/android/BUILD.gn
@@ -112,7 +112,7 @@ android_library("reactive_android_java") {
]
}
-generate_locale_config_srcjar("chromecast_locale_config") {
+generate_product_config_srcjar("chromecast_product_config") {
java_package = "org.chromium.chromecast.shell"
}
@@ -148,12 +148,12 @@ android_library("cast_shell_java") {
srcjar_deps = [
":cast_shell_build_config_gen",
- ":chromecast_locale_config",
+ ":chromecast_product_config",
":logs_provider_aidl",
"//chromecast/browser:java_enums",
]
- jar_excluded_patterns = [ "*/LocaleConfig.class" ]
+ jar_excluded_patterns = [ "*/ProductConfig.class" ]
deps = [
":cast_audio_manager_java",
diff --git a/chromium/chromecast/build/BUILD.gn b/chromium/chromecast/build/BUILD.gn
new file mode 100644
index 00000000000..f0730131d40
--- /dev/null
+++ b/chromium/chromecast/build/BUILD.gn
@@ -0,0 +1,33 @@
+# Copyright 2019 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("//chromecast/chromecast.gni")
+
+if (is_android) {
+ artifact_type_suffix = "$cast_build_incremental-$target_cpu"
+
+ copy("archive_public_cast_apk") {
+ sources = [
+ "$root_out_dir/apks/CastShell.apk",
+ ]
+ outputs = [
+ "$root_out_dir/archive/CastShell-$artifact_type_suffix.apk",
+ ]
+ deps = [
+ "//chromecast:cast_shell_apk",
+ ]
+ }
+}
+
+group("archive") {
+ if (chromecast_branding == "internal") {
+ deps = [
+ "//chromecast/internal/build:archive",
+ ]
+ } else if (is_android) {
+ deps = [
+ ":archive_public_cast_apk",
+ ]
+ }
+}
diff --git a/chromium/chromecast/chromecast.gni b/chromium/chromecast/chromecast.gni
index 6f563786199..2945bf5e82e 100644
--- a/chromium/chromecast/chromecast.gni
+++ b/chromium/chromecast/chromecast.gni
@@ -39,6 +39,10 @@ declare_args() {
# shim mixer service receiver that pushes audio to the CMA backend.
have_full_mixer = is_cast_audio_only
+ # If true, the mixer will be instantiated inside cast_shell. When false, the
+ # mixer is expected to be running in another process.
+ mixer_in_cast_shell = true
+
# Set to true on devices where the VolumeControl implementation is in the
# libcast_avsettings_1.0.so instead of in libcast_media_1.0.so.
cast_volume_control_in_avsettings = false
@@ -73,6 +77,7 @@ declare_args() {
# Set the package name and class path for the component which will provide device logs
# Values defined in eureka-internal
# These values are unused if use_remote_service_logcat is false
+ # device_logs_provider_package is a CSV, and the first resolved one would be used.
device_logs_provider_package = ""
device_logs_provider_class = ""
}
@@ -122,6 +127,9 @@ declare_args() {
# Set to true to enable audio capture service for audio input.
enable_audio_capture_service = false
+
+ # Extra rpath to use for standalone services.
+ iot_service_rpath = ""
}
declare_args() {
diff --git a/chromium/chromecast/common/mojom/BUILD.gn b/chromium/chromecast/common/mojom/BUILD.gn
index abee4b1f8e0..caf77ffecbd 100644
--- a/chromium/chromecast/common/mojom/BUILD.gn
+++ b/chromium/chromecast/common/mojom/BUILD.gn
@@ -9,6 +9,7 @@ mojom("mojom") {
"application_media_capabilities.mojom",
"constants.mojom",
"feature_manager.mojom",
+ "js_channel.mojom",
"media_caps.mojom",
"media_playback_options.mojom",
"memory_pressure.mojom",
diff --git a/chromium/chromecast/common/mojom/application_media_capabilities.mojom b/chromium/chromecast/common/mojom/application_media_capabilities.mojom
index 83634afc179..d23f71e21f2 100644
--- a/chromium/chromecast/common/mojom/application_media_capabilities.mojom
+++ b/chromium/chromecast/common/mojom/application_media_capabilities.mojom
@@ -4,10 +4,24 @@
module chromecast.shell.mojom;
+// Supported bitstream audio codecs and their associated properties. This is the
+// corresponding mojo struct of BitstreamAudioCodecsInfo in
+// chromecast/base/bitstream_audio_codecs.h
+struct BitstreamAudioCodecsInfo {
+ // Bitmap of supported bitstream audio codecs.
+ int32 codecs = 0;
+
+ // Bitmap specifying which of the corresponding codecs in |codecs| support
+ // spatial rendering.
+ int32 spatial_rendering = 0;
+};
+
// Observes changes in an individual application's media capabilities.
// See chromecast/base/bitstream_audio_codecs.h for codec values.
interface ApplicationMediaCapabilitiesObserver {
- OnSupportedBitstreamAudioCodecsChanged(int32 codecs);
+ // Called when bitstream audio supporting information is changed.
+ // |info| contains the latest supported bitstream audio codec information.
+ OnSupportedBitstreamAudioCodecsChanged(BitstreamAudioCodecsInfo info);
};
// Media capabilities for an individual application.
diff --git a/chromium/chromecast/common/mojom/application_media_capabilities.typemap b/chromium/chromecast/common/mojom/application_media_capabilities.typemap
new file mode 100644
index 00000000000..ce108e009c2
--- /dev/null
+++ b/chromium/chromecast/common/mojom/application_media_capabilities.typemap
@@ -0,0 +1,20 @@
+# Copyright 2019 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.
+
+mojom = "//chromecast/common/mojom/application_media_capabilities.mojom"
+
+public_headers = [ "//chromecast/base/bitstream_audio_codecs.h" ]
+
+traits_headers =
+ [ "//chromecast/common/mojom/application_media_capabilities_traits.h" ]
+
+sources = [
+ "//chromecast/common/mojom/application_media_capabilities_traits.h",
+]
+
+public_deps = [
+ "//chromecast/base",
+]
+
+type_mappings = [ "chromecast.shell.mojom.BitstreamAudioCodecsInfo=::chromecast::BitstreamAudioCodecsInfo" ]
diff --git a/chromium/chromecast/common/mojom/js_channel.mojom b/chromium/chromecast/common/mojom/js_channel.mojom
new file mode 100644
index 00000000000..9d71a99c57a
--- /dev/null
+++ b/chromium/chromecast/common/mojom/js_channel.mojom
@@ -0,0 +1,27 @@
+// Copyright 2019 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.
+
+module chromecast.mojom;
+
+// Send a message on this channel to the browser.
+interface JsChannel {
+ // Message from javascript.
+ PostMessage(string message);
+};
+
+// Implemented on the renderer, this gets notified by the browser to
+// add/remove channels as needed.
+interface JsChannelClient {
+ // Add a new channel binding, connecting window.channel.postMessage to |pipe|.
+ CreateChannel(string channel, pending_remote<JsChannel> pipe);
+ // Remove any existing channel binding.
+ RemoveChannel(string channel);
+};
+
+// Implemented by the browser.
+interface JsChannelBindingProvider {
+ // The RenderFrame reports its routing ID to the browser here and provides the
+ // pipe to manage channels.
+ Register(int32 routing_id, pending_remote<JsChannelClient> client);
+};
diff --git a/chromium/chromecast/external_mojo/external_service_support/BUILD.gn b/chromium/chromecast/external_mojo/external_service_support/BUILD.gn
index a2da73ca2fe..4dc8dfcb708 100644
--- a/chromium/chromecast/external_mojo/external_service_support/BUILD.gn
+++ b/chromium/chromecast/external_mojo/external_service_support/BUILD.gn
@@ -35,9 +35,14 @@ source_set("process_setup") {
]
}
-source_set("standalone_service_main") {
+source_set("service_process") {
sources = [
"service_process.h",
+ ]
+}
+
+source_set("standalone_service_main") {
+ sources = [
"standalone_service_main.cc",
]
deps = [
@@ -47,6 +52,9 @@ source_set("standalone_service_main") {
"//chromecast/external_mojo/public/cpp:common",
"//mojo/core/embedder",
]
+ public_deps = [
+ ":service_process",
+ ]
}
source_set("chromium_service") {
diff --git a/chromium/chromecast/gpu/BUILD.gn b/chromium/chromecast/gpu/BUILD.gn
new file mode 100644
index 00000000000..925ed19db6a
--- /dev/null
+++ b/chromium/chromecast/gpu/BUILD.gn
@@ -0,0 +1,23 @@
+# Copyright 2019 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("//chromecast/chromecast.gni")
+
+cast_source_set("gpu") {
+ sources = [
+ "cast_content_gpu_client.cc",
+ "cast_content_gpu_client.h",
+ ]
+
+ deps = [
+ "//base",
+ "//chromecast/media/service/mojom",
+ "//components/viz/common",
+ "//components/viz/service",
+ "//content/public/child",
+ "//content/public/gpu",
+ ]
+
+ defines = [ "IS_CHROMECAST" ]
+}
diff --git a/chromium/chromecast/graphics/BUILD.gn b/chromium/chromecast/graphics/BUILD.gn
index 552f95893d9..9df49f6d391 100644
--- a/chromium/chromecast/graphics/BUILD.gn
+++ b/chromium/chromecast/graphics/BUILD.gn
@@ -21,6 +21,10 @@ cast_source_set("graphics") {
"//ui/gfx",
]
+ public_deps = [
+ "//chromecast/ui/mojom",
+ ]
+
if (use_aura) {
sources += [
"accessibility/accessibility_cursor_ring_layer.cc",
@@ -81,7 +85,7 @@ cast_source_set("graphics") {
sources += [
"cast_window_manager_default.cc",
"cast_window_manager_default.h",
- "rounded_window_corners.h",
+ "rounded_window_corners_default.cc",
]
}
diff --git a/chromium/chromecast/media/audio/BUILD.gn b/chromium/chromecast/media/audio/BUILD.gn
index 6a87f5c9292..fec37b652a5 100644
--- a/chromium/chromecast/media/audio/BUILD.gn
+++ b/chromium/chromecast/media/audio/BUILD.gn
@@ -44,6 +44,7 @@ cast_source_set("audio") {
"//chromecast/base",
"//chromecast/common/mojom",
"//chromecast/media/audio/capture_service:receiver",
+ "//chromecast/media/audio/mixer_service:common",
"//chromecast/media/audio/mixer_service:output_stream_connection",
"//chromecast/media/audio/mixer_service:proto",
"//chromecast/media/base",
@@ -85,7 +86,7 @@ if (is_android) {
}
}
-cast_shared_library("libcast_external_audio_pipeline_1.0") {
+source_set("dummy_external_audio_pipeline") {
sources = [
"external_audio_pipeline_dummy.cc",
]
@@ -95,6 +96,12 @@ cast_shared_library("libcast_external_audio_pipeline_1.0") {
]
}
+cast_shared_library("libcast_external_audio_pipeline_1.0") {
+ public_deps = [
+ ":dummy_external_audio_pipeline",
+ ]
+}
+
source_set("fake_external_audio_pipeline") {
sources = [
"fake_external_audio_pipeline.cc",
diff --git a/chromium/chromecast/media/audio/capture_service/BUILD.gn b/chromium/chromecast/media/audio/capture_service/BUILD.gn
index f907f3f2afe..877df6c02df 100644
--- a/chromium/chromecast/media/audio/capture_service/BUILD.gn
+++ b/chromium/chromecast/media/audio/capture_service/BUILD.gn
@@ -2,7 +2,6 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-import("//build/buildflag_header.gni")
import("//chromecast/chromecast.gni")
import("//testing/libfuzzer/fuzzer_test.gni")
import("//testing/test.gni")
@@ -28,7 +27,7 @@ cast_source_set("receiver") {
deps = [
"//base",
"//chromecast/base",
- "//chromecast/media/audio:audio_buildflags",
+ "//chromecast/media/audio/mixer_service:audio_socket_service",
"//chromecast/net:small_message_socket",
"//media",
"//net",
diff --git a/chromium/chromecast/media/audio/mixer_service/BUILD.gn b/chromium/chromecast/media/audio/mixer_service/BUILD.gn
index 5407f2298e3..ddf4621f8d9 100644
--- a/chromium/chromecast/media/audio/mixer_service/BUILD.gn
+++ b/chromium/chromecast/media/audio/mixer_service/BUILD.gn
@@ -6,6 +6,12 @@ import("//build/buildflag_header.gni")
import("//chromecast/chromecast.gni")
import("//third_party/protobuf/proto_library.gni")
+buildflag_header("buildflags") {
+ header = "buildflags.h"
+
+ flags = [ "HAVE_FULL_MIXER=$have_full_mixer" ]
+}
+
proto_library("proto") {
proto_out_dir = "chromecast/media/audio/mixer_service"
sources = [
@@ -15,6 +21,7 @@ proto_library("proto") {
cast_source_set("common") {
sources = [
+ "constants.cc",
"constants.h",
"conversions.cc",
"conversions.h",
@@ -23,7 +30,9 @@ cast_source_set("common") {
]
deps = [
+ ":buildflags",
"//base",
+ "//chromecast/net:io_buffer_pool",
"//chromecast/public",
"//chromecast/public/media",
"//net",
@@ -42,10 +51,10 @@ cast_source_set("connection") {
]
deps = [
+ ":audio_socket_service",
":common",
"//base",
"//chromecast/base",
- "//chromecast/media/audio:audio_buildflags",
"//net",
]
}
@@ -59,13 +68,11 @@ cast_source_set("output_stream_connection") {
deps = [
":common",
":connection",
+ ":proto",
"//base",
+ "//chromecast/net:io_buffer_pool",
"//net",
]
-
- public_deps = [
- ":proto",
- ]
}
cast_source_set("control_connection") {
@@ -84,6 +91,54 @@ cast_source_set("control_connection") {
]
}
+cast_source_set("mixer_control") {
+ sources = [
+ "mixer_control.cc",
+ "mixer_control.h",
+ ]
+
+ deps = [
+ ":common",
+ ":control_connection",
+ "//base",
+ "//chromecast/media/audio:audio_io_thread",
+ ]
+}
+
+cast_source_set("loopback_connection") {
+ sources = [
+ "loopback_connection.cc",
+ "loopback_connection.h",
+ ]
+
+ deps = [
+ ":common",
+ ":connection",
+ ":proto",
+ "//base",
+ "//chromecast/net:io_buffer_pool",
+ "//chromecast/public/media",
+ "//net",
+ ]
+}
+
+cast_source_set("redirected_audio_connection") {
+ sources = [
+ "redirected_audio_connection.cc",
+ "redirected_audio_connection.h",
+ ]
+
+ deps = [
+ ":common",
+ ":connection",
+ ":proto",
+ "//base",
+ "//chromecast/net:io_buffer_pool",
+ "//chromecast/public",
+ "//net",
+ ]
+}
+
cast_source_set("audio_socket_service") {
sources = [
"audio_socket_service.cc",
diff --git a/chromium/chromecast/media/audio/mixer_service/receiver/BUILD.gn b/chromium/chromecast/media/audio/mixer_service/receiver/BUILD.gn
index 7cba5198429..221180d6e33 100644
--- a/chromium/chromecast/media/audio/mixer_service/receiver/BUILD.gn
+++ b/chromium/chromecast/media/audio/mixer_service/receiver/BUILD.gn
@@ -48,21 +48,15 @@ cast_source_set("receiver_cma") {
cast_source_set("receiver_creation") {
sources = [
+ "receiver_creation.cc",
"receiver_creation.h",
]
deps = [
- ":receiver",
+ ":receiver_cma",
+ "//base",
+ "//chromecast/media/audio:audio_io_thread",
+ "//chromecast/media/audio/mixer_service:buildflags",
+ "//chromecast/media/audio/mixer_service:common",
]
-
- if (have_full_mixer) {
- sources += [ "receiver_creation_none.cc" ]
- } else {
- sources += [ "receiver_creation_cma.cc" ]
- deps += [
- ":receiver_cma",
- "//base",
- "//chromecast/media/audio:audio_io_thread",
- ]
- }
}
diff --git a/chromium/chromecast/media/cma/backend/BUILD.gn b/chromium/chromecast/media/cma/backend/BUILD.gn
index 83ab53077a9..cc9810d1c38 100644
--- a/chromium/chromecast/media/cma/backend/BUILD.gn
+++ b/chromium/chromecast/media/cma/backend/BUILD.gn
@@ -40,6 +40,7 @@ cast_source_set("backend") {
"//chromecast:chromecast_buildflags",
"//chromecast/base/metrics:metrics",
"//chromecast/media:libcast_media",
+ "//chromecast/media/base:media_resource_tracker",
"//chromecast/media/cma/base",
"//chromecast/media/cma/decoder",
]
@@ -75,6 +76,7 @@ buildflag_header("audio_buildflags") {
"MEDIA_CLOCK_MONOTONIC_RAW=$media_clock_monotonic_raw",
"SYSTEM_OWNS_VOLUME=$system_owns_volume",
"VOLUME_CONTROL_IN_MEDIA_SHLIB=$volume_control_in_media_shlib",
+ "MIXER_IN_CAST_SHELL=$mixer_in_cast_shell",
]
}
@@ -202,7 +204,6 @@ cast_source_set("for_mixer_audio") {
sources = [
"audio_decoder_for_mixer.cc",
"audio_decoder_for_mixer.h",
- "cast_media_shlib_mixer_audio.cc",
"media_pipeline_backend_for_mixer.cc",
"media_pipeline_backend_for_mixer.h",
"volume_control.cc",
@@ -211,21 +212,29 @@ cast_source_set("for_mixer_audio") {
deps = [
":audio_buildflags",
":audio_helpers",
+ ":audio_resampler",
":cast_audio_json",
":public",
":volume_map",
"//base",
"//chromecast/base",
+ "//chromecast/media/audio/mixer_service:common",
"//chromecast/media/audio/mixer_service:control_connection",
+ "//chromecast/media/audio/mixer_service:output_stream_connection",
+ "//chromecast/media/audio/mixer_service:proto",
"//chromecast/media/base:monotonic_clock",
- "//chromecast/media/cma/backend/mixer",
"//chromecast/media/cma/base",
"//chromecast/media/cma/decoder",
+ "//chromecast/net:io_buffer_pool",
"//chromecast/public",
"//chromecast/public/media",
"//media",
"//media:shared_memory_support",
]
+
+ if (mixer_in_cast_shell) {
+ deps += [ "//chromecast/media/cma/backend/mixer" ]
+ }
}
test("cast_audio_backend_unittests") {
diff --git a/chromium/chromecast/media/cma/backend/desktop/BUILD.gn b/chromium/chromecast/media/cma/backend/desktop/BUILD.gn
index 7ca0dfe4d66..8f994d6f521 100644
--- a/chromium/chromecast/media/cma/backend/desktop/BUILD.gn
+++ b/chromium/chromecast/media/cma/backend/desktop/BUILD.gn
@@ -16,7 +16,6 @@ cast_source_set("desktop") {
"media_sink_desktop.h",
"video_decoder_desktop.cc",
"video_decoder_desktop.h",
- "volume_control_desktop.cc",
]
deps = [
@@ -25,17 +24,16 @@ cast_source_set("desktop") {
"//chromecast/public/media",
"//media",
]
-}
-
-cast_source_set("video_decoder_for_mixer") {
- sources = [
- "cast_media_shlib_video.cc",
- ]
-
- deps = [
- "//base",
- "//chromecast/media/cma/backend:null_video",
- "//chromecast/public",
- "//chromecast/public/media",
- ]
+ if (enable_video_with_mixed_audio) {
+ deps += [
+ "//chromecast/media/cma/backend/alsa:volume_control",
+ "//chromecast/media/cma/backend:null_video",
+ "//chromecast/media/cma/backend:for_mixer_audio",
+ "//chromecast/media/cma/backend/video:av_sync_video",
+ ]
+ } else {
+ sources += [
+ "volume_control_desktop.cc",
+ ]
+ }
}
diff --git a/chromium/chromecast/media/cma/backend/fuchsia/BUILD.gn b/chromium/chromecast/media/cma/backend/fuchsia/BUILD.gn
index 17b9ffdb647..1edd7bb7246 100644
--- a/chromium/chromecast/media/cma/backend/fuchsia/BUILD.gn
+++ b/chromium/chromecast/media/cma/backend/fuchsia/BUILD.gn
@@ -50,7 +50,7 @@ cast_source_set("mixer_output") {
"//chromecast/base",
"//chromecast/public/media",
"//media",
- "//third_party/fuchsia-sdk/sdk:media",
+ "//third_party/fuchsia-sdk/sdk:fuchsia-media",
"//third_party/fuchsia-sdk/sdk:sys_cpp",
]
}
@@ -68,6 +68,6 @@ cast_source_set("unit_tests") {
"//base",
"//base/test:test_support",
"//testing/gtest",
- "//third_party/fuchsia-sdk/sdk:media",
+ "//third_party/fuchsia-sdk/sdk:fuchsia-media",
]
}
diff --git a/chromium/chromecast/media/cma/backend/mixer/BUILD.gn b/chromium/chromecast/media/cma/backend/mixer/BUILD.gn
index 18de732670e..3b1d7994362 100644
--- a/chromium/chromecast/media/cma/backend/mixer/BUILD.gn
+++ b/chromium/chromecast/media/cma/backend/mixer/BUILD.gn
@@ -10,22 +10,31 @@ declare_args() {
mixer_output = ""
}
-cast_source_set("mixer_control") {
+cast_source_set("post_processor_paths") {
sources = [
- "mixer_control.h",
+ "post_processor_paths.cc",
+ "post_processor_paths.h",
]
deps = [
- "//chromecast/public",
+ "//base",
]
}
-cast_source_set("post_processor_paths") {
+cast_source_set("loopback") {
sources = [
- "post_processor_paths.cc",
- "post_processor_paths.h",
+ "loopback_handler.cc",
+ "loopback_handler.h",
+ "mixer_loopback_connection.cc",
+ "mixer_loopback_connection.h",
]
+
deps = [
"//base",
+ "//chromecast/media/audio:libcast_external_audio_pipeline_1.0",
+ "//chromecast/media/audio/mixer_service:common",
+ "//chromecast/media/audio/mixer_service:proto",
+ "//chromecast/net:io_buffer_pool",
+ "//chromecast/public/media",
]
}
@@ -34,14 +43,8 @@ cast_source_set("mixer") {
"audio_output_redirector.cc",
"audio_output_redirector.h",
"audio_output_redirector_input.h",
- "buffering_mixer_source.cc",
- "buffering_mixer_source.h",
- "direct_mixer_source.cc",
- "direct_mixer_source.h",
"filter_group.cc",
"filter_group.h",
- "loopback_handler.cc",
- "loopback_handler.h",
"mixer_input.cc",
"mixer_input.h",
"mixer_input_connection.cc",
@@ -62,15 +65,17 @@ cast_source_set("mixer") {
]
deps = [
- ":mixer_control",
+ ":loopback",
":post_processor_paths",
"//base",
"//chromecast/base",
"//chromecast/base:chromecast_switches",
"//chromecast/base:thread_health_checker",
+ "//chromecast/media/audio:audio_io_thread",
"//chromecast/media/audio:libcast_external_audio_pipeline_1.0",
"//chromecast/media/audio/mixer_service:common",
"//chromecast/media/audio/mixer_service:proto",
+ "//chromecast/media/audio/mixer_service:redirected_audio_connection",
"//chromecast/media/audio/mixer_service/receiver",
"//chromecast/media/base",
"//chromecast/media/cma/backend:audio_helpers",
@@ -103,6 +108,21 @@ cast_source_set("mixer") {
}
}
+cast_source_set("loopback_test_support") {
+ testonly = true
+ sources = [
+ "loopback_test_support.cc",
+ "loopback_test_support.h",
+ ]
+
+ deps = [
+ ":loopback",
+ "//base",
+ "//chromecast/media/audio/mixer_service:common",
+ "//chromecast/net:test_support",
+ ]
+}
+
cast_source_set("unittests") {
testonly = true
sources = [
@@ -118,14 +138,21 @@ cast_source_set("unittests") {
]
deps = [
+ ":loopback",
+ ":loopback_test_support",
":mixer",
"//base",
+ "//base/test:test_support",
"//chromecast/media/audio:fake_external_audio_pipeline",
+ "//chromecast/media/audio/mixer_service:common",
+ "//chromecast/media/audio/mixer_service:loopback_connection",
+ "//chromecast/media/audio/mixer_service:redirected_audio_connection",
"//chromecast/media/cma/backend/mixer/post_processors:unittests",
"//chromecast/public",
"//chromecast/public/media",
"//media",
"//media:shared_memory_support",
+ "//net",
"//testing/gmock",
"//testing/gtest",
]
diff --git a/chromium/chromecast/media/cma/backend/video/BUILD.gn b/chromium/chromecast/media/cma/backend/video/BUILD.gn
index 1a3a6e1e178..527910825bb 100644
--- a/chromium/chromecast/media/cma/backend/video/BUILD.gn
+++ b/chromium/chromecast/media/cma/backend/video/BUILD.gn
@@ -55,12 +55,7 @@ cast_source_set("libcast_media_1.0_avsync") {
if (use_alsa) {
deps += [ "//chromecast/media/cma/backend/alsa:volume_control" ]
- if (!is_cast_desktop_build) {
- libs = [ "videodecoderformixer" ]
- } else {
- deps +=
- [ "//chromecast/media/cma/backend/desktop:video_decoder_for_mixer" ]
- }
+ libs = [ "videodecoderformixer" ]
}
if (is_fuchsia) {
diff --git a/chromium/chromecast/media/service/BUILD.gn b/chromium/chromecast/media/service/BUILD.gn
index ede52568999..ca4adabdde9 100644
--- a/chromium/chromecast/media/service/BUILD.gn
+++ b/chromium/chromecast/media/service/BUILD.gn
@@ -10,6 +10,8 @@ cast_source_set("service") {
"cast_mojo_media_client.h",
"cast_renderer.cc",
"cast_renderer.h",
+ "video_geometry_setter_service.cc",
+ "video_geometry_setter_service.h",
]
public_deps = [
@@ -23,7 +25,9 @@ cast_source_set("service") {
"//chromecast/base",
"//chromecast/common/mojom",
"//chromecast/media",
+ "//chromecast/media/service/mojom",
"//media",
+ "//ui/gfx",
"//ui/gfx/geometry",
]
}
diff --git a/chromium/chromecast/media/service/mojom/BUILD.gn b/chromium/chromecast/media/service/mojom/BUILD.gn
new file mode 100644
index 00000000000..e07bcde2d4c
--- /dev/null
+++ b/chromium/chromecast/media/service/mojom/BUILD.gn
@@ -0,0 +1,17 @@
+# Copyright 2019 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("//mojo/public/tools/bindings/mojom.gni")
+
+mojom("mojom") {
+ sources = [
+ "video_geometry_setter.mojom",
+ ]
+
+ public_deps = [
+ "//mojo/public/mojom/base",
+ "//ui/gfx/geometry/mojom",
+ "//ui/gfx/mojom",
+ ]
+}
diff --git a/chromium/chromecast/media/service/mojom/video_geometry_setter.mojom b/chromium/chromecast/media/service/mojom/video_geometry_setter.mojom
new file mode 100644
index 00000000000..a6ada70bc08
--- /dev/null
+++ b/chromium/chromecast/media/service/mojom/video_geometry_setter.mojom
@@ -0,0 +1,58 @@
+// Copyright 2019 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.
+
+module chromecast.media.mojom;
+
+import "mojo/public/mojom/base/unguessable_token.mojom";
+import "ui/gfx/geometry/mojom/geometry.mojom";
+import "ui/gfx/mojom/overlay_transform.mojom";
+
+// The purpose of VideoGeometrySetterService is to provide a brokerage between
+// chromecast::media::CastRenderers and viz::OverlayStrategyUnderlayCast, in a
+// situation where multiple instances of CastRenderers possibly run within
+// different instances of MediaService. When OverlayStrategyUnderlayCast decides
+// to set video geometry on a certain CastRenderer, it relies on
+// VideoGeometrySetterService to pass the geometry information to the right CastRenderer.
+
+// CastRenderer must implement this interface.
+// CastRenderer is used in multiple places but right now only CastRenderers
+// running within ::media::MediaService, on browser process, are using
+// video geometry setter service.
+interface VideoGeometryChangeClient {
+// Implementation of VideoGeometryChangeClient sets the video geometry on
+// itself.
+ OnVideoGeometryChange(gfx.mojom.RectF rect_f, gfx.mojom.OverlayTransform
+ transform);
+};
+
+// A single instance of VideoGeometrySetterService provides both the interface
+// and VideoGeometryChangeSubscriber and VideoGeometrySetter.
+
+// To be used by a VideoGeometryChangeClient(i.e., a CastRenderer).
+// CastRenders running in browser process can subscribe for the video geometry
+// information, that would be sent from compositor, which is being migrated
+// from browser process to GPU process.
+interface VideoGeometryChangeSubscriber {
+// A VideoGeometryChangeClient informs VideoGeometrySetterService its existence.
+// |overlay_plane_id| identifies the VideoGeometryChangeClient,
+// |client_pending_remote| is the pending remote bound to the
+// VideoGeometryChangeClient itself.
+ SubscribeToVideoGeometryChange(
+ mojo_base.mojom.UnguessableToken overlay_plane_id,
+ pending_remote<VideoGeometryChangeClient> client_pending_remote) => ();
+};
+
+// To be used by OverlayStrategyUnderlayCast, which is part of compositor that
+// is being migrated to GPU process. Within GPU process
+// OverlayStrategyUnderlayCast cannot access CastRenderer any more, so it
+// uses VideoGeometrySetter interface to send out the geometry information to
+// VideoGeometrySetter, which then forward it to the right CastRenderer.
+interface VideoGeometrySetter {
+// Informs VideoGeometrySetterService the video geometry information and the
+// target CastRenderer, identified by |overlay_plane_id|, that the geometry is
+// set to.
+ SetVideoGeometry(gfx.mojom.RectF rect_f,
+ gfx.mojom.OverlayTransform transform,
+ mojo_base.mojom.UnguessableToken overlay_plane_id);
+};
diff --git a/chromium/chromecast/net/BUILD.gn b/chromium/chromecast/net/BUILD.gn
index c95ed564582..69d15d2978e 100644
--- a/chromium/chromecast/net/BUILD.gn
+++ b/chromium/chromecast/net/BUILD.gn
@@ -46,7 +46,7 @@ cast_source_set("net") {
deps += [
"//chromecast/base:chromecast_switches",
- "//third_party/fuchsia-sdk/sdk:hardware_ethernet",
+ "//third_party/fuchsia-sdk/sdk:fuchsia-hardware-ethernet",
]
}
}
diff --git a/chromium/chromecast/public/media/BUILD.gn b/chromium/chromecast/public/media/BUILD.gn
index c2768aed069..c06f050b87a 100644
--- a/chromium/chromecast/public/media/BUILD.gn
+++ b/chromium/chromecast/public/media/BUILD.gn
@@ -12,11 +12,9 @@ cast_source_set("media") {
"cast_decrypt_config.h",
"cast_key_system.h",
"decoder_config.h",
- "direct_audio_source.h",
"external_audio_pipeline_shlib.h",
"media_pipeline_backend.h",
"media_pipeline_device_params.h",
- "redirected_audio_output.h",
"stream_id.h",
]
diff --git a/chromium/chromecast/renderer/BUILD.gn b/chromium/chromecast/renderer/BUILD.gn
index d21997ca12f..59a9f1844c2 100644
--- a/chromium/chromecast/renderer/BUILD.gn
+++ b/chromium/chromecast/renderer/BUILD.gn
@@ -32,6 +32,8 @@ cast_source_set("renderer") {
"cast_media_playback_options.h",
"cast_url_loader_throttle_provider.cc",
"cast_url_loader_throttle_provider.h",
+ "js_channel_bindings.cc",
+ "js_channel_bindings.h",
"native_bindings_helper.cc",
"native_bindings_helper.h",
"on_load_script_injector.cc",
diff --git a/chromium/chromecast/typemaps.gni b/chromium/chromecast/typemaps.gni
index e3efd004c3b..151133104cc 100644
--- a/chromium/chromecast/typemaps.gni
+++ b/chromium/chromecast/typemaps.gni
@@ -4,7 +4,10 @@
import("//build/config/chromecast_build.gni")
-typemaps = [ "//chromecast/common/mojom/multiroom.typemap" ]
+typemaps = [
+ "//chromecast/common/mojom/application_media_capabilities.typemap",
+ "//chromecast/common/mojom/multiroom.typemap",
+]
if (chromecast_branding != "public") {
_typemap_internal = read_file("//chromecast/internal/typemaps.gni", "scope")
diff --git a/chromium/chromecast/ui/BUILD.gn b/chromium/chromecast/ui/BUILD.gn
new file mode 100644
index 00000000000..367682c3b88
--- /dev/null
+++ b/chromium/chromecast/ui/BUILD.gn
@@ -0,0 +1,50 @@
+# Copyright 2019 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("//chromecast/chromecast.gni")
+import("//components/vector_icons/vector_icons.gni")
+
+cast_source_set("media_control_ui") {
+ sources = [
+ "media_control_ui.cc",
+ "media_control_ui.h",
+ ]
+
+ deps = [
+ ":vector_icons",
+ "//base",
+ "//chromecast/base",
+ "//chromecast/graphics",
+ "//chromecast/ui/mojom",
+ "//ui/aura:aura",
+ "//ui/views",
+ ]
+}
+
+# Rules for generating vector icon source files.
+# Adapted from //components/vector_icons/BUILD.gn
+
+aggregate_vector_icons("media_controls_vector_icons") {
+ icon_directory = "vector_icons"
+
+ icons = [
+ "back30.icon",
+ "forward30.icon",
+ "next.icon",
+ "pause.icon",
+ "play.icon",
+ "previous.icon",
+ ]
+}
+
+static_library("vector_icons") {
+ sources = get_target_outputs(":media_controls_vector_icons")
+
+ deps = [
+ ":media_controls_vector_icons",
+ "//base",
+ "//skia",
+ "//ui/gfx",
+ ]
+}
diff --git a/chromium/chromecast/ui/mojom/BUILD.gn b/chromium/chromecast/ui/mojom/BUILD.gn
new file mode 100644
index 00000000000..f4db663699c
--- /dev/null
+++ b/chromium/chromecast/ui/mojom/BUILD.gn
@@ -0,0 +1,12 @@
+# Copyright 2019 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("//mojo/public/tools/bindings/mojom.gni")
+
+mojom("mojom") {
+ sources = [
+ "media_control_ui.mojom",
+ "ui_service.mojom",
+ ]
+}
diff --git a/chromium/chromecast/ui/mojom/media_control_ui.mojom b/chromium/chromecast/ui/mojom/media_control_ui.mojom
new file mode 100644
index 00000000000..9dbdfda0df8
--- /dev/null
+++ b/chromium/chromecast/ui/mojom/media_control_ui.mojom
@@ -0,0 +1,47 @@
+// Copyright 2019 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.
+
+module chromecast.mojom;
+
+// API for a touch-based media overlay UI. The client receives commands that
+// are triggered from the UI. The client may also set various attributes on
+// the UI, so that only relevant controls are visible to the user.
+interface MediaControlUi {
+ // Set a client for the UI.
+ SetClient(pending_remote<MediaControlClient> client);
+ // Update the UI to match the new attributes.
+ SetAttributes(MediaControlUiAttributes attributes);
+};
+
+enum MediaCommand {
+ TOGGLE_PLAY_PAUSE,
+ NEXT,
+ PREVIOUS,
+ FORWARD_30_SECONDS,
+ REPLAY_30_SECONDS,
+};
+
+// Endpoint for plumbing media commands invoked by the UI.
+interface MediaControlClient {
+ // Executes a media command on behalf of the UI. These commands are only
+ // triggered by user interaction via the touch-based UI.
+ Execute(MediaCommand command);
+};
+
+struct MediaControlUiAttributes {
+ // UI attributes.
+ bool show_seek;
+ bool show_next;
+ bool show_previous;
+
+ // Media attributes.
+ string title;
+ string metadata;
+ double current_time;
+ double duration;
+ bool is_playing;
+ bool is_paused;
+};
+
+
diff --git a/chromium/chromecast/ui/mojom/ui_service.mojom b/chromium/chromecast/ui/mojom/ui_service.mojom
new file mode 100644
index 00000000000..b9ff6747fe9
--- /dev/null
+++ b/chromium/chromecast/ui/mojom/ui_service.mojom
@@ -0,0 +1,29 @@
+// Copyright 2019 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.
+
+module chromecast.mojom;
+
+enum ZOrder {
+ // Base layer for web-based system UI, or for regular apps on Chromecast.
+ APP = -1,
+ // If the main system UI is web-based, then apps running in this layer won't
+ // be managed by the system web UI.
+ UNMANAGED_APP = 0,
+ // Diagnostic overlay for debugging.
+ DEBUG_OVERLAY = 1,
+ // Overlay apps with transparent backgrounds.
+ INFO_OVERLAY = 2,
+ // Unused.
+ SOFT_KEYBOARD = 3,
+ // Volume bar overlay.
+ VOLUME = 4,
+ // Touch-based media controls.
+ MEDIA_INFO = 5,
+ // Touch-based settings UI.
+ SETTINGS = 6,
+ // Boot animation.
+ BOOT_ANIMATION_OVERLAY = 7,
+ // Rounded corners for select devices.
+ CORNERS_OVERLAY = 8,
+};