blob: 5a4c688431fad775686dc6035711fb6ee5841bfc [file] [log] [blame]
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +00001# 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")
kjellanderfb114242016-06-13 00:19:48 -070010
kjellanderb62dbbe2016-09-23 00:38:52 -070011rtc_static_library("remote_bitrate_estimator") {
mbonadei49f465f2016-12-28 04:43:46 -080012 # TODO(mbonadei): Remove (bugs.webrtc.org/6828)
13 # Errors on cyclic dependency with:
14 # rtp_rtcp:rtp_rtcp if enabled.
15 check_includes = false
16
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +000017 sources = [
pbos@webrtc.org9f79fe62014-12-04 15:34:06 +000018 "aimd_rate_control.cc",
19 "aimd_rate_control.h",
stefan64636dd2016-08-03 00:29:03 -070020 "bwe_defines.cc",
kjellander5c1d0432016-06-09 02:40:58 -070021 "include/bwe_defines.h",
22 "include/remote_bitrate_estimator.h",
sprang318673c2015-09-04 04:43:21 -070023 "include/send_time_history.h",
pbos@webrtc.org9f79fe62014-12-04 15:34:06 +000024 "inter_arrival.cc",
25 "inter_arrival.h",
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +000026 "overuse_detector.cc",
27 "overuse_detector.h",
pbos@webrtc.org9f79fe62014-12-04 15:34:06 +000028 "overuse_estimator.cc",
29 "overuse_estimator.h",
30 "remote_bitrate_estimator_abs_send_time.cc",
kjellander5c1d0432016-06-09 02:40:58 -070031 "remote_bitrate_estimator_abs_send_time.h",
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +000032 "remote_bitrate_estimator_single_stream.cc",
kjellander5c1d0432016-06-09 02:40:58 -070033 "remote_bitrate_estimator_single_stream.h",
Erik Språng6b8d3552015-09-24 15:06:57 +020034 "remote_estimator_proxy.cc",
35 "remote_estimator_proxy.h",
sprang318673c2015-09-04 04:43:21 -070036 "send_time_history.cc",
kjellander5c1d0432016-06-09 02:40:58 -070037 "test/bwe_test_logging.h",
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +000038 ]
kjellander@webrtc.org9bef5512014-07-13 09:02:54 +000039
gaetano.carlucci61050f62016-09-30 06:29:54 -070040 if (rtc_enable_bwe_test_logging) {
41 defines = [ "BWE_TEST_LOGGING_COMPILE_TIME_ENABLE=1" ]
42 sources += [ "test/bwe_test_logging.cc" ]
43 } else {
44 defines = [ "BWE_TEST_LOGGING_COMPILE_TIME_ENABLE=0" ]
brucedawson07df20b2016-05-22 17:15:02 -070045 }
46
kjellandere40a7ee2016-10-16 23:56:12 -070047 if (!build_with_chromium && is_clang) {
48 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -070049 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellander@webrtc.org42ee5b52014-08-25 14:15:35 +000050 }
kjellander5c1d0432016-06-09 02:40:58 -070051
52 deps = [
53 "../..:webrtc_common",
ehmaldonado370dd472017-07-10 05:58:42 -070054 "../../base:rtc_base",
55 "../../base:rtc_base_approved",
kjellander5c1d0432016-06-09 02:40:58 -070056 "../../system_wrappers",
57 ]
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +000058}
kjellanderfb114242016-06-13 00:19:48 -070059
60if (rtc_include_tests) {
terelius3dcfd642016-10-07 00:39:56 -070061 rtc_static_library("bwe_simulator_lib") {
kjellanderfb114242016-06-13 00:19:48 -070062 testonly = true
63 sources = [
64 "test/bwe.cc",
65 "test/bwe.h",
66 "test/bwe_test.cc",
67 "test/bwe_test.h",
68 "test/bwe_test_baselinefile.cc",
69 "test/bwe_test_baselinefile.h",
70 "test/bwe_test_fileutils.cc",
71 "test/bwe_test_fileutils.h",
72 "test/bwe_test_framework.cc",
73 "test/bwe_test_framework.h",
74 "test/bwe_test_logging.h",
gnish6dcdf102017-06-05 06:01:26 -070075 "test/estimators/bbr.cc",
76 "test/estimators/bbr.h",
77 "test/estimators/congestion_window.h",
gnish191113a2017-07-05 05:00:46 -070078 "test/estimators/max_bandwidth_filter.cc",
gnish6dcdf102017-06-05 06:01:26 -070079 "test/estimators/max_bandwidth_filter.h",
80 "test/estimators/min_rtt_filter.h",
kjellanderfb114242016-06-13 00:19:48 -070081 "test/estimators/nada.cc",
82 "test/estimators/nada.h",
83 "test/estimators/remb.cc",
84 "test/estimators/remb.h",
85 "test/estimators/send_side.cc",
86 "test/estimators/send_side.h",
87 "test/estimators/tcp.cc",
88 "test/estimators/tcp.h",
89 "test/metric_recorder.cc",
90 "test/metric_recorder.h",
91 "test/packet.h",
92 "test/packet_receiver.cc",
93 "test/packet_receiver.h",
94 "test/packet_sender.cc",
95 "test/packet_sender.h",
96 ]
97
98 if (rtc_enable_bwe_test_logging) {
99 defines = [ "BWE_TEST_LOGGING_COMPILE_TIME_ENABLE=1" ]
kjellanderfb114242016-06-13 00:19:48 -0700100 } else {
101 defines = [ "BWE_TEST_LOGGING_COMPILE_TIME_ENABLE=0" ]
102 }
103
kjellandere40a7ee2016-10-16 23:56:12 -0700104 if (!build_with_chromium && is_clang) {
105 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700106 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellanderfb114242016-06-13 00:19:48 -0700107 }
108
109 if (is_win) {
110 cflags = [
111 # TODO(kjellander): Bug 261: fix this warning.
112 "/wd4373", # virtual function override.
113 ]
114 }
115
116 deps = [
mbonadei49f465f2016-12-28 04:43:46 -0800117 ":remote_bitrate_estimator",
mbonadei1140f972017-04-26 03:38:35 -0700118 "..:module_api",
mbonadei49f465f2016-12-28 04:43:46 -0800119 "../..:webrtc_common",
ehmaldonado370dd472017-07-10 05:58:42 -0700120 "../../base:gtest_prod",
121 "../../base:rtc_base",
122 "../../base:rtc_base_approved",
mbonadei49f465f2016-12-28 04:43:46 -0800123 "../../system_wrappers",
kjellanderfb114242016-06-13 00:19:48 -0700124 "../../test:test_support",
mbonadei49f465f2016-12-28 04:43:46 -0800125 "../../voice_engine",
126 "../bitrate_controller",
terelius95310922016-11-03 08:14:07 -0700127 "../congestion_controller",
kjellanderfb114242016-06-13 00:19:48 -0700128 "../pacing",
mbonadei49f465f2016-12-28 04:43:46 -0800129 "../rtp_rtcp",
kjellanderfb114242016-06-13 00:19:48 -0700130 "//testing/gmock",
131 "//testing/gtest",
132 ]
133 }
ehmaldonado021eef32017-01-05 07:09:50 -0800134
135 rtc_source_set("remote_bitrate_estimator_perf_tests") {
136 testonly = true
kjellandere0629c02017-04-25 04:04:50 -0700137
138 # Skip restricting visibility on mobile platforms since the tests on those
139 # gets additional generated targets which would require many lines here to
140 # cover (which would be confusing to read and hard to maintain).
141 if (!is_android && !is_ios) {
jianjun.zhuc0247402017-07-11 06:20:45 -0700142 visibility = [ "../..:webrtc_perf_tests" ]
kjellandere0629c02017-04-25 04:04:50 -0700143 }
ehmaldonado021eef32017-01-05 07:09:50 -0800144 sources = [
145 "remote_bitrate_estimators_test.cc",
146 ]
147 deps = [
148 ":bwe_simulator_lib",
149 ":remote_bitrate_estimator",
ehmaldonado370dd472017-07-10 05:58:42 -0700150 "../../base:rtc_base_approved",
ehmaldonado90474cc2017-03-17 03:47:24 -0700151 "../../test:test_support",
ehmaldonado021eef32017-01-05 07:09:50 -0800152 ]
153 if (!build_with_chromium && is_clang) {
154 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
155 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
156 }
157 }
ehmaldonado36268652017-01-19 08:27:11 -0800158
159 rtc_source_set("remote_bitrate_estimator_unittests") {
160 testonly = true
kjellandere0629c02017-04-25 04:04:50 -0700161
162 # Skip restricting visibility on mobile platforms since the tests on those
163 # gets additional generated targets which would require many lines here to
164 # cover (which would be confusing to read and hard to maintain).
165 if (!is_android && !is_ios) {
jianjun.zhuc0247402017-07-11 06:20:45 -0700166 visibility = [ "..:modules_unittests" ]
kjellandere0629c02017-04-25 04:04:50 -0700167 }
ehmaldonado36268652017-01-19 08:27:11 -0800168 sources = [
169 "aimd_rate_control_unittest.cc",
ehmaldonado36268652017-01-19 08:27:11 -0800170 "inter_arrival_unittest.cc",
171 "overuse_detector_unittest.cc",
172 "remote_bitrate_estimator_abs_send_time_unittest.cc",
173 "remote_bitrate_estimator_single_stream_unittest.cc",
174 "remote_bitrate_estimator_unittest_helper.cc",
175 "remote_bitrate_estimator_unittest_helper.h",
176 "remote_estimator_proxy_unittest.cc",
177 "send_time_history_unittest.cc",
178 "test/bwe_test_framework_unittest.cc",
179 "test/bwe_unittest.cc",
180 "test/estimators/nada_unittest.cc",
181 "test/metric_recorder_unittest.cc",
182 ]
183 deps = [
184 ":bwe_simulator_lib",
kjellandere0629c02017-04-25 04:04:50 -0700185 ":mock_remote_bitrate_observer",
ehmaldonado36268652017-01-19 08:27:11 -0800186 ":remote_bitrate_estimator",
187 "../..:webrtc_common",
ehmaldonado370dd472017-07-10 05:58:42 -0700188 "../../base:rtc_base",
189 "../../base:rtc_base_approved",
ehmaldonado36268652017-01-19 08:27:11 -0800190 "../../system_wrappers:system_wrappers",
191 "../../test:field_trial",
192 "../../test:test_support",
193 "../pacing:pacing",
194 "../rtp_rtcp:rtp_rtcp",
195 "//testing/gmock",
196 ]
197 if (is_win) {
198 cflags = [
199 # TODO(kjellander): bugs.webrtc.org/261: Fix this warning.
200 "/wd4373", # virtual function override.
201 ]
202 }
203 if (!build_with_chromium && is_clang) {
204 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
205 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
206 }
207 }
ehmaldonado9cbb0a12017-01-30 03:07:03 -0800208
kjellandere0629c02017-04-25 04:04:50 -0700209 rtc_source_set("mock_remote_bitrate_observer") {
210 testonly = true
211 sources = [
212 "include/mock/mock_remote_bitrate_observer.h",
213 ]
214 deps = [
215 ":remote_bitrate_estimator",
216 "../../test:test_support",
217 ]
218 }
219
ehmaldonado9cbb0a12017-01-30 03:07:03 -0800220 rtc_test("bwe_simulations_tests") {
221 testonly = true
222
223 sources = [
224 "bwe_simulations.cc",
225 ]
226 deps = [
227 ":bwe_simulator_lib",
228 ":remote_bitrate_estimator",
229 "../..:webrtc_common",
ehmaldonado370dd472017-07-10 05:58:42 -0700230 "../../base:rtc_base_approved",
ehmaldonado9cbb0a12017-01-30 03:07:03 -0800231 "../../test:test_main",
ehmaldonado9cbb0a12017-01-30 03:07:03 -0800232 "//testing/gmock",
233 "//testing/gtest",
234 "//third_party/gflags",
235 ]
236
237 if (!build_with_chromium && is_clang) {
238 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
239 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
240 }
241
242 if (is_win) {
243 cflags = [
244 # TODO(kjellander): bugs.webrtc.org/261: Fix this warning.
245 "/wd4373", # virtual function override.
246 ]
247 }
248 }
kjellanderfb114242016-06-13 00:19:48 -0700249}