# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//build/config/chromecast_build.gni")
import("//build/config/locales.gni")
import("//components/cast_streaming/features.gni")
import("//extensions/buildflags/buildflags.gni")
import("//media/media_options.gni")

# These args blocks should contain arguments used within the //chromecast
# directory. Arguments which are used in other Chrome components should
# be instead declared in //build/config/chromecast_build.gni.
declare_args() {
  # True if Chromecast build is targeted for linux desktop. This type of build
  # is useful for testing and development, but currently supports only a subset
  # of Cast functionality. Though this defaults to true for x86 Linux devices,
  # this should be overridden manually for an embedded x86 build.
  is_cast_desktop_build =
      target_os == "linux" && (target_cpu == "x86" || target_cpu == "x64") &&
      enable_cast_receiver
}

declare_args() {
  # If true, IS_CAST_DEBUG_BUILD() will evaluate to 1 in version.h. Otherwise,
  # it will evaluate to 0. Overriding this when is_debug=false is useful for
  # doing engineering builds.
  cast_is_debug = is_debug

  # The incremental build number. The Cast automated builders will set this
  # value to indicate the buildset. Note: The default value should be greater
  # than any value the builder may assign to prevent attempted automatic updates
  # when the default value is used.
  cast_build_incremental = "999999"

  if (is_android) {
    # If true, run receiver apps in an Android service instead of an activity.
    display_web_contents_in_service = is_cast_audio_only
  }

  # If true, Chromecast WebUI resources are included in a build.
  # TODO(antz): default to false for audio-only builds, might need further
  # clean up (b/27119303)
  enable_chromecast_webui = !is_cast_audio_only && !is_android

  # Set true to enable assistant features.
  enable_assistant = false

  # Set to true if there is a full mixer implementation; if not, we create a
  # shim mixer service receiver that pushes audio to the CMA backend.
  have_full_mixer = is_cast_audio_only

  # If true, the mixer will be instantiated inside cast_shell. When false, the
  # mixer is expected to be running in another process.
  mixer_in_cast_shell = true

  # Set to true on devices where the VolumeControl implementation is in the
  # libcast_avsettings_1.0.so instead of in libcast_media_1.0.so.
  cast_volume_control_in_avsettings = false

  # Set to true for builds targeting ARC.
  is_android_arc = false

  # Set true if the platform works as a single volume device, mapping all
  # volume streams to a single one.
  is_single_volume = false

  if (is_android) {
    # Set to true to get logcat from a remote service
    # If false, will only get the logs of the app.
    use_remote_service_logcat = false

    # Set the package name and class path for the component which will provide device logs
    # Values defined in eureka-internal
    # These values are unused if use_remote_service_logcat is false
    # device_logs_provider_package is a CSV, and the first resolved one would be used.
    device_logs_provider_package = ""
    device_logs_provider_class = ""
  }

  # Set to true to enable a CMA media backend that allows mixed audio to be
  # output with sync'd video.
  enable_video_with_mixed_audio = false

  # unified flag to pick monotonic_clock OR monotonic_clock_raw
  media_clock_monotonic_raw = !is_android && !is_cast_desktop_build

  # Include 'Android' in user agent string to avoid being served desktop
  # versions of websites.
  # TODO(halliwell): consider making this default for all Cast hardware.
  use_android_user_agent = false

  # Contain default command line switches we want to set.
  # This will get joined into a comma-separated list that looks like:
  #   "test-flag-one=public,test-flag-two=true,test-flag-three=1,"
  # TODO(ziyangch): make the parsing logic have ability to quote/escape characters.
  default_command_line_flags = []

  # Set to true to disable secure flac/opus support in EME, when using
  # cast CMA media backend and supporting Widevine or Playready.
  disable_secure_flac_and_opus_decoding = false

  # Set to true to enable mixing in CastAudioManager. Only needed on devices
  # that do not have a mixer in the CMA backend.
  enable_cast_audio_manager_mixer =
      chromecast_branding == "google" && !is_cast_audio_only && !is_android

  # Set to true to enable video capture service for video input and output.
  enable_video_capture_service = false

  # Set to true to enable external Mojo services to communicate with services
  # within cast_shell.
  enable_external_mojo_services = is_linux || is_chromeos

  # Support using system perfetto tracing
  enable_perfetto_tracing = false

  # Support using system perfetto tracing
  enable_perfetto_tracing = false

  # Recording happens at this sample rate. Must be 16000, 48000 or 96000 Hz.
  audio_input_sample_rate = 16000

  # Whether use unix sockets in Cast input/output stream.
  use_unix_sockets = is_linux || is_chromeos || is_android

  # Set to true to enable audio capture service for audio input.
  enable_audio_capture_service = false

  # Extra rpath to use for standalone services.
  iot_service_rpath = ""

  # Set to true to enable media overlay for volume bar, etc.
  enable_media_overlay = false

  # Set to true to forward crashes to the system's crash handler instead of
  # handling them internally.  This disables the built-in crash handler.
  use_system_crash_handler = false

  # True to use the Chromium runtime for cast rendering.
  enable_chromium_runtime_cast_renderer = false

  # True to link in alternate build targets for the Cast Media Runtime.
  enable_cast_media_runtime = false

  # True to use the remoting implementation of cast streaming for the cast web
  # runtime (as opposed to the mirroring-only implementation).
  enable_remoting_for_cwr = false

  # device specific string to append to User string.
  device_user_agent_suffix = ""
}

