Commit 7b76fce3 authored by Xiaohan Wang's avatar Xiaohan Wang Committed by Commit Bot

media: Rename SHOULD_BUNDLE_WIDEVINE_CDM to BUNDLE_WIDEVINE_CDM

The word "should" here is odd to read in some context. For example, in
tests, when we "should bundle widevine CDM", we run tests that requires
the CDM. This CL simply drops the word "should" so the gn/build flag
becomes "bundle_widevine_cdm", which is more definitive.

This CL also refactors widevine.gni to better support common variations.

Bug: 349182,843649
Test: No functionality change. Rename only.
Change-Id: Iaa8c6c29a33409bb1b31be86cb6202ff3f4b7cd9
Reviewed-on: https://chromium-review.googlesource.com/1249736
Commit-Queue: Xiaohan Wang <xhwang@chromium.org>
Reviewed-by: default avatarLei Zhang <thestig@chromium.org>
Reviewed-by: default avatarJohn Rummell <jrummell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#595632}
parent 0fe4b373
...@@ -1036,7 +1036,7 @@ if (is_win) { ...@@ -1036,7 +1036,7 @@ if (is_win) {
} }
} }
if (should_bundle_widevine_cdm) { if (bundle_widevine_cdm) {
bundle_data("widevine_cdm_library_binaries") { bundle_data("widevine_cdm_library_binaries") {
sources = [ sources = [
"$root_out_dir/$widevine_cdm_path/libwidevinecdm.dylib", "$root_out_dir/$widevine_cdm_path/libwidevinecdm.dylib",
...@@ -1067,7 +1067,7 @@ if (is_win) { ...@@ -1067,7 +1067,7 @@ if (is_win) {
} }
group("widevine_cdm_library") { group("widevine_cdm_library") {
if (should_bundle_widevine_cdm) { if (bundle_widevine_cdm) {
deps = [ deps = [
":widevine_cdm_library_binaries", ":widevine_cdm_library_binaries",
":widevine_cdm_library_manifest", ":widevine_cdm_library_manifest",
......
...@@ -518,12 +518,12 @@ INSTANTIATE_TEST_CASE_P(SRC_ClearKey, ...@@ -518,12 +518,12 @@ INSTANTIATE_TEST_CASE_P(SRC_ClearKey,
Values(SrcType::SRC))); Values(SrcType::SRC)));
#endif // BUILDFLAG(ENABLE_LIBRARY_CDMS) #endif // BUILDFLAG(ENABLE_LIBRARY_CDMS)
#if BUILDFLAG(SHOULD_BUNDLE_WIDEVINE_CDM) #if BUILDFLAG(BUNDLE_WIDEVINE_CDM)
INSTANTIATE_TEST_CASE_P(MSE_Widevine, INSTANTIATE_TEST_CASE_P(MSE_Widevine,
EncryptedMediaTest, EncryptedMediaTest,
Combine(Values(kWidevineKeySystem), Combine(Values(kWidevineKeySystem),
Values(SrcType::MSE))); Values(SrcType::MSE)));
#endif // #if BUILDFLAG(SHOULD_BUNDLE_WIDEVINE_CDM) #endif // #if BUILDFLAG(BUNDLE_WIDEVINE_CDM)
IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_AudioClearVideo_WebM) { IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_AudioClearVideo_WebM) {
TestSimplePlayback("bear-320x240-av_enc-a.webm", kWebMVorbisAudioVp8Video); TestSimplePlayback("bear-320x240-av_enc-a.webm", kWebMVorbisAudioVp8Video);
......
...@@ -82,13 +82,13 @@ const char kTypeErrorResult[] = "TypeError"; ...@@ -82,13 +82,13 @@ const char kTypeErrorResult[] = "TypeError";
#endif // BUILDFLAG(ENABLE_LIBRARY_CDMS) #endif // BUILDFLAG(ENABLE_LIBRARY_CDMS)
// Expectations for Widevine. // Expectations for Widevine.
#if BUILDFLAG(SHOULD_BUNDLE_WIDEVINE_CDM) #if BUILDFLAG(BUNDLE_WIDEVINE_CDM)
#define EXPECT_WV_SUCCESS EXPECT_SUCCESS #define EXPECT_WV_SUCCESS EXPECT_SUCCESS
#define EXPECT_WV_PROPRIETARY EXPECT_PROPRIETARY #define EXPECT_WV_PROPRIETARY EXPECT_PROPRIETARY
#else #else
#define EXPECT_WV_SUCCESS EXPECT_UNSUPPORTED #define EXPECT_WV_SUCCESS EXPECT_UNSUPPORTED
#define EXPECT_WV_PROPRIETARY EXPECT_UNSUPPORTED #define EXPECT_WV_PROPRIETARY EXPECT_UNSUPPORTED
#endif // BUILDFLAG(SHOULD_BUNDLE_WIDEVINE_CDM) #endif // BUILDFLAG(BUNDLE_WIDEVINE_CDM)
}; // namespace }; // namespace
......
...@@ -99,7 +99,7 @@ ...@@ -99,7 +99,7 @@
// Registers Widevine CDM if Widevine is enabled, the Widevine CDM is // Registers Widevine CDM if Widevine is enabled, the Widevine CDM is
// bundled and not a component. When the Widevine CDM is a component, it is // bundled and not a component. When the Widevine CDM is a component, it is
// registered in widevine_cdm_component_installer.cc. // registered in widevine_cdm_component_installer.cc.
#if BUILDFLAG(SHOULD_BUNDLE_WIDEVINE_CDM) && !BUILDFLAG(ENABLE_WIDEVINE_CDM_COMPONENT) #if BUILDFLAG(BUNDLE_WIDEVINE_CDM) && !BUILDFLAG(ENABLE_WIDEVINE_CDM_COMPONENT)
#define REGISTER_BUNDLED_WIDEVINE_CDM #define REGISTER_BUNDLED_WIDEVINE_CDM
#include "third_party/widevine/cdm/widevine_cdm_common.h" // nogncheck #include "third_party/widevine/cdm/widevine_cdm_common.h" // nogncheck
// TODO(crbug.com/663554): Needed for WIDEVINE_CDM_VERSION_STRING. Support // TODO(crbug.com/663554): Needed for WIDEVINE_CDM_VERSION_STRING. Support
......
...@@ -12,8 +12,9 @@ import("//build/util/process_version.gni") ...@@ -12,8 +12,9 @@ import("//build/util/process_version.gni")
import("//build/util/version.gni") import("//build/util/version.gni")
import("//chrome/process_version_rc_template.gni") # For branding_file_path. import("//chrome/process_version_rc_template.gni") # For branding_file_path.
import("//components/nacl/features.gni") import("//components/nacl/features.gni")
import("//third_party/widevine/cdm/widevine.gni")
if (current_cpu == "x86" || current_cpu == "x64") { if (bundle_widevine_cdm) {
import("//media/cdm/library_cdm/cdm_paths.gni") import("//media/cdm/library_cdm/cdm_paths.gni")
} }
...@@ -48,8 +49,7 @@ if (enable_nacl) { ...@@ -48,8 +49,7 @@ if (enable_nacl) {
} }
} }
# The widevine BUILD.gn only produces shared libraries for x86 and x64 if (bundle_widevine_cdm) {
if (is_chrome_branded && (current_cpu == "x86" || current_cpu == "x64")) {
packaging_files_shlibs += packaging_files_shlibs +=
[ "$root_out_dir/$widevine_cdm_path/libwidevinecdm.so" ] [ "$root_out_dir/$widevine_cdm_path/libwidevinecdm.so" ]
} }
...@@ -364,7 +364,7 @@ group("installer_deps") { ...@@ -364,7 +364,7 @@ group("installer_deps") {
"//ppapi/native_client:irt", "//ppapi/native_client:irt",
] ]
} }
if (current_cpu == "x86" || current_cpu == "x64") { if (bundle_widevine_cdm) {
public_deps += [ "//third_party/widevine/cdm" ] public_deps += [ "//third_party/widevine/cdm" ]
} }
if (!is_chromeos) { if (!is_chromeos) {
......
...@@ -14,7 +14,7 @@ buildflag_header("buildflags") { ...@@ -14,7 +14,7 @@ buildflag_header("buildflags") {
flags = [ flags = [
"ENABLE_WIDEVINE=$enable_widevine", "ENABLE_WIDEVINE=$enable_widevine",
"SHOULD_BUNDLE_WIDEVINE_CDM=$should_bundle_widevine_cdm", "BUNDLE_WIDEVINE_CDM=$bundle_widevine_cdm",
"ENABLE_WIDEVINE_CDM_COMPONENT=$enable_widevine_cdm_component", "ENABLE_WIDEVINE_CDM_COMPONENT=$enable_widevine_cdm_component",
] ]
} }
...@@ -29,7 +29,7 @@ widevine_cdm_manifest_file = [] ...@@ -29,7 +29,7 @@ widevine_cdm_manifest_file = []
# TODO(xhwang): widevine_cdm_version.h is only used in few places. Clean this up # TODO(xhwang): widevine_cdm_version.h is only used in few places. Clean this up
# so we don't need to copy it in most cases. # so we don't need to copy it in most cases.
if (should_bundle_widevine_cdm) { if (bundle_widevine_cdm) {
if (is_chromeos) { if (is_chromeos) {
widevine_cdm_version_h_file = widevine_cdm_version_h_file =
"chromeos/$widevine_arch/widevine_cdm_version.h" "chromeos/$widevine_arch/widevine_cdm_version.h"
...@@ -56,7 +56,7 @@ if (should_bundle_widevine_cdm) { ...@@ -56,7 +56,7 @@ if (should_bundle_widevine_cdm) {
widevine_cdm_version_h_file = "widevine_cdm_version.h" widevine_cdm_version_h_file = "widevine_cdm_version.h"
} }
if (should_bundle_widevine_cdm && enable_widevine_cdm_host_verification) { if (bundle_widevine_cdm && enable_widevine_cdm_host_verification) {
if (is_win) { if (is_win) {
widevine_cdm_binary_files += [ "win/$widevine_arch/widevinecdm.dll.sig" ] widevine_cdm_binary_files += [ "win/$widevine_arch/widevinecdm.dll.sig" ]
} else if (is_mac) { } else if (is_mac) {
......
...@@ -11,20 +11,33 @@ declare_args() { ...@@ -11,20 +11,33 @@ declare_args() {
enable_widevine = is_chrome_branded || is_android enable_widevine = is_chrome_branded || is_android
} }
# The Widevine CDM can be updated as a component. This only applies to platforms # Widevine CDM is available as a library CDM on the following platforms and
# where the CDM is a standalone library (enable_library_cdms == true). Currently # architectures. Notably on Android library CDM is not used and Widevine is
# it's only supported on Windows and Mac. The CDM can still be bundled when it's # supported via Android MediaDrm API.
# a component, see below. # 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_widevine_cdm_component =
enable_widevine && enable_library_cdms && (is_win || is_mac) enable_library_widevine_cdm && (is_win || is_mac)
# The Widevine CDM is bundled as part of Google Chrome builds. # Widevine CDM is bundled as part of Google Chrome builds.
# TODO(hmchen): Provide prebuilt libraries for ARM64. bundle_widevine_cdm = enable_library_widevine_cdm && is_chrome_branded
should_bundle_widevine_cdm = enable_widevine && is_chrome_branded &&
enable_library_cdms && target_cpu != "arm64"
enable_widevine_cdm_host_verification = enable_widevine_cdm_host_verification =
enable_widevine && enable_cdm_host_verification enable_library_widevine_cdm && enable_cdm_host_verification
template("widevine_sign_file") { template("widevine_sign_file") {
# For official builds, generate a signature file for |file| which will # For official builds, generate a signature file for |file| which will
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment