args.gni 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. # Copyright 2016 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/chromeos/ui_mode.gni")
  5. import("//build/config/ozone.gni")
  6. declare_args() {
  7. # Indicates if X11 VA-API-based hardware acceleration is to be used.
  8. # See also the comment near the |use_vaapi| arg.
  9. use_vaapi_x11 = is_linux && ozone_platform_x11 &&
  10. (target_cpu == "x86" || target_cpu == "x64") && !is_castos
  11. }
  12. declare_args() {
  13. # Indicates if V4L plugin is used.
  14. use_v4lplugin = false
  15. # Indicates if Video4Linux2 codec is used. This is used for all CrOS
  16. # platforms which have v4l2 hardware encoder / decoder.
  17. use_v4l2_codec = false
  18. # Indicates if Video4Linux2 AML encoder is used. This is used for AML
  19. # platforms which have v4l2 hardware encoder
  20. use_v4l2_codec_aml = false
  21. # Indicates if VA-API-based hardware acceleration is to be used. This
  22. # is typically the case on x86-based ChromeOS devices.
  23. # VA-API should also be compiled by default on x11-using linux devices
  24. # using x86/x64.
  25. use_vaapi = use_vaapi_x11 || (is_chromeos_lacros &&
  26. (target_cpu == "x86" || target_cpu == "x64"))
  27. # Indicates if ChromeOS protected media support exists. This is used
  28. # to enable the CDM daemon in Chrome OS as well as support for
  29. # encrypted content with HW video decoders.
  30. # TODO(jkardatzke): Enable this for Lacros always, it is determined at runtime
  31. # in that configuration.
  32. use_chromeos_protected_media = false
  33. # Indicates if the ChromeOS protected media functionality should also be
  34. # utilized by HW video decoding for ARC.
  35. use_arc_protected_media = false
  36. # Indicates if ChromeOS protected media supports the AV1 codec. By default
  37. # H.264, VP9 and HEVC are enabled if protected media is enabled; AV1 is
  38. # optional.
  39. use_chromeos_protected_av1 = false
  40. }
  41. if (use_arc_protected_media) {
  42. assert(
  43. use_chromeos_protected_media,
  44. "use_chromeos_protected_media must be set if use_arc_protected_media is")
  45. }
  46. if (use_chromeos_protected_av1) {
  47. assert(
  48. use_chromeos_protected_media,
  49. "use_chromeos_protected_media must be set if use_chromeos_protected_av1 is")
  50. }
  51. # GN requires args that depend on other args to be declared in successive
  52. # declare_args() blocks.
  53. declare_args() {
  54. # VA-API also allows decoding of images, but we don't want to use this
  55. # outside of chromeos, even if video decoding is enabled.
  56. use_vaapi_image_codecs = use_vaapi && is_chromeos_ash
  57. }