prashantv | 4025129 | 2015-04-21 21:54:22 | [diff] [blame] | 1 | # Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 | # Use of this source code is governed by a BSD-style license that can be |
| 3 | # found in the LICENSE file. |
| 4 | |
slan | 93f59d1d | 2015-11-13 17:46:49 | [diff] [blame] | 5 | import("//build/config/chromecast_build.gni") |
Stephen Lanham | 3c2131cd | 2017-04-28 01:13:41 | [diff] [blame] | 6 | import("//build/config/locales.gni") |
Scott Violet | c8240b0 | 2018-03-08 22:03:59 | [diff] [blame] | 7 | import("//extensions/buildflags/buildflags.gni") |
Melisa Carranza Z | d7998c0 | 2018-08-03 20:25:58 | [diff] [blame] | 8 | import("//media/media_options.gni") |
slan | 93f59d1d | 2015-11-13 17:46:49 | [diff] [blame] | 9 | |
slan | 77bdc2e6 | 2015-09-21 17:56:26 | [diff] [blame] | 10 | # This args block should contain arguments used within the //chromecast |
| 11 | # directory. Arguments which are used in other Chrome components should |
| 12 | # be instead declared in //build/config/chromecast_build.gni. |
prashantv | 4025129 | 2015-04-21 21:54:22 | [diff] [blame] | 13 | declare_args() { |
slan | c7957aae | 2016-05-09 22:25:59 | [diff] [blame] | 14 | # The incremental build number. The Cast automated builders will set this |
| 15 | # value to indicate the buildset. Note: The default value should be greater |
| 16 | # than any value the builder may assign to prevent attempted automatic updates |
| 17 | # when the default value is used. |
| 18 | cast_build_incremental = "999999" |
bshaya | 1ba19b6 | 2016-08-04 18:50:42 | [diff] [blame] | 19 | |
thoren | 9540c6d | 2017-05-22 20:07:04 | [diff] [blame] | 20 | if (is_android) { |
| 21 | # If true, run receiver apps in an Android service instead of an activity. |
| 22 | display_web_contents_in_service = is_cast_audio_only |
| 23 | } |
| 24 | |
gfhuang | 79ceb4f | 2016-09-07 06:43:03 | [diff] [blame] | 25 | # If true, Chromecast WebUI resources are included in a build. |
| 26 | # TODO(antz): default to false for audio-only builds, might need further |
| 27 | # clean up (b/27119303) |
| 28 | enable_chromecast_webui = !is_cast_audio_only && !is_android |
kmackay | 3801f1a | 2017-03-15 01:24:32 | [diff] [blame] | 29 | |
| 30 | # Set true to enable assistant features. |
| 31 | enable_assistant = false |
jameswest | a0889df | 2017-06-06 02:53:46 | [diff] [blame] | 32 | |
| 33 | # Set to true on devices that support multizone. Only indicates that the |
| 34 | # device supports multizone. The command line flag --enable-multizone must |
| 35 | # still be used to enable multizone. |
| 36 | supports_multizone = is_cast_audio_only && !is_cast_desktop_build |
Bryan Henry | 35001f81 | 2017-06-13 08:17:07 | [diff] [blame] | 37 | |
Ken MacKay | 67b3d04 | 2019-10-03 17:35:43 | [diff] [blame] | 38 | # Set to true if there is a full mixer implementation; if not, we create a |
| 39 | # shim mixer service receiver that pushes audio to the CMA backend. |
| 40 | have_full_mixer = is_cast_audio_only |
| 41 | |
Ken MacKay | 1ccace78 | 2019-11-21 04:25:23 | [diff] [blame] | 42 | # If true, the mixer will be instantiated inside cast_shell. When false, the |
| 43 | # mixer is expected to be running in another process. |
| 44 | mixer_in_cast_shell = true |
| 45 | |
Ken MacKay | 955c4a0 | 2019-03-07 23:17:55 | [diff] [blame] | 46 | # Set to true on devices where the VolumeControl implementation is in the |
| 47 | # libcast_avsettings_1.0.so instead of in libcast_media_1.0.so. |
| 48 | cast_volume_control_in_avsettings = false |
| 49 | |
Yves Arrouye | c4785f3 | 2017-07-12 02:48:07 | [diff] [blame] | 50 | # Set to true for builds targeting ARC. |
| 51 | is_android_arc = false |
| 52 | |
Bryan Henry | 35001f81 | 2017-06-13 08:17:07 | [diff] [blame] | 53 | # Set true for builds targeting Android Things. |
| 54 | is_android_things = false |
Aidan Wolter | 247e39e | 2017-09-12 19:29:13 | [diff] [blame] | 55 | |
Melisa Carranza Z | 43ffcb0 | 2018-08-24 19:38:17 | [diff] [blame] | 56 | # Set true if the platform works as a single volume device, mapping all |
| 57 | # volume streams to a single one. |
| 58 | is_single_volume = false |
| 59 | |
Aidan Wolter | 63fb79e | 2017-11-11 00:56:57 | [diff] [blame] | 60 | # Set to true to keep Android activities alive when they are moved to the |
| 61 | # background. |
| 62 | enable_background_activities = false |
Steve Fung | db75c69 | 2017-11-21 03:43:05 | [diff] [blame] | 63 | |
Zhiheng Vincent Li | 7b37d58 | 2018-01-24 03:44:54 | [diff] [blame] | 64 | # Set to true to use CastWebContentsFragment instead of CastWebContentsActivity |
| 65 | # to run cast receiver app. |
| 66 | # TODO(thoren) merge this flag with display_web_contents_in_service |
| 67 | enable_cast_fragment = false |
| 68 | |
Steve Fung | db75c69 | 2017-11-21 03:43:05 | [diff] [blame] | 69 | # Set the number of lines for LogcatExtractor to send. |
| 70 | logcat_extractor_size = 512 |
Sandeep Vijayasekar | 4ddbad7 | 2018-01-25 02:20:11 | [diff] [blame] | 71 | |
| 72 | if (is_android) { |
| 73 | # Set to true to get logcat from a remote service |
| 74 | # If false, will only get the logs of the app. |
| 75 | use_remote_service_logcat = false |
| 76 | |
| 77 | # Set the package name and class path for the component which will provide device logs |
| 78 | # Values defined in eureka-internal |
| 79 | # These values are unused if use_remote_service_logcat is false |
Chunlei Niu | 5f161562 | 2019-10-31 23:40:37 | [diff] [blame] | 80 | # device_logs_provider_package is a CSV, and the first resolved one would be used. |
Sandeep Vijayasekar | 4ddbad7 | 2018-01-25 02:20:11 | [diff] [blame] | 81 | device_logs_provider_package = "" |
| 82 | device_logs_provider_class = "" |
| 83 | } |
Mina Almasry | dc22e80e | 2018-03-07 19:25:37 | [diff] [blame] | 84 | |
| 85 | # Set to true to enable a CMA media backend that allows mixed audio to be |
| 86 | # output with sync'd video. |
| 87 | enable_video_with_mixed_audio = false |
Sunil Kumar | 1b9bda4 | 2018-07-09 23:22:42 | [diff] [blame] | 88 | |
| 89 | # unified flag to pick monotonic_clock OR monotonic_clock_raw |
| 90 | media_clock_monotonic_raw = !is_android && !is_cast_desktop_build |
Luke Halliwell | a6b72474 | 2018-08-14 23:11:22 | [diff] [blame] | 91 | |
| 92 | # Include 'Android' in user agent string to avoid being served desktop |
| 93 | # versions of websites. |
| 94 | # TODO(halliwell): consider making this default for all Cast hardware. |
| 95 | use_android_user_agent = false |
ziyangch | de3eb182 | 2018-09-17 21:01:28 | [diff] [blame] | 96 | |
| 97 | # Contain default command line switches we want to set. |
| 98 | # The syntax: "test-flag-> |
| 99 | # This arg can be overridden but not supports += operator. |
| 100 | # TODO(ziyangch): make the parsing logic have ability to quote/escape characters. |
| 101 | default_command_line_flags = "" |
ziyangch | 42ac1df | 2018-09-24 23:41:05 | [diff] [blame] | 102 | |
| 103 | # Set to true to disable secure flac/opus support in EME, when using |
| 104 | # cast CMA media backend and supporting Widevine or Playready. |
| 105 | disable_secure_flac_and_opus_decoding = false |
Shawn Gallea | 909fe15 | 2018-11-06 22:26:45 | [diff] [blame] | 106 | |
Ken MacKay | 79b4157 | 2018-12-06 19:31:25 | [diff] [blame] | 107 | # Set to true to enable mixing in CastAudioManager. Only needed on devices |
| 108 | # that do not have a mixer in the CMA backend. |
| 109 | enable_cast_audio_manager_mixer = |
| 110 | chromecast_branding == "google" && !is_cast_audio_only && !is_android |
Kehuang Li | a315b599 | 2019-01-17 03:22:13 | [diff] [blame] | 111 | |
| 112 | # Set to true to enable video capture service for video input and output. |
| 113 | enable_video_capture_service = false |
Ken MacKay | 14362b2 | 2019-03-04 20:58:07 | [diff] [blame] | 114 | |
| 115 | # Set to true to enable external Mojo services to communicate with services |
Jiaqi Han | 4594f8a | 2019-05-06 18:12:20 | [diff] [blame] | 116 | # within cast_shell. |
| 117 | enable_external_mojo_services = is_linux |
Kehuang Li | 26194dae | 2019-04-15 17:29:48 | [diff] [blame] | 118 | |
Chris Letnick | abed0c3 | 2020-05-20 20:12:19 | [diff] [blame^] | 119 | # Support Perfetto tracing of processes that depend on entry points in |
| 120 | # //chromecast/external_mojo/external_service_support |
| 121 | enable_external_mojo_tracing = false |
| 122 | |
Kehuang Li | 26194dae | 2019-04-15 17:29:48 | [diff] [blame] | 123 | # Recording happens at this sample rate. Must be 16000, 48000 or 96000 Hz. |
| 124 | audio_input_sample_rate = 16000 |
Kehuang Li | a7d2433 | 2019-07-09 23:10:17 | [diff] [blame] | 125 | |
| 126 | # Whether use unix sockets in Cast input/output stream. |
| 127 | use_unix_sockets = is_linux |
ziyangch | 728f643 | 2019-07-12 16:35:08 | [diff] [blame] | 128 | |
| 129 | # Set to true to enable audio capture service for audio input. |
| 130 | enable_audio_capture_service = false |
Ken MacKay | 1ccace78 | 2019-11-21 04:25:23 | [diff] [blame] | 131 | |
| 132 | # Extra rpath to use for standalone services. |
| 133 | iot_service_rpath = "" |
slan | c7957aae | 2016-05-09 22:25:59 | [diff] [blame] | 134 | } |
| 135 | |
sanfin | 459cccff | 2016-05-12 22:26:44 | [diff] [blame] | 136 | declare_args() { |
Chris Kuiper | 23393ec | 2017-09-23 01:36:29 | [diff] [blame] | 137 | enable_volume_tables_access = |
| 138 | is_android_things && chromecast_branding != "public" |
Aidan Wolter | d6c2415 | 2018-04-09 18:14:17 | [diff] [blame] | 139 | is_android_things_non_public = |
| 140 | is_android_things && chromecast_branding != "public" |
Nat Jeffries | 8db5596 | 2017-07-21 23:41:22 | [diff] [blame] | 141 | } |
| 142 | |
| 143 | declare_args() { |
sanfin | 459cccff | 2016-05-12 22:26:44 | [diff] [blame] | 144 | # Use Playready CDMs for internal non-desktop builds. |
Stephen Lanham | ebbe2bf6 | 2018-10-16 22:27:42 | [diff] [blame] | 145 | enable_playready = !is_cast_desktop_build && chromecast_branding != "public" |
sanfin | 459cccff | 2016-05-12 22:26:44 | [diff] [blame] | 146 | } |
| 147 | |
slan | c7957aae | 2016-05-09 22:25:59 | [diff] [blame] | 148 | # This is the release version, which takes the form <major>.<minor>. Internal |
| 149 | # builds will read the value from an internal file containing this value as a |
| 150 | # string. Public builds, lacking this file, will set a dummy value. |
| 151 | if (chromecast_branding == "public") { |
| 152 | cast_build_release = "eng." + getenv("USER") |
| 153 | } else { |
| 154 | cast_build_release = |
| 155 | read_file("//chromecast/internal/build/cast_build_release", "trim string") |
prashantv | 4025129 | 2015-04-21 21:54:22 | [diff] [blame] | 156 | } |
Stephen Lanham | 3c2131cd | 2017-04-28 01:13:41 | [diff] [blame] | 157 | |
| 158 | # All locales supported by Cast builds. This provides a single point of |
| 159 | # reference for all GN files referencing a locales list. |locales| is declared |
| 160 | # in //build/config/locales.gni. |
| 161 | cast_locales = locales |
Stephen Lanham | bd37862 | 2017-07-20 14:29:39 | [diff] [blame] | 162 | |
Trevor Perrier | 50302f8 | 2019-12-10 22:11:10 | [diff] [blame] | 163 | # Android currently supports more locales than Desktop and ChromeOS. |
| 164 | # If Cast will also the android files update this and the Cast grd files. |
| 165 | if (is_android) { |
| 166 | # Subtract out additional Android locales |
Trevor Perrier | 9ef6cba | 2020-02-08 02:37:10 | [diff] [blame] | 167 | cast_locales -= android_bundle_only_locales |
Trevor Perrier | 50302f8 | 2019-12-10 22:11:10 | [diff] [blame] | 168 | } |
| 169 | |
Gaofeng Huang | f2deea7 | 2019-12-20 19:07:00 | [diff] [blame] | 170 | declare_args() { |
| 171 | enable_chromecast_extensions = enable_extensions |
| 172 | } |
Albert Chaulk | 3ae73b1 | 2018-01-17 18:34:34 | [diff] [blame] | 173 | |
Melisa Carranza Z | d7998c0 | 2018-08-03 20:25:58 | [diff] [blame] | 174 | # Use Chromecast CDMs for protected content. Some Android platforms use |
| 175 | # MediaDrm for CDM support. |
| 176 | declare_args() { |
Simeon Anfinrud | 08677dd | 2019-06-30 23:30:47 | [diff] [blame] | 177 | use_chromecast_cdms = true |
Melisa Carranza Z | d7998c0 | 2018-08-03 20:25:58 | [diff] [blame] | 178 | } |
| 179 | |
Stephen Lanham | 4ad698a8 | 2017-07-25 21:24:51 | [diff] [blame] | 180 | foreach(target_type, |
| 181 | [ |
| 182 | "executable", |
| 183 | "shared_library", |
| 184 | "loadable_module", |
Bailey Forrest | 635cecc | 2017-11-01 01:09:40 | [diff] [blame] | 185 | "source_set", |
Stephen Lanham | 4ad698a8 | 2017-07-25 21:24:51 | [diff] [blame] | 186 | ]) { |
| 187 | template("cast_${target_type}") { |
| 188 | target(target_type, target_name) { |
| 189 | forward_variables_from(invoker, "*") |
Bailey Forrest | 635cecc | 2017-11-01 01:09:40 | [diff] [blame] | 190 | |
| 191 | configs += [ "//chromecast:cast_config" ] |
Stephen Lanham | bd37862 | 2017-07-20 14:29:39 | [diff] [blame] | 192 | } |
Stephen Lanham | bd37862 | 2017-07-20 14:29:39 | [diff] [blame] | 193 | } |
| 194 | } |
| 195 | |
Stephen Lanham | 4ad698a8 | 2017-07-25 21:24:51 | [diff] [blame] | 196 | # Set the defaults for each target. The defaults for these target wrappers |
| 197 | # should match their unwrapped counterparts in BUILDCONFIG.gn. The variables |
| 198 | # referenced below are declared in BUILDCONFIG.gn. |
| 199 | set_defaults("cast_executable") { |
| 200 | configs = default_executable_configs |
| 201 | } |
| 202 | |
| 203 | set_defaults("cast_shared_library") { |
| 204 | configs = default_shared_library_configs |
Doug Horn | 37635f0 | 2017-07-28 03:12:58 | [diff] [blame] | 205 | if (is_android) { |
| 206 | configs -= [ "//build/config/android:hide_all_but_jni_onload" ] |
| 207 | } |
Stephen Lanham | 4ad698a8 | 2017-07-25 21:24:51 | [diff] [blame] | 208 | } |
| 209 | |
| 210 | set_defaults("cast_loadable_module") { |
| 211 | configs = default_shared_library_configs |
| 212 | if (is_android) { |
| 213 | configs -= [ "//build/config/android:hide_all_but_jni_onload" ] |
Stephen Lanham | bd37862 | 2017-07-20 14:29:39 | [diff] [blame] | 214 | } |
| 215 | } |
Bailey Forrest | 635cecc | 2017-11-01 01:09:40 | [diff] [blame] | 216 | |
| 217 | set_defaults("cast_source_set") { |
| 218 | configs = default_compiler_configs |
| 219 | } |