BUILD.gn 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. # Copyright 2017 The Chromium Authors. All rights reserved.
  2. # Use of this source code is governed by a BSD-style license that can be
  3. # found in the LICENSE file.
  4. import("//media/media_options.gni")
  5. source_set("cdm_api") {
  6. sources = [ "api/content_decryption_module.h" ]
  7. }
  8. source_set("cdm_type_conversion") {
  9. if (enable_library_cdms || is_win) {
  10. # This target is a subcomponent.
  11. visibility = [
  12. ":*",
  13. "//media",
  14. ]
  15. configs += [ "//media:subcomponent_config" ]
  16. } else {
  17. visibility = [ "//media/cdm/library_cdm/clear_key_cdm:clear_key_cdm" ]
  18. }
  19. sources = [
  20. "cdm_type_conversion.cc",
  21. "cdm_type_conversion.h",
  22. ]
  23. deps = [
  24. ":cdm_api",
  25. "//media/base",
  26. ]
  27. }
  28. source_set("cdm") {
  29. # Do not expand the visibility here without double-checking with OWNERS, this
  30. # is a roll-up target which is part of the //media component. Most other DEPs
  31. # should be using //media and not directly DEP this roll-up target.
  32. visibility = [
  33. "//media",
  34. # TODO(crbug.com/583067): These files should not be in //media/base.
  35. "//media/base/android",
  36. "//media/filters",
  37. "//media/fuchsia/cdm",
  38. ]
  39. sources = [
  40. "aes_cbc_crypto.cc",
  41. "aes_cbc_crypto.h",
  42. "aes_decryptor.cc",
  43. "aes_decryptor.h",
  44. "cbcs_decryptor.cc",
  45. "cbcs_decryptor.h",
  46. "cdm_capability.cc",
  47. "cdm_capability.h",
  48. "cdm_context_ref_impl.cc",
  49. "cdm_context_ref_impl.h",
  50. "cenc_decryptor.cc",
  51. "cenc_decryptor.h",
  52. "cenc_utils.cc",
  53. "cenc_utils.h",
  54. "default_cdm_factory.cc",
  55. "default_cdm_factory.h",
  56. "json_web_key.cc",
  57. "json_web_key.h",
  58. "supported_audio_codecs.cc",
  59. "supported_audio_codecs.h",
  60. ]
  61. public_deps = [ ":cdm_type" ]
  62. deps = [
  63. "//crypto",
  64. "//media/base",
  65. "//media/formats",
  66. "//third_party/boringssl",
  67. "//ui/gfx/geometry",
  68. "//url",
  69. ]
  70. configs += [ "//media:subcomponent_config" ]
  71. if (enable_library_cdms) {
  72. deps += [
  73. ":cdm_api",
  74. ":cdm_paths",
  75. ]
  76. sources += [
  77. "cdm_adapter.cc",
  78. "cdm_adapter.h",
  79. "cdm_adapter_factory.cc",
  80. "cdm_adapter_factory.h",
  81. "cdm_module.cc",
  82. "cdm_module.h",
  83. "cdm_wrapper.h",
  84. "output_protection.h",
  85. "supported_cdm_versions.cc",
  86. "supported_cdm_versions.h",
  87. ]
  88. if (enable_cdm_host_verification) {
  89. sources += [
  90. "cdm_host_file.cc",
  91. "cdm_host_file.h",
  92. "cdm_host_files.cc",
  93. "cdm_host_files.h",
  94. ]
  95. }
  96. }
  97. if (is_win || enable_library_cdms) {
  98. sources += [
  99. "cdm_allocator.cc",
  100. "cdm_allocator.h",
  101. "cdm_auxiliary_helper.cc",
  102. "cdm_auxiliary_helper.h",
  103. "cdm_document_service.h",
  104. "cdm_helpers.cc",
  105. "cdm_helpers.h",
  106. ]
  107. deps += [
  108. ":cdm_api",
  109. ":cdm_type_conversion",
  110. "//components/crash/core/common:crash_key",
  111. ]
  112. }
  113. if (is_win) {
  114. sources += [
  115. "media_foundation_cdm_data.cc",
  116. "media_foundation_cdm_data.h",
  117. "win/media_foundation_cdm.cc",
  118. "win/media_foundation_cdm.h",
  119. "win/media_foundation_cdm_factory.cc",
  120. "win/media_foundation_cdm_factory.h",
  121. "win/media_foundation_cdm_module.cc",
  122. "win/media_foundation_cdm_module.h",
  123. "win/media_foundation_cdm_session.cc",
  124. "win/media_foundation_cdm_session.h",
  125. "win/media_foundation_cdm_util.cc",
  126. "win/media_foundation_cdm_util.h",
  127. ]
  128. libs = [ "Propsys.lib" ]
  129. deps += [
  130. ":cdm_paths",
  131. "//media/base/win:media_foundation_util",
  132. ]
  133. }
  134. }
  135. if (enable_library_cdms) {
  136. static_library("cdm_paths") {
  137. public = [ "cdm_paths.h" ]
  138. sources = [ "cdm_paths.cc" ]
  139. public_deps = [ ":cdm_type" ]
  140. deps = [
  141. "//base",
  142. "//media:media_buildflags",
  143. ]
  144. }
  145. }
  146. source_set("cdm_type") {
  147. sources = [ "cdm_type.h" ]
  148. deps = [ "//base" ]
  149. }
  150. source_set("unit_tests") {
  151. testonly = true
  152. sources = [
  153. "aes_cbc_crypto_unittest.cc",
  154. "aes_decryptor_unittest.cc",
  155. "cbcs_decryptor_unittest.cc",
  156. "cenc_decryptor_unittest.cc",
  157. "json_web_key_unittest.cc",
  158. ]
  159. deps = [
  160. "//base/test:test_support",
  161. "//build:chromeos_buildflags",
  162. "//crypto",
  163. "//media:test_support",
  164. "//testing/gmock",
  165. "//testing/gtest",
  166. "//third_party/boringssl",
  167. "//ui/gfx:test_support",
  168. "//url",
  169. ]
  170. configs += [ "//media:media_config" ]
  171. data_deps = []
  172. if (enable_library_cdms) {
  173. sources += [
  174. "cdm_adapter_unittest.cc",
  175. "cdm_paths_unittest.cc",
  176. "external_clear_key_test_helper.cc",
  177. "external_clear_key_test_helper.h",
  178. "mock_helpers.cc",
  179. "mock_helpers.h",
  180. "simple_cdm_allocator.cc",
  181. "simple_cdm_allocator.h",
  182. "simple_cdm_allocator_unittest.cc",
  183. "simple_cdm_buffer.cc",
  184. "simple_cdm_buffer.h",
  185. ]
  186. data_deps += [ "//media/cdm/library_cdm/clear_key_cdm" ]
  187. deps += [
  188. ":cdm_api",
  189. ":cdm_paths",
  190. "//media/cdm/library_cdm:cdm_host_proxy",
  191. "//media/cdm/library_cdm:test_support",
  192. ]
  193. }
  194. if (proprietary_codecs) {
  195. sources += [ "cenc_utils_unittest.cc" ]
  196. }
  197. if (is_win) {
  198. sources += [
  199. "win/media_foundation_cdm_factory_unittest.cc",
  200. "win/media_foundation_cdm_session_unittest.cc",
  201. "win/media_foundation_cdm_unittest.cc",
  202. ]
  203. deps += [ "//media/base/win:media_foundation_util" ]
  204. }
  205. }