Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(253)

Unified Diff: third_party/widevine/cdm/BUILD.gn

Issue 2792743002: Use Stub CDM for building libwidevinecdmadapter.so (Closed)
Patch Set: Fix chromeos. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/widevine/cdm/BUILD.gn
diff --git a/third_party/widevine/cdm/BUILD.gn b/third_party/widevine/cdm/BUILD.gn
index dda97991ca4b0c533ae7a5830d9e9d9195a86811..b66c652c0aebd8be609ce55e4964f50175098437 100644
--- a/third_party/widevine/cdm/BUILD.gn
+++ b/third_party/widevine/cdm/BUILD.gn
@@ -18,6 +18,16 @@ if (widevine_arch == "x86") {
widevine_cdm_binary_files = []
widevine_cdm_manifest_file = []
+# Due to crbug.com/707488, in linux and chromeos chrome, we temporarily use
+# stub cdm for building cdm adapter and copy the real cdm after that.
+# The stub libwidevinecdm.so is in the sub-directory "./stub_cdm" to avoid
+# GN's complaint about generating the same output in two targets.
+# TODO(hmchen): Revert this change after crbug.com/707488 fixed.
+use_stub_cdm_for_chrome = false
+if (is_chrome_branded && is_linux) {
+ use_stub_cdm_for_chrome = true
+}
+
if (is_android) {
# Always available on Android regardless of branding.
widevine_cdm_version_h_file = "android/widevine_cdm_version.h"
@@ -82,7 +92,40 @@ source_set("headers") {
]
}
-if (widevine_cdm_binary_files != []) {
+if (use_stub_cdm_for_chrome) {
+ widevine_cdm_binary_files = []
+ copy("copy_widevinecdm") {
+ if (is_chromeos) {
+ widevine_cdm = [ "chromeos/$widevine_arch/libwidevinecdm.so" ]
+ } else if (is_linux) {
+ widevine_cdm = [ "linux/$widevine_arch/libwidevinecdm.so" ]
+ }
+ sources = widevine_cdm
+ outputs = [
+ "$root_out_dir/$widevine_cdm_path/{{source_file_part}}",
+ ]
+ }
+
+ shared_library("widevinecdm") {
+ output_dir = "$root_out_dir/$widevine_cdm_path/stub_cdm"
+ sources = [
+ "//media/cdm/stub/stub_cdm.cc",
+ "//media/cdm/stub/stub_cdm.h",
+ ]
+
+ defines = [ "CDM_IMPLEMENTATION" ]
+
+ deps = [
+ ":version_h",
+ ":copy_widevinecdm",
+ "//base",
+ "//build/config/sanitizers:deps",
+ ]
+
+ public_deps = [ ":copy_widevinecdm" ]
+ cflags = [ "-fvisibility=hidden" ]
+ }
+} else if (widevine_cdm_binary_files != []) {
copy("widevinecdm") {
sources = widevine_cdm_binary_files
outputs = [
@@ -165,7 +208,7 @@ if ((is_chrome_branded || enable_widevine) && enable_pepper_cdms) {
":widevinecdm",
]
- if (is_linux) {
+ if (is_linux && !use_stub_cdm_for_chrome) {
ldflags =
[ rebase_path("$root_out_dir/$widevine_cdm_path/libwidevinecdm.so",
root_build_dir) ]
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698