blob: ef84bc716a8727eaa4c99d1c82fa0b8a7c430462 [file] [log] [blame]
aleloi77ad3942016-07-04 06:33:02 -07001# 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
mbonadei9aa3f0a2017-01-24 06:58:22 -08009import("../../webrtc.gni")
ehmaldonado38a21322016-09-02 04:10:34 -070010
kjellander6ceab082016-10-28 05:44:03 -070011group("audio_mixer") {
Mirko Bonadei03d6f2f2017-12-05 15:33:16 +010012 deps = [
kjellander6ceab082016-10-28 05:44:03 -070013 ":audio_frame_manipulator",
14 ":audio_mixer_impl",
15 ]
16}
17
Mirko Bonadei86d053c2019-10-17 21:32:04 +020018rtc_library("audio_mixer_impl") {
Mirko Bonadei97c65b72018-10-05 11:19:58 +020019 visibility = [ "*" ]
aleloi77ad3942016-07-04 06:33:02 -070020 sources = [
aleloi5d167d62016-08-24 02:20:54 -070021 "audio_mixer_impl.cc",
22 "audio_mixer_impl.h",
aleloi623427c2016-12-08 02:37:58 -080023 "default_output_rate_calculator.cc",
24 "default_output_rate_calculator.h",
aleloi24899e52017-02-21 05:06:29 -080025 "frame_combiner.cc",
26 "frame_combiner.h",
aleloi623427c2016-12-08 02:37:58 -080027 "output_rate_calculator.h",
aleloi77ad3942016-07-04 06:33:02 -070028 ]
29
aleloi44968092016-08-08 10:18:58 -070030 public = [
aleloi201dfe92016-10-20 05:06:39 -070031 "audio_mixer_impl.h",
aleloi24899e52017-02-21 05:06:29 -080032 "default_output_rate_calculator.h", # For creating a mixer with limiter disabled.
33 "frame_combiner.h",
aleloi44968092016-08-08 10:18:58 -070034 ]
35
Alex Loiko507e8d12018-02-27 13:51:47 +010036 configs += [ "../audio_processing:apm_debug_dump" ]
37
aleloi77ad3942016-07-04 06:33:02 -070038 deps = [
aleloi201dfe92016-10-20 05:06:39 -070039 ":audio_frame_manipulator",
kwiberg529662a2017-09-04 05:43:17 -070040 "../../api:array_view",
Mirko Bonadeid9708072019-01-25 20:26:48 +010041 "../../api:scoped_refptr",
Alex Loiko8396e342018-06-21 12:04:05 +020042 "../../api/audio:audio_frame_api",
Gustaf Ullberg2ae140a2018-02-16 13:43:49 +010043 "../../api/audio:audio_mixer_api",
aleloi6321b492016-12-05 01:46:09 -080044 "../../audio/utility:audio_frame_operations",
Alex Loiko507e8d12018-02-27 13:51:47 +010045 "../../common_audio",
Patrik Höglunda8005cf2017-12-13 16:05:42 +010046 "../../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -070047 "../../rtc_base:rtc_base_approved",
aleloi77ad3942016-07-04 06:33:02 -070048 "../../system_wrappers",
Mirko Bonadei17f48782018-09-28 08:51:10 +020049 "../../system_wrappers:metrics",
aleloi6321b492016-12-05 01:46:09 -080050 "../audio_processing",
Alessio Bazzicab768e882018-11-07 14:29:54 +000051 "../audio_processing:api",
Alex Loiko507e8d12018-02-27 13:51:47 +010052 "../audio_processing:apm_logging",
53 "../audio_processing:audio_frame_view",
Alex Loiko2bac8962018-03-27 13:38:36 +020054 "../audio_processing/agc2:fixed_digital",
aleloi201dfe92016-10-20 05:06:39 -070055 ]
56}
57
Mirko Bonadei86d053c2019-10-17 21:32:04 +020058rtc_library("audio_frame_manipulator") {
aleloi201dfe92016-10-20 05:06:39 -070059 visibility = [
60 ":*",
61 "../../modules:*",
62 ]
63
64 sources = [
65 "audio_frame_manipulator.cc",
66 "audio_frame_manipulator.h",
67 ]
68
69 deps = [
Fredrik Solenbergbbf21a32018-04-12 22:44:09 +020070 "../../api/audio:audio_frame_api",
Mirko Bonadei5e849cf2017-12-05 08:02:53 +010071 "../../audio/utility:audio_frame_operations",
Patrik Höglunda8005cf2017-12-13 16:05:42 +010072 "../../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -070073 "../../rtc_base:rtc_base_approved",
aleloi77ad3942016-07-04 06:33:02 -070074 ]
75}
ehmaldonado36268652017-01-19 08:27:11 -080076
77if (rtc_include_tests) {
Mirko Bonadei86d053c2019-10-17 21:32:04 +020078 rtc_library("audio_mixer_test_utils") {
ehmaldonado36268652017-01-19 08:27:11 -080079 testonly = true
kjellandere0629c02017-04-25 04:04:50 -070080
ehmaldonado36268652017-01-19 08:27:11 -080081 sources = [
aleloi2c9306e2017-03-29 04:25:16 -070082 "gain_change_calculator.cc",
83 "gain_change_calculator.h",
84 "sine_wave_generator.cc",
85 "sine_wave_generator.h",
ehmaldonado36268652017-01-19 08:27:11 -080086 ]
Alex Loiko507e8d12018-02-27 13:51:47 +010087
ehmaldonado36268652017-01-19 08:27:11 -080088 deps = [
89 ":audio_frame_manipulator",
90 ":audio_mixer_impl",
kwiberg529662a2017-09-04 05:43:17 -070091 "../../api:array_view",
Fredrik Solenbergbbf21a32018-04-12 22:44:09 +020092 "../../api/audio:audio_frame_api",
Henrik Boströmd2c336f2019-07-03 17:11:10 +020093 "../../rtc_base:checks",
94 "../../rtc_base:rtc_base_approved",
95 ]
96 }
97
Mirko Bonadei86d053c2019-10-17 21:32:04 +020098 rtc_library("audio_mixer_unittests") {
Henrik Boströmd2c336f2019-07-03 17:11:10 +020099 testonly = true
100
101 sources = [
102 "audio_frame_manipulator_unittest.cc",
103 "audio_mixer_impl_unittest.cc",
104 "frame_combiner_unittest.cc",
105 ]
106
107 deps = [
108 ":audio_frame_manipulator",
109 ":audio_mixer_impl",
110 ":audio_mixer_test_utils",
111 "../../api:array_view",
Gustaf Ullberg2ae140a2018-02-16 13:43:49 +0100112 "../../api/audio:audio_mixer_api",
aleloi2c9306e2017-03-29 04:25:16 -0700113 "../../audio/utility:audio_frame_operations",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100114 "../../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700115 "../../rtc_base:rtc_base_approved",
Danil Chapovalovd26a9162019-03-19 18:08:37 +0100116 "../../rtc_base:task_queue_for_test",
ehmaldonado36268652017-01-19 08:27:11 -0800117 "../../test:test_support",
ehmaldonado36268652017-01-19 08:27:11 -0800118 ]
ehmaldonado36268652017-01-19 08:27:11 -0800119 }
Alex Loiko99a2c5d2018-02-27 14:09:47 +0100120
121 rtc_executable("audio_mixer_test") {
122 testonly = true
123 sources = [
124 "audio_mixer_test.cc",
125 ]
126
127 deps = [
128 ":audio_mixer_impl",
129 "../../api/audio:audio_mixer_api",
130 "../../common_audio",
Mirko Bonadei2ab97f62019-07-18 13:44:12 +0200131 "../../rtc_base:stringutils",
132 "//third_party/abseil-cpp/absl/flags:flag",
133 "//third_party/abseil-cpp/absl/flags:parse",
Alex Loiko99a2c5d2018-02-27 14:09:47 +0100134 ]
135 }
ehmaldonado36268652017-01-19 08:27:11 -0800136}