declare_args() {
  # Use Playready CDMs for internal non-desktop builds.
  enable_playready = !is_cast_desktop_build && chromecast_branding != "public"
}

# This is the release version, which takes the form <major>.<minor>. Internal
# builds will read the value from an internal file containing this value as a
# string. Public builds, lacking this file, will set a dummy value.
if (chromecast_branding == "public") {
  cast_build_release = "eng." + getenv("USER")
} else {
  cast_build_release =
      read_file("//chromecast/internal/build/cast_build_release", "trim string")
}

# All locales supported by Cast builds. This provides a single point of
# reference for all GN files referencing a locales list.
# |locales_without_pseudolocales| is declared in //build/config/locales.gni.
# See https://chromium-review.googlesource.com/488166/ for why we can't use
# pseudolocales in chromecast.
cast_locales = locales_without_pseudolocales

# Android currently supports more locales than Desktop and ChromeOS.
# If Cast will also the android files update this and the Cast grd files.
if (is_android) {
  # Subtract out additional Android locales
  cast_locales -= extended_locales
}
if (!(is_ios || is_chromeos)) {
  # Subtract out the additional desktop locales
  cast_locales -= [
    "af",
    "ur",
  ]
}

declare_args() {
  enable_chromecast_extensions = enable_extensions
}

# Use Chromecast CDMs for protected content. Some Android platforms use
# MediaDrm for CDM support.
declare_args() {
  use_chromecast_cdms = true
}

foreach(target_type,
        [
          "executable",
          "shared_library",
          "loadable_module",
          "source_set",
        ]) {
  template("cast_${target_type}") {
    target(target_type, target_name) {
      forward_variables_from(invoker, "*")

      configs += [ "//chromecast:cast_config" ]
    }
  }
}

# Set the defaults for each target. The defaults for these target wrappers
# should match their unwrapped counterparts in BUILDCONFIG.gn. The variables
# referenced below are declared in BUILDCONFIG.gn.
set_defaults("cast_executable") {
  configs = default_executable_configs
}

set_defaults("cast_shared_library") {
  configs = default_shared_library_configs
  if (is_android) {
    configs -= [ "//build/config/android:hide_all_but_jni_onload" ]
  }
}

set_defaults("cast_loadable_module") {
  configs = default_shared_library_configs
  if (is_android) {
    configs -= [ "//build/config/android:hide_all_but_jni_onload" ]
  }
}

set_defaults("cast_source_set") {
  configs = default_compiler_configs
}

assert(
    !enable_cast_media_runtime || cast_streaming_enable_remoting,
    "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.")
