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)
47 config("platform_config") {
49 defines = [ "USE_ALSA" ]
54 visibility = [ "//media/*" ]
57 "audio_device_name.cc",
58 "audio_device_name.h",
59 "audio_device_thread.cc",
60 "audio_device_thread.h",
61 "audio_input_controller.cc",
62 "audio_input_controller.h",
63 "audio_input_device.cc",
64 "audio_input_device.h",
70 "audio_manager_base.cc",
71 "audio_manager_base.h",
72 "audio_output_controller.cc",
73 "audio_output_controller.h",
74 "audio_output_device.cc",
75 "audio_output_device.h",
76 "audio_output_dispatcher.cc",
77 "audio_output_dispatcher.h",
78 "audio_output_dispatcher_impl.cc",
79 "audio_output_dispatcher_impl.h",
80 "audio_output_ipc.cc",
82 "audio_output_proxy.cc",
83 "audio_output_proxy.h",
84 "audio_output_resampler.cc",
85 "audio_output_resampler.h",
86 "audio_output_stream_sink.cc",
87 "audio_output_stream_sink.h",
88 "audio_power_monitor.cc",
89 "audio_power_monitor.h",
90 "audio_source_diverter.h",
91 "clockless_audio_sink.cc",
92 "clockless_audio_sink.h",
93 "fake_audio_input_stream.cc",
94 "fake_audio_input_stream.h",
95 "fake_audio_log_factory.cc",
96 "fake_audio_log_factory.h",
97 "fake_audio_manager.cc",
98 "fake_audio_manager.h",
99 "fake_audio_output_stream.cc",
100 "fake_audio_output_stream.h",
101 "fake_audio_worker.cc",
102 "fake_audio_worker.h",
103 "null_audio_sink.cc",
107 "scoped_task_runner_observer.cc",
108 "scoped_task_runner_observer.h",
111 "sounds/audio_stream_handler.cc",
112 "sounds/audio_stream_handler.h",
113 "sounds/sounds_manager.cc",
114 "sounds/sounds_manager.h",
115 "sounds/wav_audio_handler.cc",
116 "sounds/wav_audio_handler.h",
117 "virtual_audio_input_stream.cc",
118 "virtual_audio_input_stream.h",
119 "virtual_audio_output_stream.cc",
120 "virtual_audio_output_stream.h",
126 "//media:media_config",
127 "//media:media_implementation",
132 "mac/audio_auhal_mac.cc",
133 "mac/audio_auhal_mac.h",
134 "mac/audio_device_listener_mac.cc",
135 "mac/audio_device_listener_mac.h",
136 "mac/audio_input_mac.cc",
137 "mac/audio_input_mac.h",
138 "mac/audio_low_latency_input_mac.cc",
139 "mac/audio_low_latency_input_mac.h",
140 "mac/audio_manager_mac.cc",
141 "mac/audio_manager_mac.h",
144 "AudioToolbox.framework",
145 "AudioUnit.framework",
146 "CoreAudio.framework",
152 "win/audio_device_listener_win.cc",
153 "win/audio_device_listener_win.h",
154 "win/audio_low_latency_input_win.cc",
155 "win/audio_low_latency_input_win.h",
156 "win/audio_low_latency_output_win.cc",
157 "win/audio_low_latency_output_win.h",
158 "win/audio_manager_win.cc",
159 "win/audio_manager_win.h",
160 "win/avrt_wrapper_win.cc",
161 "win/avrt_wrapper_win.h",
162 "win/core_audio_util_win.cc",
163 "win/core_audio_util_win.h",
164 "win/device_enumeration_win.cc",
165 "win/device_enumeration_win.h",
166 "win/wavein_input_win.cc",
167 "win/wavein_input_win.h",
168 "win/waveout_output_win.cc",
169 "win/waveout_output_win.h",
175 "android/audio_manager_android.cc",
176 "android/audio_manager_android.h",
177 "android/audio_record_input.cc",
178 "android/audio_record_input.h",
179 "android/opensles_input.cc",
180 "android/opensles_input.h",
181 "android/opensles_output.cc",
182 "android/opensles_output.h",
183 "android/opensles_wrapper.cc",
185 deps += [ "//media/base/android:media_jni_headers" ]
190 "openbsd/audio_manager_openbsd.cc",
191 "openbsd/audio_manager_openbsd.h",
196 sources += [ "linux/audio_manager_linux.cc" ]
202 "alsa/alsa_input.cc",
204 "alsa/alsa_output.cc",
205 "alsa/alsa_output.h",
208 "alsa/alsa_wrapper.cc",
209 "alsa/alsa_wrapper.h",
210 "alsa/audio_manager_alsa.cc",
211 "alsa/audio_manager_alsa.h",
217 "cras/audio_manager_cras.cc",
218 "cras/audio_manager_cras.h",
219 "cras/cras_input.cc",
221 "cras/cras_unified.cc",
222 "cras/cras_unified.h",
225 pkg_config("libcras") {
226 packages = [ "libcras" ]
228 configs += [ ":libcras" ]
229 deps += [ "//chromeos:chromeos" ]
232 if (use_pulseaudio) {
234 "pulse/audio_manager_pulse.cc",
235 "pulse/audio_manager_pulse.h",
236 "pulse/pulse_input.cc",
237 "pulse/pulse_input.h",
238 "pulse/pulse_output.cc",
239 "pulse/pulse_output.h",
240 "pulse/pulse_util.cc",
241 "pulse/pulse_util.h",
244 if (link_pulseaudio) {
245 pkg_config("libpulse") {
246 packages = [ "libpulse" ]
248 configs += [ ":libpulse" ]
250 # TODO(ajwong): Technically, this dl should go in the action.
252 deps += [ ":pulse_generate_stubs" ]
253 sources += get_target_outputs(":pulse_generate_stubs")
257 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
260 source_set("test_support") {
263 "audio_unittest_util.cc",
264 "audio_unittest_util.h",
265 "mock_audio_manager.cc",
266 "mock_audio_manager.h",
267 "mock_audio_source_callback.cc",
268 "mock_audio_source_callback.h",
269 "test_audio_input_controller_factory.cc",
270 "test_audio_input_controller_factory.h",
272 configs += [ ":platform_config" ]
276 configs += [ "//media:media_config" ]
279 source_set("unittests") {
282 "audio_input_controller_unittest.cc",
283 "audio_input_unittest.cc",
284 "audio_manager_factory_unittest.cc",
285 "audio_manager_unittest.cc",
286 "audio_output_controller_unittest.cc",
287 "audio_output_device_unittest.cc",
288 "audio_output_proxy_unittest.cc",
289 "audio_parameters_unittest.cc",
290 "audio_power_monitor_unittest.cc",
291 "fake_audio_worker_unittest.cc",
292 "simple_sources_unittest.cc",
293 "virtual_audio_input_stream_unittest.cc",
294 "virtual_audio_output_stream_unittest.cc",
298 "//media/base:test_support",
306 "//build/config/compiler:no_size_t_to_int_warning",
307 "//media:media_config",
311 sources += [ "android/audio_android_unittest.cc" ]
312 deps += [ "//ui/gl" ]
314 sources += [ "audio_input_volume_unittest.cc" ]
319 "mac/audio_auhal_mac_unittest.cc",
320 "mac/audio_device_listener_mac_unittest.cc",
321 "mac/audio_low_latency_input_mac_unittest.cc",
327 "sounds/audio_stream_handler_unittest.cc",
328 "sounds/sounds_manager_unittest.cc",
329 "sounds/test_data.cc",
330 "sounds/test_data.h",
331 "sounds/wav_audio_handler_unittest.cc",
336 "cras/cras_input_unittest.cc",
337 "cras/cras_unified_unittest.cc",
344 "win/audio_device_listener_win_unittest.cc",
345 "win/audio_low_latency_input_win_unittest.cc",
346 "win/audio_low_latency_output_win_unittest.cc",
347 "win/audio_output_win_unittest.cc",
348 "win/core_audio_util_win_unittest.cc",
354 "alsa/alsa_output_unittest.cc",
355 "audio_low_latency_input_output_unittest.cc",