| # 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/chrome_build.gni") |
| import("//media/media_options.gni") |
| |
| declare_args() { |
| # Enables Widevine key system support. Enabled by default in Google Chrome and |
| # on Android. |
| # Can be optionally enabled in Chromium on non-Android platforms. Please see |
| # //src/third_party/widevine/LICENSE file for details. |
| enable_widevine = is_chrome_branded || is_android |
| } |
| |
| # Widevine CDM is available as a library CDM on the following platforms and |
| # architectures. Notably on Android library CDM is not used and Widevine is |
| # supported via Android MediaDrm API. |
| # TODO(hmchen): Provide support on "arm64". |
| library_widevine_cdm_available = |
| (is_chromeos && (target_cpu == "x64" || target_cpu == "arm")) || |
| (is_desktop_linux && (target_cpu == "x86" || target_cpu == "x64")) || |
| (is_mac && target_cpu == "x64") || |
| (is_win && (target_cpu == "x86" || target_cpu == "x64")) |
| |
| # Widevine CDM is available as a library CDM and it's supported by Chromium. |
| # This does not define how the CDM will be deployed. It can be bundled or |
| # component updated. See below. |
| enable_library_widevine_cdm = |
| enable_widevine && enable_library_cdms && library_widevine_cdm_available |
| |
| # Widevine CDM can be deployed as a component. Currently only supported on Mac |
| # and Windows. The CDM can be bundled regardless whether it's a component. See |
| # below. |
| enable_widevine_cdm_component = |
| enable_library_widevine_cdm && (is_win || is_mac) |
| |
| # Widevine CDM is bundled as part of Google Chrome builds. |
| bundle_widevine_cdm = enable_library_widevine_cdm && is_chrome_branded |
| |
| enable_widevine_cdm_host_verification = |
| enable_library_widevine_cdm && enable_cdm_host_verification |
| |
| template("widevine_sign_file") { |
| # For official builds, generate a signature file for |file| which will |
| # be used by Widevine. If |signature_file| is not specified, the signature |
| # file will be in the same directory as |file|. |
| action(target_name) { |
| forward_variables_from(invoker, |
| [ |
| "file", |
| "signature_file", |
| "flags", |
| "deps", |
| ]) |
| assert(defined(file), "File to be signed must be specified.") |
| if (!defined(signature_file)) { |
| signature_file = "$file.sig" |
| } |
| if (!defined(flags)) { |
| flags = 0 |
| } |
| |
| script = "//third_party/widevine/scripts/signature_generator.py" |
| sources = [ |
| "$file", |
| ] |
| outputs = [ |
| "$signature_file", |
| ] |
| args = [ |
| "--input_file", |
| rebase_path("$file", root_build_dir), |
| "--output_file", |
| rebase_path("$signature_file", root_build_dir), |
| "--flags", |
| "$flags", |
| ] |
| } |
| } |