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" ]
189 sources += [ "linux/audio_manager_linux.cc" ]
195 "alsa/alsa_input.cc",
197 "alsa/alsa_output.cc",
198 "alsa/alsa_output.h",
201 "alsa/alsa_wrapper.cc",
202 "alsa/alsa_wrapper.h",
203 "alsa/audio_manager_alsa.cc",
204 "alsa/audio_manager_alsa.h",
210 "cras/audio_manager_cras.cc",
211 "cras/audio_manager_cras.h",
212 "cras/cras_input.cc",
214 "cras/cras_unified.cc",
215 "cras/cras_unified.h",
218 pkg_config("libcras") {
219 packages = [ "libcras" ]
221 configs += [ ":libcras" ]
222 deps += [ "//chromeos:chromeos" ]
225 if (use_pulseaudio) {
227 "pulse/audio_manager_pulse.cc",
228 "pulse/audio_manager_pulse.h",
229 "pulse/pulse_input.cc",
230 "pulse/pulse_input.h",
231 "pulse/pulse_output.cc",
232 "pulse/pulse_output.h",
233 "pulse/pulse_util.cc",
234 "pulse/pulse_util.h",
237 if (link_pulseaudio) {
238 pkg_config("libpulse") {
239 packages = [ "libpulse" ]
241 configs += [ ":libpulse" ]
243 # TODO(ajwong): Technically, this dl should go in the action.
245 deps += [ ":pulse_generate_stubs" ]
246 sources += get_target_outputs(":pulse_generate_stubs")
250 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
253 source_set("test_support") {
256 "audio_unittest_util.cc",
257 "audio_unittest_util.h",
258 "mock_audio_manager.cc",
259 "mock_audio_manager.h",
260 "mock_audio_source_callback.cc",
261 "mock_audio_source_callback.h",
262 "test_audio_input_controller_factory.cc",
263 "test_audio_input_controller_factory.h",
265 configs += [ ":platform_config" ]
269 configs += [ "//media:media_config" ]
272 source_set("unittests") {
275 "audio_input_controller_unittest.cc",
276 "audio_input_unittest.cc",
277 "audio_manager_factory_unittest.cc",
278 "audio_manager_unittest.cc",
279 "audio_output_controller_unittest.cc",
280 "audio_output_device_unittest.cc",
281 "audio_output_proxy_unittest.cc",
282 "audio_parameters_unittest.cc",
283 "audio_power_monitor_unittest.cc",
284 "fake_audio_worker_unittest.cc",
285 "simple_sources_unittest.cc",
286 "virtual_audio_input_stream_unittest.cc",
287 "virtual_audio_output_stream_unittest.cc",
291 "//media/base:test_support",
299 "//build/config/compiler:no_size_t_to_int_warning",
300 "//media:media_config",
304 sources += [ "android/audio_android_unittest.cc" ]
305 deps += [ "//ui/gl" ]
307 sources += [ "audio_input_volume_unittest.cc" ]
312 "mac/audio_auhal_mac_unittest.cc",
313 "mac/audio_device_listener_mac_unittest.cc",
314 "mac/audio_low_latency_input_mac_unittest.cc",
320 "sounds/audio_stream_handler_unittest.cc",
321 "sounds/sounds_manager_unittest.cc",
322 "sounds/test_data.cc",
323 "sounds/test_data.h",
324 "sounds/wav_audio_handler_unittest.cc",
329 "cras/cras_input_unittest.cc",
330 "cras/cras_unified_unittest.cc",
337 "win/audio_device_listener_win_unittest.cc",
338 "win/audio_low_latency_input_win_unittest.cc",
339 "win/audio_low_latency_output_win_unittest.cc",
340 "win/audio_output_win_unittest.cc",
341 "win/core_audio_util_win_unittest.cc",
347 "alsa/alsa_output_unittest.cc",
348 "audio_low_latency_input_output_unittest.cc",