summaryrefslogtreecommitdiffstats
path: root/third_party/libwebrtc/build/config/chromecast_build.gni
blob: b309e29d96b55bbd5377aae328a815ba23ee2eac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# 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.

# The args declared in this file should be referenced by components outside of
# //chromecast. Args needed only in //chromecast should be declared in
# //chromecast/chromecast.gni.
declare_args() {
  # Set this true for a Chromecast build. Chromecast builds are supported on
  # Linux and Android.
  is_chromecast = false

  # 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

  # chromecast_branding is used to include or exclude Google-branded components.
  # Set it to "public" for a Chromium build.
  chromecast_branding = "public"

  # Set this true for an audio-only Chromecast build.
  is_cast_audio_only = false

  # If non empty, rpath of executables is set to this.
  # If empty, default value is used.
  target_rpath = ""

  # Set true to enable modular_updater.
  enable_modular_updater = false
}

# Note(slan): This arg depends on the value of is_chromecast, and thus must be
# declared in a separate block. These blocks can be combined when/if
# crbug.com/542846 is resolved.
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 overriden manually for an embedded x86 build.
  # TODO(slan): Remove instances of this when x86 is a fully supported platform.
  is_cast_desktop_build = is_chromecast && target_os == "linux" &&
                          (target_cpu == "x86" || target_cpu == "x64")

  # Mozilla added: Until upstream's build repo is updated to
  # 56e01bffd1de3e5b27e0da87f8019d44aa55a562, we'll default this to false
  # to keep the build happy.
  is_castos = false
}

declare_args() {
  # True to enable the cast renderer.  It is enabled by default for linux and
  # android audio only builds.
  enable_cast_renderer = is_chromecast && (is_linux || is_chromeos ||
                                           (is_cast_audio_only && is_android))
}

declare_args() {
  # True to enable the cast audio renderer.
  enable_cast_audio_renderer = false
}

# Configures media options for cast.  See media/media_options.gni
cast_mojo_media_services = []
cast_mojo_media_host = ""

if (enable_cast_audio_renderer) {
  if (is_android) {
    cast_mojo_media_services = [
      "cdm",
      "audio_decoder",
    ]
  }

  if (!is_cast_audio_only) {
    cast_mojo_media_services += [ "video_decoder" ]
  }

  if (is_android && is_cast_audio_only) {
    cast_mojo_media_host = "browser"
  } else {
    cast_mojo_media_host = "gpu"
  }
} else if (enable_cast_renderer) {
  # In this path, mojo media services are hosted in two processes:
  # 1. "renderer" and "cdm" run in browser process. This is hard coded in the
  # code.
  # 2. "video_decoder" runs in the process specified by "cast_mojo_media_host".
  cast_mojo_media_services = [
    "cdm",
    "renderer",
  ]
  if (!is_cast_audio_only) {
    cast_mojo_media_services += [ "video_decoder" ]
  }

  cast_mojo_media_host = "gpu"
} else if (is_android) {
  # On Android, all the enabled mojo media services run in the process specified
  # by "cast_mojo_media_host".
  cast_mojo_media_services = [
    "cdm",
    "audio_decoder",
  ]
  if (!is_cast_audio_only) {
    # These are Cast/Android devices with Video capabilities (and GPU)
    cast_mojo_media_services += [ "video_decoder" ]
    cast_mojo_media_host = "gpu"
  } else {
    # These are Cast/Android devices with only Audio capabilities (no GPU)
    cast_mojo_media_host = "browser"
  }
}

# Assert that Chromecast is being built for a supported platform.
assert(is_linux || is_chromeos || is_android || is_fuchsia || !is_chromecast,
       "Chromecast builds are not supported on $target_os")

# Assert that is_cast_audio_only and is_cast_desktop_build are both false on a
# non-Chromecast build.
assert(is_chromecast || (!is_cast_audio_only && !is_cast_desktop_build))