blob: 8875178c15f07aaee2e0d252466cfc41739e9acf [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 = [
kjellander@webrtc.orgc4870bb2014-09-01 04:24:11 +000021 "audio_device_buffer.cc",
22 "audio_device_buffer.h",
Henrik Kjellander57e5fd22015-05-25 12:55:39 +020023 "audio_device_config.h",
kjellander@webrtc.orgc4870bb2014-09-01 04:24:11 +000024 "audio_device_generic.cc",
25 "audio_device_generic.h",
kjellander@webrtc.orgc4870bb2014-09-01 04:24:11 +000026 "dummy/audio_device_dummy.cc",
27 "dummy/audio_device_dummy.h",
kjellander@webrtc.orgc4870bb2014-09-01 04:24:11 +000028 "dummy/file_audio_device.cc",
29 "dummy/file_audio_device.h",
henrika86d907c2015-09-07 16:09:50 +020030 "fine_audio_buffer.cc",
31 "fine_audio_buffer.h",
Henrik Kjellander57e5fd22015-05-25 12:55:39 +020032 "include/audio_device.h",
33 "include/audio_device_defines.h",
kjellander@webrtc.orgc4870bb2014-09-01 04:24:11 +000034 ]
35
kjellander@webrtc.orgc4870bb2014-09-01 04:24:11 +000036 include_dirs = []
37 if (is_linux) {
38 include_dirs += [ "linux" ]
39 }
40 if (is_ios) {
41 include_dirs += [ "ios" ]
42 }
43 if (is_mac) {
44 include_dirs += [ "mac" ]
45 }
46 if (is_win) {
47 include_dirs += [ "win" ]
48 }
49 if (is_android) {
50 include_dirs += [ "android" ]
51 }
Henrik Kjellanderb79472a2015-10-14 08:13:58 +020052 defines = []
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +000053 if (rtc_include_internal_audio_device) {
Tommi931e6582015-05-20 09:44:38 +020054 defines += [ "WEBRTC_INCLUDE_INTERNAL_AUDIO_DEVICE" ]
kjellander@webrtc.orgc4870bb2014-09-01 04:24:11 +000055 sources += [
kjellander@webrtc.orgc4870bb2014-09-01 04:24:11 +000056 "android/audio_device_template.h",
henrika8324b522015-03-27 10:56:23 +010057 "android/audio_manager.cc",
58 "android/audio_manager.h",
kjellander@webrtc.orgc4870bb2014-09-01 04:24:11 +000059 "android/audio_record_jni.cc",
60 "android/audio_record_jni.h",
61 "android/audio_track_jni.cc",
62 "android/audio_track_jni.h",
kjellander@webrtc.orgc4870bb2014-09-01 04:24:11 +000063 "android/opensles_common.cc",
64 "android/opensles_common.h",
henrikab2619892015-05-18 16:49:16 +020065 "android/opensles_player.cc",
66 "android/opensles_player.h",
Tommi931e6582015-05-20 09:44:38 +020067 "audio_device_impl.cc",
68 "audio_device_impl.h",
Tommidf0c05b2015-05-19 15:30:39 +020069 "ios/audio_device_ios.h",
70 "ios/audio_device_ios.mm",
Tommidf0c05b2015-05-19 15:30:39 +020071 "linux/alsasymboltable_linux.cc",
72 "linux/alsasymboltable_linux.h",
73 "linux/audio_device_alsa_linux.cc",
74 "linux/audio_device_alsa_linux.h",
Tommidf0c05b2015-05-19 15:30:39 +020075 "linux/audio_mixer_manager_alsa_linux.cc",
76 "linux/audio_mixer_manager_alsa_linux.h",
77 "linux/latebindingsymboltable_linux.cc",
78 "linux/latebindingsymboltable_linux.h",
79 "mac/audio_device_mac.cc",
80 "mac/audio_device_mac.h",
Tommidf0c05b2015-05-19 15:30:39 +020081 "mac/audio_mixer_manager_mac.cc",
82 "mac/audio_mixer_manager_mac.h",
83 "mac/portaudio/pa_memorybarrier.h",
84 "mac/portaudio/pa_ringbuffer.c",
85 "mac/portaudio/pa_ringbuffer.h",
86 "win/audio_device_core_win.cc",
87 "win/audio_device_core_win.h",
Tommidf0c05b2015-05-19 15:30:39 +020088 "win/audio_device_wave_win.cc",
89 "win/audio_device_wave_win.h",
90 "win/audio_mixer_manager_win.cc",
91 "win/audio_mixer_manager_win.h",
kjellander@webrtc.orgc4870bb2014-09-01 04:24:11 +000092 ]
93 if (is_linux) {
94 defines += [ "LINUX_ALSA" ]
95
96 libs = [
97 "dl",
98 "X11",
99 ]
100
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +0000101 if (rtc_include_pulse_audio) {
kjellander@webrtc.orgc4870bb2014-09-01 04:24:11 +0000102 sources += [
103 "linux/audio_device_pulse_linux.cc",
104 "linux/audio_device_pulse_linux.h",
105 "linux/audio_mixer_manager_pulse_linux.cc",
106 "linux/audio_mixer_manager_pulse_linux.h",
107 "linux/pulseaudiosymboltable_linux.cc",
108 "linux/pulseaudiosymboltable_linux.h",
109 ]
110
111 defines += [ "LINUX_PULSE" ]
112 }
113 }
114 if (is_mac) {
115 libs = [
116 "AudioToolbox.framework",
117 "CoreAudio.framework",
118 ]
119 }
120 if (is_ios) {
121 cflags += [ "-fobjc-arc" ] # CLANG_ENABLE_OBJC_ARC = YES.
122
123 libs = [
124 "AudioToolbox.framework",
125 "AVFoundation.framework",
kjellander@webrtc.orgd7e34e12015-01-26 19:17:26 +0000126 "Foundation.framework",
kjellander@webrtc.orgc4870bb2014-09-01 04:24:11 +0000127 ]
128 }
129 if (is_win) {
130 libs = [
131 # Required for the built-in WASAPI AEC.
132 "dmoguids.lib",
133 "wmcodecdspuuid.lib",
134 "amstrmid.lib",
135 "msdmo.lib",
136 ]
137 }
138 } else {
139 defines = [ "WEBRTC_DUMMY_AUDIO_BUILD" ]
140 }
141
142 if (!build_with_chromium) {
143 sources += [
144 # Do not link these into Chrome since they contain static data.
145 "dummy/file_audio_device_factory.cc",
146 "dummy/file_audio_device_factory.h",
147 ]
148 }
149
kjellander@webrtc.orgf21ea912014-09-28 17:37:22 +0000150 configs += [ "../..:common_config" ]
151 public_configs = [
152 "../..:common_inherited_config",
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200153 ":audio_device_config",
kjellander@webrtc.orgf21ea912014-09-28 17:37:22 +0000154 ]
155
kjellander@webrtc.orgc4870bb2014-09-01 04:24:11 +0000156 if (is_clang) {
157 # Suppress warnings from Chrome's Clang plugins.
158 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
159 configs -= [ "//build/config/clang:find_bad_constructs" ]
160 }
161
162 deps = [
kwiberg@webrtc.orgac2d27d2015-02-26 13:59:22 +0000163 "../..:webrtc_common",
henrika@webrtc.org62f6e752015-02-11 08:38:35 +0000164 "../../base:rtc_base_approved",
kjellander@webrtc.orgc4870bb2014-09-01 04:24:11 +0000165 "../../common_audio",
166 "../../system_wrappers",
167 "../utility",
168 ]
169}