blob: 5b40e86a73fa3ac5f8250caa11c4fb98bf8ab81c [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
9import("//build/config/linux/pkg_config.gni")
mbonadei9aa3f0a2017-01-24 06:58:22 -080010import("../webrtc.gni")
kjellanderc76dc952016-06-03 03:09:32 -070011
12group("media") {
Dan Minor9c686132018-01-15 10:20:00 -050013 deps = []
14 if (!build_with_mozilla) {
15 deps += [
16 ":rtc_media",
17 ":rtc_media_base",
18 ]
19 }
kjellanderc76dc952016-06-03 03:09:32 -070020}
21
22config("rtc_media_defines_config") {
23 defines = [
24 "HAVE_WEBRTC_VIDEO",
25 "HAVE_WEBRTC_VOICE",
26 ]
27}
28
zhihuang130ca7e2017-06-21 01:02:59 -070029rtc_source_set("rtc_h264_profile_id") {
Per Kjellandera7f2d842018-01-10 15:54:53 +000030 visibility = [ "*" ]
zhihuang130ca7e2017-06-21 01:02:59 -070031 sources = [
32 "base/h264_profile_level_id.cc",
33 "base/h264_profile_level_id.h",
34 ]
35
36 if (!build_with_chromium && is_clang) {
37 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
38 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
39 }
40
41 deps = [
42 "..:webrtc_common",
ehmaldonadof6a861a2017-07-19 10:40:47 -070043 "../rtc_base:rtc_base",
44 "../rtc_base:rtc_base_approved",
Danil Chapovalov00c71832018-06-15 15:58:38 +020045 "//third_party/abseil-cpp/absl/types:optional",
zhihuang130ca7e2017-06-21 01:02:59 -070046 ]
47}
48
Niels Möller6daa2782018-01-23 10:37:42 +010049rtc_source_set("rtc_media_config") {
50 visibility = [ "*" ]
51 sources = [
52 "base/mediaconfig.h",
53 ]
54}
55
Emircan Uysaler98badbc2018-06-28 10:59:02 -070056rtc_source_set("rtc_vp9_profile") {
57 sources = [
58 "base/vp9_profile.cc",
59 "base/vp9_profile.h",
60 ]
61
62 deps = [
63 "..:webrtc_common",
64 "../api/video_codecs:video_codecs_api",
65 "../rtc_base:rtc_base_approved",
66 "//third_party/abseil-cpp/absl/types:optional",
67 ]
68}
69
zhihuangab97e182017-06-22 01:28:59 -070070rtc_static_library("rtc_media_base") {
Per Kjellandera7f2d842018-01-10 15:54:53 +000071 visibility = [ "*" ]
kjellanderc76dc952016-06-03 03:09:32 -070072 defines = []
73 libs = []
Patrik Höglunda8005cf2017-12-13 16:05:42 +010074 deps = [
Niels Möllera6fe2612018-01-19 11:28:54 +010075 "../api:audio_options_api",
Patrik Höglunda8005cf2017-12-13 16:05:42 +010076 "../rtc_base:checks",
Tommi8d2c5a82018-03-19 11:12:48 +010077 "../rtc_base:rtc_base_approved",
78 "../rtc_base:rtc_task_queue",
Patrik Höglunda8005cf2017-12-13 16:05:42 +010079 "../rtc_base:sanitizer",
Tommi1829af62018-02-06 09:29:17 +010080 "../rtc_base:sequenced_task_checker",
Patrik Höglund3e113432017-12-15 14:40:10 +010081 "../rtc_base:stringutils",
Patrik Höglunda8005cf2017-12-13 16:05:42 +010082 ]
kjellanderc76dc952016-06-03 03:09:32 -070083 sources = [
nisse6f5a6c32016-09-22 01:25:59 -070084 "base/adaptedvideotracksource.cc",
85 "base/adaptedvideotracksource.h",
kjellanderc76dc952016-06-03 03:09:32 -070086 "base/audiosource.h",
87 "base/codec.cc",
88 "base/codec.h",
kjellanderc76dc952016-06-03 03:09:32 -070089 "base/cryptoparams.h",
90 "base/device.h",
Paulina Hensman11b34f42018-04-09 14:24:52 +020091 "base/mediachannel.cc",
kjellanderc76dc952016-06-03 03:09:32 -070092 "base/mediachannel.h",
kjellanderc76dc952016-06-03 03:09:32 -070093 "base/mediaconstants.cc",
94 "base/mediaconstants.h",
95 "base/mediaengine.cc",
96 "base/mediaengine.h",
97 "base/rtpdataengine.cc",
98 "base/rtpdataengine.h",
kjellanderc76dc952016-06-03 03:09:32 -070099 "base/rtputils.cc",
100 "base/rtputils.h",
kjellanderc76dc952016-06-03 03:09:32 -0700101 "base/streamparams.cc",
102 "base/streamparams.h",
103 "base/turnutils.cc",
104 "base/turnutils.h",
105 "base/videoadapter.cc",
106 "base/videoadapter.h",
107 "base/videobroadcaster.cc",
108 "base/videobroadcaster.h",
109 "base/videocapturer.cc",
110 "base/videocapturer.h",
111 "base/videocapturerfactory.h",
112 "base/videocommon.cc",
113 "base/videocommon.h",
kjellanderc76dc952016-06-03 03:09:32 -0700114 "base/videosourcebase.cc",
115 "base/videosourcebase.h",
magjed0928a3c2016-11-25 00:40:18 -0800116 ]
117
magjed0928a3c2016-11-25 00:40:18 -0800118 if (!build_with_chromium && is_clang) {
119 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
120 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
121 }
122
magjed0928a3c2016-11-25 00:40:18 -0800123 deps += [
Mirko Bonadei75baa492018-01-11 17:07:30 +0100124 ":rtc_h264_profile_id",
Niels Möller6daa2782018-01-23 10:37:42 +0100125 ":rtc_media_config",
Emircan Uysaler98badbc2018-06-28 10:59:02 -0700126 ":rtc_vp9_profile",
magjed0928a3c2016-11-25 00:40:18 -0800127 "..:webrtc_common",
kjellandera2ef4f92017-03-06 06:04:55 -0800128 "../api:libjingle_peerconnection_api",
Patrik Höglundaba85d12017-11-28 15:46:08 +0100129 "../api/audio_codecs:audio_codecs_api",
Åsa Persson23eba222018-10-02 14:47:06 +0200130 "../api/video:video_bitrate_allocation",
Niels Möllerc6ce9c52018-05-11 11:15:30 +0200131 "../api/video:video_frame",
132 "../api/video:video_frame_i420",
Patrik Höglundaba85d12017-11-28 15:46:08 +0100133 "../api/video_codecs:video_codecs_api",
134 "../call:call_interfaces",
Patrik Höglundbe214a22018-01-04 12:14:35 +0100135 "../common_video",
Patrik Höglundaba85d12017-11-28 15:46:08 +0100136 "../modules/audio_processing:audio_processing_statistics",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700137 "../rtc_base:rtc_base",
138 "../rtc_base:rtc_base_approved",
Mirko Bonadei3d255302018-10-11 10:50:45 +0200139 "../rtc_base/system:rtc_export",
Artem Titove41c4332018-07-25 15:04:28 +0200140 "../rtc_base/third_party/sigslot",
Danil Chapovalov00c71832018-06-15 15:58:38 +0200141 "//third_party/abseil-cpp/absl/types:optional",
magjed0928a3c2016-11-25 00:40:18 -0800142 ]
kjellander8a116632017-04-21 05:17:08 -0700143
Dan Minor9c686132018-01-15 10:20:00 -0500144 if (!build_with_mozilla) {
145 deps += [ "../p2p" ]
146 }
147
kjellander8a116632017-04-21 05:17:08 -0700148 if (is_nacl) {
149 deps += [ "//native_client_sdk/src/libraries/nacl_io" ]
150 }
magjed0928a3c2016-11-25 00:40:18 -0800151}
152
Anders Carlssona114c882018-01-04 15:10:22 +0100153rtc_static_library("rtc_constants") {
magjed0928a3c2016-11-25 00:40:18 -0800154 defines = []
155 libs = []
Anders Carlssona114c882018-01-04 15:10:22 +0100156 deps = []
magjed0928a3c2016-11-25 00:40:18 -0800157 sources = [
mallikarjun829deda482017-11-20 17:48:13 +0530158 "engine/constants.cc",
charujain66748462017-09-14 13:53:02 -0700159 "engine/constants.h",
Anders Carlssona114c882018-01-04 15:10:22 +0100160 ]
161}
162
163rtc_static_library("rtc_internal_video_codecs") {
Per Kjellandera0f5f602018-01-10 15:57:32 +0000164 visibility = [ "*" ]
Karl Wiberg7ba22b82018-04-27 04:31:53 +0200165 allow_poison = [ "software_video_codecs" ]
Anders Carlssona114c882018-01-04 15:10:22 +0100166 defines = []
167 libs = []
Patrik Höglund99175c62018-01-08 11:05:10 +0100168 deps = [
Mirko Bonadei75baa492018-01-11 17:07:30 +0100169 ":rtc_h264_profile_id",
Patrik Höglund99175c62018-01-08 11:05:10 +0100170 "../modules/video_coding:video_codec_interface",
Mirko Bonadei17f48782018-09-28 08:51:10 +0200171 "../system_wrappers:field_trial",
Karl Wiberg918f50c2018-07-05 11:40:33 +0200172 "//third_party/abseil-cpp/absl/memory",
Patrik Höglund99175c62018-01-08 11:05:10 +0100173 ]
Anders Carlssona114c882018-01-04 15:10:22 +0100174 sources = [
Magnus Jedvert07e0d012017-10-31 11:24:54 +0100175 "engine/convert_legacy_video_factory.cc",
176 "engine/convert_legacy_video_factory.h",
magjeddd407022016-12-01 00:27:27 -0800177 "engine/internaldecoderfactory.cc",
178 "engine/internaldecoderfactory.h",
magjed509e4fe2016-11-18 01:34:11 -0800179 "engine/internalencoderfactory.cc",
180 "engine/internalencoderfactory.h",
Emircan Uysalerd7ae3c32018-01-25 13:01:09 -0800181 "engine/multiplexcodecfactory.cc",
182 "engine/multiplexcodecfactory.h",
andersc063f0c02017-09-11 11:50:51 -0700183 "engine/scopedvideodecoder.cc",
184 "engine/scopedvideodecoder.h",
magjed3f897582017-08-28 08:05:42 -0700185 "engine/scopedvideoencoder.cc",
186 "engine/scopedvideoencoder.h",
magjed6cc25612017-07-10 03:26:36 -0700187 "engine/simulcast_encoder_adapter.cc",
188 "engine/simulcast_encoder_adapter.h",
Ilya Nikolaevskiyc22a3a62017-10-25 10:04:54 +0200189 "engine/vp8_encoder_simulcast_proxy.cc",
190 "engine/vp8_encoder_simulcast_proxy.h",
Anders Carlssona114c882018-01-04 15:10:22 +0100191 "engine/webrtcvideodecoderfactory.h",
Anders Carlssona114c882018-01-04 15:10:22 +0100192 "engine/webrtcvideoencoderfactory.h",
193 ]
194
Anders Carlssona114c882018-01-04 15:10:22 +0100195 if (!build_with_chromium && is_clang) {
196 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
197 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
198 }
199
Anders Carlssona114c882018-01-04 15:10:22 +0100200 include_dirs = []
201
202 public_configs = []
203 deps += [
204 ":rtc_constants",
205 ":rtc_media_base",
206 "..:webrtc_common",
Erik Språng7fd0a282018-05-22 15:37:23 +0200207 "../api/video:video_bitrate_allocation",
Niels Möllerc6ce9c52018-05-11 11:15:30 +0200208 "../api/video:video_frame_i420",
Anders Carlssondd3e0ab2018-06-12 11:15:56 +0200209 "../api/video_codecs:rtc_software_fallback_wrappers",
Anders Carlssona114c882018-01-04 15:10:22 +0100210 "../api/video_codecs:video_codecs_api",
211 "../call:call_interfaces",
212 "../call:video_stream_api",
Sergio Garcia Murillo43800f92018-06-21 16:16:38 +0200213 "../modules/video_coding:video_coding_utility",
Anders Carlssona114c882018-01-04 15:10:22 +0100214 "../modules/video_coding:webrtc_h264",
Emircan Uysalerd7ae3c32018-01-25 13:01:09 -0800215 "../modules/video_coding:webrtc_multiplex",
Anders Carlssona114c882018-01-04 15:10:22 +0100216 "../modules/video_coding:webrtc_vp8",
Anders Carlssona114c882018-01-04 15:10:22 +0100217 "../modules/video_coding:webrtc_vp9",
218 "../rtc_base:checks",
219 "../rtc_base:rtc_base_approved",
220 "../rtc_base:sequenced_task_checker",
221 "../system_wrappers",
Ilya Nikolaevskiyc30a1312018-08-27 11:07:48 +0200222 "//third_party/abseil-cpp/absl/types:optional",
Anders Carlssona114c882018-01-04 15:10:22 +0100223 "//third_party/libyuv",
224 ]
225}
226
227rtc_static_library("rtc_audio_video") {
Per Kjellandera7f2d842018-01-10 15:54:53 +0000228 visibility = [ "*" ]
Anders Carlsson1f433e42018-04-24 16:39:05 +0200229 allow_poison = [
230 "audio_codecs", # TODO(bugs.webrtc.org/8396): Remove.
231 "software_video_codecs", # TODO(bugs.webrtc.org/7925): Remove.
232 ]
Anders Carlssona114c882018-01-04 15:10:22 +0100233 defines = []
234 libs = []
235 deps = [
Mirko Bonadeica913b02018-01-26 15:11:40 +0100236 "../modules/audio_processing/aec_dump:aec_dump",
Patrik Höglunda97af1f2018-01-16 10:11:40 +0100237 "../modules/video_coding:video_codec_interface",
Patrik Höglund99175c62018-01-08 11:05:10 +0100238 "../modules/video_coding:video_coding",
Sergio Garcia Murillo43800f92018-06-21 16:16:38 +0200239 "../modules/video_coding:video_coding_utility",
Jonas Olssonabbe8412018-04-03 13:40:05 +0200240 "../rtc_base:audio_format_to_string",
Anders Carlssona114c882018-01-04 15:10:22 +0100241 "../rtc_base:checks",
Artem Titova76af0c2018-07-23 17:38:12 +0200242 "../rtc_base/third_party/base64",
Mirko Bonadei17f48782018-09-28 08:51:10 +0200243 "../system_wrappers:field_trial",
244 "../system_wrappers:metrics",
Anders Carlssona114c882018-01-04 15:10:22 +0100245 ]
246
247 sources = [
248 "engine/adm_helpers.cc",
249 "engine/adm_helpers.h",
250 "engine/apm_helpers.cc",
251 "engine/apm_helpers.h",
252 "engine/nullwebrtcvideoengine.h",
253 "engine/payload_type_mapper.cc",
254 "engine/payload_type_mapper.h",
Anders Carlssondd8c1652018-01-30 10:32:13 +0100255 "engine/simulcast.cc",
256 "engine/simulcast.h",
kjellanderc76dc952016-06-03 03:09:32 -0700257 "engine/webrtcmediaengine.cc",
258 "engine/webrtcmediaengine.h",
259 "engine/webrtcvideocapturer.cc",
260 "engine/webrtcvideocapturer.h",
261 "engine/webrtcvideocapturerfactory.cc",
262 "engine/webrtcvideocapturerfactory.h",
Anders Carlssondd8c1652018-01-30 10:32:13 +0100263 "engine/webrtcvideodecoderfactory.cc",
264 "engine/webrtcvideodecoderfactory.h",
265 "engine/webrtcvideoencoderfactory.cc",
266 "engine/webrtcvideoencoderfactory.h",
eladalonf1841382017-06-12 01:16:46 -0700267 "engine/webrtcvideoengine.cc",
268 "engine/webrtcvideoengine.h",
kjellanderc76dc952016-06-03 03:09:32 -0700269 "engine/webrtcvoiceengine.cc",
270 "engine/webrtcvoiceengine.h",
kjellanderc76dc952016-06-03 03:09:32 -0700271 ]
272
kjellandere40a7ee2016-10-16 23:56:12 -0700273 if (!build_with_chromium && is_clang) {
kjellander82a94492016-06-12 22:12:01 -0700274 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
kjellander660312b2016-09-26 06:11:53 -0700275 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellanderc76dc952016-06-03 03:09:32 -0700276 }
277
minyue2e03c662017-02-01 17:31:11 -0800278 if (rtc_opus_support_120ms_ptime) {
279 defines += [ "WEBRTC_OPUS_SUPPORT_120MS_PTIME=1" ]
280 } else {
281 defines += [ "WEBRTC_OPUS_SUPPORT_120MS_PTIME=0" ]
282 }
283
kjellanderec5c9062016-08-19 01:07:30 -0700284 include_dirs = []
kjellanderc76dc952016-06-03 03:09:32 -0700285
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700286 public_configs = []
kjellanderc76dc952016-06-03 03:09:32 -0700287 if (build_with_chromium) {
288 deps += [ "../modules/video_capture:video_capture" ]
289 } else {
kjellanderc76dc952016-06-03 03:09:32 -0700290 public_configs += [ ":rtc_media_defines_config" ]
291 deps += [ "../modules/video_capture:video_capture_internal_impl" ]
292 }
aleloi048cbdd2017-05-29 02:56:27 -0700293 if (rtc_enable_protobuf) {
294 deps += [ "../modules/audio_processing/aec_dump:aec_dump_impl" ]
295 } else {
296 deps += [ "../modules/audio_processing/aec_dump:null_aec_dump_factory" ]
297 }
Anders Carlssondd8c1652018-01-30 10:32:13 +0100298 if (rtc_use_builtin_sw_codecs) {
299 deps += [ ":rtc_internal_video_codecs" ]
300 }
kjellanderc76dc952016-06-03 03:09:32 -0700301 deps += [
Anders Carlssona114c882018-01-04 15:10:22 +0100302 ":rtc_constants",
magjed0928a3c2016-11-25 00:40:18 -0800303 ":rtc_media_base",
kjellanderc76dc952016-06-03 03:09:32 -0700304 "..:webrtc_common",
kjellandera69d9732016-08-31 07:33:05 -0700305 "../api:call_api",
zhihuang38ede132017-06-15 12:52:32 -0700306 "../api:libjingle_peerconnection_api",
aleloia8eb7562016-11-28 07:02:13 -0800307 "../api:transport_api",
kjellandera2ef4f92017-03-06 06:04:55 -0800308 "../api/audio_codecs:audio_codecs_api",
Niels Möllerc6ce9c52018-05-11 11:15:30 +0200309 "../api/video:video_frame",
310 "../api/video:video_frame_i420",
Anders Carlssondd3e0ab2018-06-12 11:15:56 +0200311 "../api/video_codecs:rtc_software_fallback_wrappers",
ilnikd60d06a2017-04-05 03:02:20 -0700312 "../api/video_codecs:video_codecs_api",
kjellander82a94492016-06-12 22:12:01 -0700313 "../call",
Anders Carlssona114c882018-01-04 15:10:22 +0100314 "../call:call_interfaces",
aleloi440b6d92017-08-22 05:43:23 -0700315 "../call:video_stream_api",
kjellandera2ef4f92017-03-06 06:04:55 -0800316 "../common_video:common_video",
kjellandera2ef4f92017-03-06 06:04:55 -0800317 "../modules/audio_device:audio_device",
Paulina Hensman7bd79a02018-03-15 12:44:12 +0100318 "../modules/audio_device:audio_device_impl",
aleloi10111bc2016-11-17 06:48:48 -0800319 "../modules/audio_mixer:audio_mixer_impl",
kjellandera2ef4f92017-03-06 06:04:55 -0800320 "../modules/audio_processing:audio_processing",
321 "../modules/video_capture:video_capture_module",
zhihuang38ede132017-06-15 12:52:32 -0700322 "../pc:rtc_pc_base",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700323 "../rtc_base:rtc_base",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700324 "../rtc_base:rtc_task_queue",
Anders Carlssona114c882018-01-04 15:10:22 +0100325 "../rtc_base:stringutils",
Åsa Persson1a35fbd2018-10-12 17:36:57 +0200326 "../rtc_base/experiments:normalize_simulcast_size_experiment",
kjellanderc76dc952016-06-03 03:09:32 -0700327 "../system_wrappers",
Danil Chapovalov00c71832018-06-15 15:58:38 +0200328 "//third_party/abseil-cpp/absl/types:optional",
kjellanderc76dc952016-06-03 03:09:32 -0700329 ]
330}
kjellander82a94492016-06-12 22:12:01 -0700331
zhihuang38ede132017-06-15 12:52:32 -0700332rtc_static_library("rtc_data") {
333 defines = []
334 deps = []
335
336 if (rtc_enable_sctp) {
337 sources = [
338 "sctp/sctptransport.cc",
339 "sctp/sctptransport.h",
340 "sctp/sctptransportinternal.h",
341 ]
Kári Tristan Helgason4d3e24a2017-12-01 15:26:41 +0100342 } else {
343 # libtool on mac does not like empty targets.
344 sources = [
Mirko Bonadei6c8e6662017-12-13 07:40:54 +0100345 "sctp/noop.cc",
Kári Tristan Helgason4d3e24a2017-12-01 15:26:41 +0100346 ]
zhihuang38ede132017-06-15 12:52:32 -0700347 }
348
zhihuang38ede132017-06-15 12:52:32 -0700349 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
zhihuang38ede132017-06-15 12:52:32 -0700354 if (rtc_enable_sctp && rtc_build_usrsctp) {
355 include_dirs = [
356 # TODO(jiayl): move this into the public_configs of
357 # //third_party/usrsctp/BUILD.gn.
358 "//third_party/usrsctp/usrsctplib",
359 ]
360 deps += [ "//third_party/usrsctp" ]
361 }
362
363 deps += [
364 ":rtc_media_base",
365 "..:webrtc_common",
366 "../api:call_api",
367 "../api:transport_api",
zhihuang38ede132017-06-15 12:52:32 -0700368 "../p2p:rtc_p2p",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700369 "../rtc_base:rtc_base",
370 "../rtc_base:rtc_base_approved",
Artem Titove41c4332018-07-25 15:04:28 +0200371 "../rtc_base/third_party/sigslot",
zhihuang38ede132017-06-15 12:52:32 -0700372 "../system_wrappers",
373 ]
374}
375
376rtc_source_set("rtc_media") {
Per Kjellandera7f2d842018-01-10 15:54:53 +0000377 visibility = [ "*" ]
Anders Carlsson1f433e42018-04-24 16:39:05 +0200378 allow_poison = [
379 "audio_codecs", # TODO(bugs.webrtc.org/8396): Remove.
380 "software_video_codecs", # TODO(bugs.webrtc.org/7925): Remove.
381 ]
Mirko Bonadei75baa492018-01-11 17:07:30 +0100382 deps = [
zhihuang38ede132017-06-15 12:52:32 -0700383 ":rtc_audio_video",
384 ":rtc_data",
385 ]
386}
387
kjellander82a94492016-06-12 22:12:01 -0700388if (rtc_include_tests) {
mbonadei9087d492017-04-25 00:35:35 -0700389 rtc_source_set("rtc_media_tests_utils") {
kjellander82a94492016-06-12 22:12:01 -0700390 testonly = true
391
Anders Carlsson5f2bb622018-05-14 09:48:06 +0200392 defines = []
kjellanderec5c9062016-08-19 01:07:30 -0700393 include_dirs = []
kjellandera2ef4f92017-03-06 06:04:55 -0800394 deps = [
Mirko Bonadei75baa492018-01-11 17:07:30 +0100395 ":rtc_audio_video",
Patrik Höglundbe214a22018-01-04 12:14:35 +0100396 "../api:libjingle_peerconnection_api",
Niels Möllerc6ce9c52018-05-11 11:15:30 +0200397 "../api/video:video_frame_i420",
aleloi440b6d92017-08-22 05:43:23 -0700398 "../call:video_stream_api",
Patrik Höglundbe214a22018-01-04 12:14:35 +0100399 "../common_video:common_video",
kjellandera2ef4f92017-03-06 06:04:55 -0800400 "../modules/audio_coding:rent_a_codec",
401 "../modules/audio_processing:audio_processing",
Mirko Bonadeib5728d92017-12-06 07:51:33 +0100402 "../modules/rtp_rtcp:rtp_rtcp_format",
Patrik Höglund99175c62018-01-08 11:05:10 +0100403 "../modules/video_coding:video_codec_interface",
charujaincb728ea2017-09-18 03:08:08 -0700404 "../modules/video_coding:video_coding_utility",
kjellandera2ef4f92017-03-06 06:04:55 -0800405 "../p2p:rtc_p2p",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100406 "../rtc_base:checks",
Tommi8d2c5a82018-03-19 11:12:48 +0100407 "../rtc_base:rtc_task_queue",
Patrik Höglund3e113432017-12-15 14:40:10 +0100408 "../rtc_base:stringutils",
Karl Wiberg918f50c2018-07-05 11:40:33 +0200409 "//third_party/abseil-cpp/absl/memory",
kjellandera2ef4f92017-03-06 06:04:55 -0800410 ]
kjellander82a94492016-06-12 22:12:01 -0700411 sources = [
Niels Möllera6cc0f92018-02-12 17:14:55 +0100412 "base/fakeframesource.cc",
413 "base/fakeframesource.h",
kjellander82a94492016-06-12 22:12:01 -0700414 "base/fakemediaengine.h",
415 "base/fakenetworkinterface.h",
jbauch5869f502017-06-29 12:31:36 -0700416 "base/fakertp.cc",
kjellander82a94492016-06-12 22:12:01 -0700417 "base/fakertp.h",
Tommi1829af62018-02-06 09:29:17 +0100418 "base/fakevideocapturer.cc",
kjellander82a94492016-06-12 22:12:01 -0700419 "base/fakevideocapturer.h",
Mirko Bonadei17aff352018-07-26 12:20:40 +0200420 "base/fakevideorenderer.cc",
kjellander82a94492016-06-12 22:12:01 -0700421 "base/fakevideorenderer.h",
422 "base/testutils.cc",
423 "base/testutils.h",
424 "engine/fakewebrtccall.cc",
425 "engine/fakewebrtccall.h",
kjellander82a94492016-06-12 22:12:01 -0700426 "engine/fakewebrtcdeviceinfo.h",
427 "engine/fakewebrtcvcmfactory.h",
428 "engine/fakewebrtcvideocapturemodule.h",
Anders Carlsson67537952018-05-03 11:28:29 +0200429 "engine/fakewebrtcvideoengine.cc",
kjellander82a94492016-06-12 22:12:01 -0700430 "engine/fakewebrtcvideoengine.h",
kjellander82a94492016-06-12 22:12:01 -0700431 ]
432
kjellandere40a7ee2016-10-16 23:56:12 -0700433 if (!build_with_chromium && is_clang) {
434 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700435 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellander82a94492016-06-12 22:12:01 -0700436 }
437
Anders Carlsson5f2bb622018-05-14 09:48:06 +0200438 if (rtc_use_h264) {
439 defines += [ "WEBRTC_USE_H264" ]
440 }
441
kjellander82a94492016-06-12 22:12:01 -0700442 deps += [
Anders Carlssona114c882018-01-04 15:10:22 +0100443 ":rtc_internal_video_codecs",
kjellandera2ef4f92017-03-06 06:04:55 -0800444 ":rtc_media",
445 ":rtc_media_base",
446 "..:webrtc_common",
447 "../api:call_api",
Erik Språng7fd0a282018-05-22 15:37:23 +0200448 "../api/video:video_bitrate_allocation",
Niels Möllerc6ce9c52018-05-11 11:15:30 +0200449 "../api/video:video_frame",
ilnikd60d06a2017-04-05 03:02:20 -0700450 "../api/video_codecs:video_codecs_api",
kjellandera2ef4f92017-03-06 06:04:55 -0800451 "../call:call_interfaces",
Sebastian Jansson8f83b422018-02-21 13:07:13 +0100452 "../call:mock_rtp_interfaces",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700453 "../rtc_base:rtc_base",
454 "../rtc_base:rtc_base_approved",
455 "../rtc_base:rtc_base_tests_utils",
Tommi68561562018-02-13 19:47:50 +0100456 "../rtc_base:rtc_task_queue_for_test",
Artem Titove41c4332018-07-25 15:04:28 +0200457 "../rtc_base/third_party/sigslot",
kjellandera2ef4f92017-03-06 06:04:55 -0800458 "../test:test_support",
kjellander82a94492016-06-12 22:12:01 -0700459 "//testing/gtest",
460 ]
kjellander82a94492016-06-12 22:12:01 -0700461 }
462
ehmaldonado3a7f35b2016-09-14 05:10:01 -0700463 rtc_media_unittests_resources = [
Mirko Bonadei92ea95e2017-09-15 06:47:31 +0200464 "../resources/media/captured-320x240-2s-48.frames",
465 "../resources/media/faces.1280x720_P420.yuv",
466 "../resources/media/faces_I420.jpg",
467 "../resources/media/faces_I422.jpg",
468 "../resources/media/faces_I444.jpg",
469 "../resources/media/faces_I411.jpg",
470 "../resources/media/faces_I400.jpg",
ehmaldonado3a7f35b2016-09-14 05:10:01 -0700471 ]
kjellander32c4a202016-08-30 02:53:49 -0700472
473 if (is_ios) {
474 bundle_data("rtc_media_unittests_bundle_data") {
475 testonly = true
476 sources = rtc_media_unittests_resources
477 outputs = [
478 "{{bundle_resources_dir}}/{{source_file_part}}",
479 ]
480 }
481 }
482
ehmaldonado38a21322016-09-02 04:10:34 -0700483 rtc_test("rtc_media_unittests") {
kjellander82a94492016-06-12 22:12:01 -0700484 testonly = true
485
johan073ece42016-08-26 02:59:47 -0700486 defines = []
kjellandera2ef4f92017-03-06 06:04:55 -0800487 deps = [
Mirko Bonadei75baa492018-01-11 17:07:30 +0100488 ":rtc_audio_video",
Anders Carlssona114c882018-01-04 15:10:22 +0100489 ":rtc_constants",
Mirko Bonadei75baa492018-01-11 17:07:30 +0100490 ":rtc_data",
Jonas Oreland49ac5952018-09-26 16:04:32 +0200491 "../api/units:time_delta",
Niels Möllerc6ce9c52018-05-11 11:15:30 +0200492 "../api/video:video_frame_i420",
Patrik Höglund62139292017-12-19 16:44:45 +0100493 "../modules/audio_processing:mocks",
Åsa Persson23cd45a2018-07-03 10:40:40 +0200494 "../modules/rtp_rtcp",
Patrik Höglund99175c62018-01-08 11:05:10 +0100495 "../modules/video_coding:video_codec_interface",
Sergio Garcia Murillo43800f92018-06-21 16:16:38 +0200496 "../modules/video_coding:webrtc_vp8",
kjellandera2ef4f92017-03-06 06:04:55 -0800497 "../pc:rtc_pc",
Mirko Bonadeie51f7852017-12-06 11:23:19 +0100498 "../pc:rtc_pc_base",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100499 "../rtc_base:checks",
Tommi8d2c5a82018-03-19 11:12:48 +0100500 "../rtc_base:rtc_task_queue",
Patrik Höglund3e113432017-12-15 14:40:10 +0100501 "../rtc_base:stringutils",
kjellandera2ef4f92017-03-06 06:04:55 -0800502 "../test:field_trial",
Rasmus Brandt0cedc052018-05-31 12:53:00 +0200503 "../test:test_common",
Karl Wiberg918f50c2018-07-05 11:40:33 +0200504 "//third_party/abseil-cpp/absl/memory",
kjellandera2ef4f92017-03-06 06:04:55 -0800505 ]
kjellander82a94492016-06-12 22:12:01 -0700506 sources = [
507 "base/codec_unittest.cc",
508 "base/rtpdataengine_unittest.cc",
kjellander82a94492016-06-12 22:12:01 -0700509 "base/rtputils_unittest.cc",
510 "base/streamparams_unittest.cc",
511 "base/turnutils_unittest.cc",
512 "base/videoadapter_unittest.cc",
513 "base/videobroadcaster_unittest.cc",
514 "base/videocapturer_unittest.cc",
515 "base/videocommon_unittest.cc",
solenberg76377c52017-02-21 00:54:31 -0800516 "engine/apm_helpers_unittest.cc",
magjeddd407022016-12-01 00:27:27 -0800517 "engine/internaldecoderfactory_unittest.cc",
Emircan Uysalerd7ae3c32018-01-25 13:01:09 -0800518 "engine/multiplexcodecfactory_unittest.cc",
kjellander82a94492016-06-12 22:12:01 -0700519 "engine/nullwebrtcvideoengine_unittest.cc",
ossuc54071d2016-08-17 02:45:41 -0700520 "engine/payload_type_mapper_unittest.cc",
magjed6cc25612017-07-10 03:26:36 -0700521 "engine/simulcast_encoder_adapter_unittest.cc",
Åsa Persson31cb8f92018-06-27 10:44:56 +0200522 "engine/simulcast_unittest.cc",
Ilya Nikolaevskiyc22a3a62017-10-25 10:04:54 +0200523 "engine/vp8_encoder_simulcast_proxy_unittest.cc",
kjellander82a94492016-06-12 22:12:01 -0700524 "engine/webrtcmediaengine_unittest.cc",
525 "engine/webrtcvideocapturer_unittest.cc",
noahricbe850e12017-01-20 01:07:26 -0800526 "engine/webrtcvideoencoderfactory_unittest.cc",
eladalonf1841382017-06-12 01:16:46 -0700527 "engine/webrtcvideoengine_unittest.cc",
kjellander82a94492016-06-12 22:12:01 -0700528 ]
529
oprypin45197522017-06-22 01:47:20 -0700530 # TODO(kthelgason): Reenable this test on iOS.
531 # See bugs.webrtc.org/5569
532 if (!is_ios) {
533 sources += [ "engine/webrtcvoiceengine_unittest.cc" ]
534 }
535
deadbeef40610e22016-12-22 10:53:38 -0800536 if (rtc_enable_sctp) {
deadbeef953c2ce2017-01-09 14:53:41 -0800537 sources += [ "sctp/sctptransport_unittest.cc" ]
deadbeef40610e22016-12-22 10:53:38 -0800538 }
539
johan073ece42016-08-26 02:59:47 -0700540 if (rtc_use_h264) {
541 defines += [ "WEBRTC_USE_H264" ]
542 }
ossu11bfc532017-02-16 05:37:06 -0800543
544 if (rtc_opus_support_120ms_ptime) {
545 defines += [ "WEBRTC_OPUS_SUPPORT_120MS_PTIME=1" ]
546 } else {
547 defines += [ "WEBRTC_OPUS_SUPPORT_120MS_PTIME=0" ]
548 }
549
kjellandere40a7ee2016-10-16 23:56:12 -0700550 if (!build_with_chromium && is_clang) {
ehmaldonado38a21322016-09-02 04:10:34 -0700551 suppressed_configs += [
kjellandere40a7ee2016-10-16 23:56:12 -0700552 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
kjellander82a94492016-06-12 22:12:01 -0700553 "//build/config/clang:find_bad_constructs",
554 ]
555 }
556
ehmaldonado3a7f35b2016-09-14 05:10:01 -0700557 data = rtc_media_unittests_resources
558
kjellander82a94492016-06-12 22:12:01 -0700559 if (is_android) {
560 deps += [ "//testing/android/native_test:native_test_support" ]
kjellander28a0ffd2016-08-24 07:48:42 -0700561 shard_timeout = 900
562 }
kjellander32c4a202016-08-30 02:53:49 -0700563
564 if (is_ios) {
565 deps += [ ":rtc_media_unittests_bundle_data" ]
kjellander82a94492016-06-12 22:12:01 -0700566 }
567
568 deps += [
Anders Carlssona114c882018-01-04 15:10:22 +0100569 ":rtc_internal_video_codecs",
kjellander82a94492016-06-12 22:12:01 -0700570 ":rtc_media",
kjellandera2ef4f92017-03-06 06:04:55 -0800571 ":rtc_media_base",
mbonadei9087d492017-04-25 00:35:35 -0700572 ":rtc_media_tests_utils",
Emircan Uysaler98badbc2018-06-28 10:59:02 -0700573 ":rtc_vp9_profile",
Rasmus Brandt0cedc052018-05-31 12:53:00 +0200574 "../api:create_simulcast_test_fixture_api",
Seth Hampson24722b32017-12-22 09:36:42 -0800575 "../api:libjingle_peerconnection_api",
Emircan Uysalerdbcac7f2017-10-30 23:10:12 -0700576 "../api:mock_video_codec_factory",
Rasmus Brandt0cedc052018-05-31 12:53:00 +0200577 "../api:simulcast_test_fixture_api",
kjellandera2ef4f92017-03-06 06:04:55 -0800578 "../api/audio_codecs:builtin_audio_decoder_factory",
ossueb1fde42017-05-02 06:46:30 -0700579 "../api/audio_codecs:builtin_audio_encoder_factory",
Erik Språng7fd0a282018-05-22 15:37:23 +0200580 "../api/video:video_bitrate_allocation",
Niels Möllerc6ce9c52018-05-11 11:15:30 +0200581 "../api/video:video_frame",
Anders Carlsson5f2bb622018-05-14 09:48:06 +0200582 "../api/video_codecs:builtin_video_decoder_factory",
583 "../api/video_codecs:builtin_video_encoder_factory",
ilnikd60d06a2017-04-05 03:02:20 -0700584 "../api/video_codecs:video_codecs_api",
kjellander82a94492016-06-12 22:12:01 -0700585 "../audio",
kjellandera2ef4f92017-03-06 06:04:55 -0800586 "../call:call_interfaces",
587 "../common_video:common_video",
588 "../logging:rtc_event_log_api",
Qingsi Wang970b0882018-02-01 11:04:46 -0800589 "../logging:rtc_event_log_impl_base",
aleloi5de52fd2016-11-10 01:05:34 -0800590 "../modules/audio_device:mock_audio_device",
kjellandera2ef4f92017-03-06 06:04:55 -0800591 "../modules/audio_processing:audio_processing",
Rasmus Brandt0cedc052018-05-31 12:53:00 +0200592 "../modules/video_coding:simulcast_test_fixture_impl",
deadbeef59edb922017-04-18 15:49:09 -0700593 "../p2p:p2p_test_utils",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700594 "../rtc_base:rtc_base",
595 "../rtc_base:rtc_base_approved",
596 "../rtc_base:rtc_base_tests_main",
597 "../rtc_base:rtc_base_tests_utils",
kwiberg37e99fd2017-04-10 05:15:48 -0700598 "../test:audio_codec_mocks",
kjellandera2ef4f92017-03-06 06:04:55 -0800599 "../test:test_support",
Ilya Nikolaevskiyc22a3a62017-10-25 10:04:54 +0200600 "../test:video_test_common",
kjellander82a94492016-06-12 22:12:01 -0700601 ]
602 }
603}