blob: f1f2d910df64b11e1ff2097abd07ff925afa243b [file] [log] [blame]
skvladcc91d282016-10-03 18:31:22 -07001# 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
mbonadei9aa3f0a2017-01-24 06:58:22 -08009import("../webrtc.gni")
Dan Minor9c686132018-01-15 10:20:00 -050010if (!build_with_mozilla) {
11 import("//third_party/protobuf/proto_library.gni")
12}
skvladcc91d282016-10-03 18:31:22 -070013if (is_android) {
14 import("//build/config/android/config.gni")
15 import("//build/config/android/rules.gni")
16}
17
kjellander6ceab082016-10-28 05:44:03 -070018group("logging") {
Mirko Bonadei818d9102017-12-12 12:46:13 +010019 deps = [
Qingsi Wang970b0882018-02-01 11:04:46 -080020 ":rtc_event_audio",
21 ":rtc_event_bwe",
22 ":rtc_event_log_impl_base",
23 ":rtc_event_log_impl_encoder",
24 ":rtc_event_log_impl_output",
25 ":rtc_event_pacing",
26 ":rtc_event_rtp_rtcp",
27 ":rtc_event_video",
kjellander6ceab082016-10-28 05:44:03 -070028 ]
Qingsi Wang970b0882018-02-01 11:04:46 -080029
kjellander6ceab082016-10-28 05:44:03 -070030 if (rtc_enable_protobuf) {
Mirko Bonadei818d9102017-12-12 12:46:13 +010031 deps += [ ":rtc_event_log_parser" ]
kjellander6ceab082016-10-28 05:44:03 -070032 }
33}
34
Qingsi Wang970b0882018-02-01 11:04:46 -080035# TODO(mbonadei): Remove when the following CL is landed:
36# https://webrtc-review.googlesource.com/c/src/+/46900.
37# This is only a backwards compatible target.
38rtc_source_set("rtc_event_log_impl") {
39 visibility = [ "*" ]
40 deps = [
41 ":rtc_event_log_impl_base",
42 ]
43}
44
skvladcc91d282016-10-03 18:31:22 -070045rtc_source_set("rtc_event_log_api") {
46 sources = [
Qingsi Wang970b0882018-02-01 11:04:46 -080047 "rtc_event_log/encoder/rtc_event_log_encoder.h",
Elad Alon652cc842017-10-02 11:27:52 +020048 "rtc_event_log/events/rtc_event.h",
Qingsi Wang970b0882018-02-01 11:04:46 -080049 "rtc_event_log/rtc_event_log.h",
50 "rtc_event_log/rtc_event_log_factory_interface.h",
51 ]
52
53 deps = [
54 "../api:libjingle_logging_api",
55 "../rtc_base:rtc_base_approved",
56 ]
57}
58
59rtc_source_set("rtc_stream_config") {
60 sources = [
61 "rtc_event_log/rtc_stream_config.cc",
62 "rtc_event_log/rtc_stream_config.h",
63 ]
64
65 deps = [
66 ":rtc_event_log_api",
67 "..:webrtc_common",
68 "../api:libjingle_peerconnection_api",
69 ]
70}
71
72rtc_source_set("rtc_event_pacing") {
73 sources = [
Ilya Nikolaevskiya4259f62017-12-05 13:19:45 +010074 "rtc_event_log/events/rtc_event_alr_state.cc",
75 "rtc_event_log/events/rtc_event_alr_state.h",
Qingsi Wang970b0882018-02-01 11:04:46 -080076 ]
77
78 deps = [
79 ":rtc_event_log_api",
80 "../:typedefs",
81 ]
82}
83
84rtc_source_set("rtc_event_audio") {
85 sources = [
Elad Alon652cc842017-10-02 11:27:52 +020086 "rtc_event_log/events/rtc_event_audio_network_adaptation.cc",
87 "rtc_event_log/events/rtc_event_audio_network_adaptation.h",
88 "rtc_event_log/events/rtc_event_audio_playout.cc",
89 "rtc_event_log/events/rtc_event_audio_playout.h",
90 "rtc_event_log/events/rtc_event_audio_receive_stream_config.cc",
91 "rtc_event_log/events/rtc_event_audio_receive_stream_config.h",
92 "rtc_event_log/events/rtc_event_audio_send_stream_config.cc",
93 "rtc_event_log/events/rtc_event_audio_send_stream_config.h",
Qingsi Wang970b0882018-02-01 11:04:46 -080094 ]
95
96 deps = [
97 ":rtc_event_log_api",
98 ":rtc_stream_config",
99 "../modules/audio_coding:audio_network_adaptor_config",
100 ]
101}
102
103rtc_source_set("rtc_event_bwe") {
104 sources = [
Elad Alon652cc842017-10-02 11:27:52 +0200105 "rtc_event_log/events/rtc_event_bwe_update_delay_based.cc",
106 "rtc_event_log/events/rtc_event_bwe_update_delay_based.h",
107 "rtc_event_log/events/rtc_event_bwe_update_loss_based.cc",
108 "rtc_event_log/events/rtc_event_bwe_update_loss_based.h",
Elad Alon652cc842017-10-02 11:27:52 +0200109 "rtc_event_log/events/rtc_event_probe_cluster_created.cc",
110 "rtc_event_log/events/rtc_event_probe_cluster_created.h",
111 "rtc_event_log/events/rtc_event_probe_result_failure.cc",
112 "rtc_event_log/events/rtc_event_probe_result_failure.h",
113 "rtc_event_log/events/rtc_event_probe_result_success.cc",
114 "rtc_event_log/events/rtc_event_probe_result_success.h",
Qingsi Wang970b0882018-02-01 11:04:46 -0800115 ]
116
117 deps = [
118 ":rtc_event_log_api",
119 "../modules/remote_bitrate_estimator:remote_bitrate_estimator",
120 ]
121}
122
123rtc_source_set("rtc_event_rtp_rtcp") {
124 sources = [
Elad Alon652cc842017-10-02 11:27:52 +0200125 "rtc_event_log/events/rtc_event_rtcp_packet_incoming.cc",
126 "rtc_event_log/events/rtc_event_rtcp_packet_incoming.h",
127 "rtc_event_log/events/rtc_event_rtcp_packet_outgoing.cc",
128 "rtc_event_log/events/rtc_event_rtcp_packet_outgoing.h",
129 "rtc_event_log/events/rtc_event_rtp_packet_incoming.cc",
130 "rtc_event_log/events/rtc_event_rtp_packet_incoming.h",
131 "rtc_event_log/events/rtc_event_rtp_packet_outgoing.cc",
132 "rtc_event_log/events/rtc_event_rtp_packet_outgoing.h",
Qingsi Wang970b0882018-02-01 11:04:46 -0800133 ]
134
135 deps = [
136 ":rtc_event_log_api",
137 "../api:array_view",
138 "../modules/rtp_rtcp:rtp_rtcp_format",
139 "../rtc_base:rtc_base_approved",
140 ]
141}
142
143rtc_source_set("rtc_event_video") {
144 sources = [
Elad Alon652cc842017-10-02 11:27:52 +0200145 "rtc_event_log/events/rtc_event_video_receive_stream_config.cc",
146 "rtc_event_log/events/rtc_event_video_receive_stream_config.h",
147 "rtc_event_log/events/rtc_event_video_send_stream_config.cc",
148 "rtc_event_log/events/rtc_event_video_send_stream_config.h",
skvladcc91d282016-10-03 18:31:22 -0700149 ]
Elad Alon83ccca12017-10-04 13:18:26 +0200150
kjellander727ac1d2017-03-08 02:12:11 -0800151 deps = [
Qingsi Wang970b0882018-02-01 11:04:46 -0800152 ":rtc_event_log_api",
153 ":rtc_stream_config",
kjellander727ac1d2017-03-08 02:12:11 -0800154 ]
skvladcc91d282016-10-03 18:31:22 -0700155}
156
Qingsi Wang970b0882018-02-01 11:04:46 -0800157rtc_static_library("rtc_event_log_impl_encoder") {
Per Kjellandera7f2d842018-01-10 15:54:53 +0000158 visibility = [ "*" ]
skvladcc91d282016-10-03 18:31:22 -0700159 sources = [
Elad Alon1d87b0e2017-10-03 15:01:03 +0200160 "rtc_event_log/encoder/rtc_event_log_encoder_legacy.cc",
161 "rtc_event_log/encoder/rtc_event_log_encoder_legacy.h",
skvladcc91d282016-10-03 18:31:22 -0700162 ]
163
164 defines = []
165
166 deps = [
Qingsi Wang970b0882018-02-01 11:04:46 -0800167 ":rtc_event_audio",
168 ":rtc_event_bwe",
skvladcc91d282016-10-03 18:31:22 -0700169 ":rtc_event_log_api",
Qingsi Wang970b0882018-02-01 11:04:46 -0800170 ":rtc_event_log_impl_output",
171 ":rtc_event_pacing",
172 ":rtc_event_rtp_rtcp",
173 ":rtc_event_video",
174 ":rtc_stream_config",
minyue4b7c9522017-01-24 04:54:59 -0800175 "../modules/audio_coding:audio_network_adaptor",
michaelt97653702017-04-11 00:49:44 -0700176 "../modules/remote_bitrate_estimator:remote_bitrate_estimator",
Mirko Bonadeib5728d92017-12-06 07:51:33 +0100177 "../modules/rtp_rtcp:rtp_rtcp_format",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100178 "../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700179 "../rtc_base:rtc_base_approved",
skvladcc91d282016-10-03 18:31:22 -0700180 ]
181
182 if (rtc_enable_protobuf) {
183 defines += [ "ENABLE_RTC_EVENT_LOG" ]
184 deps += [ ":rtc_event_log_proto" ]
185 }
Elad Alon83ccca12017-10-04 13:18:26 +0200186
187 # TODO(eladalon): Remove this.
kjellandere40a7ee2016-10-16 23:56:12 -0700188 if (!build_with_chromium && is_clang) {
189 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
skvladcc91d282016-10-03 18:31:22 -0700190 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
191 }
192}
193
Qingsi Wang970b0882018-02-01 11:04:46 -0800194rtc_source_set("rtc_event_log_impl_output") {
195 sources = [
196 "rtc_event_log/output/rtc_event_log_output_file.cc",
197 "rtc_event_log/output/rtc_event_log_output_file.h",
198 ]
199
200 deps = [
201 ":rtc_event_log_api",
202 "../api:libjingle_logging_api",
203 "../rtc_base:checks",
204 "../rtc_base:rtc_base_approved",
205 ]
206
207 if (!build_with_chromium && is_clang) {
208 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
209 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
210 }
211}
212
213rtc_static_library("rtc_event_log_impl_base") {
214 visibility = [ "*" ]
215 sources = [
216 "rtc_event_log/rtc_event_log_factory.cc",
217 "rtc_event_log/rtc_event_log_factory.h",
218 "rtc_event_log/rtc_event_log_impl.cc",
219 ]
220
221 defines = []
222
223 deps = [
224 ":rtc_event_log_api",
225 ":rtc_event_log_impl_encoder",
226 ":rtc_event_log_impl_output",
227 "../rtc_base:checks",
228 "../rtc_base:rtc_base_approved",
229 "../rtc_base:rtc_task_queue_api",
230 "../rtc_base:sequenced_task_checker",
231 ]
232
233 if (rtc_enable_protobuf) {
234 defines += [ "ENABLE_RTC_EVENT_LOG" ]
235 deps += [ ":rtc_event_log_proto" ]
236 }
237
238 if (!build_with_chromium && is_clang) {
239 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
240 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
241 }
242}
243
skvladcc91d282016-10-03 18:31:22 -0700244if (rtc_enable_protobuf) {
245 proto_library("rtc_event_log_proto") {
246 sources = [
247 "rtc_event_log/rtc_event_log.proto",
248 ]
Mirko Bonadei92ea95e2017-09-15 06:47:31 +0200249 proto_out_dir = "logging/rtc_event_log"
skvladcc91d282016-10-03 18:31:22 -0700250 }
skvladcc91d282016-10-03 18:31:22 -0700251
Mirko Bonadeib3c210f2017-12-15 17:12:42 +0100252 proto_library("rtc_event_log2_proto") {
253 sources = [
254 "rtc_event_log/rtc_event_log2.proto",
255 ]
256 proto_out_dir = "logging/rtc_event_log"
257 }
258
skvladcc91d282016-10-03 18:31:22 -0700259 rtc_static_library("rtc_event_log_parser") {
260 sources = [
261 "rtc_event_log/rtc_event_log_parser.cc",
262 "rtc_event_log/rtc_event_log_parser.h",
263 ]
264
Mirko Bonadei818d9102017-12-12 12:46:13 +0100265 deps = [
Qingsi Wang970b0882018-02-01 11:04:46 -0800266 ":rtc_event_bwe",
Mirko Bonadeib3c210f2017-12-15 17:12:42 +0100267 ":rtc_event_log2_proto",
kjellander727ac1d2017-03-08 02:12:11 -0800268 ":rtc_event_log_api",
skvladcc91d282016-10-03 18:31:22 -0700269 ":rtc_event_log_proto",
Qingsi Wang970b0882018-02-01 11:04:46 -0800270 ":rtc_stream_config",
skvladcc91d282016-10-03 18:31:22 -0700271 "..:webrtc_common",
Mirko Bonadei818d9102017-12-12 12:46:13 +0100272 "../call:video_stream_api",
michaeltcde46b72017-04-06 05:59:10 -0700273 "../modules/audio_coding:audio_network_adaptor",
michaelt97653702017-04-11 00:49:44 -0700274 "../modules/remote_bitrate_estimator:remote_bitrate_estimator",
Mirko Bonadeib5728d92017-12-06 07:51:33 +0100275 "../modules/rtp_rtcp",
Mirko Bonadei818d9102017-12-12 12:46:13 +0100276 "../modules/rtp_rtcp:rtp_rtcp_format",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100277 "../rtc_base:checks",
Mirko Bonadei818d9102017-12-12 12:46:13 +0100278 "../rtc_base:protobuf_utils",
279 "../rtc_base:rtc_base_approved",
skvladcc91d282016-10-03 18:31:22 -0700280 ]
281
kjellandere40a7ee2016-10-16 23:56:12 -0700282 if (!build_with_chromium && is_clang) {
283 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
skvladcc91d282016-10-03 18:31:22 -0700284 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
285 }
286 }
ehmaldonado1fd08c12017-01-17 02:37:34 -0800287
288 if (rtc_include_tests) {
289 rtc_source_set("rtc_event_log_tests") {
290 testonly = true
Elad Alon1d87b0e2017-10-03 15:01:03 +0200291 assert(rtc_enable_protobuf)
292 defines = [ "ENABLE_RTC_EVENT_LOG" ]
Elad Alon8233bfe2017-10-05 15:27:29 +0200293 if (rtc_use_memcheck) {
294 defines += [ "WEBRTC_USE_MEMCHECK" ]
295 }
ehmaldonado1fd08c12017-01-17 02:37:34 -0800296 sources = [
Elad Alon1d87b0e2017-10-03 15:01:03 +0200297 "rtc_event_log/encoder/rtc_event_log_encoder_unittest.cc",
Elad Alon83ccca12017-10-04 13:18:26 +0200298 "rtc_event_log/output/rtc_event_log_output_file_unittest.cc",
ehmaldonado1fd08c12017-01-17 02:37:34 -0800299 "rtc_event_log/rtc_event_log_unittest.cc",
300 "rtc_event_log/rtc_event_log_unittest_helper.cc",
eladalonb5c319a2017-08-17 08:32:39 -0700301 "rtc_event_log/rtc_event_log_unittest_helper.h",
ehmaldonado1fd08c12017-01-17 02:37:34 -0800302 ]
303 deps = [
Qingsi Wang970b0882018-02-01 11:04:46 -0800304 ":rtc_event_audio",
305 ":rtc_event_bwe",
Mirko Bonadei818d9102017-12-12 12:46:13 +0100306 ":rtc_event_log_api",
Qingsi Wang970b0882018-02-01 11:04:46 -0800307 ":rtc_event_log_impl_base",
308 ":rtc_event_log_impl_encoder",
309 ":rtc_event_log_impl_output",
ehmaldonado1fd08c12017-01-17 02:37:34 -0800310 ":rtc_event_log_parser",
Mirko Bonadei818d9102017-12-12 12:46:13 +0100311 ":rtc_event_log_proto",
Qingsi Wang970b0882018-02-01 11:04:46 -0800312 ":rtc_event_rtp_rtcp",
313 ":rtc_event_video",
314 ":rtc_stream_config",
Mirko Bonadeia0e1a552017-12-04 10:50:51 +0100315 "../api:libjingle_peerconnection_api",
ehmaldonado1fd08c12017-01-17 02:37:34 -0800316 "../call",
Mirko Bonadeia0e1a552017-12-04 10:50:51 +0100317 "../call:call_interfaces",
michaeltcde46b72017-04-06 05:59:10 -0700318 "../modules/audio_coding:audio_network_adaptor",
michaelt97653702017-04-11 00:49:44 -0700319 "../modules/remote_bitrate_estimator:remote_bitrate_estimator",
Mirko Bonadeib5728d92017-12-06 07:51:33 +0100320 "../modules/rtp_rtcp:rtp_rtcp_format",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100321 "../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700322 "../rtc_base:rtc_base_approved",
323 "../rtc_base:rtc_base_tests_utils",
kjellander727ac1d2017-03-08 02:12:11 -0800324 "../test:test_support",
ehmaldonado1fd08c12017-01-17 02:37:34 -0800325 "//testing/gtest",
326 ]
327 if (!build_with_chromium && is_clang) {
328 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
329 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
330 }
331 }
ivoc54b6e982017-02-08 00:28:09 -0800332 rtc_test("rtc_event_log2rtp_dump") {
333 testonly = true
334 sources = [
335 "rtc_event_log/rtc_event_log2rtp_dump.cc",
336 ]
337 deps = [
338 ":rtc_event_log_api",
ivoc54b6e982017-02-08 00:28:09 -0800339 ":rtc_event_log_parser",
Mirko Bonadei818d9102017-12-12 12:46:13 +0100340 "../modules/rtp_rtcp",
Mirko Bonadeib5728d92017-12-06 07:51:33 +0100341 "../modules/rtp_rtcp:rtp_rtcp_format",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100342 "../rtc_base:checks",
Mirko Bonadei818d9102017-12-12 12:46:13 +0100343 "../rtc_base:protobuf_utils",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700344 "../rtc_base:rtc_base_approved",
ivoc54b6e982017-02-08 00:28:09 -0800345 "../system_wrappers:field_trial_default",
346 "../system_wrappers:metrics_default",
347 "../test:rtp_test_utils",
ivoc54b6e982017-02-08 00:28:09 -0800348 ]
349 if (!build_with_chromium && is_clang) {
350 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
351 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
352 }
353 }
ehmaldonado1fd08c12017-01-17 02:37:34 -0800354 }
Patrik Höglund731082c2018-01-03 09:08:20 +0100355
tereliusd4ed7f52017-02-08 04:22:53 -0800356 if (rtc_include_tests) {
357 rtc_executable("rtc_event_log2text") {
358 testonly = true
359 sources = [
360 "rtc_event_log/rtc_event_log2text.cc",
361 ]
362 deps = [
363 ":rtc_event_log_api",
tereliusd4ed7f52017-02-08 04:22:53 -0800364 ":rtc_event_log_parser",
Mirko Bonadei818d9102017-12-12 12:46:13 +0100365 "../:webrtc_common",
Stefan Holmer1acbd682017-09-01 15:29:28 +0200366 "../call:video_stream_api",
Mirko Bonadeib5728d92017-12-06 07:51:33 +0100367 "../modules/rtp_rtcp:rtp_rtcp_format",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100368 "../rtc_base:checks",
Mirko Bonadei818d9102017-12-12 12:46:13 +0100369 "../rtc_base:protobuf_utils",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700370 "../rtc_base:rtc_base_approved",
tereliusbb46b952017-02-08 09:37:30 -0800371
372 # TODO(kwiberg): Remove this dependency.
kwiberg087bd342017-02-10 08:15:44 -0800373 "../api/audio_codecs:audio_codecs_api",
Elad Alona96fd7f2017-09-15 16:13:21 +0200374 "../modules/audio_coding:audio_network_adaptor_config",
Mirko Bonadeib5728d92017-12-06 07:51:33 +0100375 "../modules/rtp_rtcp",
tereliusd4ed7f52017-02-08 04:22:53 -0800376 ]
377 if (!build_with_chromium && is_clang) {
378 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
379 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
380 }
381 }
382 }
tereliusee37e862017-04-28 07:48:17 -0700383 if (rtc_include_tests) {
384 rtc_executable("rtc_event_log2stats") {
385 testonly = true
386 sources = [
387 "rtc_event_log/rtc_event_log2stats.cc",
388 ]
389 deps = [
390 ":rtc_event_log_api",
tereliusee37e862017-04-28 07:48:17 -0700391 ":rtc_event_log_proto",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100392 "../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700393 "../rtc_base:rtc_base_approved",
tereliusee37e862017-04-28 07:48:17 -0700394 ]
395 if (!build_with_chromium && is_clang) {
396 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
397 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
398 }
399 }
400 }
skvladcc91d282016-10-03 18:31:22 -0700401}
Patrik Höglund731082c2018-01-03 09:08:20 +0100402
403if (rtc_include_tests) {
404 rtc_source_set("mocks") {
405 testonly = true
406 sources = [
407 "rtc_event_log/mock/mock_rtc_event_log.h",
408 ]
409 deps = [
410 ":rtc_event_log_api",
411 "../../test:test_support",
412 ]
413 }
414}