blob: 39442d41f5a5819614c5b0fe19ff26f82b0ecf4f [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")
skvladcc91d282016-10-03 18:31:22 -070010import("//third_party/protobuf/proto_library.gni")
11if (is_android) {
12 import("//build/config/android/config.gni")
13 import("//build/config/android/rules.gni")
14}
15
kjellander6ceab082016-10-28 05:44:03 -070016group("logging") {
Mirko Bonadei818d9102017-12-12 12:46:13 +010017 deps = [
kjellander6ceab082016-10-28 05:44:03 -070018 ":rtc_event_log_impl",
19 ]
20 if (rtc_enable_protobuf) {
Mirko Bonadei818d9102017-12-12 12:46:13 +010021 deps += [ ":rtc_event_log_parser" ]
kjellander6ceab082016-10-28 05:44:03 -070022 }
23}
24
skvladcc91d282016-10-03 18:31:22 -070025rtc_source_set("rtc_event_log_api") {
26 sources = [
Elad Alon652cc842017-10-02 11:27:52 +020027 "rtc_event_log/events/rtc_event.h",
Ilya Nikolaevskiya4259f62017-12-05 13:19:45 +010028 "rtc_event_log/events/rtc_event_alr_state.cc",
29 "rtc_event_log/events/rtc_event_alr_state.h",
Elad Alon652cc842017-10-02 11:27:52 +020030 "rtc_event_log/events/rtc_event_audio_network_adaptation.cc",
31 "rtc_event_log/events/rtc_event_audio_network_adaptation.h",
32 "rtc_event_log/events/rtc_event_audio_playout.cc",
33 "rtc_event_log/events/rtc_event_audio_playout.h",
34 "rtc_event_log/events/rtc_event_audio_receive_stream_config.cc",
35 "rtc_event_log/events/rtc_event_audio_receive_stream_config.h",
36 "rtc_event_log/events/rtc_event_audio_send_stream_config.cc",
37 "rtc_event_log/events/rtc_event_audio_send_stream_config.h",
38 "rtc_event_log/events/rtc_event_bwe_update_delay_based.cc",
39 "rtc_event_log/events/rtc_event_bwe_update_delay_based.h",
40 "rtc_event_log/events/rtc_event_bwe_update_loss_based.cc",
41 "rtc_event_log/events/rtc_event_bwe_update_loss_based.h",
42 "rtc_event_log/events/rtc_event_logging_started.cc",
43 "rtc_event_log/events/rtc_event_logging_started.h",
44 "rtc_event_log/events/rtc_event_logging_stopped.cc",
45 "rtc_event_log/events/rtc_event_logging_stopped.h",
46 "rtc_event_log/events/rtc_event_probe_cluster_created.cc",
47 "rtc_event_log/events/rtc_event_probe_cluster_created.h",
48 "rtc_event_log/events/rtc_event_probe_result_failure.cc",
49 "rtc_event_log/events/rtc_event_probe_result_failure.h",
50 "rtc_event_log/events/rtc_event_probe_result_success.cc",
51 "rtc_event_log/events/rtc_event_probe_result_success.h",
52 "rtc_event_log/events/rtc_event_rtcp_packet_incoming.cc",
53 "rtc_event_log/events/rtc_event_rtcp_packet_incoming.h",
54 "rtc_event_log/events/rtc_event_rtcp_packet_outgoing.cc",
55 "rtc_event_log/events/rtc_event_rtcp_packet_outgoing.h",
56 "rtc_event_log/events/rtc_event_rtp_packet_incoming.cc",
57 "rtc_event_log/events/rtc_event_rtp_packet_incoming.h",
58 "rtc_event_log/events/rtc_event_rtp_packet_outgoing.cc",
59 "rtc_event_log/events/rtc_event_rtp_packet_outgoing.h",
60 "rtc_event_log/events/rtc_event_video_receive_stream_config.cc",
61 "rtc_event_log/events/rtc_event_video_receive_stream_config.h",
62 "rtc_event_log/events/rtc_event_video_send_stream_config.cc",
63 "rtc_event_log/events/rtc_event_video_send_stream_config.h",
Elad Alon83ccca12017-10-04 13:18:26 +020064 "rtc_event_log/output/rtc_event_log_output_file.cc",
65 "rtc_event_log/output/rtc_event_log_output_file.h",
skvladcc91d282016-10-03 18:31:22 -070066 "rtc_event_log/rtc_event_log.h",
zhihuang38ede132017-06-15 12:52:32 -070067 "rtc_event_log/rtc_event_log_factory_interface.h",
eladalon4bb3b9c2017-09-11 07:25:26 -070068 "rtc_event_log/rtc_stream_config.cc",
69 "rtc_event_log/rtc_stream_config.h",
skvladcc91d282016-10-03 18:31:22 -070070 ]
Elad Alon83ccca12017-10-04 13:18:26 +020071
kjellander727ac1d2017-03-08 02:12:11 -080072 deps = [
perkj77cd58e2017-05-30 03:52:10 -070073 "..:webrtc_common",
Patrik Höglund3e113432017-12-15 14:40:10 +010074 "../:typedefs",
Bjorn Terelius440216f2017-09-29 21:01:42 +020075 "../api:array_view",
Elad Alon80810732017-10-06 13:07:32 +020076 "../api:libjingle_logging_api",
Stefan Holmer1acbd682017-09-01 15:29:28 +020077 "../api:libjingle_peerconnection_api",
aleloi440b6d92017-08-22 05:43:23 -070078 "../call:video_stream_api",
Elad Alon078a7812017-10-02 13:33:31 +020079 "../modules/audio_coding:audio_network_adaptor_config",
80 "../modules/remote_bitrate_estimator:remote_bitrate_estimator",
81 "../modules/rtp_rtcp:rtp_rtcp_format",
Patrik Höglunda8005cf2017-12-13 16:05:42 +010082 "../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -070083 "../rtc_base:rtc_base_approved",
Patrik Höglunda8005cf2017-12-13 16:05:42 +010084 "../system_wrappers",
kjellander727ac1d2017-03-08 02:12:11 -080085 ]
Elad Alon83ccca12017-10-04 13:18:26 +020086
87 # TODO(eladalon): Remove this.
88 if (!build_with_chromium && is_clang) {
89 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
90 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
91 }
skvladcc91d282016-10-03 18:31:22 -070092}
93
94rtc_static_library("rtc_event_log_impl") {
95 sources = [
Elad Alon1d87b0e2017-10-03 15:01:03 +020096 "rtc_event_log/encoder/rtc_event_log_encoder.h",
97 "rtc_event_log/encoder/rtc_event_log_encoder_legacy.cc",
98 "rtc_event_log/encoder/rtc_event_log_encoder_legacy.h",
skvladcc91d282016-10-03 18:31:22 -070099 "rtc_event_log/rtc_event_log.cc",
zhihuang38ede132017-06-15 12:52:32 -0700100 "rtc_event_log/rtc_event_log_factory.cc",
101 "rtc_event_log/rtc_event_log_factory.h",
skvladcc91d282016-10-03 18:31:22 -0700102 ]
103
104 defines = []
105
106 deps = [
107 ":rtc_event_log_api",
108 "..:webrtc_common",
minyue4b7c9522017-01-24 04:54:59 -0800109 "../modules/audio_coding:audio_network_adaptor",
michaelt97653702017-04-11 00:49:44 -0700110 "../modules/remote_bitrate_estimator:remote_bitrate_estimator",
Mirko Bonadeib5728d92017-12-06 07:51:33 +0100111 "../modules/rtp_rtcp:rtp_rtcp_format",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100112 "../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700113 "../rtc_base:protobuf_utils",
114 "../rtc_base:rtc_base_approved",
eladalon248fd4f2017-09-06 05:18:15 -0700115 "../rtc_base:rtc_task_queue",
116 "../rtc_base:sequenced_task_checker",
kjellander727ac1d2017-03-08 02:12:11 -0800117 "../system_wrappers",
skvladcc91d282016-10-03 18:31:22 -0700118 ]
119
120 if (rtc_enable_protobuf) {
121 defines += [ "ENABLE_RTC_EVENT_LOG" ]
122 deps += [ ":rtc_event_log_proto" ]
123 }
Elad Alon83ccca12017-10-04 13:18:26 +0200124
125 # TODO(eladalon): Remove this.
kjellandere40a7ee2016-10-16 23:56:12 -0700126 if (!build_with_chromium && is_clang) {
127 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
skvladcc91d282016-10-03 18:31:22 -0700128 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
129 }
130}
131
skvladcc91d282016-10-03 18:31:22 -0700132if (rtc_enable_protobuf) {
133 proto_library("rtc_event_log_proto") {
134 sources = [
135 "rtc_event_log/rtc_event_log.proto",
136 ]
Mirko Bonadei92ea95e2017-09-15 06:47:31 +0200137 proto_out_dir = "logging/rtc_event_log"
skvladcc91d282016-10-03 18:31:22 -0700138 }
skvladcc91d282016-10-03 18:31:22 -0700139
Mirko Bonadeib3c210f2017-12-15 17:12:42 +0100140 proto_library("rtc_event_log2_proto") {
141 sources = [
142 "rtc_event_log/rtc_event_log2.proto",
143 ]
144 proto_out_dir = "logging/rtc_event_log"
145 }
146
skvladcc91d282016-10-03 18:31:22 -0700147 rtc_static_library("rtc_event_log_parser") {
148 sources = [
149 "rtc_event_log/rtc_event_log_parser.cc",
150 "rtc_event_log/rtc_event_log_parser.h",
151 ]
152
Mirko Bonadei818d9102017-12-12 12:46:13 +0100153 deps = [
Mirko Bonadeib3c210f2017-12-15 17:12:42 +0100154 ":rtc_event_log2_proto",
kjellander727ac1d2017-03-08 02:12:11 -0800155 ":rtc_event_log_api",
skvladcc91d282016-10-03 18:31:22 -0700156 ":rtc_event_log_proto",
157 "..:webrtc_common",
Mirko Bonadei818d9102017-12-12 12:46:13 +0100158 "../call:video_stream_api",
michaeltcde46b72017-04-06 05:59:10 -0700159 "../modules/audio_coding:audio_network_adaptor",
michaelt97653702017-04-11 00:49:44 -0700160 "../modules/remote_bitrate_estimator:remote_bitrate_estimator",
Mirko Bonadeib5728d92017-12-06 07:51:33 +0100161 "../modules/rtp_rtcp",
Mirko Bonadei818d9102017-12-12 12:46:13 +0100162 "../modules/rtp_rtcp:rtp_rtcp_format",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100163 "../rtc_base:checks",
Mirko Bonadei818d9102017-12-12 12:46:13 +0100164 "../rtc_base:protobuf_utils",
165 "../rtc_base:rtc_base_approved",
kjellander727ac1d2017-03-08 02:12:11 -0800166 "../system_wrappers",
skvladcc91d282016-10-03 18:31:22 -0700167 ]
168
kjellandere40a7ee2016-10-16 23:56:12 -0700169 if (!build_with_chromium && is_clang) {
170 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
skvladcc91d282016-10-03 18:31:22 -0700171 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
172 }
173 }
ehmaldonado1fd08c12017-01-17 02:37:34 -0800174
175 if (rtc_include_tests) {
176 rtc_source_set("rtc_event_log_tests") {
177 testonly = true
Elad Alon1d87b0e2017-10-03 15:01:03 +0200178 assert(rtc_enable_protobuf)
179 defines = [ "ENABLE_RTC_EVENT_LOG" ]
Elad Alon8233bfe2017-10-05 15:27:29 +0200180 if (rtc_use_memcheck) {
181 defines += [ "WEBRTC_USE_MEMCHECK" ]
182 }
ehmaldonado1fd08c12017-01-17 02:37:34 -0800183 sources = [
Elad Alon1d87b0e2017-10-03 15:01:03 +0200184 "rtc_event_log/encoder/rtc_event_log_encoder_unittest.cc",
Elad Alon83ccca12017-10-04 13:18:26 +0200185 "rtc_event_log/output/rtc_event_log_output_file_unittest.cc",
ehmaldonado1fd08c12017-01-17 02:37:34 -0800186 "rtc_event_log/rtc_event_log_unittest.cc",
187 "rtc_event_log/rtc_event_log_unittest_helper.cc",
eladalonb5c319a2017-08-17 08:32:39 -0700188 "rtc_event_log/rtc_event_log_unittest_helper.h",
ehmaldonado1fd08c12017-01-17 02:37:34 -0800189 ]
190 deps = [
Mirko Bonadei818d9102017-12-12 12:46:13 +0100191 ":rtc_event_log_api",
ehmaldonado1fd08c12017-01-17 02:37:34 -0800192 ":rtc_event_log_impl",
193 ":rtc_event_log_parser",
Mirko Bonadei818d9102017-12-12 12:46:13 +0100194 ":rtc_event_log_proto",
Mirko Bonadeia0e1a552017-12-04 10:50:51 +0100195 "../api:libjingle_peerconnection_api",
ehmaldonado1fd08c12017-01-17 02:37:34 -0800196 "../call",
Mirko Bonadeia0e1a552017-12-04 10:50:51 +0100197 "../call:call_interfaces",
michaeltcde46b72017-04-06 05:59:10 -0700198 "../modules/audio_coding:audio_network_adaptor",
michaelt97653702017-04-11 00:49:44 -0700199 "../modules/remote_bitrate_estimator:remote_bitrate_estimator",
Mirko Bonadeib5728d92017-12-06 07:51:33 +0100200 "../modules/rtp_rtcp:rtp_rtcp_format",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100201 "../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700202 "../rtc_base:rtc_base_approved",
203 "../rtc_base:rtc_base_tests_utils",
ehmaldonado1fd08c12017-01-17 02:37:34 -0800204 "../system_wrappers:metrics_default",
kjellander727ac1d2017-03-08 02:12:11 -0800205 "../test:test_support",
ehmaldonado1fd08c12017-01-17 02:37:34 -0800206 "//testing/gmock",
207 "//testing/gtest",
208 ]
209 if (!build_with_chromium && is_clang) {
210 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
211 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
212 }
213 }
ivoc54b6e982017-02-08 00:28:09 -0800214 rtc_test("rtc_event_log2rtp_dump") {
215 testonly = true
216 sources = [
217 "rtc_event_log/rtc_event_log2rtp_dump.cc",
218 ]
219 deps = [
220 ":rtc_event_log_api",
221 ":rtc_event_log_impl",
222 ":rtc_event_log_parser",
Mirko Bonadei818d9102017-12-12 12:46:13 +0100223 "../modules/rtp_rtcp",
Mirko Bonadeib5728d92017-12-06 07:51:33 +0100224 "../modules/rtp_rtcp:rtp_rtcp_format",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100225 "../rtc_base:checks",
Mirko Bonadei818d9102017-12-12 12:46:13 +0100226 "../rtc_base:protobuf_utils",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700227 "../rtc_base:rtc_base_approved",
ivoc54b6e982017-02-08 00:28:09 -0800228 "../system_wrappers:field_trial_default",
229 "../system_wrappers:metrics_default",
230 "../test:rtp_test_utils",
ivoc54b6e982017-02-08 00:28:09 -0800231 ]
232 if (!build_with_chromium && is_clang) {
233 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
234 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
235 }
236 }
ehmaldonado1fd08c12017-01-17 02:37:34 -0800237 }
Patrik Höglund731082c2018-01-03 09:08:20 +0100238
tereliusd4ed7f52017-02-08 04:22:53 -0800239 if (rtc_include_tests) {
240 rtc_executable("rtc_event_log2text") {
241 testonly = true
242 sources = [
243 "rtc_event_log/rtc_event_log2text.cc",
244 ]
245 deps = [
246 ":rtc_event_log_api",
247 ":rtc_event_log_impl",
248 ":rtc_event_log_parser",
Mirko Bonadei818d9102017-12-12 12:46:13 +0100249 "../:webrtc_common",
Stefan Holmer1acbd682017-09-01 15:29:28 +0200250 "../call:video_stream_api",
Mirko Bonadeib5728d92017-12-06 07:51:33 +0100251 "../modules/rtp_rtcp:rtp_rtcp_format",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100252 "../rtc_base:checks",
Mirko Bonadei818d9102017-12-12 12:46:13 +0100253 "../rtc_base:protobuf_utils",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700254 "../rtc_base:rtc_base_approved",
tereliusbb46b952017-02-08 09:37:30 -0800255
256 # TODO(kwiberg): Remove this dependency.
kwiberg087bd342017-02-10 08:15:44 -0800257 "../api/audio_codecs:audio_codecs_api",
Elad Alona96fd7f2017-09-15 16:13:21 +0200258 "../modules/audio_coding:audio_network_adaptor_config",
Mirko Bonadeib5728d92017-12-06 07:51:33 +0100259 "../modules/rtp_rtcp",
tereliusd4ed7f52017-02-08 04:22:53 -0800260 ]
261 if (!build_with_chromium && is_clang) {
262 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
263 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
264 }
265 }
266 }
tereliusee37e862017-04-28 07:48:17 -0700267 if (rtc_include_tests) {
268 rtc_executable("rtc_event_log2stats") {
269 testonly = true
270 sources = [
271 "rtc_event_log/rtc_event_log2stats.cc",
272 ]
273 deps = [
274 ":rtc_event_log_api",
275 ":rtc_event_log_impl",
276 ":rtc_event_log_proto",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100277 "../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700278 "../rtc_base:rtc_base_approved",
tereliusee37e862017-04-28 07:48:17 -0700279 ]
280 if (!build_with_chromium && is_clang) {
281 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
282 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
283 }
284 }
285 }
skvladcc91d282016-10-03 18:31:22 -0700286}
Patrik Höglund731082c2018-01-03 09:08:20 +0100287
288if (rtc_include_tests) {
289 rtc_source_set("mocks") {
290 testonly = true
291 sources = [
292 "rtc_event_log/mock/mock_rtc_event_log.h",
293 ]
294 deps = [
295 ":rtc_event_log_api",
296 "../../test:test_support",
297 ]
298 }
299}