blob: 5f6c03502877a90a29a1c2d8a629f612837697bf [file] [log] [blame]
# 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")
source_set("cdm_api") {
sources = [ "api/content_decryption_module.h" ]
}
source_set("cdm_type_conversion") {
if (enable_library_cdms || is_win) {
# This target is a subcomponent.
visibility = [
"//media",
"//media/cdm",
]
configs += [ "//media:subcomponent_config" ]
} else {
visibility = [ "//media/cdm/library_cdm/clear_key_cdm:clear_key_cdm" ]
}
sources = [
"cdm_type_conversion.cc",
"cdm_type_conversion.h",
]
deps = [
":cdm_api",
"//media/base",
]
}
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",
"//media/fuchsia/cdm",
]
sources = [
"aes_cbc_crypto.cc",
"aes_cbc_crypto.h",
"aes_decryptor.cc",
"aes_decryptor.h",
"cbcs_decryptor.cc",
"cbcs_decryptor.h",
"cdm_capability.cc",
"cdm_capability.h",
"cdm_context_ref_impl.cc",
"cdm_context_ref_impl.h",
"cenc_decryptor.cc",
"cenc_decryptor.h",
"cenc_utils.cc",
"cenc_utils.h",
"default_cdm_factory.cc",
"default_cdm_factory.h",
"json_web_key.cc",
"json_web_key.h",
"supported_audio_codecs.cc",
"supported_audio_codecs.h",
]
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_module.cc",
"cdm_module.h",
"cdm_wrapper.h",
"output_protection.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",
]
}
}
if (is_win || enable_library_cdms) {
sources += [
"cdm_allocator.cc",
"cdm_allocator.h",
"cdm_auxiliary_helper.cc",
"cdm_auxiliary_helper.h",
"cdm_document_service.h",
"cdm_helpers.cc",
"cdm_helpers.h",
]
deps += [
":cdm_api",
":cdm_type_conversion",
]
}
if (is_win) {
sources += [
"media_foundation_cdm_data.cc",
"media_foundation_cdm_data.h",
"win/media_foundation_cdm.cc",
"win/media_foundation_cdm.h",
"win/media_foundation_cdm_factory.cc",
"win/media_foundation_cdm_factory.h",
"win/media_foundation_cdm_module.cc",
"win/media_foundation_cdm_module.h",
"win/media_foundation_cdm_session.cc",
"win/media_foundation_cdm_session.h",
]
libs = [ "Propsys.lib" ]
deps += [
":cdm_paths",
"//media/base/win:media_foundation_util",
]
}
}
static_library("cdm_paths") {
sources = [
"cdm_paths.cc",
"cdm_paths.h",
]
deps = [
"//base",
"//media:media_buildflags",
]
}
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",
"//build:chromeos_buildflags",
"//crypto",
"//media:test_support",
"//testing/gmock",
"//testing/gtest",
"//third_party/boringssl",
"//ui/gfx:test_support",
"//url",
]
configs += [ "//media:media_config" ]
data_deps = []
if (enable_library_cdms) {
sources += [
"cdm_adapter_unittest.cc",
"cdm_paths_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" ]
}
if (is_win) {
sources += [
"win/media_foundation_cdm_factory_unittest.cc",
"win/media_foundation_cdm_session_unittest.cc",
"win/media_foundation_cdm_unittest.cc",
]
deps += [ "//media/base/win:media_foundation_util" ]
}
}