# Copyright 2017 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("//media/media_options.gni") if (enable_library_cdms) { source_set("cdm_api") { sources = [ "api/content_decryption_module.h", ] } } source_set("cdm") { # Do not expand the visibility here without double-checking with OWNERS, this # is a roll-up target which is part of the //media component. Most other DEPs # should be using //media and not directly DEP this roll-up target. visibility = [ "//media", # TODO(crbug.com/583067): These files should not be in //media/base. "//media/base/android", "//media/filters", ] sources = [ "aes_cbc_crypto.cc", "aes_cbc_crypto.h", "aes_decryptor.cc", "aes_decryptor.h", "cbcs_decryptor.cc", "cbcs_decryptor.h", "cdm_context_ref_impl.cc", "cdm_context_ref_impl.h", "cenc_decryptor.cc", "cenc_decryptor.h", # TODO(crbug.com/676224): Move this to |enable_library_cdms| block below # when EnabledIf attribute is supported in mojom. "cdm_proxy.cc", "cdm_proxy.h", "cenc_utils.cc", "cenc_utils.h", "default_cdm_factory.cc", "default_cdm_factory.h", "json_web_key.cc", "json_web_key.h", "player_tracker_impl.cc", "player_tracker_impl.h", ] # TODO(crbug.com/167187): Fix size_t to int truncations. configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] deps = [ "//crypto", "//media/base", "//media/formats", "//third_party/boringssl", "//ui/gfx/geometry", "//url", ] configs += [ "//media:subcomponent_config" ] if (enable_library_cdms) { deps += [ ":cdm_api", ":cdm_paths", "//components/crash/core/common:crash_key", ] sources += [ "cdm_adapter.cc", "cdm_adapter.h", "cdm_adapter_factory.cc", "cdm_adapter_factory.h", "cdm_allocator.cc", "cdm_allocator.h", "cdm_auxiliary_helper.cc", "cdm_auxiliary_helper.h", "cdm_helpers.cc", "cdm_helpers.h", "cdm_module.cc", "cdm_module.h", "cdm_wrapper.h", "output_protection.h", "platform_verification.h", "supported_cdm_versions.cc", "supported_cdm_versions.h", ] if (enable_cdm_host_verification) { sources += [ "cdm_host_file.cc", "cdm_host_file.h", "cdm_host_files.cc", "cdm_host_files.h", ] deps += [ # Needed for finding CDM path from CDM adapter path. # TODO(xhwang): Remove this dependency when CDM adapter is deprecated. # See http://crbug.com/403462 "//third_party/widevine/cdm:headers", ] } } } config("cdm_manager_implementation") { defines = [ "CDM_MANAGER_IMPLEMENTATION" ] } # cdm_manager must not be a source_set() because CdmManager exposes a static # singleton, shared by multiple component()s. # # TODO(xhwang): Remove this component once AVDA no longer depends on it. component("cdm_manager") { visibility = [ "//media/gpu", "//media/mojo/services", ] sources = [ "cdm_manager.cc", "cdm_manager.h", "cdm_manager_export.h", ] configs += [ ":cdm_manager_implementation" ] deps = [ "//base", "//media", ] } static_library("cdm_paths") { sources = [ "cdm_paths.cc", "cdm_paths.h", ] deps = [ "//base", ] } source_set("unit_tests") { testonly = true sources = [ "aes_cbc_crypto_unittest.cc", "aes_decryptor_unittest.cc", "cbcs_decryptor_unittest.cc", "cenc_decryptor_unittest.cc", "json_web_key_unittest.cc", ] deps = [ "//base/test:test_support", "//crypto", "//media:test_support", "//testing/gmock", "//testing/gtest", "//third_party/boringssl", "//ui/gfx:test_support", "//url", ] configs += [ # TODO(crbug.com/167187): Fix size_t to int truncations. "//build/config/compiler:no_size_t_to_int_warning", "//media:media_config", ] data_deps = [] if (enable_library_cdms) { sources += [ "cdm_adapter_unittest.cc", "external_clear_key_test_helper.cc", "external_clear_key_test_helper.h", "mock_helpers.cc", "mock_helpers.h", "simple_cdm_allocator.cc", "simple_cdm_allocator.h", "simple_cdm_allocator_unittest.cc", "simple_cdm_buffer.cc", "simple_cdm_buffer.h", ] data_deps += [ "//media/cdm/library_cdm/clear_key_cdm" ] deps += [ ":cdm_api", ":cdm_paths", "//media/cdm/library_cdm:cdm_host_proxy", "//media/cdm/library_cdm:test_support", ] } if (proprietary_codecs) { sources += [ "cenc_utils_unittest.cc" ] } }