xref: /aosp_15_r20/external/webrtc/modules/audio_mixer/BUILD.gn (revision d9f758449e529ab9291ac668be2861e7a55c2422)
1# 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("../../webrtc.gni")
10
11group("audio_mixer") {
12  deps = [
13    ":audio_frame_manipulator",
14    ":audio_mixer_impl",
15  ]
16}
17
18rtc_library("audio_mixer_impl") {
19  visibility = [ "*" ]
20  sources = [
21    "audio_mixer_impl.cc",
22    "audio_mixer_impl.h",
23    "default_output_rate_calculator.cc",
24    "default_output_rate_calculator.h",
25    "frame_combiner.cc",
26    "frame_combiner.h",
27    "output_rate_calculator.h",
28  ]
29
30  public = [
31    "audio_mixer_impl.h",
32    "default_output_rate_calculator.h",  # For creating a mixer with limiter
33                                         # disabled.
34    "frame_combiner.h",
35  ]
36
37  configs += [ "../audio_processing:apm_debug_dump" ]
38
39  deps = [
40    ":audio_frame_manipulator",
41    "../../api:array_view",
42    "../../api:rtp_packet_info",
43    "../../api:scoped_refptr",
44    "../../api/audio:audio_frame_api",
45    "../../api/audio:audio_mixer_api",
46    "../../audio/utility:audio_frame_operations",
47    "../../common_audio",
48    "../../rtc_base:checks",
49    "../../rtc_base:event_tracer",
50    "../../rtc_base:logging",
51    "../../rtc_base:macromagic",
52    "../../rtc_base:race_checker",
53    "../../rtc_base:refcount",
54    "../../rtc_base:safe_conversions",
55    "../../rtc_base/synchronization:mutex",
56    "../../system_wrappers",
57    "../../system_wrappers:metrics",
58    "../audio_processing:api",
59    "../audio_processing:apm_logging",
60    "../audio_processing:audio_frame_view",
61    "../audio_processing/agc2:fixed_digital",
62  ]
63}
64
65rtc_library("audio_frame_manipulator") {
66  visibility = [
67    ":*",
68    "../../modules:*",
69  ]
70
71  sources = [
72    "audio_frame_manipulator.cc",
73    "audio_frame_manipulator.h",
74  ]
75
76  deps = [
77    "../../api/audio:audio_frame_api",
78    "../../audio/utility:audio_frame_operations",
79    "../../rtc_base:checks",
80  ]
81}
82
83if (rtc_include_tests) {
84  rtc_library("audio_mixer_test_utils") {
85    testonly = true
86
87    sources = [
88      "gain_change_calculator.cc",
89      "gain_change_calculator.h",
90      "sine_wave_generator.cc",
91      "sine_wave_generator.h",
92    ]
93
94    deps = [
95      ":audio_frame_manipulator",
96      ":audio_mixer_impl",
97      "../../api:array_view",
98      "../../api/audio:audio_frame_api",
99      "../../rtc_base:checks",
100      "../../rtc_base:safe_conversions",
101    ]
102  }
103
104  rtc_library("audio_mixer_unittests") {
105    testonly = true
106
107    sources = [
108      "audio_frame_manipulator_unittest.cc",
109      "audio_mixer_impl_unittest.cc",
110      "frame_combiner_unittest.cc",
111    ]
112    absl_deps = [ "//third_party/abseil-cpp/absl/types:optional" ]
113    deps = [
114      ":audio_frame_manipulator",
115      ":audio_mixer_impl",
116      ":audio_mixer_test_utils",
117      "../../api:array_view",
118      "../../api:rtp_packet_info",
119      "../../api/audio:audio_mixer_api",
120      "../../api/units:timestamp",
121      "../../audio/utility:audio_frame_operations",
122      "../../rtc_base:checks",
123      "../../rtc_base:stringutils",
124      "../../rtc_base:task_queue_for_test",
125      "../../test:test_support",
126    ]
127  }
128
129  if (!build_with_chromium) {
130    rtc_executable("audio_mixer_test") {
131      testonly = true
132      sources = [ "audio_mixer_test.cc" ]
133
134      deps = [
135        ":audio_mixer_impl",
136        "../../api/audio:audio_mixer_api",
137        "../../common_audio",
138        "../../rtc_base:stringutils",
139        "//third_party/abseil-cpp/absl/flags:flag",
140        "//third_party/abseil-cpp/absl/flags:parse",
141      ]
142    }
143  }
144}
145