blob: f32c0562455b32f5b80b02469b1829c226c3b440 [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",
Henrik Kjellander57e5fd22015-05-25 12:55:39 +020030 "include/audio_device.h",
31 "include/audio_device_defines.h",
kjellander@webrtc.orgc4870bb2014-09-01 04:24:11 +000032 ]
33
kjellander@webrtc.orgc4870bb2014-09-01 04:24:11 +000034 include_dirs = []
35 if (is_linux) {
36 include_dirs += [ "linux" ]
37 }
38 if (is_ios) {
39 include_dirs += [ "ios" ]
40 }
41 if (is_mac) {
42 include_dirs += [ "mac" ]
43 }
44 if (is_win) {
45 include_dirs += [ "win" ]
46 }
47 if (is_android) {
48 include_dirs += [ "android" ]
49 }
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +000050 if (rtc_include_internal_audio_device) {
Tommi931e6582015-05-20 09:44:38 +020051 defines += [ "WEBRTC_INCLUDE_INTERNAL_AUDIO_DEVICE" ]
kjellander@webrtc.orgc4870bb2014-09-01 04:24:11 +000052 sources += [
kjellander@webrtc.orgc4870bb2014-09-01 04:24:11 +000053 "android/audio_device_template.h",
henrika8324b522015-03-27 10:56:23 +010054 "android/audio_manager.cc",
55 "android/audio_manager.h",
kjellander@webrtc.orgc4870bb2014-09-01 04:24:11 +000056 "android/audio_record_jni.cc",
57 "android/audio_record_jni.h",
58 "android/audio_track_jni.cc",
59 "android/audio_track_jni.h",
60 "android/fine_audio_buffer.cc",
61 "android/fine_audio_buffer.h",
kjellander@webrtc.orgc4870bb2014-09-01 04:24:11 +000062 "android/opensles_common.cc",
63 "android/opensles_common.h",
henrikab2619892015-05-18 16:49:16 +020064 "android/opensles_player.cc",
65 "android/opensles_player.h",
Tommi931e6582015-05-20 09:44:38 +020066 "audio_device_impl.cc",
67 "audio_device_impl.h",
Tommidf0c05b2015-05-19 15:30:39 +020068 "ios/audio_device_ios.h",
69 "ios/audio_device_ios.mm",
Tommidf0c05b2015-05-19 15:30:39 +020070 "linux/alsasymboltable_linux.cc",
71 "linux/alsasymboltable_linux.h",
72 "linux/audio_device_alsa_linux.cc",
73 "linux/audio_device_alsa_linux.h",
Tommidf0c05b2015-05-19 15:30:39 +020074 "linux/audio_mixer_manager_alsa_linux.cc",
75 "linux/audio_mixer_manager_alsa_linux.h",
76 "linux/latebindingsymboltable_linux.cc",
77 "linux/latebindingsymboltable_linux.h",
78 "mac/audio_device_mac.cc",
79 "mac/audio_device_mac.h",
Tommidf0c05b2015-05-19 15:30:39 +020080 "mac/audio_mixer_manager_mac.cc",
81 "mac/audio_mixer_manager_mac.h",
82 "mac/portaudio/pa_memorybarrier.h",
83 "mac/portaudio/pa_ringbuffer.c",
84 "mac/portaudio/pa_ringbuffer.h",
85 "win/audio_device_core_win.cc",
86 "win/audio_device_core_win.h",
Tommidf0c05b2015-05-19 15:30:39 +020087 "win/audio_device_wave_win.cc",
88 "win/audio_device_wave_win.h",
89 "win/audio_mixer_manager_win.cc",
90 "win/audio_mixer_manager_win.h",
kjellander@webrtc.orgc4870bb2014-09-01 04:24:11 +000091 ]
92 if (is_linux) {
93 defines += [ "LINUX_ALSA" ]
94
95 libs = [
96 "dl",
97 "X11",
98 ]
99
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +0000100 if (rtc_include_pulse_audio) {
kjellander@webrtc.orgc4870bb2014-09-01 04:24:11 +0000101 sources += [
102 "linux/audio_device_pulse_linux.cc",
103 "linux/audio_device_pulse_linux.h",
104 "linux/audio_mixer_manager_pulse_linux.cc",
105 "linux/audio_mixer_manager_pulse_linux.h",
106 "linux/pulseaudiosymboltable_linux.cc",
107 "linux/pulseaudiosymboltable_linux.h",
108 ]
109
110 defines += [ "LINUX_PULSE" ]
111 }
112 }
113 if (is_mac) {
114 libs = [
115 "AudioToolbox.framework",
116 "CoreAudio.framework",
117 ]
118 }
119 if (is_ios) {
120 cflags += [ "-fobjc-arc" ] # CLANG_ENABLE_OBJC_ARC = YES.
121
122 libs = [
123 "AudioToolbox.framework",
124 "AVFoundation.framework",
kjellander@webrtc.orgd7e34e12015-01-26 19:17:26 +0000125 "Foundation.framework",
kjellander@webrtc.orgc4870bb2014-09-01 04:24:11 +0000126 ]
127 }
128 if (is_win) {
129 libs = [
130 # Required for the built-in WASAPI AEC.
131 "dmoguids.lib",
132 "wmcodecdspuuid.lib",
133 "amstrmid.lib",
134 "msdmo.lib",
135 ]
136 }
137 } else {
138 defines = [ "WEBRTC_DUMMY_AUDIO_BUILD" ]
139 }
140
141 if (!build_with_chromium) {
142 sources += [
143 # Do not link these into Chrome since they contain static data.
144 "dummy/file_audio_device_factory.cc",
145 "dummy/file_audio_device_factory.h",
146 ]
147 }
148
kjellander@webrtc.orgf21ea912014-09-28 17:37:22 +0000149 configs += [ "../..:common_config" ]
150 public_configs = [
151 "../..:common_inherited_config",
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200152 ":audio_device_config",
kjellander@webrtc.orgf21ea912014-09-28 17:37:22 +0000153 ]
154
kjellander@webrtc.orgc4870bb2014-09-01 04:24:11 +0000155 if (is_clang) {
156 # Suppress warnings from Chrome's Clang plugins.
157 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
158 configs -= [ "//build/config/clang:find_bad_constructs" ]
159 }
160
161 deps = [
kwiberg@webrtc.orgac2d27d2015-02-26 13:59:22 +0000162 "../..:webrtc_common",
henrika@webrtc.org62f6e752015-02-11 08:38:35 +0000163 "../../base:rtc_base_approved",
kjellander@webrtc.orgc4870bb2014-09-01 04:24:11 +0000164 "../../common_audio",
165 "../../system_wrappers",
166 "../utility",
167 ]
168}