blob: 084b240e58e2039951bfe43d33aeebea5c5cedc0 [file] [log] [blame]
kjellanderc76dc952016-06-03 03:09:32 -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")
ossu7bb87ee2017-01-23 04:56:25 -080010if (is_android) {
11 import("//build/config/android/config.gni")
12 import("//build/config/android/rules.gni")
13}
kjellanderc76dc952016-06-03 03:09:32 -070014
15group("pc") {
Mirko Bonadeie51f7852017-12-06 11:23:19 +010016 deps = [
kjellanderc76dc952016-06-03 03:09:32 -070017 ":rtc_pc",
18 ]
19}
20
21config("rtc_pc_config") {
jbaucheaa9c1d2017-03-06 11:32:22 -080022 defines = []
deadbeef40610e22016-12-22 10:53:38 -080023 if (rtc_enable_sctp) {
24 defines += [ "HAVE_SCTP" ]
25 }
kjellanderc76dc952016-06-03 03:09:32 -070026}
27
zhihuang38ede132017-06-15 12:52:32 -070028rtc_static_library("rtc_pc_base") {
Per Kjellandera7f2d842018-01-10 15:54:53 +000029 visibility = [ "*" ]
kjellanderc76dc952016-06-03 03:09:32 -070030 defines = []
31 sources = [
kjellanderc76dc952016-06-03 03:09:32 -070032 "channel.cc",
33 "channel.h",
34 "channelmanager.cc",
35 "channelmanager.h",
Zhi Huangf2d7beb2017-11-20 14:35:11 -080036 "dtlssrtptransport.cc",
37 "dtlssrtptransport.h",
jbauchdfcab722017-03-06 00:14:10 -080038 "externalhmac.cc",
39 "externalhmac.h",
Zhi Huang365381f2018-04-13 16:44:34 -070040 "jseptransport.cc",
41 "jseptransport.h",
Zhi Huange818b6e2018-02-22 15:26:27 -080042 "jseptransportcontroller.cc",
43 "jseptransportcontroller.h",
kjellanderc76dc952016-06-03 03:09:32 -070044 "mediasession.cc",
45 "mediasession.h",
kjellanderc76dc952016-06-03 03:09:32 -070046 "rtcpmuxfilter.cc",
47 "rtcpmuxfilter.h",
Steve Anton1d03a752017-11-27 14:30:09 -080048 "rtpmediautils.cc",
49 "rtpmediautils.h",
zsteind48dbda2017-04-04 19:45:57 -070050 "rtptransport.cc",
51 "rtptransport.h",
zstein398c3fd2017-07-19 13:38:02 -070052 "rtptransportinternal.h",
Zhi Huangf2d7beb2017-11-20 14:35:11 -080053 "rtptransportinternaladapter.h",
Steve Anton4ab68ee2017-12-19 14:26:11 -080054 "sessiondescription.cc",
55 "sessiondescription.h",
kjellanderc76dc952016-06-03 03:09:32 -070056 "srtpfilter.cc",
57 "srtpfilter.h",
zstein4dde3df2017-07-07 14:26:25 -070058 "srtpsession.cc",
59 "srtpsession.h",
zstein398c3fd2017-07-19 13:38:02 -070060 "srtptransport.cc",
61 "srtptransport.h",
Zhi Huange818b6e2018-02-22 15:26:27 -080062 "transportstats.cc",
63 "transportstats.h",
kjellanderc76dc952016-06-03 03:09:32 -070064 ]
65
66 deps = [
mbonadei7d9a55b2017-06-01 13:01:48 -070067 "..:webrtc_common",
Joachim Bauch5b32f232018-03-07 20:02:26 +010068 "../api:array_view",
kjellandera69d9732016-08-31 07:33:05 -070069 "../api:call_api",
mbonadei7d9a55b2017-06-01 13:01:48 -070070 "../api:libjingle_peerconnection_api",
71 "../api:ortc_api",
Niels Möllerc6ce9c52018-05-11 11:15:30 +020072 "../api/video:video_frame",
Zhi Huang365381f2018-04-13 16:44:34 -070073 "../call:rtp_interfaces",
74 "../call:rtp_receiver",
Patrik Höglundbe214a22018-01-04 12:14:35 +010075 "../common_video:common_video",
Qingsi Wang7685e862018-06-11 20:15:46 -070076 "../logging:rtc_event_log_api",
zhihuang38ede132017-06-15 12:52:32 -070077 "../media:rtc_data",
zhihuang130ca7e2017-06-21 01:02:59 -070078 "../media:rtc_h264_profile_id",
zhihuang38ede132017-06-15 12:52:32 -070079 "../media:rtc_media_base",
Zhi Huang365381f2018-04-13 16:44:34 -070080 "../modules/rtp_rtcp:rtp_rtcp_format",
mbonadei7d9a55b2017-06-01 13:01:48 -070081 "../p2p:rtc_p2p",
Artem Titov6bbeb082018-06-18 14:25:54 +020082 "../rtc_base:base64",
Patrik Höglunda8005cf2017-12-13 16:05:42 +010083 "../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -070084 "../rtc_base:rtc_base",
85 "../rtc_base:rtc_task_queue",
Patrik Höglund3e113432017-12-15 14:40:10 +010086 "../rtc_base:stringutils",
Zhi Huang0a5fdbb2018-06-14 10:40:19 -070087 "../system_wrappers:metrics_api",
Danil Chapovalov66cadcc2018-06-19 16:47:43 +020088 "//third_party/abseil-cpp/absl/types:optional",
kjellanderc76dc952016-06-03 03:09:32 -070089 ]
90
kjellanderc76dc952016-06-03 03:09:32 -070091 if (rtc_build_libsrtp) {
92 deps += [ "//third_party/libsrtp" ]
93 }
94
ehmaldonadoe9cc6862016-09-05 06:10:18 -070095 public_configs = [ ":rtc_pc_config" ]
kjellanderc76dc952016-06-03 03:09:32 -070096
kjellandere40a7ee2016-10-16 23:56:12 -070097 if (!build_with_chromium && is_clang) {
kjellander142f8c52016-06-13 00:08:24 -070098 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -070099 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellanderc76dc952016-06-03 03:09:32 -0700100 }
101}
kjellander142f8c52016-06-13 00:08:24 -0700102
zhihuang38ede132017-06-15 12:52:32 -0700103rtc_source_set("rtc_pc") {
Per Kjellandera7f2d842018-01-10 15:54:53 +0000104 visibility = [ "*" ]
Anders Carlsson1f433e42018-04-24 16:39:05 +0200105 allow_poison = [
106 "audio_codecs", # TODO(bugs.webrtc.org/8396): Remove.
107 "software_video_codecs", # TODO(bugs.webrtc.org/7925): Remove.
108 ]
zhihuang38ede132017-06-15 12:52:32 -0700109 deps = [
Mirko Bonadeie51f7852017-12-06 11:23:19 +0100110 ":rtc_pc_base",
zhihuang38ede132017-06-15 12:52:32 -0700111 "../media:rtc_audio_video",
112 ]
113}
114
ossu7bb87ee2017-01-23 04:56:25 -0800115config("libjingle_peerconnection_warnings_config") {
116 # GN orders flags on a target before flags from configs. The default config
117 # adds these flags so to cancel them out they need to come from a config and
118 # cannot be on the target directly.
119 if (!is_win && !is_clang) {
120 cflags = [ "-Wno-maybe-uninitialized" ] # Only exists for GCC.
121 }
122}
123
zhihuang38ede132017-06-15 12:52:32 -0700124rtc_static_library("peerconnection") {
Per Kjellandera7f2d842018-01-10 15:54:53 +0000125 visibility = [ "*" ]
ossu7bb87ee2017-01-23 04:56:25 -0800126 cflags = []
127 sources = [
128 "audiotrack.cc",
129 "audiotrack.h",
130 "datachannel.cc",
131 "datachannel.h",
132 "dtmfsender.cc",
133 "dtmfsender.h",
deadbeef1dcb1642017-03-29 21:08:16 -0700134 "iceserverparsing.cc",
135 "iceserverparsing.h",
ossu7bb87ee2017-01-23 04:56:25 -0800136 "jsepicecandidate.cc",
137 "jsepsessiondescription.cc",
138 "localaudiosource.cc",
139 "localaudiosource.h",
ossu7bb87ee2017-01-23 04:56:25 -0800140 "mediastream.cc",
141 "mediastream.h",
142 "mediastreamobserver.cc",
143 "mediastreamobserver.h",
144 "mediastreamtrack.h",
ossu7bb87ee2017-01-23 04:56:25 -0800145 "peerconnection.cc",
146 "peerconnection.h",
147 "peerconnectionfactory.cc",
148 "peerconnectionfactory.h",
Steve Anton2d8609c2018-01-23 16:38:46 -0800149 "peerconnectioninternal.h",
ossu7bb87ee2017-01-23 04:56:25 -0800150 "remoteaudiosource.cc",
151 "remoteaudiosource.h",
152 "rtcstatscollector.cc",
153 "rtcstatscollector.h",
Henrik Boströmb6199362018-03-12 10:27:55 +0100154 "rtcstatstraversal.cc",
155 "rtcstatstraversal.h",
Florent Castelli72b751a2018-06-28 14:09:33 +0200156 "rtpparametersconversion.cc",
157 "rtpparametersconversion.h",
ossu7bb87ee2017-01-23 04:56:25 -0800158 "rtpreceiver.cc",
159 "rtpreceiver.h",
160 "rtpsender.cc",
161 "rtpsender.h",
Steve Anton6e634bf2017-11-13 10:44:53 -0800162 "rtptransceiver.cc",
163 "rtptransceiver.h",
ossu7bb87ee2017-01-23 04:56:25 -0800164 "sctputils.cc",
165 "sctputils.h",
Steve Anton97a9f762017-10-06 10:14:03 -0700166 "sdputils.cc",
167 "sdputils.h",
ossu7bb87ee2017-01-23 04:56:25 -0800168 "statscollector.cc",
169 "statscollector.h",
170 "streamcollection.h",
deadbeef804c1af2017-02-11 19:07:31 -0800171 "trackmediainfomap.cc",
172 "trackmediainfomap.h",
ossu7bb87ee2017-01-23 04:56:25 -0800173 "videocapturertracksource.cc",
174 "videocapturertracksource.h",
175 "videotrack.cc",
176 "videotrack.h",
177 "videotracksource.cc",
178 "videotracksource.h",
179 "webrtcsdp.cc",
180 "webrtcsdp.h",
ossu7bb87ee2017-01-23 04:56:25 -0800181 "webrtcsessiondescriptionfactory.cc",
182 "webrtcsessiondescriptionfactory.h",
183 ]
184
185 configs += [ ":libjingle_peerconnection_warnings_config" ]
186
187 if (!build_with_chromium && is_clang) {
188 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
189 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
190 }
191
192 deps = [
zhihuang38ede132017-06-15 12:52:32 -0700193 ":rtc_pc_base",
mbonadei7d9a55b2017-06-01 13:01:48 -0700194 "..:webrtc_common",
ossu7bb87ee2017-01-23 04:56:25 -0800195 "../api:call_api",
Ying Wang0dd1b0a2018-02-20 12:50:27 +0100196 "../api:fec_controller_api",
Mirko Bonadeie51f7852017-12-06 11:23:19 +0100197 "../api:libjingle_peerconnection_api",
ossu7bb87ee2017-01-23 04:56:25 -0800198 "../api:rtc_stats_api",
Niels Möllerc6ce9c52018-05-11 11:15:30 +0200199 "../api/video:video_frame",
ilnikd60d06a2017-04-05 03:02:20 -0700200 "../api/video_codecs:video_codecs_api",
zhihuang38ede132017-06-15 12:52:32 -0700201 "../call:call_interfaces",
Patrik Höglundbe214a22018-01-04 12:14:35 +0100202 "../common_video:common_video",
Qingsi Wang93a84392018-01-30 17:13:09 -0800203 "../logging:ice_log",
mbonadei7d9a55b2017-06-01 13:01:48 -0700204 "../logging:rtc_event_log_api",
Qingsi Wang970b0882018-02-01 11:04:46 -0800205 "../logging:rtc_event_log_impl_output",
zhihuang38ede132017-06-15 12:52:32 -0700206 "../media:rtc_data",
207 "../media:rtc_media_base",
Sebastian Janssondfce03a2018-05-18 18:05:10 +0200208 "../modules/congestion_controller/bbr",
mbonadei7d9a55b2017-06-01 13:01:48 -0700209 "../p2p:rtc_p2p",
Artem Titov6bbeb082018-06-18 14:25:54 +0200210 "../rtc_base:base64",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100211 "../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700212 "../rtc_base:rtc_base",
213 "../rtc_base:rtc_base_approved",
Patrik Höglund3e113432017-12-15 14:40:10 +0100214 "../rtc_base:stringutils",
Sebastian Janssondfce03a2018-05-18 18:05:10 +0200215 "../rtc_base/experiments:congestion_controller_experiment",
ossu7bb87ee2017-01-23 04:56:25 -0800216 "../stats",
Mirko Bonadeia498ae82017-12-06 09:17:14 +0100217 "../system_wrappers",
218 "../system_wrappers:field_trial_api",
Danil Chapovalov66cadcc2018-06-19 16:47:43 +0200219 "//third_party/abseil-cpp/absl/types:optional",
ossu7bb87ee2017-01-23 04:56:25 -0800220 ]
zhihuang38ede132017-06-15 12:52:32 -0700221}
222
223# This target implements CreatePeerConnectionFactory methods that will create a
224# PeerConnection will full functionality (audio, video and data). Applications
225# that wish to reduce their binary size by ommitting functionality they don't
226# need should use CreateModularCreatePeerConnectionFactory instead, using the
227# "peerconnection" build target and other targets specific to their
228# requrements. See comment in peerconnectionfactoryinterface.h.
zhihuangab97e182017-06-22 01:28:59 -0700229rtc_static_library("create_pc_factory") {
zhihuang38ede132017-06-15 12:52:32 -0700230 sources = [
231 "createpeerconnectionfactory.cc",
232 ]
233
234 deps = [
Niels Möller8366e172018-02-14 12:20:13 +0100235 "../api:callfactory_api",
zhihuang38ede132017-06-15 12:52:32 -0700236 "../api:libjingle_peerconnection_api",
Gustaf Ullberg2ae140a2018-02-16 13:43:49 +0100237 "../api/audio:audio_mixer_api",
zhihuang38ede132017-06-15 12:52:32 -0700238 "../api/audio_codecs:audio_codecs_api",
Magnus Jedvert58b03162017-09-15 19:02:47 +0200239 "../api/video_codecs:video_codecs_api",
zhihuang38ede132017-06-15 12:52:32 -0700240 "../call",
241 "../call:call_interfaces",
242 "../logging:rtc_event_log_api",
Qingsi Wang970b0882018-02-01 11:04:46 -0800243 "../logging:rtc_event_log_impl_base",
zhihuang38ede132017-06-15 12:52:32 -0700244 "../media:rtc_audio_video",
Edward Lemur872cf382017-11-20 18:41:50 +0100245 "../media:rtc_media_base",
zhihuang38ede132017-06-15 12:52:32 -0700246 "../modules/audio_device:audio_device",
peaha9cc40b2017-06-29 08:32:09 -0700247 "../modules/audio_processing:audio_processing",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700248 "../rtc_base:rtc_base",
249 "../rtc_base:rtc_base_approved",
zhihuang38ede132017-06-15 12:52:32 -0700250 ]
251
252 configs += [ ":libjingle_peerconnection_warnings_config" ]
253
254 if (!build_with_chromium && is_clang) {
255 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
256 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
257 }
258}
259
260rtc_source_set("libjingle_peerconnection") {
Per Kjellandera7f2d842018-01-10 15:54:53 +0000261 visibility = [ "*" ]
Anders Carlsson1f433e42018-04-24 16:39:05 +0200262 allow_poison = [
263 "audio_codecs", # TODO(bugs.webrtc.org/8396): Remove.
264 "software_video_codecs", # TODO(bugs.webrtc.org/7925): Remove.
265 ]
Mirko Bonadeie51f7852017-12-06 11:23:19 +0100266 deps = [
zhihuang38ede132017-06-15 12:52:32 -0700267 ":create_pc_factory",
268 ":peerconnection",
269 "../api:libjingle_peerconnection_api",
270 ]
ossu7bb87ee2017-01-23 04:56:25 -0800271}
272
kjellander142f8c52016-06-13 00:08:24 -0700273if (rtc_include_tests) {
274 config("rtc_pc_unittests_config") {
275 # GN orders flags on a target before flags from configs. The default config
276 # adds -Wall, and this flag have to be after -Wall -- so they need to
277 # come from a config and can't be on the target directly.
278 if (!is_win && !is_clang) {
279 cflags = [ "-Wno-maybe-uninitialized" ] # Only exists for GCC.
280 }
281 }
282
ehmaldonado38a21322016-09-02 04:10:34 -0700283 rtc_test("rtc_pc_unittests") {
kjellander142f8c52016-06-13 00:08:24 -0700284 testonly = true
285
286 sources = [
kjellander142f8c52016-06-13 00:08:24 -0700287 "channel_unittest.cc",
288 "channelmanager_unittest.cc",
Zhi Huangf2d7beb2017-11-20 14:35:11 -0800289 "dtlssrtptransport_unittest.cc",
Zhi Huang365381f2018-04-13 16:44:34 -0700290 "jseptransport_unittest.cc",
Zhi Huange818b6e2018-02-22 15:26:27 -0800291 "jseptransportcontroller_unittest.cc",
kjellander142f8c52016-06-13 00:08:24 -0700292 "mediasession_unittest.cc",
293 "rtcpmuxfilter_unittest.cc",
zstein56162b92017-04-24 16:54:35 -0700294 "rtptransport_unittest.cc",
zstein398c3fd2017-07-19 13:38:02 -0700295 "rtptransporttestutil.h",
kjellander142f8c52016-06-13 00:08:24 -0700296 "srtpfilter_unittest.cc",
zstein4dde3df2017-07-07 14:26:25 -0700297 "srtpsession_unittest.cc",
298 "srtptestutil.h",
zstein398c3fd2017-07-19 13:38:02 -0700299 "srtptransport_unittest.cc",
kjellander142f8c52016-06-13 00:08:24 -0700300 ]
301
302 include_dirs = [ "//third_party/libsrtp/srtp" ]
303
ehmaldonado7a2ce0b2016-09-05 01:35:44 -0700304 configs += [ ":rtc_pc_unittests_config" ]
kjellander142f8c52016-06-13 00:08:24 -0700305
kjellandere40a7ee2016-10-16 23:56:12 -0700306 if (!build_with_chromium && is_clang) {
kjellander142f8c52016-06-13 00:08:24 -0700307 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700308 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellander142f8c52016-06-13 00:08:24 -0700309 }
310
311 if (is_win) {
312 libs = [ "strmiids.lib" ]
313 }
314
315 deps = [
ossu7bb87ee2017-01-23 04:56:25 -0800316 ":libjingle_peerconnection",
Zhi Huangb5261582017-09-29 10:51:43 -0700317 ":pc_test_utils",
kjellander142f8c52016-06-13 00:08:24 -0700318 ":rtc_pc",
Mirko Bonadeie51f7852017-12-06 11:23:19 +0100319 ":rtc_pc_base",
kwiberg529662a2017-09-04 05:43:17 -0700320 "../api:array_view",
Steve Antondb67ba12018-03-19 17:41:42 -0700321 "../api:fakemetricsobserver",
Mirko Bonadeie51f7852017-12-06 11:23:19 +0100322 "../api:libjingle_peerconnection_api",
Zhi Huang365381f2018-04-13 16:44:34 -0700323 "../call:rtp_interfaces",
mbonadei7d9a55b2017-06-01 13:01:48 -0700324 "../logging:rtc_event_log_api",
325 "../media:rtc_media_base",
mbonadei9087d492017-04-25 00:35:35 -0700326 "../media:rtc_media_tests_utils",
Zhi Huang365381f2018-04-13 16:44:34 -0700327 "../modules/rtp_rtcp:rtp_rtcp_format",
mbonadei7d9a55b2017-06-01 13:01:48 -0700328 "../p2p:p2p_test_utils",
329 "../p2p:rtc_p2p",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100330 "../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700331 "../rtc_base:rtc_base",
332 "../rtc_base:rtc_base_approved",
333 "../rtc_base:rtc_base_tests_main",
334 "../rtc_base:rtc_base_tests_utils",
kjellander142f8c52016-06-13 00:08:24 -0700335 "../system_wrappers:metrics_default",
Ilya Nikolaevskiy2ffe3e82018-01-17 19:57:24 +0000336 "../system_wrappers:runtime_enabled_features_default",
zstein398c3fd2017-07-19 13:38:02 -0700337 "../test:test_support",
kjellander142f8c52016-06-13 00:08:24 -0700338 ]
339
340 if (rtc_build_libsrtp) {
341 deps += [ "//third_party/libsrtp" ]
342 }
343
344 if (is_android) {
345 deps += [ "//testing/android/native_test:native_test_support" ]
346 }
347 }
ossu7bb87ee2017-01-23 04:56:25 -0800348
Seth Hampsond1003d72018-06-22 15:40:16 -0700349 rtc_source_set("peerconnection_perf_tests") {
350 testonly = true
351 sources = [
352 "peerconnection_rampup_tests.cc",
353 "peerconnectionwrapper.cc",
354 "peerconnectionwrapper.h",
355 ]
356 deps = [
357 ":pc_test_utils",
358 "../api:fakemetricsobserver",
359 "../api:libjingle_peerconnection_api",
360 "../api:libjingle_peerconnection_test_api",
361 "../api:rtc_stats_api",
362 "../api/audio_codecs:builtin_audio_decoder_factory",
363 "../api/audio_codecs:builtin_audio_encoder_factory",
364 "../api/video_codecs:builtin_video_decoder_factory",
365 "../api/video_codecs:builtin_video_encoder_factory",
366 "../media:rtc_media_tests_utils",
367 "../p2p:p2p_test_utils",
368 "../p2p:rtc_p2p",
369 "../pc:peerconnection",
370 "../rtc_base:rtc_base",
371 "../rtc_base:rtc_base_approved",
372 "../rtc_base:rtc_base_tests_utils",
373 "../test:perf_test",
374 "../test:test_support",
375 ]
376 if (!build_with_chromium && is_clang) {
377 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
378 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
379 }
380 }
381
deadbeefe814a0d2017-02-25 18:15:09 -0800382 rtc_source_set("pc_test_utils") {
383 testonly = true
384 sources = [
385 "test/fakeaudiocapturemodule.cc",
386 "test/fakeaudiocapturemodule.h",
387 "test/fakedatachannelprovider.h",
Steve Antonbe5e2082018-01-24 15:29:17 -0800388 "test/fakepeerconnectionbase.h",
Steve Anton3871f6f2018-01-26 10:25:53 -0800389 "test/fakepeerconnectionforstats.h",
Niels Möller48cca022018-03-21 09:20:21 +0100390 "test/fakeperiodicvideosource.h",
Niels Möller0f405822018-05-17 09:16:41 +0200391 "test/fakeperiodicvideotracksource.h",
deadbeefe814a0d2017-02-25 18:15:09 -0800392 "test/fakertccertificategenerator.h",
Steve Antonda6c0952017-10-23 11:41:54 -0700393 "test/fakesctptransport.h",
deadbeefe814a0d2017-02-25 18:15:09 -0800394 "test/fakevideotrackrenderer.h",
395 "test/fakevideotracksource.h",
Seth Hampsond1003d72018-06-22 15:40:16 -0700396 "test/framegeneratorcapturervideotracksource.h",
deadbeefe814a0d2017-02-25 18:15:09 -0800397 "test/mock_datachannel.h",
398 "test/mock_peerconnection.h",
Steve Anton57858b32018-02-15 15:19:50 -0800399 "test/mock_rtpreceiverinternal.h",
400 "test/mock_rtpsenderinternal.h",
deadbeefe814a0d2017-02-25 18:15:09 -0800401 "test/mockpeerconnectionobservers.h",
402 "test/peerconnectiontestwrapper.cc",
403 "test/peerconnectiontestwrapper.h",
404 "test/rtcstatsobtainer.h",
405 "test/testsdpstrings.h",
406 ]
407
408 deps = [
409 ":libjingle_peerconnection",
Mirko Bonadeie51f7852017-12-06 11:23:19 +0100410 ":peerconnection",
Zhi Huangb5261582017-09-29 10:51:43 -0700411 ":rtc_pc_base",
mbonadei7d9a55b2017-06-01 13:01:48 -0700412 "..:webrtc_common",
Mirko Bonadei34814c72018-01-11 10:13:56 +0100413 "../api:libjingle_peerconnection_api",
mbonadei7d9a55b2017-06-01 13:01:48 -0700414 "../api:libjingle_peerconnection_test_api",
415 "../api:rtc_stats_api",
Niels Möller0327c2d2018-05-21 14:09:31 +0200416 "../api/video:video_frame",
Anders Carlsson67537952018-05-03 11:28:29 +0200417 "../api/video_codecs:builtin_video_decoder_factory",
418 "../api/video_codecs:builtin_video_encoder_factory",
zhihuang38ede132017-06-15 12:52:32 -0700419 "../call:call_interfaces",
420 "../logging:rtc_event_log_api",
Mirko Bonadei75baa492018-01-11 17:07:30 +0100421 "../media:rtc_data",
mbonadei7d9a55b2017-06-01 13:01:48 -0700422 "../media:rtc_media",
Edward Lemur872cf382017-11-20 18:41:50 +0100423 "../media:rtc_media_base",
mbonadei7d9a55b2017-06-01 13:01:48 -0700424 "../media:rtc_media_tests_utils",
425 "../modules/audio_device:audio_device",
Anders Carlsson67537952018-05-03 11:28:29 +0200426 "../modules/audio_processing:audio_processing",
mbonadei7d9a55b2017-06-01 13:01:48 -0700427 "../p2p:p2p_test_utils",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100428 "../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700429 "../rtc_base:rtc_base",
430 "../rtc_base:rtc_base_approved",
431 "../rtc_base:rtc_base_tests_utils",
Tommi8d2c5a82018-03-19 11:12:48 +0100432 "../rtc_base:rtc_task_queue",
mbonadei7d9a55b2017-06-01 13:01:48 -0700433 "../test:test_support",
Seth Hampsond1003d72018-06-22 15:40:16 -0700434 "../test:video_test_common",
deadbeefe814a0d2017-02-25 18:15:09 -0800435 ]
436
437 if (!build_with_chromium && is_clang) {
438 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
439 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
440 }
441 }
442
ossu7bb87ee2017-01-23 04:56:25 -0800443 config("peerconnection_unittests_config") {
444 # The warnings below are enabled by default. Since GN orders compiler flags
445 # for a target before flags from configs, the only way to disable such
446 # warnings is by having them in a separate config, loaded from the target.
447 # TODO(kjellander): Make the code compile without disabling these flags.
448 # See https://bugs.webrtc.org/3307.
449 if (is_clang && is_win) {
450 cflags = [
451 # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6267
452 # for -Wno-sign-compare
453 "-Wno-sign-compare",
ossu7bb87ee2017-01-23 04:56:25 -0800454 ]
455 }
456
457 if (!is_win) {
458 cflags = [ "-Wno-sign-compare" ]
459 }
460 }
461
462 rtc_test("peerconnection_unittests") {
ossu7bb87ee2017-01-23 04:56:25 -0800463 testonly = true
464 sources = [
465 "datachannel_unittest.cc",
466 "dtmfsender_unittest.cc",
deadbeef1dcb1642017-03-29 21:08:16 -0700467 "iceserverparsing_unittest.cc",
ossu7bb87ee2017-01-23 04:56:25 -0800468 "jsepsessiondescription_unittest.cc",
469 "localaudiosource_unittest.cc",
470 "mediaconstraintsinterface_unittest.cc",
471 "mediastream_unittest.cc",
Steve Anton6f25b092017-10-23 09:39:20 -0700472 "peerconnection_bundle_unittest.cc",
Steve Anton6b63cd52017-10-06 11:20:31 -0700473 "peerconnection_crypto_unittest.cc",
Steve Antonda6c0952017-10-23 11:41:54 -0700474 "peerconnection_datachannel_unittest.cc",
Harald Alvestrand19793842018-06-25 12:03:50 +0200475 "peerconnection_histogram_unittest.cc",
Steve Antonf1c6db12017-10-13 11:13:35 -0700476 "peerconnection_ice_unittest.cc",
deadbeef1dcb1642017-03-29 21:08:16 -0700477 "peerconnection_integrationtest.cc",
Steve Antondcc3c022017-12-22 16:02:54 -0800478 "peerconnection_jsep_unittest.cc",
Steve Anton8d3444d2017-10-20 15:30:51 -0700479 "peerconnection_media_unittest.cc",
Henrik Boström933d8b02017-10-10 10:05:16 -0700480 "peerconnection_rtp_unittest.cc",
Steve Anton8d3444d2017-10-20 15:30:51 -0700481 "peerconnection_signaling_unittest.cc",
ossu7bb87ee2017-01-23 04:56:25 -0800482 "peerconnectionendtoend_unittest.cc",
483 "peerconnectionfactory_unittest.cc",
484 "peerconnectioninterface_unittest.cc",
Steve Anton94286cb2017-09-26 16:20:19 -0700485 "peerconnectionwrapper.cc",
486 "peerconnectionwrapper.h",
ossu7bb87ee2017-01-23 04:56:25 -0800487 "proxy_unittest.cc",
488 "rtcstats_integrationtest.cc",
489 "rtcstatscollector_unittest.cc",
Henrik Boströmb6199362018-03-12 10:27:55 +0100490 "rtcstatstraversal_unittest.cc",
Steve Anton1d03a752017-11-27 14:30:09 -0800491 "rtpmediautils_unittest.cc",
Florent Castelli72b751a2018-06-28 14:09:33 +0200492 "rtpparametersconversion_unittest.cc",
ossu7bb87ee2017-01-23 04:56:25 -0800493 "rtpsenderreceiver_unittest.cc",
494 "sctputils_unittest.cc",
495 "statscollector_unittest.cc",
ossu7bb87ee2017-01-23 04:56:25 -0800496 "test/fakeaudiocapturemodule_unittest.cc",
ossu7bb87ee2017-01-23 04:56:25 -0800497 "test/testsdpstrings.h",
deadbeef804c1af2017-02-11 19:07:31 -0800498 "trackmediainfomap_unittest.cc",
ossu7bb87ee2017-01-23 04:56:25 -0800499 "videocapturertracksource_unittest.cc",
500 "videotrack_unittest.cc",
501 "webrtcsdp_unittest.cc",
ossu7bb87ee2017-01-23 04:56:25 -0800502 ]
503
504 if (rtc_enable_sctp) {
505 defines = [ "HAVE_SCTP" ]
506 }
507
508 configs += [ ":peerconnection_unittests_config" ]
509
510 if (!build_with_chromium && is_clang) {
511 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
512 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
513 }
514
Mirko Bonadeie51f7852017-12-06 11:23:19 +0100515 deps = [
516 ":peerconnection",
517 ":rtc_pc_base",
Mirko Bonadei34814c72018-01-11 10:13:56 +0100518 "../api:libjingle_peerconnection_api",
Patrik Höglund4b9e6ba2017-12-19 10:32:11 +0100519 "../api:mock_rtp",
Sebastian Jansson5f83cf02018-05-08 14:52:22 +0200520 "../api/units:time_delta",
Qingsi Wang7685e862018-06-11 20:15:46 -0700521 "../logging:fake_rtc_event_log",
Artem Titov6bbeb082018-06-18 14:25:54 +0200522 "../rtc_base:base64",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100523 "../rtc_base:checks",
Patrik Höglund3e113432017-12-15 14:40:10 +0100524 "../rtc_base:stringutils",
Patrik Höglund7696bef2018-03-15 15:05:39 +0100525 "../test:fileutils",
Mirko Bonadeie51f7852017-12-06 11:23:19 +0100526 ]
ossu7bb87ee2017-01-23 04:56:25 -0800527 if (is_android) {
Patrik Höglund563934e2017-09-15 09:04:28 +0200528 deps += [ ":android_black_magic" ]
ossu7bb87ee2017-01-23 04:56:25 -0800529 }
530
531 deps += [
532 ":libjingle_peerconnection",
deadbeefe814a0d2017-02-25 18:15:09 -0800533 ":pc_test_utils",
ossu7bb87ee2017-01-23 04:56:25 -0800534 "..:webrtc_common",
Niels Möller8366e172018-02-14 12:20:13 +0100535 "../api:callfactory_api",
ossu7bb87ee2017-01-23 04:56:25 -0800536 "../api:fakemetricsobserver",
Patrik Höglund563934e2017-09-15 09:04:28 +0200537 "../api:libjingle_peerconnection_test_api",
538 "../api:rtc_stats_api",
Karl Wibergc5bb00b2017-10-10 23:17:17 +0200539 "../api/audio_codecs:audio_codecs_api",
Patrik Höglund563934e2017-09-15 09:04:28 +0200540 "../api/audio_codecs:builtin_audio_decoder_factory",
541 "../api/audio_codecs:builtin_audio_encoder_factory",
Karl Wibergc5bb00b2017-10-10 23:17:17 +0200542 "../api/audio_codecs/L16:audio_decoder_L16",
543 "../api/audio_codecs/L16:audio_encoder_L16",
Anders Carlsson67537952018-05-03 11:28:29 +0200544 "../api/video_codecs:builtin_video_decoder_factory",
545 "../api/video_codecs:builtin_video_encoder_factory",
546 "../api/video_codecs:video_codecs_api",
Steve Anton8d3444d2017-10-20 15:30:51 -0700547 "../call:call_interfaces",
Elad Alon99c3fe52017-10-13 16:29:40 +0200548 "../logging:rtc_event_log_api",
Qingsi Wang970b0882018-02-01 11:04:46 -0800549 "../logging:rtc_event_log_impl_base",
550 "../logging:rtc_event_log_impl_output",
Patrik Höglund563934e2017-09-15 09:04:28 +0200551 "../media:rtc_audio_video",
552 "../media:rtc_data", # TODO(phoglund): AFAIK only used for one sctp constant.
553 "../media:rtc_media_base",
mbonadei9087d492017-04-25 00:35:35 -0700554 "../media:rtc_media_tests_utils",
Patrik Höglund563934e2017-09-15 09:04:28 +0200555 "../modules/audio_processing:audio_processing",
556 "../modules/utility:utility",
557 "../p2p:p2p_test_utils",
558 "../p2p:rtc_p2p",
ossu7bb87ee2017-01-23 04:56:25 -0800559 "../pc:rtc_pc",
Henrik Boström933d8b02017-10-10 10:05:16 -0700560 "../rtc_base:rtc_base",
Patrik Höglund563934e2017-09-15 09:04:28 +0200561 "../rtc_base:rtc_base_approved",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700562 "../rtc_base:rtc_base_tests_main",
563 "../rtc_base:rtc_base_tests_utils",
Tommi8d2c5a82018-03-19 11:12:48 +0100564 "../rtc_base:rtc_task_queue",
ossu7bb87ee2017-01-23 04:56:25 -0800565 "../system_wrappers:metrics_default",
Ilya Nikolaevskiy2ffe3e82018-01-17 19:57:24 +0000566 "../system_wrappers:runtime_enabled_features_default",
kwiberg2b3aa142017-06-14 03:31:17 -0700567 "../test:audio_codec_mocks",
Patrik Höglund563934e2017-09-15 09:04:28 +0200568 "../test:test_support",
Danil Chapovalov66cadcc2018-06-19 16:47:43 +0200569 "//third_party/abseil-cpp/absl/types:optional",
ossu7bb87ee2017-01-23 04:56:25 -0800570 ]
571
572 if (is_android) {
Patrik Höglund563934e2017-09-15 09:04:28 +0200573 deps += [
574 "//testing/android/native_test:native_test_support",
575
576 # We need to depend on this one directly, or classloads will fail for
577 # the voice engine BuildInfo, for instance.
578 "../sdk/android:libjingle_peerconnection_java",
579 ]
ossu7bb87ee2017-01-23 04:56:25 -0800580
581 shard_timeout = 900
582 }
583 }
Patrik Höglund563934e2017-09-15 09:04:28 +0200584
585 if (is_android) {
586 rtc_source_set("android_black_magic") {
587 # The android code uses hacky includes to chromium-base and the ssl code;
588 # having this in a separate target enables us to keep the peerconnection
589 # unit tests clean.
590 check_includes = false
591 testonly = true
592 sources = [
593 "test/androidtestinitializer.cc",
594 "test/androidtestinitializer.h",
595 ]
596 deps = [
597 "../sdk/android:libjingle_peerconnection_jni",
598 "//testing/android/native_test:native_test_support",
599 ]
600 }
601 }
kjellander142f8c52016-06-13 00:08:24 -0700602}