1 # Copyright 2014 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.
5 import("//build/config/linux/pkg_config.gni")
6 import("//media/media_options.gni")
8 # When libpulse is not directly linked, use stubs to allow for dlopening of the
10 if (!link_pulseaudio) {
11 action("pulse_generate_stubs") {
12 extra_header = "pulse/pulse_stub_header.fragment"
14 script = "../../tools/generate_stubs/generate_stubs.py"
21 stubs_filename_root = "pulse_stubs"
23 # TODO(ajwong): these need to be included in the pulse build.
25 "$target_gen_dir/pulse/$stubs_filename_root.cc",
26 "$target_gen_dir/pulse/$stubs_filename_root.h",
30 rebase_path("$target_gen_dir/pulse", root_build_dir),
32 rebase_path("$target_gen_dir/pulse", root_build_dir),
36 rebase_path(extra_header, root_build_dir),
43 args += rebase_path(sources, root_build_dir)
48 visibility = [ "//media/*" ]
51 "audio_device_name.cc",
52 "audio_device_name.h",
53 "audio_device_thread.cc",
54 "audio_device_thread.h",
55 "audio_input_controller.cc",
56 "audio_input_controller.h",
57 "audio_input_device.cc",
58 "audio_input_device.h",
64 "audio_manager_base.cc",
65 "audio_manager_base.h",
66 "audio_output_controller.cc",
67 "audio_output_controller.h",
68 "audio_output_device.cc",
69 "audio_output_device.h",
70 "audio_output_dispatcher.cc",
71 "audio_output_dispatcher.h",
72 "audio_output_dispatcher_impl.cc",
73 "audio_output_dispatcher_impl.h",
74 "audio_output_ipc.cc",
76 "audio_output_proxy.cc",
77 "audio_output_proxy.h",
78 "audio_output_resampler.cc",
79 "audio_output_resampler.h",
80 "audio_output_stream_sink.cc",
81 "audio_output_stream_sink.h",
82 "audio_power_monitor.cc",
83 "audio_power_monitor.h",
84 "audio_source_diverter.h",
85 "clockless_audio_sink.cc",
86 "clockless_audio_sink.h",
87 "fake_audio_input_stream.cc",
88 "fake_audio_input_stream.h",
89 "fake_audio_log_factory.cc",
90 "fake_audio_log_factory.h",
91 "fake_audio_manager.cc",
92 "fake_audio_manager.h",
93 "fake_audio_output_stream.cc",
94 "fake_audio_output_stream.h",
95 "fake_audio_worker.cc",
96 "fake_audio_worker.h",
101 "scoped_task_runner_observer.cc",
102 "scoped_task_runner_observer.h",
105 "sounds/audio_stream_handler.cc",
106 "sounds/audio_stream_handler.h",
107 "sounds/sounds_manager.cc",
108 "sounds/sounds_manager.h",
109 "sounds/wav_audio_handler.cc",
110 "sounds/wav_audio_handler.h",
111 "virtual_audio_input_stream.cc",
112 "virtual_audio_input_stream.h",
113 "virtual_audio_output_stream.cc",
114 "virtual_audio_output_stream.h",
118 configs += [ "//media:media_config" ]
122 "mac/audio_auhal_mac.cc",
123 "mac/audio_auhal_mac.h",
124 "mac/audio_device_listener_mac.cc",
125 "mac/audio_device_listener_mac.h",
126 "mac/audio_input_mac.cc",
127 "mac/audio_input_mac.h",
128 "mac/audio_low_latency_input_mac.cc",
129 "mac/audio_low_latency_input_mac.h",
130 "mac/audio_manager_mac.cc",
131 "mac/audio_manager_mac.h",
134 "AudioToolbox.framework",
135 "AudioUnit.framework",
136 "CoreAudio.framework",
142 "win/audio_device_listener_win.cc",
143 "win/audio_device_listener_win.h",
144 "win/audio_low_latency_input_win.cc",
145 "win/audio_low_latency_input_win.h",
146 "win/audio_low_latency_output_win.cc",
147 "win/audio_low_latency_output_win.h",
148 "win/audio_manager_win.cc",
149 "win/audio_manager_win.h",
150 "win/avrt_wrapper_win.cc",
151 "win/avrt_wrapper_win.h",
152 "win/core_audio_util_win.cc",
153 "win/core_audio_util_win.h",
154 "win/device_enumeration_win.cc",
155 "win/device_enumeration_win.h",
156 "win/wavein_input_win.cc",
157 "win/wavein_input_win.h",
158 "win/waveout_output_win.cc",
159 "win/waveout_output_win.h",
165 "android/audio_manager_android.cc",
166 "android/audio_manager_android.h",
167 "android/audio_record_input.cc",
168 "android/audio_record_input.h",
169 "android/opensles_input.cc",
170 "android/opensles_input.h",
171 "android/opensles_output.cc",
172 "android/opensles_output.h",
173 "android/opensles_wrapper.cc",
175 deps += [ "//media/base/android:media_jni_headers" ]
180 "openbsd/audio_manager_openbsd.cc",
181 "openbsd/audio_manager_openbsd.h",
186 sources += [ "linux/audio_manager_linux.cc" ]
191 defines = [ "USE_ALSA" ]
193 "alsa/alsa_input.cc",
195 "alsa/alsa_output.cc",
196 "alsa/alsa_output.h",
199 "alsa/alsa_wrapper.cc",
200 "alsa/alsa_wrapper.h",
201 "alsa/audio_manager_alsa.cc",
202 "alsa/audio_manager_alsa.h",
208 "cras/audio_manager_cras.cc",
209 "cras/audio_manager_cras.h",
210 "cras/cras_input.cc",
212 "cras/cras_unified.cc",
213 "cras/cras_unified.h",
216 pkg_config("libcras") {
217 packages = [ "libcras" ]
219 configs += [ ":libcras" ]
222 if (use_pulseaudio) {
224 "pulse/audio_manager_pulse.cc",
225 "pulse/audio_manager_pulse.h",
226 "pulse/pulse_input.cc",
227 "pulse/pulse_input.h",
228 "pulse/pulse_output.cc",
229 "pulse/pulse_output.h",
230 "pulse/pulse_util.cc",
231 "pulse/pulse_util.h",
234 if (link_pulseaudio) {
235 pkg_config("libpulse") {
236 packages = [ "libpulse" ]
238 configs += [ ":libpulse" ]
240 # TODO(ajwong): Technically, this dl should go in the action.
242 deps += [ ":pulse_generate_stubs" ]
243 sources += get_target_outputs(":pulse_generate_stubs")
247 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
250 source_set("test_support") {
253 "audio_unittest_util.cc",
254 "audio_unittest_util.h",
255 "mock_audio_manager.cc",
256 "mock_audio_manager.h",
257 "mock_audio_source_callback.cc",
258 "mock_audio_source_callback.h",
259 "test_audio_input_controller_factory.cc",
260 "test_audio_input_controller_factory.h",
265 configs += [ "//media:media_config" ]
268 source_set("unittests") {
271 "audio_input_controller_unittest.cc",
272 "audio_input_unittest.cc",
273 "audio_manager_factory_unittest.cc",
274 "audio_manager_unittest.cc",
275 "audio_output_controller_unittest.cc",
276 "audio_output_device_unittest.cc",
277 "audio_output_proxy_unittest.cc",
278 "audio_parameters_unittest.cc",
279 "audio_power_monitor_unittest.cc",
280 "fake_audio_worker_unittest.cc",
281 "simple_sources_unittest.cc",
282 "virtual_audio_input_stream_unittest.cc",
283 "virtual_audio_output_stream_unittest.cc",
292 "//build/config/compiler:no_size_t_to_int_warning",
293 "//media:media_config",
297 sources += [ "android/audio_android_unittest.cc" ]
299 sources += [ "audio_input_volume_unittest.cc" ]
304 "mac/audio_auhal_mac_unittest.cc",
305 "mac/audio_device_listener_mac_unittest.cc",
306 "mac/audio_low_latency_input_mac_unittest.cc",
312 "sounds/audio_stream_handler_unittest.cc",
313 "sounds/sounds_manager_unittest.cc",
314 "sounds/test_data.cc",
315 "sounds/test_data.h",
316 "sounds/wav_audio_handler_unittest.cc",
321 "cras/cras_input_unittest.cc",
322 "cras/cras_unified_unittest.cc",
329 "win/audio_device_listener_win_unittest.cc",
330 "win/audio_low_latency_input_win_unittest.cc",
331 "win/audio_low_latency_output_win_unittest.cc",
332 "win/audio_output_win_unittest.cc",
333 "win/core_audio_util_win_unittest.cc",
339 "alsa/alsa_output_unittest.cc",
340 "audio_low_latency_input_output_unittest.cc",