blob: c72aa2e7a62ef8ad8ec14f911d1a9c4538955815 [file] [log] [blame]
andrew@webrtc.orgb9d7d932012-01-25 19:21:13 +00001# Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
niklase@google.com470e71d2011-07-07 08:21:25 +00002#
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
9{
andrew@webrtc.orgb0730102013-11-11 17:20:27 +000010 'variables': {
11 'audio_processing_dependencies': [
xians@webrtc.orge46bc772014-10-10 08:36:56 +000012 '<(webrtc_root)/base/base.gyp:rtc_base_approved',
andrew@webrtc.orgb0730102013-11-11 17:20:27 +000013 '<(webrtc_root)/common_audio/common_audio.gyp:common_audio',
14 '<(webrtc_root)/system_wrappers/source/system_wrappers.gyp:system_wrappers',
15 ],
michaelbai@google.com82ebb462014-02-11 04:48:27 +000016 'shared_generated_dir': '<(SHARED_INTERMEDIATE_DIR)/audio_processing/asm_offsets',
andrew@webrtc.orgb0730102013-11-11 17:20:27 +000017 },
niklase@google.com470e71d2011-07-07 08:21:25 +000018 'targets': [
19 {
20 'target_name': 'audio_processing',
andrew@webrtc.org8c4696c2012-09-08 19:27:24 +000021 'type': 'static_library',
22 'variables': {
23 # Outputs some low-level debug files.
24 'aec_debug_dump%': 0,
bjornv@webrtc.orgea297872014-09-23 11:21:39 +000025 'agc_debug_dump%': 0,
andrew@webrtc.org1760a172013-09-25 23:17:38 +000026
27 # Disables the usual mode where we trust the reported system delay
28 # values the AEC receives. The corresponding define is set appropriately
29 # in the code, but it can be force-enabled here for testing.
30 'aec_untrusted_delay_for_testing%': 0,
andrew@webrtc.org8c4696c2012-09-08 19:27:24 +000031 },
niklase@google.com470e71d2011-07-07 08:21:25 +000032 'dependencies': [
andrew@webrtc.orgb0730102013-11-11 17:20:27 +000033 '<@(audio_processing_dependencies)',
niklase@google.com470e71d2011-07-07 08:21:25 +000034 ],
niklase@google.com470e71d2011-07-07 08:21:25 +000035 'sources': [
andrew@webrtc.org8c4696c2012-09-08 19:27:24 +000036 'aec/include/echo_cancellation.h',
37 'aec/echo_cancellation.c',
38 'aec/echo_cancellation_internal.h',
39 'aec/aec_core.h',
40 'aec/aec_core.c',
bjornv@webrtc.org56a9ec32013-02-20 22:38:47 +000041 'aec/aec_core_internal.h',
andrew@webrtc.org8c4696c2012-09-08 19:27:24 +000042 'aec/aec_rdft.h',
43 'aec/aec_rdft.c',
44 'aec/aec_resampler.h',
45 'aec/aec_resampler.c',
46 'aecm/include/echo_control_mobile.h',
47 'aecm/echo_control_mobile.c',
48 'aecm/aecm_core.c',
49 'aecm/aecm_core.h',
50 'agc/include/gain_control.h',
51 'agc/analog_agc.c',
52 'agc/analog_agc.h',
53 'agc/digital_agc.c',
54 'agc/digital_agc.h',
niklase@google.com470e71d2011-07-07 08:21:25 +000055 'audio_buffer.cc',
56 'audio_buffer.h',
57 'audio_processing_impl.cc',
58 'audio_processing_impl.h',
aluebs@webrtc.org79b9eba2014-11-26 20:21:38 +000059 'channel_buffer.cc',
60 'channel_buffer.h',
andrew@webrtc.orgddbb8a22014-04-22 21:00:04 +000061 'common.h',
niklase@google.com470e71d2011-07-07 08:21:25 +000062 'echo_cancellation_impl.cc',
63 'echo_cancellation_impl.h',
64 'echo_control_mobile_impl.cc',
65 'echo_control_mobile_impl.h',
66 'gain_control_impl.cc',
67 'gain_control_impl.h',
68 'high_pass_filter_impl.cc',
69 'high_pass_filter_impl.h',
andrew@webrtc.org8c4696c2012-09-08 19:27:24 +000070 'include/audio_processing.h',
niklase@google.com470e71d2011-07-07 08:21:25 +000071 'level_estimator_impl.cc',
72 'level_estimator_impl.h',
73 'noise_suppression_impl.cc',
74 'noise_suppression_impl.h',
niklase@google.com470e71d2011-07-07 08:21:25 +000075 'processing_component.cc',
76 'processing_component.h',
aluebs@webrtc.orgbe05c742014-11-14 22:18:10 +000077 'splitting_filter.cc',
78 'splitting_filter.h',
andrew@webrtc.org382c0c22014-05-05 18:22:21 +000079 'rms_level.cc',
80 'rms_level.h',
henrikg@webrtc.orgc6937042014-01-30 09:50:46 +000081 'typing_detection.cc',
82 'typing_detection.h',
andrew@webrtc.org8c4696c2012-09-08 19:27:24 +000083 'utility/delay_estimator.c',
84 'utility/delay_estimator.h',
85 'utility/delay_estimator_internal.h',
86 'utility/delay_estimator_wrapper.c',
87 'utility/delay_estimator_wrapper.h',
88 'utility/fft4g.c',
89 'utility/fft4g.h',
90 'utility/ring_buffer.c',
91 'utility/ring_buffer.h',
niklase@google.com470e71d2011-07-07 08:21:25 +000092 'voice_detection_impl.cc',
93 'voice_detection_impl.h',
94 ],
andrew@webrtc.org8c4696c2012-09-08 19:27:24 +000095 'conditions': [
96 ['aec_debug_dump==1', {
97 'defines': ['WEBRTC_AEC_DEBUG_DUMP',],
98 }],
andrew@webrtc.org1760a172013-09-25 23:17:38 +000099 ['aec_untrusted_delay_for_testing==1', {
100 'defines': ['WEBRTC_UNTRUSTED_DELAY',],
101 }],
bjornv@webrtc.orgea297872014-09-23 11:21:39 +0000102 ['agc_debug_dump==1', {
103 'defines': ['WEBRTC_AGC_DEBUG_DUMP',],
104 }],
andrew@webrtc.org8c4696c2012-09-08 19:27:24 +0000105 ['enable_protobuf==1', {
106 'dependencies': ['audioproc_debug_proto'],
107 'defines': ['WEBRTC_AUDIOPROC_DEBUG_DUMP'],
108 }],
109 ['prefer_fixed_point==1', {
110 'defines': ['WEBRTC_NS_FIXED'],
111 'sources': [
112 'ns/include/noise_suppression_x.h',
113 'ns/noise_suppression_x.c',
114 'ns/nsx_core.c',
115 'ns/nsx_core.h',
116 'ns/nsx_defines.h',
117 ],
andrew@webrtc.orgea9392d2014-01-16 07:22:01 +0000118 'conditions': [
andrew@webrtc.org11533222014-11-21 16:28:32 +0000119 ['target_arch=="mipsel" and mips_arch_variant!="r6" and android_webview_build==0', {
andrew@webrtc.orgea9392d2014-01-16 07:22:01 +0000120 'sources': [
121 'ns/nsx_core_mips.c',
122 ],
123 }, {
124 'sources': [
125 'ns/nsx_core_c.c',
126 ],
127 }],
128 ],
andrew@webrtc.org8c4696c2012-09-08 19:27:24 +0000129 }, {
130 'defines': ['WEBRTC_NS_FLOAT'],
131 'sources': [
132 'ns/defines.h',
133 'ns/include/noise_suppression.h',
134 'ns/noise_suppression.c',
135 'ns/ns_core.c',
136 'ns/ns_core.h',
137 'ns/windows_private.h',
138 ],
139 }],
140 ['target_arch=="ia32" or target_arch=="x64"', {
141 'dependencies': ['audio_processing_sse2',],
142 }],
andrew@webrtc.orga56a2c52014-11-26 17:01:40 +0000143 ['(target_arch=="arm" and arm_version==7) or target_arch=="armv7" or target_arch=="arm64"', {
andrew@webrtc.org8c4696c2012-09-08 19:27:24 +0000144 'dependencies': ['audio_processing_neon',],
145 }],
andrew@webrtc.org11533222014-11-21 16:28:32 +0000146 ['target_arch=="mipsel" and mips_arch_variant!="r6" and android_webview_build==0', {
andrew@webrtc.orge03cafa2013-11-11 20:10:01 +0000147 'sources': [
148 'aecm/aecm_core_mips.c',
149 ],
andrew@webrtc.orgc0907ef2014-02-21 00:13:31 +0000150 'conditions': [
151 ['mips_fpu==1', {
152 'sources': [
153 'aec/aec_core_mips.c',
154 'aec/aec_rdft_mips.c',
155 ],
156 }],
157 ],
andrew@webrtc.orge03cafa2013-11-11 20:10:01 +0000158 }, {
159 'sources': [
160 'aecm/aecm_core_c.c',
161 ],
162 }],
andrew@webrtc.org8c4696c2012-09-08 19:27:24 +0000163 ],
andrew@webrtc.org63e09642013-01-29 06:45:22 +0000164 # TODO(jschuh): Bug 1348: fix size_t to int truncations.
165 'msvs_disabled_warnings': [ 4267, ],
niklase@google.com470e71d2011-07-07 08:21:25 +0000166 },
andrew@webrtc.org7bf26462011-12-03 00:03:31 +0000167 ],
168 'conditions': [
169 ['enable_protobuf==1', {
170 'targets': [
171 {
172 'target_name': 'audioproc_debug_proto',
173 'type': 'static_library',
andrew@webrtc.org8c4696c2012-09-08 19:27:24 +0000174 'sources': ['debug.proto',],
andrew@webrtc.org7bf26462011-12-03 00:03:31 +0000175 'variables': {
176 'proto_in_dir': '.',
177 # Workaround to protect against gyp's pathname relativization when
178 # this file is included by modules.gyp.
179 'proto_out_protected': 'webrtc/audio_processing',
180 'proto_out_dir': '<(proto_out_protected)',
181 },
andrew@webrtc.org8c4696c2012-09-08 19:27:24 +0000182 'includes': ['../../build/protoc.gypi',],
183 },
184 ],
185 }],
186 ['target_arch=="ia32" or target_arch=="x64"', {
187 'targets': [
188 {
189 'target_name': 'audio_processing_sse2',
190 'type': 'static_library',
191 'sources': [
192 'aec/aec_core_sse2.c',
193 'aec/aec_rdft_sse2.c',
194 ],
195 'cflags': ['-msse2',],
196 'xcode_settings': {
197 'OTHER_CFLAGS': ['-msse2',],
198 },
199 },
200 ],
201 }],
andrew@webrtc.orga56a2c52014-11-26 17:01:40 +0000202 ['(target_arch=="arm" and arm_version==7) or target_arch=="armv7" or target_arch=="arm64"', {
kma@webrtc.org12454022012-11-07 22:34:31 +0000203 'targets': [{
204 'target_name': 'audio_processing_neon',
205 'type': 'static_library',
206 'includes': ['../../build/arm_neon.gypi',],
207 'dependencies': [
andrew@webrtc.org34235372013-04-30 23:43:26 +0000208 '<(webrtc_root)/common_audio/common_audio.gyp:common_audio',
kma@webrtc.org12454022012-11-07 22:34:31 +0000209 ],
210 'sources': [
bjornv@webrtc.orgaf6f02f2014-06-13 14:50:23 +0000211 'aec/aec_core_neon.c',
bjornv@webrtc.orgcd9b90a2014-06-30 12:05:18 +0000212 'aec/aec_rdft_neon.c',
kma@webrtc.org12454022012-11-07 22:34:31 +0000213 'aecm/aecm_core_neon.c',
214 'ns/nsx_core_neon.c',
215 ],
216 'conditions': [
andrew@webrtc.orga56a2c52014-11-26 17:01:40 +0000217 ['(OS=="android" or OS=="ios") and target_arch!="arm64"', {
kma@webrtc.org12454022012-11-07 22:34:31 +0000218 'dependencies': [
michaelbai@google.com82ebb462014-02-11 04:48:27 +0000219 '<(gen_core_neon_offsets_gyp):*',
kma@webrtc.org12454022012-11-07 22:34:31 +0000220 ],
kma@webrtc.org12454022012-11-07 22:34:31 +0000221 'sources': [
222 'aecm/aecm_core_neon.S',
223 'ns/nsx_core_neon.S',
224 ],
michaelbai@google.com82ebb462014-02-11 04:48:27 +0000225 'include_dirs': [
226 '<(shared_generated_dir)',
227 ],
kma@webrtc.org12454022012-11-07 22:34:31 +0000228 'sources!': [
229 'aecm/aecm_core_neon.c',
230 'ns/nsx_core_neon.c',
231 ],
232 'includes!': ['../../build/arm_neon.gypi',],
233 }],
andrew@webrtc.orgaf7fdfc2014-08-29 17:41:13 +0000234 # Disable LTO in audio_processing_neon target due to compiler bug
235 ['use_lto==1', {
236 'cflags!': [
237 '-flto',
238 '-ffat-lto-objects',
239 ],
240 }],
kma@webrtc.org12454022012-11-07 22:34:31 +0000241 ],
242 }],
andrew@webrtc.org7bf26462011-12-03 00:03:31 +0000243 }],
niklase@google.com470e71d2011-07-07 08:21:25 +0000244 ],
245}