xref: /aosp_15_r20/external/webrtc/modules/congestion_controller/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
11config("bwe_test_logging") {
12  if (rtc_enable_bwe_test_logging) {
13    defines = [ "BWE_TEST_LOGGING_COMPILE_TIME_ENABLE=1" ]
14  } else {
15    defines = [ "BWE_TEST_LOGGING_COMPILE_TIME_ENABLE=0" ]
16  }
17}
18
19rtc_library("congestion_controller") {
20  visibility = [ "*" ]
21  configs += [ ":bwe_test_logging" ]
22  sources = [
23    "include/receive_side_congestion_controller.h",
24    "receive_side_congestion_controller.cc",
25    "remb_throttler.cc",
26    "remb_throttler.h",
27  ]
28
29  deps = [
30    "../../api/transport:network_control",
31    "../../api/units:data_rate",
32    "../../api/units:time_delta",
33    "../../api/units:timestamp",
34    "../../rtc_base:logging",
35    "../../rtc_base:macromagic",
36    "../../rtc_base/synchronization:mutex",
37    "../pacing",
38    "../remote_bitrate_estimator",
39    "../rtp_rtcp:rtp_rtcp_format",
40  ]
41
42  if (!build_with_mozilla) {
43    deps += [ "../../rtc_base" ]
44  }
45}
46
47if (rtc_include_tests && !build_with_chromium) {
48  rtc_library("congestion_controller_unittests") {
49    testonly = true
50
51    sources = [
52      "receive_side_congestion_controller_unittest.cc",
53      "remb_throttler_unittest.cc",
54    ]
55    deps = [
56      ":congestion_controller",
57      "../../api/test/network_emulation",
58      "../../api/test/network_emulation:create_cross_traffic",
59      "../../api/units:data_rate",
60      "../../api/units:time_delta",
61      "../../api/units:timestamp",
62      "../../system_wrappers",
63      "../../test:test_support",
64      "../../test/scenario",
65      "../pacing",
66      "goog_cc:estimators",
67      "goog_cc:goog_cc_unittests",
68      "pcc:pcc_unittests",
69      "rtp:congestion_controller_unittests",
70    ]
71  }
72}
73