blob: 91d031eedeebd223ed5acd19b2dd95096ef23662 [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",
henrika8324b522015-03-27 10:56:23 +010092 "android/audio_manager.cc",
93 "android/audio_manager.h",
kjellander@webrtc.orgc4870bb2014-09-01 04:24:11 +000094 "android/audio_manager_jni.cc",
95 "android/audio_manager_jni.h",
96 "android/audio_record_jni.cc",
97 "android/audio_record_jni.h",
98 "android/audio_track_jni.cc",
99 "android/audio_track_jni.h",
100 "android/fine_audio_buffer.cc",
101 "android/fine_audio_buffer.h",
102 "android/low_latency_event_posix.cc",
103 "android/low_latency_event.h",
104 "android/opensles_common.cc",
105 "android/opensles_common.h",
106 "android/opensles_input.cc",
107 "android/opensles_input.h",
108 "android/opensles_output.cc",
109 "android/opensles_output.h",
110 "android/single_rw_fifo.cc",
111 "android/single_rw_fifo.h",
112 ]
113 if (is_linux) {
114 defines += [ "LINUX_ALSA" ]
115
116 libs = [
117 "dl",
118 "X11",
119 ]
120
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +0000121 if (rtc_include_pulse_audio) {
kjellander@webrtc.orgc4870bb2014-09-01 04:24:11 +0000122 sources += [
123 "linux/audio_device_pulse_linux.cc",
124 "linux/audio_device_pulse_linux.h",
125 "linux/audio_mixer_manager_pulse_linux.cc",
126 "linux/audio_mixer_manager_pulse_linux.h",
127 "linux/pulseaudiosymboltable_linux.cc",
128 "linux/pulseaudiosymboltable_linux.h",
129 ]
130
131 defines += [ "LINUX_PULSE" ]
132 }
133 }
134 if (is_mac) {
135 libs = [
136 "AudioToolbox.framework",
137 "CoreAudio.framework",
138 ]
139 }
140 if (is_ios) {
141 cflags += [ "-fobjc-arc" ] # CLANG_ENABLE_OBJC_ARC = YES.
142
143 libs = [
144 "AudioToolbox.framework",
145 "AVFoundation.framework",
kjellander@webrtc.orgd7e34e12015-01-26 19:17:26 +0000146 "Foundation.framework",
kjellander@webrtc.orgc4870bb2014-09-01 04:24:11 +0000147 ]
148 }
149 if (is_win) {
150 libs = [
151 # Required for the built-in WASAPI AEC.
152 "dmoguids.lib",
153 "wmcodecdspuuid.lib",
154 "amstrmid.lib",
155 "msdmo.lib",
156 ]
157 }
158 } else {
159 defines = [ "WEBRTC_DUMMY_AUDIO_BUILD" ]
160 }
161
162 if (!build_with_chromium) {
163 sources += [
164 # Do not link these into Chrome since they contain static data.
165 "dummy/file_audio_device_factory.cc",
166 "dummy/file_audio_device_factory.h",
167 ]
168 }
169
kjellander@webrtc.orgf21ea912014-09-28 17:37:22 +0000170 configs += [ "../..:common_config" ]
171 public_configs = [
172 "../..:common_inherited_config",
173 ":audio_device_config",
174 ]
175
kjellander@webrtc.orgc4870bb2014-09-01 04:24:11 +0000176 if (is_clang) {
177 # Suppress warnings from Chrome's Clang plugins.
178 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
179 configs -= [ "//build/config/clang:find_bad_constructs" ]
180 }
181
182 deps = [
kwiberg@webrtc.orgac2d27d2015-02-26 13:59:22 +0000183 "../..:webrtc_common",
henrika@webrtc.org62f6e752015-02-11 08:38:35 +0000184 "../../base:rtc_base_approved",
kjellander@webrtc.orgc4870bb2014-09-01 04:24:11 +0000185 "../../common_audio",
186 "../../system_wrappers",
187 "../utility",
188 ]
189}
190
191