blob: 3ac87b81e84e1c2d1cef6d6a8f0cf86241e3dbbd [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',
andrew@webrtc.orgddbb8a22014-04-22 21:00:04 +000059 'common.h',
niklase@google.com470e71d2011-07-07 08:21:25 +000060 'echo_cancellation_impl.cc',
61 'echo_cancellation_impl.h',
62 'echo_control_mobile_impl.cc',
63 'echo_control_mobile_impl.h',
64 'gain_control_impl.cc',
65 'gain_control_impl.h',
66 'high_pass_filter_impl.cc',
67 'high_pass_filter_impl.h',
andrew@webrtc.org8c4696c2012-09-08 19:27:24 +000068 'include/audio_processing.h',
niklase@google.com470e71d2011-07-07 08:21:25 +000069 'level_estimator_impl.cc',
70 'level_estimator_impl.h',
71 'noise_suppression_impl.cc',
72 'noise_suppression_impl.h',
niklase@google.com470e71d2011-07-07 08:21:25 +000073 'processing_component.cc',
74 'processing_component.h',
aluebs@webrtc.orgbe05c742014-11-14 22:18:10 +000075 'splitting_filter.cc',
76 'splitting_filter.h',
andrew@webrtc.org382c0c22014-05-05 18:22:21 +000077 'rms_level.cc',
78 'rms_level.h',
henrikg@webrtc.orgc6937042014-01-30 09:50:46 +000079 'typing_detection.cc',
80 'typing_detection.h',
andrew@webrtc.org8c4696c2012-09-08 19:27:24 +000081 'utility/delay_estimator.c',
82 'utility/delay_estimator.h',
83 'utility/delay_estimator_internal.h',
84 'utility/delay_estimator_wrapper.c',
85 'utility/delay_estimator_wrapper.h',
86 'utility/fft4g.c',
87 'utility/fft4g.h',
88 'utility/ring_buffer.c',
89 'utility/ring_buffer.h',
niklase@google.com470e71d2011-07-07 08:21:25 +000090 'voice_detection_impl.cc',
91 'voice_detection_impl.h',
92 ],
andrew@webrtc.org8c4696c2012-09-08 19:27:24 +000093 'conditions': [
94 ['aec_debug_dump==1', {
95 'defines': ['WEBRTC_AEC_DEBUG_DUMP',],
96 }],
andrew@webrtc.org1760a172013-09-25 23:17:38 +000097 ['aec_untrusted_delay_for_testing==1', {
98 'defines': ['WEBRTC_UNTRUSTED_DELAY',],
99 }],
bjornv@webrtc.orgea297872014-09-23 11:21:39 +0000100 ['agc_debug_dump==1', {
101 'defines': ['WEBRTC_AGC_DEBUG_DUMP',],
102 }],
andrew@webrtc.org8c4696c2012-09-08 19:27:24 +0000103 ['enable_protobuf==1', {
104 'dependencies': ['audioproc_debug_proto'],
105 'defines': ['WEBRTC_AUDIOPROC_DEBUG_DUMP'],
106 }],
107 ['prefer_fixed_point==1', {
108 'defines': ['WEBRTC_NS_FIXED'],
109 'sources': [
110 'ns/include/noise_suppression_x.h',
111 'ns/noise_suppression_x.c',
112 'ns/nsx_core.c',
113 'ns/nsx_core.h',
114 'ns/nsx_defines.h',
115 ],
andrew@webrtc.orgea9392d2014-01-16 07:22:01 +0000116 'conditions': [
andrew@webrtc.org11533222014-11-21 16:28:32 +0000117 ['target_arch=="mipsel" and mips_arch_variant!="r6" and android_webview_build==0', {
andrew@webrtc.orgea9392d2014-01-16 07:22:01 +0000118 'sources': [
119 'ns/nsx_core_mips.c',
120 ],
121 }, {
122 'sources': [
123 'ns/nsx_core_c.c',
124 ],
125 }],
126 ],
andrew@webrtc.org8c4696c2012-09-08 19:27:24 +0000127 }, {
128 'defines': ['WEBRTC_NS_FLOAT'],
129 'sources': [
130 'ns/defines.h',
131 'ns/include/noise_suppression.h',
132 'ns/noise_suppression.c',
133 'ns/ns_core.c',
134 'ns/ns_core.h',
135 'ns/windows_private.h',
136 ],
137 }],
138 ['target_arch=="ia32" or target_arch=="x64"', {
139 'dependencies': ['audio_processing_sse2',],
140 }],
kjellander@webrtc.org917306d2013-12-10 09:26:07 +0000141 ['(target_arch=="arm" and arm_version==7) or target_arch=="armv7"', {
andrew@webrtc.org8c4696c2012-09-08 19:27:24 +0000142 'dependencies': ['audio_processing_neon',],
143 }],
andrew@webrtc.org11533222014-11-21 16:28:32 +0000144 ['target_arch=="mipsel" and mips_arch_variant!="r6" and android_webview_build==0', {
andrew@webrtc.orge03cafa2013-11-11 20:10:01 +0000145 'sources': [
146 'aecm/aecm_core_mips.c',
147 ],
andrew@webrtc.orgc0907ef2014-02-21 00:13:31 +0000148 'conditions': [
149 ['mips_fpu==1', {
150 'sources': [
151 'aec/aec_core_mips.c',
152 'aec/aec_rdft_mips.c',
153 ],
154 }],
155 ],
andrew@webrtc.orge03cafa2013-11-11 20:10:01 +0000156 }, {
157 'sources': [
158 'aecm/aecm_core_c.c',
159 ],
160 }],
andrew@webrtc.org8c4696c2012-09-08 19:27:24 +0000161 ],
andrew@webrtc.org63e09642013-01-29 06:45:22 +0000162 # TODO(jschuh): Bug 1348: fix size_t to int truncations.
163 'msvs_disabled_warnings': [ 4267, ],
niklase@google.com470e71d2011-07-07 08:21:25 +0000164 },
andrew@webrtc.org7bf26462011-12-03 00:03:31 +0000165 ],
166 'conditions': [
167 ['enable_protobuf==1', {
168 'targets': [
169 {
170 'target_name': 'audioproc_debug_proto',
171 'type': 'static_library',
andrew@webrtc.org8c4696c2012-09-08 19:27:24 +0000172 'sources': ['debug.proto',],
andrew@webrtc.org7bf26462011-12-03 00:03:31 +0000173 'variables': {
174 'proto_in_dir': '.',
175 # Workaround to protect against gyp's pathname relativization when
176 # this file is included by modules.gyp.
177 'proto_out_protected': 'webrtc/audio_processing',
178 'proto_out_dir': '<(proto_out_protected)',
179 },
andrew@webrtc.org8c4696c2012-09-08 19:27:24 +0000180 'includes': ['../../build/protoc.gypi',],
181 },
182 ],
183 }],
184 ['target_arch=="ia32" or target_arch=="x64"', {
185 'targets': [
186 {
187 'target_name': 'audio_processing_sse2',
188 'type': 'static_library',
189 'sources': [
190 'aec/aec_core_sse2.c',
191 'aec/aec_rdft_sse2.c',
192 ],
193 'cflags': ['-msse2',],
194 'xcode_settings': {
195 'OTHER_CFLAGS': ['-msse2',],
196 },
197 },
198 ],
199 }],
kjellander@webrtc.org917306d2013-12-10 09:26:07 +0000200 ['(target_arch=="arm" and arm_version==7) or target_arch=="armv7"', {
kma@webrtc.org12454022012-11-07 22:34:31 +0000201 'targets': [{
202 'target_name': 'audio_processing_neon',
203 'type': 'static_library',
204 'includes': ['../../build/arm_neon.gypi',],
205 'dependencies': [
andrew@webrtc.org34235372013-04-30 23:43:26 +0000206 '<(webrtc_root)/common_audio/common_audio.gyp:common_audio',
kma@webrtc.org12454022012-11-07 22:34:31 +0000207 ],
208 'sources': [
bjornv@webrtc.orgaf6f02f2014-06-13 14:50:23 +0000209 'aec/aec_core_neon.c',
bjornv@webrtc.orgcd9b90a2014-06-30 12:05:18 +0000210 'aec/aec_rdft_neon.c',
kma@webrtc.org12454022012-11-07 22:34:31 +0000211 'aecm/aecm_core_neon.c',
212 'ns/nsx_core_neon.c',
213 ],
214 'conditions': [
kma@webrtc.org2f9bd242013-02-23 04:16:59 +0000215 ['OS=="android" or OS=="ios"', {
kma@webrtc.org12454022012-11-07 22:34:31 +0000216 'dependencies': [
michaelbai@google.com82ebb462014-02-11 04:48:27 +0000217 '<(gen_core_neon_offsets_gyp):*',
kma@webrtc.org12454022012-11-07 22:34:31 +0000218 ],
kma@webrtc.org12454022012-11-07 22:34:31 +0000219 'sources': [
220 'aecm/aecm_core_neon.S',
221 'ns/nsx_core_neon.S',
222 ],
michaelbai@google.com82ebb462014-02-11 04:48:27 +0000223 'include_dirs': [
224 '<(shared_generated_dir)',
225 ],
kma@webrtc.org12454022012-11-07 22:34:31 +0000226 'sources!': [
227 'aecm/aecm_core_neon.c',
228 'ns/nsx_core_neon.c',
229 ],
230 'includes!': ['../../build/arm_neon.gypi',],
231 }],
andrew@webrtc.orgaf7fdfc2014-08-29 17:41:13 +0000232 # Disable LTO in audio_processing_neon target due to compiler bug
233 ['use_lto==1', {
234 'cflags!': [
235 '-flto',
236 '-ffat-lto-objects',
237 ],
238 }],
kma@webrtc.org12454022012-11-07 22:34:31 +0000239 ],
240 }],
andrew@webrtc.org7bf26462011-12-03 00:03:31 +0000241 }],
niklase@google.com470e71d2011-07-07 08:21:25 +0000242 ],
243}