BUILD.gn 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  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("//build/buildflag_header.gni")
  5. import("//build/config/chromecast_build.gni")
  6. import("//build/config/chromeos/ui_mode.gni")
  7. import("//media/media_options.gni")
  8. import("//testing/test.gni")
  9. source_set("audio") {
  10. sources = [
  11. "aecdump_recording_manager.cc",
  12. "aecdump_recording_manager.h",
  13. "audio_manager_power_user.h",
  14. "concurrent_stream_metric_reporter.cc",
  15. "concurrent_stream_metric_reporter.h",
  16. "debug_recording.cc",
  17. "debug_recording.h",
  18. "delay_buffer.cc",
  19. "delay_buffer.h",
  20. "device_listener_output_stream.cc",
  21. "device_listener_output_stream.h",
  22. "device_notifier.cc",
  23. "device_notifier.h",
  24. "device_output_listener.h",
  25. "group_coordinator-impl.h",
  26. "group_coordinator.h",
  27. "in_process_audio_manager_accessor.cc",
  28. "in_process_audio_manager_accessor.h",
  29. "input_controller.cc",
  30. "input_controller.h",
  31. "input_stream.cc",
  32. "input_stream.h",
  33. "input_sync_writer.cc",
  34. "input_sync_writer.h",
  35. "local_muter.cc",
  36. "local_muter.h",
  37. "log_adapter.cc",
  38. "log_adapter.h",
  39. "log_factory_adapter.cc",
  40. "log_factory_adapter.h",
  41. "log_factory_manager.cc",
  42. "log_factory_manager.h",
  43. "loopback_coordinator.cc",
  44. "loopback_coordinator.h",
  45. "loopback_group_member.h",
  46. "loopback_stream.cc",
  47. "loopback_stream.h",
  48. "output_controller.cc",
  49. "output_controller.h",
  50. "output_stream.cc",
  51. "output_stream.h",
  52. "owning_audio_manager_accessor.cc",
  53. "owning_audio_manager_accessor.h",
  54. "realtime_audio_thread.cc",
  55. "realtime_audio_thread.h",
  56. "reference_output.h",
  57. "service.cc",
  58. "service.h",
  59. "service_factory.cc",
  60. "service_factory.h",
  61. "service_metrics.cc",
  62. "service_metrics.h",
  63. "snooper_node.cc",
  64. "snooper_node.h",
  65. "stream_factory.cc",
  66. "stream_factory.h",
  67. "stream_monitor.h",
  68. "sync_reader.cc",
  69. "sync_reader.h",
  70. "system_info.cc",
  71. "system_info.h",
  72. "user_input_monitor.cc",
  73. "user_input_monitor.h",
  74. ]
  75. deps = [
  76. ":testing_api_support",
  77. "//build:chromecast_buildflags",
  78. "//build:chromeos_buildflags",
  79. ]
  80. public_deps = [
  81. "//base",
  82. "//media",
  83. "//media:media_buildflags",
  84. "//media/mojo/mojom",
  85. "//services/audio/public/mojom",
  86. ]
  87. if (is_linux || is_chromeos) {
  88. sources += [
  89. "audio_sandbox_hook_linux.cc",
  90. "audio_sandbox_hook_linux.h",
  91. ]
  92. public_deps += [
  93. "//sandbox/linux:sandbox_services",
  94. "//sandbox/policy",
  95. ]
  96. }
  97. if (chrome_wide_echo_cancellation_supported) {
  98. sources += [
  99. "audio_processor_handler.cc",
  100. "audio_processor_handler.h",
  101. "mixing_graph.cc",
  102. "mixing_graph.h",
  103. "mixing_graph_impl.cc",
  104. "mixing_graph_impl.h",
  105. "output_device_mixer.cc",
  106. "output_device_mixer.h",
  107. "output_device_mixer_impl.cc",
  108. "output_device_mixer_impl.h",
  109. "output_device_mixer_manager.cc",
  110. "output_device_mixer_manager.h",
  111. "output_tapper.cc",
  112. "output_tapper.h",
  113. "processing_audio_fifo.cc",
  114. "processing_audio_fifo.h",
  115. "sync_mixing_graph_input.cc",
  116. "sync_mixing_graph_input.h",
  117. ]
  118. public_deps += [ "//media/webrtc" ]
  119. }
  120. configs += [
  121. "//build/config/compiler:wexit_time_destructors",
  122. "//media:media_config",
  123. "//media/audio:platform_config",
  124. ]
  125. }
  126. # NOTE: This is its own component target because it exposes static storage
  127. # consumed by multiple binary targets that get linked together (e.g.
  128. # content/utility and content_browsertests in a component build). Consider
  129. # making the entire ":audio" target a component library and merging this in.
  130. component("testing_api_support") {
  131. visibility = [ ":audio" ]
  132. sources = [
  133. "testing_api_binder.cc",
  134. "testing_api_binder.h",
  135. ]
  136. public_deps = [
  137. "//base",
  138. "//services/audio/public/mojom",
  139. ]
  140. defines = [ "IS_AUDIO_SERVICE_TESTING_API_SUPPORT_IMPL" ]
  141. }
  142. source_set("tests") {
  143. testonly = true
  144. sources = [
  145. "aecdump_recording_manager_unittest.cc",
  146. "debug_recording_unittest.cc",
  147. "delay_buffer_unittest.cc",
  148. "device_listener_output_stream_unittest.cc",
  149. "device_notifier_unittest.cc",
  150. "group_coordinator_unittest.cc",
  151. "input_controller_unittest.cc",
  152. "input_stream_unittest.cc",
  153. "input_sync_writer_unittest.cc",
  154. "local_muter_unittest.cc",
  155. "log_factory_manager_unittest.cc",
  156. "loopback_stream_unittest.cc",
  157. "output_controller_unittest.cc",
  158. "output_stream_unittest.cc",
  159. "public/cpp/input_ipc_unittest.cc",
  160. "public/cpp/output_device_unittest.cc",
  161. "realtime_audio_thread_test.cc",
  162. "service_metrics_unittest.cc",
  163. "snooper_node_unittest.cc",
  164. "sync_reader_unittest.cc",
  165. "test/audio_system_to_service_adapter_test.cc",
  166. "test/debug_recording_session_unittest.cc",
  167. "test/fake_consumer.cc",
  168. "test/fake_consumer.h",
  169. "test/fake_loopback_group_member.cc",
  170. "test/fake_loopback_group_member.h",
  171. "test/in_process_service_test.cc",
  172. "test/mock_group_coordinator.cc",
  173. "test/mock_group_coordinator.h",
  174. "test/mock_group_member.cc",
  175. "test/mock_group_member.h",
  176. "test/mock_log.cc",
  177. "test/mock_log.h",
  178. "user_input_monitor_unittest.cc",
  179. ]
  180. deps = [
  181. ":audio",
  182. "//base/test:test_support",
  183. "//build:chromeos_buildflags",
  184. "//media:test_support",
  185. "//services/audio/public/cpp",
  186. "//services/audio/public/cpp:test_support",
  187. "//services/audio/public/mojom",
  188. "//testing/gmock",
  189. "//testing/gtest",
  190. ]
  191. if (is_chromeos_ash || is_castos || is_cast_android) {
  192. sources += [
  193. "public/cpp/sounds/audio_stream_handler_unittest.cc",
  194. "public/cpp/sounds/sounds_manager_unittest.cc",
  195. ]
  196. }
  197. if (chrome_wide_echo_cancellation_supported) {
  198. sources += [
  199. "mixing_graph_impl_unittest.cc",
  200. "mixing_graph_input_unittest.cc",
  201. "output_device_mixer_impl_unittest.cc",
  202. "output_device_mixer_manager_unittest.cc",
  203. "processing_audio_fifo_unittest.cc",
  204. ]
  205. }
  206. }