chromecast.gni 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257
  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. import("//build/config/chromecast_build.gni")
  5. import("//build/config/locales.gni")
  6. import("//components/cast_streaming/features.gni")
  7. import("//media/media_options.gni")
  8. # These args blocks should contain arguments used within the //chromecast
  9. # directory. Arguments which are used in other Chrome components should
  10. # be instead declared in //build/config/chromecast_build.gni.
  11. declare_args() {
  12. # True if Chromecast build is targeted for linux desktop. This type of build
  13. # is useful for testing and development, but currently supports only a subset
  14. # of Cast functionality. Though this defaults to true for x86 Linux devices,
  15. # this should be overridden manually for an embedded x86 build.
  16. is_cast_desktop_build =
  17. target_os == "linux" && (target_cpu == "x86" || target_cpu == "x64") &&
  18. enable_cast_receiver
  19. # chromecast_branding is used to include or exclude Google-branded components.
  20. # Set it to "public" for a Chromium build.
  21. chromecast_branding = "public"
  22. }
  23. declare_args() {
  24. # If true, IS_CAST_DEBUG_BUILD() will evaluate to 1 in version.h. Otherwise,
  25. # it will evaluate to 0. Overriding this when is_debug=false is useful for
  26. # doing engineering builds.
  27. cast_is_debug = is_debug
  28. # The incremental build number. The Cast automated builders will set this
  29. # value to indicate the buildset. Note: The default value should be greater
  30. # than any value the builder may assign to prevent attempted automatic updates
  31. # when the default value is used.
  32. cast_build_incremental = "999999"
  33. if (is_android) {
  34. # If true, run receiver apps in an Android service instead of an activity.
  35. display_web_contents_in_service = is_cast_audio_only
  36. }
  37. # If true, Chromecast WebUI resources are included in a build.
  38. # TODO(antz): default to false for audio-only builds, might need further
  39. # clean up (b/27119303)
  40. enable_chromecast_webui = !is_cast_audio_only && !is_android
  41. # Set true to enable assistant features.
  42. enable_assistant = false
  43. # Set to true if there is a full mixer implementation; if not, we create a
  44. # shim mixer service receiver that pushes audio to the CMA backend.
  45. have_full_mixer = is_cast_audio_only
  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. # Set to true on devices where the VolumeControl implementation is in the
  50. # libcast_avsettings_1.0.so instead of in libcast_media_1.0.so.
  51. cast_volume_control_in_avsettings = false
  52. # Set to true for builds targeting ARC.
  53. is_android_arc = false
  54. if (is_android) {
  55. # Set to true to get logcat from a remote service
  56. # If false, will only get the logs of the app.
  57. use_remote_service_logcat = false
  58. # Set the package name and class path for the component which will provide device logs
  59. # Values defined in eureka-internal
  60. # These values are unused if use_remote_service_logcat is false
  61. # device_logs_provider_package is a CSV, and the first resolved one would be used.
  62. device_logs_provider_package = ""
  63. device_logs_provider_class = ""
  64. }
  65. # Set to true to enable a CMA media backend that allows mixed audio to be
  66. # output with sync'd video.
  67. enable_video_with_mixed_audio = false
  68. # unified flag to pick monotonic_clock OR monotonic_clock_raw
  69. media_clock_monotonic_raw = !is_android && !is_cast_desktop_build
  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
  74. # Contain default command line switches we want to set.
  75. # This will get joined into a comma-separated list that looks like:
  76. # "test-flag-one=public,test-flag-two=true,test-flag-three=1,"
  77. # TODO(ziyangch): make the parsing logic have ability to quote/escape characters.
  78. default_command_line_flags = []
  79. # Set to true to disable secure flac/opus support in EME, when using
  80. # cast CMA media backend and supporting Widevine or Playready.
  81. disable_secure_flac_and_opus_decoding = false
  82. # Set to true to enable mixing in CastAudioManager. Only needed on devices
  83. # that do not have a mixer in the CMA backend.
  84. enable_cast_audio_manager_mixer =
  85. chromecast_branding == "google" && !is_cast_audio_only && !is_android
  86. # Set to true to enable video capture service for video input and output.
  87. enable_video_capture_service = false
  88. # Set to true to enable external Mojo services to communicate with services
  89. # within cast_shell.
  90. enable_external_mojo_services = is_linux || is_chromeos || is_android
  91. # Support using system perfetto tracing
  92. enable_perfetto_tracing = false
  93. # Support using system perfetto tracing
  94. enable_perfetto_tracing = false
  95. # Recording happens at this sample rate. Must be 16000, 48000 or 96000 Hz.
  96. audio_input_sample_rate = 16000
  97. # Whether use unix sockets in Cast input/output stream.
  98. use_unix_sockets = is_linux || is_chromeos || is_android
  99. # Set to true to enable audio capture service for audio input.
  100. enable_audio_capture_service = false
  101. # Extra rpath to use for standalone services.
  102. iot_service_rpath = ""
  103. # Set to true to enable media overlay for volume bar, etc.
  104. enable_media_overlay = false
  105. # Set to true to forward crashes to the system's crash handler instead of
  106. # handling them internally. This disables the built-in crash handler.
  107. use_system_crash_handler = false
  108. # True to use the Chromium runtime for cast rendering.
  109. enable_chromium_runtime_cast_renderer = false
  110. # True to link in alternate build targets for the Cast Media Runtime.
  111. enable_cast_media_runtime = false
  112. # True to use the remoting implementation of cast streaming for the cast web
  113. # runtime (as opposed to the mirroring-only implementation).
  114. enable_remoting_for_cwr = false
  115. # device specific string to append to User string.
  116. device_user_agent_suffix = ""
  117. # link vendor-supplied functionality as shared libraries. When true,
  118. # cast_shared_library targets are normal shared libraries. When false,
  119. # they become source_sets.
  120. use_vendor_shlibs = !is_android
  121. }
  122. declare_args() {
  123. # Use Playready CDMs for internal non-desktop builds.
  124. enable_playready = !is_cast_desktop_build && chromecast_branding != "public"
  125. }
  126. # This is the release version, which takes the form <major>.<minor>. Internal
  127. # builds will read the value from an internal file containing this value as a
  128. # string. Public builds, lacking this file, will set a dummy value.
  129. if (chromecast_branding == "public") {
  130. cast_build_release = "eng." + getenv("USER")
  131. } else {
  132. cast_build_release =
  133. read_file("//chromecast/internal/build/cast_build_release", "trim string")
  134. }
  135. # All locales supported by Cast builds. This provides a single point of
  136. # reference for all GN files referencing a locales list.
  137. # |locales_without_pseudolocales| is declared in //build/config/locales.gni.
  138. # See https://chromium-review.googlesource.com/488166/ for why we can't use
  139. # pseudolocales in chromecast.
  140. cast_locales = locales_without_pseudolocales
  141. # Android currently supports more locales than Desktop and ChromeOS.
  142. # If Cast will also the android files update this and the Cast grd files.
  143. if (is_android) {
  144. # Subtract out additional Android locales
  145. cast_locales -= extended_locales
  146. }
  147. if (!(is_ios || is_chromeos)) {
  148. # Subtract out the additional desktop locales
  149. cast_locales -= [
  150. "af",
  151. "ur",
  152. ]
  153. }
  154. # Use Chromecast CDMs for protected content. Some Android platforms use
  155. # MediaDrm for CDM support.
  156. declare_args() {
  157. use_chromecast_cdms = true
  158. }
  159. foreach(target_type,
  160. [
  161. "executable",
  162. "loadable_module",
  163. "source_set",
  164. ]) {
  165. template("cast_${target_type}") {
  166. target(target_type, target_name) {
  167. forward_variables_from(invoker, "*", TESTONLY_AND_VISIBILITY)
  168. forward_variables_from(invoker, [ "testonly" ])
  169. configs += [ "//chromecast:cast_config" ]
  170. }
  171. }
  172. }
  173. template("cast_shared_library") {
  174. if (use_vendor_shlibs) {
  175. target_type = "shared_library"
  176. } else {
  177. target_type = "source_set"
  178. }
  179. target(target_type, target_name) {
  180. forward_variables_from(invoker, "*", TESTONLY_AND_VISIBILITY)
  181. forward_variables_from(invoker, [ "testonly" ])
  182. configs += [ "//chromecast:cast_config" ]
  183. }
  184. }
  185. # Set the defaults for each target. The defaults for these target wrappers
  186. # should match their unwrapped counterparts in BUILDCONFIG.gn. The variables
  187. # referenced below are declared in BUILDCONFIG.gn.
  188. set_defaults("cast_executable") {
  189. configs = default_executable_configs
  190. }
  191. set_defaults("cast_shared_library") {
  192. configs = default_shared_library_configs
  193. if (is_android) {
  194. configs -= [ "//build/config/android:hide_all_but_jni_onload" ]
  195. }
  196. }
  197. set_defaults("cast_loadable_module") {
  198. configs = default_shared_library_configs
  199. if (is_android) {
  200. configs -= [ "//build/config/android:hide_all_but_jni_onload" ]
  201. }
  202. }
  203. set_defaults("cast_source_set") {
  204. configs = default_compiler_configs
  205. }
  206. assert(
  207. !enable_cast_media_runtime || cast_streaming_enable_remoting,
  208. "In order to support playback control (specifically starting playback), the cast remoting functionality is used, so this flag must be enabled. To control this feature for the cast_core code, instead use the enable_remoting_for_cwr flag.")