Avi Drissman | d878a501 | 2022-09-12 19:13:30 | [diff] [blame] | 1 | # Copyright 2015 The Chromium Authors |
prashantv | 4025129 | 2015-04-21 21:54:22 | [diff] [blame] | 2 | # Use of this source code is governed by a BSD-style license that can be |
| 3 | # found in the LICENSE file. |
| 4 | |
mark a. foltz | e185ab2fa | 2023-11-06 21:21:20 | [diff] [blame] | 5 | import("//build/config/cast.gni") |
Stephen Lanham | 3c2131cd | 2017-04-28 01:13:41 | [diff] [blame] | 6 | import("//build/config/locales.gni") |
Ryan Keane | 166a120 | 2022-04-01 03:52:26 | [diff] [blame] | 7 | import("//components/cast_streaming/features.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 | |
Ryan Keane | af3ac0f | 2022-05-02 18:40:08 | [diff] [blame] | 10 | # These args blocks should contain arguments used within the //chromecast |
slan | 77bdc2e6 | 2015-09-21 17:56:26 | [diff] [blame] | 11 | # directory. Arguments which are used in other Chrome components should |
mark a. foltz | e185ab2fa | 2023-11-06 21:21:20 | [diff] [blame] | 12 | # be instead declared in //build/config/cast.gni. |
prashantv | 4025129 | 2015-04-21 21:54:22 | [diff] [blame] | 13 | declare_args() { |
Ryan Keane | af3ac0f | 2022-05-02 18:40:08 | [diff] [blame] | 14 | # True if Chromecast build is targeted for linux desktop. This type of build |
| 15 | # is useful for testing and development, but currently supports only a subset |
| 16 | # of Cast functionality. Though this defaults to true for x86 Linux devices, |
| 17 | # this should be overridden manually for an embedded x86 build. |
| 18 | is_cast_desktop_build = |
| 19 | target_os == "linux" && (target_cpu == "x86" || target_cpu == "x64") && |
| 20 | enable_cast_receiver |
mark a. foltz | e0e5005 | 2022-08-02 22:28:28 | [diff] [blame] | 21 | |
| 22 | # chromecast_branding is used to include or exclude Google-branded components. |
| 23 | # Set it to "public" for a Chromium build. |
| 24 | chromecast_branding = "public" |
Ryan Keane | af3ac0f | 2022-05-02 18:40:08 | [diff] [blame] | 25 | } |
| 26 | |
| 27 | declare_args() { |
Ryan Keane | 0df88cb | 2022-03-29 01:14:58 | [diff] [blame] | 28 | # If true, IS_CAST_DEBUG_BUILD() will evaluate to 1 in version.h. Otherwise, |
| 29 | # it will evaluate to 0. Overriding this when is_debug=false is useful for |
| 30 | # doing engineering builds. |
| 31 | cast_is_debug = is_debug |
| 32 | |
slan | c7957aae | 2016-05-09 22:25:59 | [diff] [blame] | 33 | # The incremental build number. The Cast automated builders will set this |
| 34 | # value to indicate the buildset. Note: The default value should be greater |
| 35 | # than any value the builder may assign to prevent attempted automatic updates |
| 36 | # when the default value is used. |
| 37 | cast_build_incremental = "999999" |
bshaya | 1ba19b6 | 2016-08-04 18:50:42 | [diff] [blame] | 38 | |
kmackay | 3801f1a | 2017-03-15 01:24:32 | [diff] [blame] | 39 | # Set true to enable assistant features. |
| 40 | enable_assistant = false |
jameswest | a0889df | 2017-06-06 02:53:46 | [diff] [blame] | 41 | |
Ken MacKay | 67b3d04 | 2019-10-03 17:35:43 | [diff] [blame] | 42 | # Set to true if there is a full mixer implementation; if not, we create a |
| 43 | # shim mixer service receiver that pushes audio to the CMA backend. |
| 44 | have_full_mixer = is_cast_audio_only |
| 45 | |
Ken MacKay | 1ccace78 | 2019-11-21 04:25:23 | [diff] [blame] | 46 | # If true, the mixer will be instantiated inside cast_shell. When false, the |
| 47 | # mixer is expected to be running in another process. |
| 48 | mixer_in_cast_shell = true |
| 49 | |
Ken MacKay | 955c4a0 | 2019-03-07 23:17:55 | [diff] [blame] | 50 | # Set to true on devices where the VolumeControl implementation is in the |
| 51 | # libcast_avsettings_1.0.so instead of in libcast_media_1.0.so. |
| 52 | cast_volume_control_in_avsettings = false |
| 53 | |
Yves Arrouye | c4785f3 | 2017-07-12 02:48:07 | [diff] [blame] | 54 | # Set to true for builds targeting ARC. |
| 55 | is_android_arc = false |
| 56 | |
Sandeep Vijayasekar | 4ddbad7 | 2018-01-25 02:20:11 | [diff] [blame] | 57 | if (is_android) { |
| 58 | # Set to true to get logcat from a remote service |
| 59 | # If false, will only get the logs of the app. |
| 60 | use_remote_service_logcat = false |
Sandeep Vijayasekar | 4ddbad7 | 2018-01-25 02:20:11 | [diff] [blame] | 61 | } |
Mina Almasry | dc22e80e | 2018-03-07 19:25:37 | [diff] [blame] | 62 | |
| 63 | # Set to true to enable a CMA media backend that allows mixed audio to be |
| 64 | # output with sync'd video. |
| 65 | enable_video_with_mixed_audio = false |
Sunil Kumar | 1b9bda4 | 2018-07-09 23:22:42 | [diff] [blame] | 66 | |
| 67 | # unified flag to pick monotonic_clock OR monotonic_clock_raw |
| 68 | media_clock_monotonic_raw = !is_android && !is_cast_desktop_build |
Luke Halliwell | a6b72474 | 2018-08-14 23:11:22 | [diff] [blame] | 69 | |
| 70 | # Include 'Android' in user agent string to avoid being served desktop |
| 71 | # versions of websites. |
| 72 | # TODO(halliwell): consider making this default for all Cast hardware. |
| 73 | use_android_user_agent = false |
ziyangch | de3eb182 | 2018-09-17 21:01:28 | [diff] [blame] | 74 | |
| 75 | # Contain default command line switches we want to set. |
Simeon Anfinrud | e8b5c5158 | 2021-04-03 00:13:13 | [diff] [blame] | 76 | # This will get joined into a comma-separated list that looks like: |
| 77 | # "test-flag-> |
ziyangch | de3eb182 | 2018-09-17 21:01:28 | [diff] [blame] | 78 | # TODO(ziyangch): make the parsing logic have ability to quote/escape characters. |
Simeon Anfinrud | e8b5c5158 | 2021-04-03 00:13:13 | [diff] [blame] | 79 | default_command_line_flags = [] |
ziyangch | 42ac1df | 2018-09-24 23:41:05 | [diff] [blame] | 80 | |
| 81 | # Set to true to disable secure flac/opus support in EME, when using |
| 82 | # cast CMA media backend and supporting Widevine or Playready. |
| 83 | disable_secure_flac_and_opus_decoding = false |
Shawn Gallea | 909fe15 | 2018-11-06 22:26:45 | [diff] [blame] | 84 | |
Ken MacKay | 79b4157 | 2018-12-06 19:31:25 | [diff] [blame] | 85 | # Set to true to enable mixing in CastAudioManager. Only needed on devices |
| 86 | # that do not have a mixer in the CMA backend. |
| 87 | enable_cast_audio_manager_mixer = |
| 88 | chromecast_branding == "google" && !is_cast_audio_only && !is_android |
Kehuang Li | a315b599 | 2019-01-17 03:22:13 | [diff] [blame] | 89 | |
| 90 | # Set to true to enable video capture service for video input and output. |
| 91 | enable_video_capture_service = false |
Ken MacKay | 14362b2 | 2019-03-04 20:58:07 | [diff] [blame] | 92 | |
| 93 | # Set to true to enable external Mojo services to communicate with services |
Jiaqi Han | 4594f8a | 2019-05-06 18:12:20 | [diff] [blame] | 94 | # within cast_shell. |
Sean Topping | ce4bebfc | 2022-06-09 22:37:32 | [diff] [blame] | 95 | enable_external_mojo_services = is_linux || is_chromeos || is_android |
Kehuang Li | 26194dae | 2019-04-15 17:29:48 | [diff] [blame] | 96 | |
Shiv Sakhuja | cf502bcf | 2022-03-08 20:22:36 | [diff] [blame] | 97 | # Support using system perfetto tracing |
| 98 | enable_perfetto_tracing = false |
Chris Letnick | abed0c3 | 2020-05-20 20:12:19 | [diff] [blame] | 99 | |
Shiv Sakhuja | 08303077 | 2022-02-14 22:05:32 | [diff] [blame] | 100 | # Support using system perfetto tracing |
| 101 | enable_perfetto_tracing = false |
| 102 | |
Kehuang Li | 26194dae | 2019-04-15 17:29:48 | [diff] [blame] | 103 | # Recording happens at this sample rate. Must be 16000, 48000 or 96000 Hz. |
| 104 | audio_input_sample_rate = 16000 |
Kehuang Li | a7d2433 | 2019-07-09 23:10:17 | [diff] [blame] | 105 | |
| 106 | # Whether use unix sockets in Cast input/output stream. |
Junbo Ke | e42a839 | 2021-10-14 16:46:26 | [diff] [blame] | 107 | use_unix_sockets = is_linux || is_chromeos || is_android |
ziyangch | 728f643 | 2019-07-12 16:35:08 | [diff] [blame] | 108 | |
| 109 | # Set to true to enable audio capture service for audio input. |
| 110 | enable_audio_capture_service = false |
Ken MacKay | 1ccace78 | 2019-11-21 04:25:23 | [diff] [blame] | 111 | |
| 112 | # Extra rpath to use for standalone services. |
| 113 | iot_service_rpath = "" |
Shawn Gallea | e43a540 | 2020-05-22 00:54:25 | [diff] [blame] | 114 | |
| 115 | # Set to true to enable media overlay for volume bar, etc. |
| 116 | enable_media_overlay = false |
Joshua LeVasseur | bb8b8d97 | 2020-06-19 23:40:33 | [diff] [blame] | 117 | |
| 118 | # Set to true to forward crashes to the system's crash handler instead of |
| 119 | # handling them internally. This disables the built-in crash handler. |
| 120 | use_system_crash_handler = false |
Ryan Keane | 67064cf | 2020-09-23 02:17:26 | [diff] [blame] | 121 | |
| 122 | # True to use the Chromium runtime for cast rendering. |
| 123 | enable_chromium_runtime_cast_renderer = false |
Ryan Keane | 75327a92 | 2021-05-05 20:15:41 | [diff] [blame] | 124 | |
Ryan Keane | 16eec72 | 2022-01-26 20:31:57 | [diff] [blame] | 125 | # True to use the remoting implementation of cast streaming for the cast web |
| 126 | # runtime (as opposed to the mirroring-only implementation). |
| 127 | enable_remoting_for_cwr = false |
| 128 | |
Guohui Deng | 10f5e62a | 2021-08-06 00:13:44 | [diff] [blame] | 129 | # device specific string to append to User string. |
| 130 | device_user_agent_suffix = "" |
Thoren Paulson | 29c8596 | 2022-07-19 19:34:09 | [diff] [blame] | 131 | |
| 132 | # link vendor-supplied functionality as shared libraries. When true, |
| 133 | # cast_shared_library targets are normal shared libraries. When false, |
| 134 | # they become source_sets. |
| 135 | use_vendor_shlibs = !is_android |
Thoren Paulson | cab7fb8 | 2022-12-14 19:17:45 | [diff] [blame] | 136 | |
| 137 | # build APKs/bundles for the listed device types. Each APK has different |
| 138 | # features enabled in its manifest to ensure it is only distributed to select |
| 139 | # devices. |
| 140 | android_device_types = [ |
| 141 | "generic", |
| 142 | "atv", |
| 143 | "tablet", |
| 144 | "automotive", |
| 145 | ] |
slan | c7957aae | 2016-05-09 22:25:59 | [diff] [blame] | 146 | } |
| 147 | |
sanfin | 459cccff | 2016-05-12 22:26:44 | [diff] [blame] | 148 | declare_args() { |
| 149 | # Use Playready CDMs for internal non-desktop builds. |
Stephen Lanham | ebbe2bf6 | 2018-10-16 22:27:42 | [diff] [blame] | 150 | enable_playready = !is_cast_desktop_build && chromecast_branding != "public" |
sanfin | 459cccff | 2016-05-12 22:26:44 | [diff] [blame] | 151 | } |
| 152 | |
slan | c7957aae | 2016-05-09 22:25:59 | [diff] [blame] | 153 | # This is the release version, which takes the form <major>.<minor>. Internal |
| 154 | # builds will read the value from an internal file containing this value as a |
| 155 | # string. Public builds, lacking this file, will set a dummy value. |
| 156 | if (chromecast_branding == "public") { |
| 157 | cast_build_release = "eng." + getenv("USER") |
| 158 | } else { |
| 159 | cast_build_release = |
| 160 | read_file("//chromecast/internal/build/cast_build_release", "trim string") |
prashantv | 4025129 | 2015-04-21 21:54:22 | [diff] [blame] | 161 | } |
Stephen Lanham | 3c2131cd | 2017-04-28 01:13:41 | [diff] [blame] | 162 | |
| 163 | # All locales supported by Cast builds. This provides a single point of |
Matt Stark | 5ed983d | 2021-03-18 01:55:07 | [diff] [blame] | 164 | # reference for all GN files referencing a locales list. |
| 165 | # |locales_without_pseudolocales| is declared in //build/config/locales.gni. |
| 166 | # See https://chromium-review.googlesource.com/488166/ for why we can't use |
| 167 | # pseudolocales in chromecast. |
| 168 | cast_locales = locales_without_pseudolocales |
Stephen Lanham | bd37862 | 2017-07-20 14:29:39 | [diff] [blame] | 169 | |
Trevor Perrier | 50302f8 | 2019-12-10 22:11:10 | [diff] [blame] | 170 | # Android currently supports more locales than Desktop and ChromeOS. |
| 171 | # If Cast will also the android files update this and the Cast grd files. |
| 172 | if (is_android) { |
| 173 | # Subtract out additional Android locales |
Trevor Perrier | a2eef93 | 2022-03-08 19:03:57 | [diff] [blame] | 174 | cast_locales -= extended_locales |
Trevor Perrier | 50302f8 | 2019-12-10 22:11:10 | [diff] [blame] | 175 | } |
Nico Weber | d73c9038 | 2022-03-30 20:37:50 | [diff] [blame] | 176 | if (!(is_ios || is_chromeos)) { |
Trevor Perrier | 45655e8 | 2022-03-15 21:45:29 | [diff] [blame] | 177 | # Subtract out the additional desktop locales |
| 178 | cast_locales -= [ |
| 179 | "af", |
| 180 | "ur", |
| 181 | ] |
| 182 | } |
Trevor Perrier | 50302f8 | 2019-12-10 22:11:10 | [diff] [blame] | 183 | |
Melisa Carranza Z | d7998c0 | 2018-08-03 20:25:58 | [diff] [blame] | 184 | # Use Chromecast CDMs for protected content. Some Android platforms use |
| 185 | # MediaDrm for CDM support. |
| 186 | declare_args() { |
Simeon Anfinrud | 08677dd | 2019-06-30 23:30:47 | [diff] [blame] | 187 | use_chromecast_cdms = true |
Melisa Carranza Z | d7998c0 | 2018-08-03 20:25:58 | [diff] [blame] | 188 | } |
| 189 | |
Stephen Lanham | 4ad698a8 | 2017-07-25 21:24:51 | [diff] [blame] | 190 | foreach(target_type, |
| 191 | [ |
| 192 | "executable", |
Stephen Lanham | 4ad698a8 | 2017-07-25 21:24:51 | [diff] [blame] | 193 | "loadable_module", |
Bailey Forrest | 635cecc | 2017-11-01 01:09:40 | [diff] [blame] | 194 | "source_set", |
Stephen Lanham | 4ad698a8 | 2017-07-25 21:24:51 | [diff] [blame] | 195 | ]) { |
| 196 | template("cast_${target_type}") { |
| 197 | target(target_type, target_name) { |
Thoren Paulson | 29c8596 | 2022-07-19 19:34:09 | [diff] [blame] | 198 | forward_variables_from(invoker, "*", TESTONLY_AND_VISIBILITY) |
| 199 | forward_variables_from(invoker, [ "testonly" ]) |
Bailey Forrest | 635cecc | 2017-11-01 01:09:40 | [diff] [blame] | 200 | |
| 201 | configs += [ "//chromecast:cast_config" ] |
Stephen Lanham | bd37862 | 2017-07-20 14:29:39 | [diff] [blame] | 202 | } |
Stephen Lanham | bd37862 | 2017-07-20 14:29:39 | [diff] [blame] | 203 | } |
| 204 | } |
| 205 | |
Thoren Paulson | 29c8596 | 2022-07-19 19:34:09 | [diff] [blame] | 206 | template("cast_shared_library") { |
| 207 | if (use_vendor_shlibs) { |
| 208 | target_type = "shared_library" |
| 209 | } else { |
| 210 | target_type = "source_set" |
| 211 | } |
| 212 | target(target_type, target_name) { |
| 213 | forward_variables_from(invoker, "*", TESTONLY_AND_VISIBILITY) |
| 214 | forward_variables_from(invoker, [ "testonly" ]) |
| 215 | |
| 216 | configs += [ "//chromecast:cast_config" ] |
| 217 | } |
| 218 | } |
| 219 | |
Stephen Lanham | 4ad698a8 | 2017-07-25 21:24:51 | [diff] [blame] | 220 | # Set the defaults for each target. The defaults for these target wrappers |
| 221 | # should match their unwrapped counterparts in BUILDCONFIG.gn. The variables |
| 222 | # referenced below are declared in BUILDCONFIG.gn. |
| 223 | set_defaults("cast_executable") { |
| 224 | configs = default_executable_configs |
| 225 | } |
| 226 | |
| 227 | set_defaults("cast_shared_library") { |
| 228 | configs = default_shared_library_configs |
Doug Horn | 37635f0 | 2017-07-28 03:12:58 | [diff] [blame] | 229 | if (is_android) { |
| 230 | configs -= [ "//build/config/android:hide_all_but_jni_onload" ] |
| 231 | } |
Stephen Lanham | 4ad698a8 | 2017-07-25 21:24:51 | [diff] [blame] | 232 | } |
| 233 | |
| 234 | set_defaults("cast_loadable_module") { |
| 235 | configs = default_shared_library_configs |
| 236 | if (is_android) { |
| 237 | configs -= [ "//build/config/android:hide_all_but_jni_onload" ] |
Stephen Lanham | bd37862 | 2017-07-20 14:29:39 | [diff] [blame] | 238 | } |
| 239 | } |
Bailey Forrest | 635cecc | 2017-11-01 01:09:40 | [diff] [blame] | 240 | |
| 241 | set_defaults("cast_source_set") { |
| 242 | configs = default_compiler_configs |
| 243 | } |