blob: f3202dfee3c49ed04f17d1d9d6500e200d34510c [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_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",
kjellander@webrtc.orgc4870bb2014-09-01 04:24:11 +0000100 "android/opensles_common.cc",
101 "android/opensles_common.h",
henrikab2619892015-05-18 16:49:16 +0200102 "android/opensles_player.cc",
103 "android/opensles_player.h",
kjellander@webrtc.orgc4870bb2014-09-01 04:24:11 +0000104 ]
105 if (is_linux) {
106 defines += [ "LINUX_ALSA" ]
107
108 libs = [
109 "dl",
110 "X11",
111 ]
112
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +0000113 if (rtc_include_pulse_audio) {
kjellander@webrtc.orgc4870bb2014-09-01 04:24:11 +0000114 sources += [
115 "linux/audio_device_pulse_linux.cc",
116 "linux/audio_device_pulse_linux.h",
117 "linux/audio_mixer_manager_pulse_linux.cc",
118 "linux/audio_mixer_manager_pulse_linux.h",
119 "linux/pulseaudiosymboltable_linux.cc",
120 "linux/pulseaudiosymboltable_linux.h",
121 ]
122
123 defines += [ "LINUX_PULSE" ]
124 }
125 }
126 if (is_mac) {
127 libs = [
128 "AudioToolbox.framework",
129 "CoreAudio.framework",
130 ]
131 }
132 if (is_ios) {
133 cflags += [ "-fobjc-arc" ] # CLANG_ENABLE_OBJC_ARC = YES.
134
135 libs = [
136 "AudioToolbox.framework",
137 "AVFoundation.framework",
kjellander@webrtc.orgd7e34e12015-01-26 19:17:26 +0000138 "Foundation.framework",
kjellander@webrtc.orgc4870bb2014-09-01 04:24:11 +0000139 ]
140 }
141 if (is_win) {
142 libs = [
143 # Required for the built-in WASAPI AEC.
144 "dmoguids.lib",
145 "wmcodecdspuuid.lib",
146 "amstrmid.lib",
147 "msdmo.lib",
148 ]
149 }
150 } else {
151 defines = [ "WEBRTC_DUMMY_AUDIO_BUILD" ]
152 }
153
154 if (!build_with_chromium) {
155 sources += [
156 # Do not link these into Chrome since they contain static data.
157 "dummy/file_audio_device_factory.cc",
158 "dummy/file_audio_device_factory.h",
159 ]
160 }
161
kjellander@webrtc.orgf21ea912014-09-28 17:37:22 +0000162 configs += [ "../..:common_config" ]
163 public_configs = [
164 "../..:common_inherited_config",
165 ":audio_device_config",
166 ]
167
kjellander@webrtc.orgc4870bb2014-09-01 04:24:11 +0000168 if (is_clang) {
169 # Suppress warnings from Chrome's Clang plugins.
170 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
171 configs -= [ "//build/config/clang:find_bad_constructs" ]
172 }
173
174 deps = [
kwiberg@webrtc.orgac2d27d2015-02-26 13:59:22 +0000175 "../..:webrtc_common",
henrika@webrtc.org62f6e752015-02-11 08:38:35 +0000176 "../../base:rtc_base_approved",
kjellander@webrtc.orgc4870bb2014-09-01 04:24:11 +0000177 "../../common_audio",
178 "../../system_wrappers",
179 "../utility",
180 ]
181}
182
183