[go: nahoru, domu]

blob: f04c598940b5a1a938b07e88790d7771292bce2a [file] [log] [blame]
Avi Drissmand878a5012022-09-12 19:13:301# Copyright 2015 The Chromium Authors
prashantv40251292015-04-21 21:54:222# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
mark a. foltze185ab2fa2023-11-06 21:21:205import("//build/config/cast.gni")
Stephen Lanham3c2131cd2017-04-28 01:13:416import("//build/config/locales.gni")
Ryan Keane166a1202022-04-01 03:52:267import("//components/cast_streaming/features.gni")
Melisa Carranza Zd7998c02018-08-03 20:25:588import("//media/media_options.gni")
slan93f59d1d2015-11-13 17:46:499
Ryan Keaneaf3ac0f2022-05-02 18:40:0810# These args blocks should contain arguments used within the //chromecast
slan77bdc2e62015-09-21 17:56:2611# directory. Arguments which are used in other Chrome components should
mark a. foltze185ab2fa2023-11-06 21:21:2012# be instead declared in //build/config/cast.gni.
prashantv40251292015-04-21 21:54:2213declare_args() {
Ryan Keaneaf3ac0f2022-05-02 18:40:0814 # 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. foltze0e50052022-08-02 22:28:2821
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 Keaneaf3ac0f2022-05-02 18:40:0825}
26
27declare_args() {
Ryan Keane0df88cb2022-03-29 01:14:5828 # 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
slanc7957aae2016-05-09 22:25:5933 # 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"
bshaya1ba19b62016-08-04 18:50:4238
kmackay3801f1a2017-03-15 01:24:3239 # Set true to enable assistant features.
40 enable_assistant = false
jameswesta0889df2017-06-06 02:53:4641
Ken MacKay67b3d042019-10-03 17:35:4342 # 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 MacKay1ccace782019-11-21 04:25:2346 # 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 MacKay955c4a02019-03-07 23:17:5550 # 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 Arrouyec4785f32017-07-12 02:48:0754 # Set to true for builds targeting ARC.
55 is_android_arc = false
56
Sandeep Vijayasekar4ddbad72018-01-25 02:20:1157 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 Vijayasekar4ddbad72018-01-25 02:20:1161 }
Mina Almasrydc22e80e2018-03-07 19:25:3762
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 Kumar1b9bda42018-07-09 23:22:4266
67 # unified flag to pick monotonic_clock OR monotonic_clock_raw
68 media_clock_monotonic_raw = !is_android && !is_cast_desktop_build
Luke Halliwella6b724742018-08-14 23:11:2269
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
ziyangchde3eb1822018-09-17 21:01:2874
75 # Contain default command line switches we want to set.
Simeon Anfinrude8b5c51582021-04-03 00:13:1376 # This will get joined into a comma-separated list that looks like:
77 # "test-flag->
ziyangchde3eb1822018-09-17 21:01:2878 # TODO(ziyangch): make the parsing logic have ability to quote/escape characters.
Simeon Anfinrude8b5c51582021-04-03 00:13:1379 default_command_line_flags = []
ziyangch42ac1df2018-09-24 23:41:0580
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 Gallea909fe152018-11-06 22:26:4584
Ken MacKay79b41572018-12-06 19:31:2585 # 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 Lia315b5992019-01-17 03:22:1389
90 # Set to true to enable video capture service for video input and output.
91 enable_video_capture_service = false
Ken MacKay14362b22019-03-04 20:58:0792
93 # Set to true to enable external Mojo services to communicate with services
Jiaqi Han4594f8a2019-05-06 18:12:2094 # within cast_shell.
Sean Toppingce4bebfc2022-06-09 22:37:3295 enable_external_mojo_services = is_linux || is_chromeos || is_android
Kehuang Li26194dae2019-04-15 17:29:4896
Shiv Sakhujacf502bcf2022-03-08 20:22:3697 # Support using system perfetto tracing
98 enable_perfetto_tracing = false
Chris Letnickabed0c32020-05-20 20:12:1999
Shiv Sakhuja083030772022-02-14 22:05:32100 # Support using system perfetto tracing
101 enable_perfetto_tracing = false
102
Kehuang Li26194dae2019-04-15 17:29:48103 # Recording happens at this sample rate. Must be 16000, 48000 or 96000 Hz.
104 audio_input_sample_rate = 16000
Kehuang Lia7d24332019-07-09 23:10:17105
106 # Whether use unix sockets in Cast input/output stream.
Junbo Kee42a8392021-10-14 16:46:26107 use_unix_sockets = is_linux || is_chromeos || is_android
ziyangch728f6432019-07-12 16:35:08108
109 # Set to true to enable audio capture service for audio input.
110 enable_audio_capture_service = false
Ken MacKay1ccace782019-11-21 04:25:23111
112 # Extra rpath to use for standalone services.
113 iot_service_rpath = ""
Shawn Galleae43a5402020-05-22 00:54:25114
115 # Set to true to enable media overlay for volume bar, etc.
116 enable_media_overlay = false
Joshua LeVasseurbb8b8d972020-06-19 23:40:33117
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 Keane67064cf2020-09-23 02:17:26121
122 # True to use the Chromium runtime for cast rendering.
123 enable_chromium_runtime_cast_renderer = false
Ryan Keane75327a922021-05-05 20:15:41124
Ryan Keane16eec722022-01-26 20:31:57125 # 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 Deng10f5e62a2021-08-06 00:13:44129 # device specific string to append to User string.
130 device_user_agent_suffix = ""
Thoren Paulson29c85962022-07-19 19:34:09131
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 Paulsoncab7fb82022-12-14 19:17:45136
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 ]
slanc7957aae2016-05-09 22:25:59146}
147
sanfin459cccff2016-05-12 22:26:44148declare_args() {
149 # Use Playready CDMs for internal non-desktop builds.
Stephen Lanhamebbe2bf62018-10-16 22:27:42150 enable_playready = !is_cast_desktop_build && chromecast_branding != "public"
sanfin459cccff2016-05-12 22:26:44151}
152
slanc7957aae2016-05-09 22:25:59153# 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.
156if (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")
prashantv40251292015-04-21 21:54:22161}
Stephen Lanham3c2131cd2017-04-28 01:13:41162
163# All locales supported by Cast builds. This provides a single point of
Matt Stark5ed983d2021-03-18 01:55:07164# 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.
168cast_locales = locales_without_pseudolocales
Stephen Lanhambd378622017-07-20 14:29:39169
Trevor Perrier50302f82019-12-10 22:11:10170# Android currently supports more locales than Desktop and ChromeOS.
171# If Cast will also the android files update this and the Cast grd files.
172if (is_android) {
173 # Subtract out additional Android locales
Trevor Perriera2eef932022-03-08 19:03:57174 cast_locales -= extended_locales
Trevor Perrier50302f82019-12-10 22:11:10175}
Nico Weberd73c90382022-03-30 20:37:50176if (!(is_ios || is_chromeos)) {
Trevor Perrier45655e82022-03-15 21:45:29177 # Subtract out the additional desktop locales
178 cast_locales -= [
179 "af",
180 "ur",
181 ]
182}
Trevor Perrier50302f82019-12-10 22:11:10183
Melisa Carranza Zd7998c02018-08-03 20:25:58184# Use Chromecast CDMs for protected content. Some Android platforms use
185# MediaDrm for CDM support.
186declare_args() {
Simeon Anfinrud08677dd2019-06-30 23:30:47187 use_chromecast_cdms = true
Melisa Carranza Zd7998c02018-08-03 20:25:58188}
189
Stephen Lanham4ad698a82017-07-25 21:24:51190foreach(target_type,
191 [
192 "executable",
Stephen Lanham4ad698a82017-07-25 21:24:51193 "loadable_module",
Bailey Forrest635cecc2017-11-01 01:09:40194 "source_set",
Stephen Lanham4ad698a82017-07-25 21:24:51195 ]) {
196 template("cast_${target_type}") {
197 target(target_type, target_name) {
Thoren Paulson29c85962022-07-19 19:34:09198 forward_variables_from(invoker, "*", TESTONLY_AND_VISIBILITY)
199 forward_variables_from(invoker, [ "testonly" ])
Bailey Forrest635cecc2017-11-01 01:09:40200
201 configs += [ "//chromecast:cast_config" ]
Stephen Lanhambd378622017-07-20 14:29:39202 }
Stephen Lanhambd378622017-07-20 14:29:39203 }
204}
205
Thoren Paulson29c85962022-07-19 19:34:09206template("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 Lanham4ad698a82017-07-25 21:24:51220# 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.
223set_defaults("cast_executable") {
224 configs = default_executable_configs
225}
226
227set_defaults("cast_shared_library") {
228 configs = default_shared_library_configs
Doug Horn37635f02017-07-28 03:12:58229 if (is_android) {
230 configs -= [ "//build/config/android:hide_all_but_jni_onload" ]
231 }
Stephen Lanham4ad698a82017-07-25 21:24:51232}
233
234set_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 Lanhambd378622017-07-20 14:29:39238 }
239}
Bailey Forrest635cecc2017-11-01 01:09:40240
241set_defaults("cast_source_set") {
242 configs = default_compiler_configs
243}