blob: e06dba91124be2f8b6a015b6b91eb084f7646bd7 [file] [log] [blame]
# Copyright 2015 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.
# The args declared in this file should be referenced by components outside of
# //chromecast. Args needed only in //chromecast should be declared in
# //chromecast/chromecast.gni.
#
# TODO(crbug.com/1294964): Rename this file after is_chromecast is removed.
declare_args() {
# DEPRECATED. This flag will be removed in the future; see https://crbug.com/1219802.
#
# New code should use enable_cast_receiver if the feature in question is
# required for all Cast-enabled browsers, or an alternative buildflag if it is
# for specific types of devices.
is_chromecast = false
# chromecast_branding is used to include or exclude Google-branded components.
# Set it to "public" for a Chromium build.
# TODO(crbug.com/1293517): Remove usages in Chromium and move to //chromecast.
chromecast_branding = "public"
# Set this true for an audio-only Chromecast build.
# TODO(crbug.com/1293538): Replace with a buildflag for speaker-only builds not
# specific to Cast.
is_cast_audio_only = false
# If non empty, rpath of executables is set to this.
# If empty, default value is used.
target_rpath = ""
# Set true to enable modular_updater.
enable_modular_updater = false
# True to enable the cast audio renderer.
#
# TODO(crbug.com/1293520): Remove this buildflag.
enable_cast_audio_renderer = false
}
declare_args() {
# Set this true for a Chromecast build. Chromecast builds are supported on
# Linux, Android, ChromeOS, and Fuchsia.
#
# During the migration from is_chromecast, this must be set to the same value
# as is_chromecast.
enable_cast_receiver = is_chromecast
# Set this to true to build for Nest hardware running Linux (aka "CastOS").
# Set this to false to use the defaults for the target OS/platform.
#
# Prevent it from being true for the building of host tools when the target
# is Fuchsia. is_a_target_toolchain could be checked instead, but this would
# be a change in behavior.
# TODO(crbug.com/1340117): Migrate to NOT setting is_castos to true in the
# host toolchain even after the following TODO is addressed.
# TODO(crbug.com/1314528): Change default to false.
is_castos = is_chromecast && is_linux && target_os != "fuchsia"
# Set this to true to build for Android-based Cast devices.
# Set this to false to use the defaults for the target OS/platform.
is_cast_android = is_chromecast && is_android
}
declare_args() {
# True to enable the cast renderer. It is enabled by default for Linux and
# Android audio only builds.
#
# TODO(crbug.com/1293520): Remove this buildflag.
enable_cast_renderer =
enable_cast_receiver &&
(is_linux || is_chromeos || (is_cast_audio_only && is_android))
}
# Configures media options for cast. See media/media_options.gni
cast_mojo_media_services = []
cast_mojo_media_host = ""
if (enable_cast_audio_renderer) {
if (is_android) {
cast_mojo_media_services = [
"cdm",
"audio_decoder",
]
}
if (!is_cast_audio_only) {
cast_mojo_media_services += [ "video_decoder" ]
}
if (is_android && is_cast_audio_only) {
cast_mojo_media_host = "browser"
} else {
cast_mojo_media_host = "gpu"
}
} else if (enable_cast_renderer) {
# In this path, mojo media services are hosted in two processes:
# 1. "renderer" and "cdm" run in browser process. This is hard coded in the
# code.
# 2. "video_decoder" runs in the process specified by "cast_mojo_media_host".
cast_mojo_media_services = [
"cdm",
"renderer",
]
if (!is_cast_audio_only) {
cast_mojo_media_services += [ "video_decoder" ]
}
cast_mojo_media_host = "gpu"
} else if (is_android) {
# On Android, all the enabled mojo media services run in the process specified
# by "cast_mojo_media_host".
cast_mojo_media_services = [
"cdm",
"audio_decoder",
]
if (!is_cast_audio_only) {
# These are Cast/Android devices with Video capabilities (and GPU)
cast_mojo_media_services += [ "video_decoder" ]
cast_mojo_media_host = "gpu"
} else {
# These are Cast/Android devices with only Audio capabilities (no GPU)
cast_mojo_media_host = "browser"
}
}
# Assert that Chromecast is being built for a supported platform.
assert(is_linux || is_chromeos || is_android || is_fuchsia ||
!enable_cast_receiver,
"Cast receiver builds are not supported on $target_os")
assert(enable_cast_receiver || !is_cast_audio_only,
"is_cast_audio_only = true requires enable_cast_receiver = true.")
assert(enable_cast_receiver || !is_chromecast,
"is_chromecast = true requires enable_cast_receiver = true.")
assert(enable_cast_receiver || !is_castos,
"is_castos = true requires enable_cast_receiver = true.")
assert(is_linux || !is_castos, "is_castos = true requires is_linux = true.")
assert(enable_cast_receiver || !is_cast_android,
"is_cast_android = true requires enable_cast_receiver = true.")
assert(is_android || !is_cast_android,
"is_cast_android = true requires is_android = true.")
assert(!is_fuchsia || !is_chromecast,
"is_chromecast is no longer supported on Fuchsia.")