blob: 09412232e297b8861cde2bb4bb461a5af6a34231 [file] [log] [blame]
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +00001# Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
2#
3# Use of this source code is governed by a BSD-style license
4# that can be found in the LICENSE file in the root of the source
5# tree. An additional intellectual property rights grant can be found
6# in the file PATENTS. All contributing project authors may
7# be found in the AUTHORS file in the root of the source tree.
8
9import("../../build/webrtc.gni")
10
kjellander@webrtc.orgc4870bb2014-09-01 04:24:11 +000011config("audio_device_config") {
12 include_dirs = [
13 "../interface",
14 "include",
15 "dummy", # Contains dummy audio device implementations.
16 ]
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +000017}
kjellander@webrtc.orgc4870bb2014-09-01 04:24:11 +000018
19source_set("audio_device") {
20 sources = [
21 "include/audio_device.h",
22 "include/audio_device_defines.h",
23 "audio_device_buffer.cc",
24 "audio_device_buffer.h",
25 "audio_device_generic.cc",
26 "audio_device_generic.h",
27 "audio_device_utility.cc",
28 "audio_device_utility.h",
29 "audio_device_impl.cc",
30 "audio_device_impl.h",
31 "audio_device_config.h",
32 "dummy/audio_device_dummy.cc",
33 "dummy/audio_device_dummy.h",
34 "dummy/audio_device_utility_dummy.cc",
35 "dummy/audio_device_utility_dummy.h",
36 "dummy/file_audio_device.cc",
37 "dummy/file_audio_device.h",
38 ]
39
kjellander@webrtc.orgc4870bb2014-09-01 04:24:11 +000040 include_dirs = []
41 if (is_linux) {
42 include_dirs += [ "linux" ]
43 }
44 if (is_ios) {
45 include_dirs += [ "ios" ]
46 }
47 if (is_mac) {
48 include_dirs += [ "mac" ]
49 }
50 if (is_win) {
51 include_dirs += [ "win" ]
52 }
53 if (is_android) {
54 include_dirs += [ "android" ]
55 }
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +000056 if (rtc_include_internal_audio_device) {
kjellander@webrtc.orgc4870bb2014-09-01 04:24:11 +000057 sources += [
58 "linux/alsasymboltable_linux.cc",
59 "linux/alsasymboltable_linux.h",
60 "linux/audio_device_alsa_linux.cc",
61 "linux/audio_device_alsa_linux.h",
62 "linux/audio_device_utility_linux.cc",
63 "linux/audio_device_utility_linux.h",
64 "linux/audio_mixer_manager_alsa_linux.cc",
65 "linux/audio_mixer_manager_alsa_linux.h",
66 "linux/latebindingsymboltable_linux.cc",
67 "linux/latebindingsymboltable_linux.h",
68 "ios/audio_device_ios.mm",
69 "ios/audio_device_ios.h",
70 "ios/audio_device_utility_ios.cc",
71 "ios/audio_device_utility_ios.h",
72 "mac/audio_device_mac.cc",
73 "mac/audio_device_mac.h",
74 "mac/audio_device_utility_mac.cc",
75 "mac/audio_device_utility_mac.h",
76 "mac/audio_mixer_manager_mac.cc",
77 "mac/audio_mixer_manager_mac.h",
78 "mac/portaudio/pa_memorybarrier.h",
79 "mac/portaudio/pa_ringbuffer.c",
80 "mac/portaudio/pa_ringbuffer.h",
81 "win/audio_device_core_win.cc",
82 "win/audio_device_core_win.h",
83 "win/audio_device_wave_win.cc",
84 "win/audio_device_wave_win.h",
85 "win/audio_device_utility_win.cc",
86 "win/audio_device_utility_win.h",
87 "win/audio_mixer_manager_win.cc",
88 "win/audio_mixer_manager_win.h",
89 "android/audio_device_template.h",
90 "android/audio_device_utility_android.cc",
91 "android/audio_device_utility_android.h",
92 "android/audio_manager_jni.cc",
93 "android/audio_manager_jni.h",
94 "android/audio_record_jni.cc",
95 "android/audio_record_jni.h",
96 "android/audio_track_jni.cc",
97 "android/audio_track_jni.h",
98 "android/fine_audio_buffer.cc",
99 "android/fine_audio_buffer.h",
100 "android/low_latency_event_posix.cc",
101 "android/low_latency_event.h",
102 "android/opensles_common.cc",
103 "android/opensles_common.h",
104 "android/opensles_input.cc",
105 "android/opensles_input.h",
106 "android/opensles_output.cc",
107 "android/opensles_output.h",
108 "android/single_rw_fifo.cc",
109 "android/single_rw_fifo.h",
110 ]
111 if (is_linux) {
112 defines += [ "LINUX_ALSA" ]
113
114 libs = [
115 "dl",
116 "X11",
117 ]
118
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +0000119 if (rtc_include_pulse_audio) {
kjellander@webrtc.orgc4870bb2014-09-01 04:24:11 +0000120 sources += [
121 "linux/audio_device_pulse_linux.cc",
122 "linux/audio_device_pulse_linux.h",
123 "linux/audio_mixer_manager_pulse_linux.cc",
124 "linux/audio_mixer_manager_pulse_linux.h",
125 "linux/pulseaudiosymboltable_linux.cc",
126 "linux/pulseaudiosymboltable_linux.h",
127 ]
128
129 defines += [ "LINUX_PULSE" ]
130 }
131 }
132 if (is_mac) {
133 libs = [
134 "AudioToolbox.framework",
135 "CoreAudio.framework",
136 ]
137 }
138 if (is_ios) {
139 cflags += [ "-fobjc-arc" ] # CLANG_ENABLE_OBJC_ARC = YES.
140
141 libs = [
142 "AudioToolbox.framework",
143 "AVFoundation.framework",
kjellander@webrtc.orgd7e34e12015-01-26 19:17:26 +0000144 "Foundation.framework",
kjellander@webrtc.orgc4870bb2014-09-01 04:24:11 +0000145 ]
146 }
147 if (is_win) {
148 libs = [
149 # Required for the built-in WASAPI AEC.
150 "dmoguids.lib",
151 "wmcodecdspuuid.lib",
152 "amstrmid.lib",
153 "msdmo.lib",
154 ]
155 }
156 } else {
157 defines = [ "WEBRTC_DUMMY_AUDIO_BUILD" ]
158 }
159
160 if (!build_with_chromium) {
161 sources += [
162 # Do not link these into Chrome since they contain static data.
163 "dummy/file_audio_device_factory.cc",
164 "dummy/file_audio_device_factory.h",
165 ]
166 }
167
kjellander@webrtc.orgf21ea912014-09-28 17:37:22 +0000168 configs += [ "../..:common_config" ]
169 public_configs = [
170 "../..:common_inherited_config",
171 ":audio_device_config",
172 ]
173
kjellander@webrtc.orgc4870bb2014-09-01 04:24:11 +0000174 if (is_clang) {
175 # Suppress warnings from Chrome's Clang plugins.
176 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
177 configs -= [ "//build/config/clang:find_bad_constructs" ]
178 }
179
180 deps = [
kwiberg@webrtc.orgac2d27d2015-02-26 13:59:22 +0000181 "../..:webrtc_common",
henrika@webrtc.org62f6e752015-02-11 08:38:35 +0000182 "../../base:rtc_base_approved",
kjellander@webrtc.orgc4870bb2014-09-01 04:24:11 +0000183 "../../common_audio",
184 "../../system_wrappers",
185 "../utility",
186 ]
187}
188
189