# 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_decryptor.cc", "aes_decryptor.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", "//ui/gfx/geometry", "//url", ] configs += [ "//media:subcomponent_config" ] if (proprietary_codecs) { sources += [ "cenc_utils.cc", "cenc_utils.h", ] } if (enable_library_cdms) { deps += [ ":cdm_api", ":cdm_paths", ] 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_file_adapter.cc", "cdm_file_adapter.h", "cdm_file_io.cc", "cdm_file_io.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_decryptor_unittest.cc", "json_web_key_unittest.cc", ] deps = [ "//base/test:test_support", "//media:test_support", "//testing/gmock", "//testing/gtest", "//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 ExternalClearKey is built, we can test CdmAdapter. 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/ppapi:clearkeycdm" ] deps += [ ":cdm_api", ":cdm_paths", ] } if (proprietary_codecs) { sources += [ "cenc_utils_unittest.cc" ] } }