xref: /aosp_15_r20/external/webrtc/modules/BUILD.gn (revision d9f758449e529ab9291ac668be2861e7a55c2422)
1# Copyright (c) 2016 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")
10import("audio_coding/audio_coding.gni")
11
12group("modules") {
13  deps = [
14    "audio_coding",
15    "audio_device",
16    "audio_mixer",
17    "audio_processing",
18    "congestion_controller",
19    "pacing",
20    "remote_bitrate_estimator",
21    "rtp_rtcp",
22    "utility",
23    "video_coding",
24  ]
25
26  if (rtc_desktop_capture_supported) {
27    deps += [ "desktop_capture" ]
28  }
29}
30
31rtc_source_set("module_api_public") {
32  sources = [ "include/module_common_types_public.h" ]
33  absl_deps = [ "//third_party/abseil-cpp/absl/types:optional" ]
34}
35
36rtc_source_set("module_api") {
37  visibility = [ "*" ]
38  sources = [ "include/module_common_types.h" ]
39}
40
41rtc_source_set("module_fec_api") {
42  visibility = [ "*" ]
43  sources = [ "include/module_fec_types.h" ]
44}
45
46if (rtc_include_tests && !build_with_chromium) {
47  modules_tests_resources = [
48    "../resources/audio_coding/testfile16kHz.pcm",
49    "../resources/audio_coding/testfile32kHz.pcm",
50    "../resources/audio_coding/teststereo32kHz.pcm",
51    "../resources/foreman_cif.yuv",
52  ]
53
54  if (is_ios) {
55    bundle_data("modules_tests_bundle_data") {
56      testonly = true
57      sources = modules_tests_resources
58      outputs = [ "{{bundle_resources_dir}}/{{source_file_part}}" ]
59    }
60  }
61
62  rtc_test("modules_tests") {
63    testonly = true
64
65    deps = [
66      "../test:test_main",
67      "../test:video_test_common",
68      "audio_coding:audio_coding_modules_tests",
69      "rtp_rtcp:rtp_rtcp_modules_tests",
70      "video_coding:video_coding_modules_tests",
71      "//testing/gtest",
72    ]
73
74    if (rtc_desktop_capture_supported) {
75      deps += [ "desktop_capture:desktop_capture_modules_tests" ]
76    }
77
78    data = modules_tests_resources
79
80    if (is_android) {
81      use_default_launcher = false
82      deps += [
83        # NOTE(brandtr): Including Java classes seems only to be possible from
84        # rtc_test targets. Therefore we include this target here, instead of
85        # in video_coding_modules_tests, where it is actually used.
86        "../sdk/android:libjingle_peerconnection_java",
87        "//sdk/android:native_test_jni_onload",
88        "//testing/android/native_test:native_test_support",
89      ]
90      shard_timeout = 900
91    }
92
93    if (is_ios) {
94      deps += [ ":modules_tests_bundle_data" ]
95    }
96  }
97
98  modules_unittests_resources = [
99    "../resources/audio_coding/neteq_opus.rtp",
100    "../resources/audio_coding/neteq_opus_dtx.rtp",
101    "../resources/audio_coding/neteq_universal_new.rtp",
102    "../resources/audio_coding/speech_4_channels_48k_one_second.wav",
103    "../resources/audio_coding/speech_mono_16kHz.pcm",
104    "../resources/audio_coding/speech_mono_32_48kHz.pcm",
105    "../resources/audio_coding/testfile16kHz.pcm",
106    "../resources/audio_coding/testfile32kHz.pcm",
107    "../resources/audio_coding/testfile_fake_stereo_32kHz.pcm",
108    "../resources/audio_coding/teststereo32kHz.pcm",
109    "../resources/audio_device/audio_short16.pcm",
110    "../resources/audio_device/audio_short44.pcm",
111    "../resources/audio_device/audio_short48.pcm",
112    "../resources/audio_processing/agc/agc_audio.pcm",
113    "../resources/audio_processing/agc/agc_no_circular_buffer.dat",
114    "../resources/audio_processing/agc/agc_pitch_gain.dat",
115    "../resources/audio_processing/agc/agc_pitch_lag.dat",
116    "../resources/audio_processing/agc/agc_spectral_peak.dat",
117    "../resources/audio_processing/agc/agc_vad.dat",
118    "../resources/audio_processing/agc/agc_voicing_prob.dat",
119    "../resources/audio_processing/agc/agc_with_circular_buffer.dat",
120    "../resources/audio_processing/output_data_fixed.pb",
121    "../resources/audio_processing/output_data_float.pb",
122    "../resources/audio_processing/output_data_float_avx2.pb",
123    "../resources/audio_processing/output_data_mac.pb",
124    "../resources/audio_processing/transient/ajm-macbook-1-spke16m.pcm",
125    "../resources/audio_processing/transient/audio16kHz.pcm",
126    "../resources/audio_processing/transient/audio32kHz.pcm",
127    "../resources/audio_processing/transient/audio48kHz.pcm",
128    "../resources/audio_processing/transient/audio8kHz.pcm",
129    "../resources/audio_processing/transient/detect16kHz.dat",
130    "../resources/audio_processing/transient/detect32kHz.dat",
131    "../resources/audio_processing/transient/detect48kHz.dat",
132    "../resources/audio_processing/transient/detect8kHz.dat",
133    "../resources/audio_processing/transient/double-utils.dat",
134    "../resources/audio_processing/transient/float-utils.dat",
135    "../resources/audio_processing/transient/suppressed16kHz.pcm",
136    "../resources/audio_processing/transient/suppressed32kHz.pcm",
137    "../resources/audio_processing/transient/suppressed8kHz.pcm",
138    "../resources/audio_processing/transient/wpd0.dat",
139    "../resources/audio_processing/transient/wpd1.dat",
140    "../resources/audio_processing/transient/wpd2.dat",
141    "../resources/audio_processing/transient/wpd3.dat",
142    "../resources/audio_processing/transient/wpd4.dat",
143    "../resources/audio_processing/transient/wpd5.dat",
144    "../resources/audio_processing/transient/wpd6.dat",
145    "../resources/audio_processing/transient/wpd7.dat",
146    "../resources/deflicker_before_cif_short.yuv",
147    "../resources/far16_stereo.pcm",
148    "../resources/far176_stereo.pcm",
149    "../resources/far192_stereo.pcm",
150    "../resources/far22_stereo.pcm",
151    "../resources/far32_stereo.pcm",
152    "../resources/far44_stereo.pcm",
153    "../resources/far48_stereo.pcm",
154    "../resources/far88_stereo.pcm",
155    "../resources/far8_stereo.pcm",
156    "../resources/far96_stereo.pcm",
157    "../resources/foremanColorEnhanced_cif_short.yuv",
158    "../resources/foreman_cif.yuv",
159    "../resources/foreman_cif_short.yuv",
160    "../resources/near16_stereo.pcm",
161    "../resources/near176_stereo.pcm",
162    "../resources/near192_stereo.pcm",
163    "../resources/near22_stereo.pcm",
164    "../resources/near32_stereo.pcm",
165    "../resources/near44_stereo.pcm",
166    "../resources/near48_stereo.pcm",
167    "../resources/near88_stereo.pcm",
168    "../resources/near8_stereo.pcm",
169    "../resources/near96_stereo.pcm",
170    "../resources/ref03.aecdump",
171    "../resources/remote_bitrate_estimator/VideoSendersTest_BweTest_IncreasingChoke1_0_AST.bin",
172    "../resources/remote_bitrate_estimator/VideoSendersTest_BweTest_IncreasingChoke1_0_TOF.bin",
173    "../resources/remote_bitrate_estimator/VideoSendersTest_BweTest_IncreasingChoke1_1_AST.bin",
174    "../resources/remote_bitrate_estimator/VideoSendersTest_BweTest_IncreasingChoke1_1_TOF.bin",
175    "../resources/remote_bitrate_estimator/VideoSendersTest_BweTest_IncreasingChoke2_0_AST.bin",
176    "../resources/remote_bitrate_estimator/VideoSendersTest_BweTest_IncreasingChoke2_0_TOF.bin",
177    "../resources/remote_bitrate_estimator/VideoSendersTest_BweTest_IncreasingChoke2_1_AST.bin",
178    "../resources/remote_bitrate_estimator/VideoSendersTest_BweTest_IncreasingChoke2_1_TOF.bin",
179    "../resources/remote_bitrate_estimator/VideoSendersTest_BweTest_IncreasingDelay1_0_AST.bin",
180    "../resources/remote_bitrate_estimator/VideoSendersTest_BweTest_IncreasingDelay1_0_TOF.bin",
181    "../resources/remote_bitrate_estimator/VideoSendersTest_BweTest_IncreasingLoss1_0_AST.bin",
182    "../resources/remote_bitrate_estimator/VideoSendersTest_BweTest_IncreasingLoss1_0_TOF.bin",
183    "../resources/remote_bitrate_estimator/VideoSendersTest_BweTest_Multi1_1_AST.bin",
184    "../resources/remote_bitrate_estimator/VideoSendersTest_BweTest_Multi1_1_TOF.bin",
185    "../resources/remote_bitrate_estimator/VideoSendersTest_BweTest_SteadyChoke_0_AST.bin",
186    "../resources/remote_bitrate_estimator/VideoSendersTest_BweTest_SteadyChoke_0_TOF.bin",
187    "../resources/remote_bitrate_estimator/VideoSendersTest_BweTest_SteadyChoke_1_AST.bin",
188    "../resources/remote_bitrate_estimator/VideoSendersTest_BweTest_SteadyChoke_1_TOF.bin",
189    "../resources/remote_bitrate_estimator/VideoSendersTest_BweTest_SteadyDelay_0_AST.bin",
190    "../resources/remote_bitrate_estimator/VideoSendersTest_BweTest_SteadyDelay_0_TOF.bin",
191    "../resources/remote_bitrate_estimator/VideoSendersTest_BweTest_SteadyLoss_0_AST.bin",
192    "../resources/remote_bitrate_estimator/VideoSendersTest_BweTest_SteadyLoss_0_TOF.bin",
193    "../resources/remote_bitrate_estimator/VideoSendersTest_BweTest_UnlimitedSpeed_0_AST.bin",
194    "../resources/remote_bitrate_estimator/VideoSendersTest_BweTest_UnlimitedSpeed_0_TOF.bin",
195    "../resources/short_mixed_mono_48.dat",
196    "../resources/short_mixed_mono_48.pcm",
197    "../resources/short_mixed_mono_48_arm.dat",
198    "../resources/short_mixed_stereo_48.dat",
199    "../resources/short_mixed_stereo_48.pcm",
200    "../resources/voice_engine/audio_tiny48.wav",
201  ]
202  if (is_ios) {
203    bundle_data("modules_unittests_bundle_data") {
204      testonly = true
205      sources = modules_unittests_resources
206      outputs = [ "{{bundle_resources_dir}}/{{source_file_part}}" ]
207    }
208  }
209
210  rtc_test("modules_unittests") {
211    testonly = true
212    defines = []
213    sources = [ "module_common_types_unittest.cc" ]
214
215    deps = [
216      ":module_api",
217      ":module_api_public",
218      "../test:test_main",
219      "../test:test_support",
220      "audio_coding:audio_coding_unittests",
221      "audio_device:audio_device_unittests",
222      "audio_mixer:audio_mixer_unittests",
223      "audio_processing:audio_processing_unittests",
224      "audio_processing/aec3:aec3_unittests",
225      "audio_processing/ns:ns_unittests",
226      "congestion_controller:congestion_controller_unittests",
227      "pacing:pacing_unittests",
228      "remote_bitrate_estimator:remote_bitrate_estimator_unittests",
229      "rtp_rtcp:rtp_rtcp_unittests",
230      "utility:utility_unittests",
231      "video_coding:video_coding_unittests",
232      "video_coding/timing:timing_unittests",
233    ]
234
235    if (rtc_desktop_capture_supported) {
236      deps += [ "desktop_capture:desktop_capture_unittests" ]
237    }
238
239    data = modules_unittests_resources
240
241    if (is_android) {
242      use_default_launcher = false
243      deps += [
244        "../sdk/android:libjingle_peerconnection_java",
245        "//testing/android/native_test:native_test_support",
246      ]
247      shard_timeout = 900
248    }
249    if (is_ios) {
250      info_plist = "../test/ios/Info.plist"
251      deps += [ ":modules_unittests_bundle_data" ]
252      configs += [ "..:common_objc" ]
253      ldflags = [ "-ObjC" ]
254    }
255  }
256}
257