blob: 8739513c017c70de633e3029647b482f726abe93 [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 = [
Henrik Kjellanderff761fb2015-11-04 08:31:52 +010013 "../include",
kjellander@webrtc.orgc4870bb2014-09-01 04:24:11 +000014 "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 = []
kjellander70bed7d2015-11-23 17:23:44 -080053 cflags = []
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +000054 if (rtc_include_internal_audio_device) {
Tommi931e6582015-05-20 09:44:38 +020055 defines += [ "WEBRTC_INCLUDE_INTERNAL_AUDIO_DEVICE" ]
kjellander@webrtc.orgc4870bb2014-09-01 04:24:11 +000056 sources += [
kjellander@webrtc.orgc4870bb2014-09-01 04:24:11 +000057 "android/audio_device_template.h",
henrika8324b522015-03-27 10:56:23 +010058 "android/audio_manager.cc",
59 "android/audio_manager.h",
kjellander@webrtc.orgc4870bb2014-09-01 04:24:11 +000060 "android/audio_record_jni.cc",
61 "android/audio_record_jni.h",
62 "android/audio_track_jni.cc",
63 "android/audio_track_jni.h",
kjellander@webrtc.orgc4870bb2014-09-01 04:24:11 +000064 "android/opensles_common.cc",
65 "android/opensles_common.h",
henrikab2619892015-05-18 16:49:16 +020066 "android/opensles_player.cc",
67 "android/opensles_player.h",
Tommi931e6582015-05-20 09:44:38 +020068 "audio_device_impl.cc",
69 "audio_device_impl.h",
Tommidf0c05b2015-05-19 15:30:39 +020070 "ios/audio_device_ios.h",
71 "ios/audio_device_ios.mm",
Tommidf0c05b2015-05-19 15:30:39 +020072 "linux/alsasymboltable_linux.cc",
73 "linux/alsasymboltable_linux.h",
74 "linux/audio_device_alsa_linux.cc",
75 "linux/audio_device_alsa_linux.h",
Tommidf0c05b2015-05-19 15:30:39 +020076 "linux/audio_mixer_manager_alsa_linux.cc",
77 "linux/audio_mixer_manager_alsa_linux.h",
78 "linux/latebindingsymboltable_linux.cc",
79 "linux/latebindingsymboltable_linux.h",
80 "mac/audio_device_mac.cc",
81 "mac/audio_device_mac.h",
Tommidf0c05b2015-05-19 15:30:39 +020082 "mac/audio_mixer_manager_mac.cc",
83 "mac/audio_mixer_manager_mac.h",
84 "mac/portaudio/pa_memorybarrier.h",
85 "mac/portaudio/pa_ringbuffer.c",
86 "mac/portaudio/pa_ringbuffer.h",
87 "win/audio_device_core_win.cc",
88 "win/audio_device_core_win.h",
Tommidf0c05b2015-05-19 15:30:39 +020089 "win/audio_device_wave_win.cc",
90 "win/audio_device_wave_win.h",
91 "win/audio_mixer_manager_win.cc",
92 "win/audio_mixer_manager_win.h",
kjellander@webrtc.orgc4870bb2014-09-01 04:24:11 +000093 ]
94 if (is_linux) {
95 defines += [ "LINUX_ALSA" ]
96
97 libs = [
98 "dl",
99 "X11",
100 ]
101
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +0000102 if (rtc_include_pulse_audio) {
kjellander@webrtc.orgc4870bb2014-09-01 04:24:11 +0000103 sources += [
104 "linux/audio_device_pulse_linux.cc",
105 "linux/audio_device_pulse_linux.h",
106 "linux/audio_mixer_manager_pulse_linux.cc",
107 "linux/audio_mixer_manager_pulse_linux.h",
108 "linux/pulseaudiosymboltable_linux.cc",
109 "linux/pulseaudiosymboltable_linux.h",
110 ]
111
112 defines += [ "LINUX_PULSE" ]
113 }
114 }
115 if (is_mac) {
116 libs = [
117 "AudioToolbox.framework",
118 "CoreAudio.framework",
119 ]
120 }
121 if (is_ios) {
122 cflags += [ "-fobjc-arc" ] # CLANG_ENABLE_OBJC_ARC = YES.
123
124 libs = [
125 "AudioToolbox.framework",
126 "AVFoundation.framework",
kjellander@webrtc.orgd7e34e12015-01-26 19:17:26 +0000127 "Foundation.framework",
kjellander@webrtc.orgc4870bb2014-09-01 04:24:11 +0000128 ]
129 }
130 if (is_win) {
131 libs = [
132 # Required for the built-in WASAPI AEC.
133 "dmoguids.lib",
134 "wmcodecdspuuid.lib",
135 "amstrmid.lib",
136 "msdmo.lib",
137 ]
138 }
139 } else {
140 defines = [ "WEBRTC_DUMMY_AUDIO_BUILD" ]
141 }
142
143 if (!build_with_chromium) {
144 sources += [
145 # Do not link these into Chrome since they contain static data.
146 "dummy/file_audio_device_factory.cc",
147 "dummy/file_audio_device_factory.h",
148 ]
149 }
150
kjellander@webrtc.orgf21ea912014-09-28 17:37:22 +0000151 configs += [ "../..:common_config" ]
152 public_configs = [
153 "../..:common_inherited_config",
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200154 ":audio_device_config",
kjellander@webrtc.orgf21ea912014-09-28 17:37:22 +0000155 ]
156
kjellander@webrtc.orgc4870bb2014-09-01 04:24:11 +0000157 if (is_clang) {
158 # Suppress warnings from Chrome's Clang plugins.
159 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
160 configs -= [ "//build/config/clang:find_bad_constructs" ]
161 }
162
163 deps = [
kwiberg@webrtc.orgac2d27d2015-02-26 13:59:22 +0000164 "../..:webrtc_common",
henrika@webrtc.org62f6e752015-02-11 08:38:35 +0000165 "../../base:rtc_base_approved",
kjellander@webrtc.orgc4870bb2014-09-01 04:24:11 +0000166 "../../common_audio",
167 "../../system_wrappers",
168 "../utility",
169 ]
170}