[go: nahoru, domu]

blob: 6f108500e6f1270c92b09c422ed5dd8c206f7265 [file] [log] [blame]
prashantv40251292015-04-21 21:54:221# 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
slan93f59d1d2015-11-13 17:46:495import("//build/config/chromecast_build.gni")
Stephen Lanham3c2131cd2017-04-28 01:13:416import("//build/config/locales.gni")
Scott Violetc8240b02018-03-08 22:03:597import("//extensions/buildflags/buildflags.gni")
Melisa Carranza Zd7998c02018-08-03 20:25:588import("//media/media_options.gni")
slan93f59d1d2015-11-13 17:46:499
slan77bdc2e62015-09-21 17:56:2610# 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.
prashantv40251292015-04-21 21:54:2213declare_args() {
slanc7957aae2016-05-09 22:25:5914 # 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"
bshaya1ba19b62016-08-04 18:50:4219
thoren9540c6d2017-05-22 20:07:0420 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
gfhuang79ceb4f2016-09-07 06:43:0325 # 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
kmackay3801f1a2017-03-15 01:24:3229
30 # Set true to enable assistant features.
31 enable_assistant = false
jameswesta0889df2017-06-06 02:53:4632
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 Henry35001f812017-06-13 08:17:0737
Ken MacKay67b3d042019-10-03 17:35:4338 # 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 MacKay1ccace782019-11-21 04:25:2342 # 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 MacKay955c4a02019-03-07 23:17:5546 # 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 Arrouyec4785f32017-07-12 02:48:0750 # Set to true for builds targeting ARC.
51 is_android_arc = false
52
Bryan Henry35001f812017-06-13 08:17:0753 # Set true for builds targeting Android Things.
54 is_android_things = false
Aidan Wolter247e39e2017-09-12 19:29:1355
Melisa Carranza Z43ffcb02018-08-24 19:38:1756 # 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 Wolter63fb79e2017-11-11 00:56:5760 # Set to true to keep Android activities alive when they are moved to the
61 # background.
62 enable_background_activities = false
Steve Fungdb75c692017-11-21 03:43:0563
Zhiheng Vincent Li7b37d582018-01-24 03:44:5464 # 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 Fungdb75c692017-11-21 03:43:0569 # Set the number of lines for LogcatExtractor to send.
70 logcat_extractor_size = 512
Sandeep Vijayasekar4ddbad72018-01-25 02:20:1171
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 Niu5f1615622019-10-31 23:40:3780 # device_logs_provider_package is a CSV, and the first resolved one would be used.
Sandeep Vijayasekar4ddbad72018-01-25 02:20:1181 device_logs_provider_package = ""
82 device_logs_provider_class = ""
83 }
Mina Almasrydc22e80e2018-03-07 19:25:3784
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 Kumar1b9bda42018-07-09 23:22:4288
89 # unified flag to pick monotonic_clock OR monotonic_clock_raw
90 media_clock_monotonic_raw = !is_android && !is_cast_desktop_build
Luke Halliwella6b724742018-08-14 23:11:2291
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
ziyangchde3eb1822018-09-17 21:01:2896
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 = ""
ziyangch42ac1df2018-09-24 23:41:05102
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 Gallea909fe152018-11-06 22:26:45106
Ken MacKay79b41572018-12-06 19:31:25107 # 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 Lia315b5992019-01-17 03:22:13111
112 # Set to true to enable video capture service for video input and output.
113 enable_video_capture_service = false
Ken MacKay14362b22019-03-04 20:58:07114
115 # Set to true to enable external Mojo services to communicate with services
Jiaqi Han4594f8a2019-05-06 18:12:20116 # within cast_shell.
117 enable_external_mojo_services = is_linux
Kehuang Li26194dae2019-04-15 17:29:48118
Chris Letnickabed0c32020-05-20 20:12:19119 # 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 Li26194dae2019-04-15 17:29:48123 # Recording happens at this sample rate. Must be 16000, 48000 or 96000 Hz.
124 audio_input_sample_rate = 16000
Kehuang Lia7d24332019-07-09 23:10:17125
126 # Whether use unix sockets in Cast input/output stream.
127 use_unix_sockets = is_linux
ziyangch728f6432019-07-12 16:35:08128
129 # Set to true to enable audio capture service for audio input.
130 enable_audio_capture_service = false
Ken MacKay1ccace782019-11-21 04:25:23131
132 # Extra rpath to use for standalone services.
133 iot_service_rpath = ""
slanc7957aae2016-05-09 22:25:59134}
135
sanfin459cccff2016-05-12 22:26:44136declare_args() {
Chris Kuiper23393ec2017-09-23 01:36:29137 enable_volume_tables_access =
138 is_android_things && chromecast_branding != "public"
Aidan Wolterd6c24152018-04-09 18:14:17139 is_android_things_non_public =
140 is_android_things && chromecast_branding != "public"
Nat Jeffries8db55962017-07-21 23:41:22141}
142
143declare_args() {
sanfin459cccff2016-05-12 22:26:44144 # Use Playready CDMs for internal non-desktop builds.
Stephen Lanhamebbe2bf62018-10-16 22:27:42145 enable_playready = !is_cast_desktop_build && chromecast_branding != "public"
sanfin459cccff2016-05-12 22:26:44146}
147
slanc7957aae2016-05-09 22:25:59148# 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.
151if (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")
prashantv40251292015-04-21 21:54:22156}
Stephen Lanham3c2131cd2017-04-28 01:13:41157
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.
161cast_locales = locales
Stephen Lanhambd378622017-07-20 14:29:39162
Trevor Perrier50302f82019-12-10 22:11:10163# Android currently supports more locales than Desktop and ChromeOS.
164# If Cast will also the android files update this and the Cast grd files.
165if (is_android) {
166 # Subtract out additional Android locales
Trevor Perrier9ef6cba2020-02-08 02:37:10167 cast_locales -= android_bundle_only_locales
Trevor Perrier50302f82019-12-10 22:11:10168}
169
Gaofeng Huangf2deea72019-12-20 19:07:00170declare_args() {
171 enable_chromecast_extensions = enable_extensions
172}
Albert Chaulk3ae73b12018-01-17 18:34:34173
Melisa Carranza Zd7998c02018-08-03 20:25:58174# Use Chromecast CDMs for protected content. Some Android platforms use
175# MediaDrm for CDM support.
176declare_args() {
Simeon Anfinrud08677dd2019-06-30 23:30:47177 use_chromecast_cdms = true
Melisa Carranza Zd7998c02018-08-03 20:25:58178}
179
Stephen Lanham4ad698a82017-07-25 21:24:51180foreach(target_type,
181 [
182 "executable",
183 "shared_library",
184 "loadable_module",
Bailey Forrest635cecc2017-11-01 01:09:40185 "source_set",
Stephen Lanham4ad698a82017-07-25 21:24:51186 ]) {
187 template("cast_${target_type}") {
188 target(target_type, target_name) {
189 forward_variables_from(invoker, "*")
Bailey Forrest635cecc2017-11-01 01:09:40190
191 configs += [ "//chromecast:cast_config" ]
Stephen Lanhambd378622017-07-20 14:29:39192 }
Stephen Lanhambd378622017-07-20 14:29:39193 }
194}
195
Stephen Lanham4ad698a82017-07-25 21:24:51196# 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.
199set_defaults("cast_executable") {
200 configs = default_executable_configs
201}
202
203set_defaults("cast_shared_library") {
204 configs = default_shared_library_configs
Doug Horn37635f02017-07-28 03:12:58205 if (is_android) {
206 configs -= [ "//build/config/android:hide_all_but_jni_onload" ]
207 }
Stephen Lanham4ad698a82017-07-25 21:24:51208}
209
210set_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 Lanhambd378622017-07-20 14:29:39214 }
215}
Bailey Forrest635cecc2017-11-01 01:09:40216
217set_defaults("cast_source_set") {
218 configs = default_compiler_configs
219}