blob: d561bf60f9989e2b46c671202c01fcc2310e123d [file] [log] [blame]
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +00001# Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
2#
3# Use of this source code is governed by a BSD-style license
4# that can be found in the LICENSE file in the root of the source
5# tree. An additional intellectual property rights grant can be found
6# in the file PATENTS. All contributing project authors may
7# be found in the AUTHORS file in the root of the source tree.
8
mbonadei9aa3f0a2017-01-24 06:58:22 -08009import("../../webrtc.gni")
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +000010
kjellanderb62dbbe2016-09-23 00:38:52 -070011rtc_static_library("video_coding") {
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +000012 sources = [
Henrik Kjellander2557b862015-11-18 22:00:21 +010013 "codec_database.cc",
14 "codec_database.h",
15 "codec_timer.cc",
16 "codec_timer.h",
Henrik Kjellander2557b862015-11-18 22:00:21 +010017 "decoding_state.cc",
18 "decoding_state.h",
19 "encoded_frame.cc",
20 "encoded_frame.h",
brandtr71b1c1f2017-01-12 06:16:24 -080021 "fec_rate_table.h",
Henrik Kjellander2557b862015-11-18 22:00:21 +010022 "frame_buffer.cc",
23 "frame_buffer.h",
philipelbe7a9e52016-05-19 12:19:35 +020024 "frame_buffer2.cc",
25 "frame_buffer2.h",
philipelc707ab72016-04-01 02:01:54 -070026 "frame_object.cc",
27 "frame_object.h",
Henrik Kjellander2557b862015-11-18 22:00:21 +010028 "generic_decoder.cc",
29 "generic_decoder.h",
30 "generic_encoder.cc",
31 "generic_encoder.h",
johanb0a11112016-12-08 03:57:17 -080032 "h264_sprop_parameter_sets.cc",
33 "h264_sprop_parameter_sets.h",
philipel34852cf2016-11-03 04:03:01 -070034 "h264_sps_pps_tracker.cc",
35 "h264_sps_pps_tracker.h",
philipel83f831a2016-03-12 03:30:23 -080036 "histogram.cc",
37 "histogram.h",
Erik Språng08127a92016-11-16 16:41:30 +010038 "include/video_codec_initializer.h",
Henrik Kjellander2557b862015-11-18 22:00:21 +010039 "include/video_coding.h",
40 "include/video_coding_defines.h",
41 "inter_frame_delay.cc",
42 "inter_frame_delay.h",
43 "internal_defines.h",
44 "jitter_buffer.cc",
45 "jitter_buffer.h",
46 "jitter_buffer_common.h",
47 "jitter_estimator.cc",
48 "jitter_estimator.h",
49 "media_opt_util.cc",
50 "media_opt_util.h",
51 "media_optimization.cc",
52 "media_optimization.h",
53 "nack_fec_tables.h",
philipel83f831a2016-03-12 03:30:23 -080054 "nack_module.cc",
55 "nack_module.h",
Henrik Kjellander2557b862015-11-18 22:00:21 +010056 "packet.cc",
57 "packet.h",
philipelc707ab72016-04-01 02:01:54 -070058 "packet_buffer.cc",
59 "packet_buffer.h",
Per69b332d2016-06-02 15:45:42 +020060 "protection_bitrate_calculator.cc",
61 "protection_bitrate_calculator.h",
kjellandera8d8aad2017-03-08 05:42:26 -080062 "qp_parser.cc",
63 "qp_parser.h",
Henrik Kjellander2557b862015-11-18 22:00:21 +010064 "receiver.cc",
65 "receiver.h",
philipel02447bc2016-05-13 06:01:03 -070066 "rtp_frame_reference_finder.cc",
67 "rtp_frame_reference_finder.h",
Henrik Kjellander2557b862015-11-18 22:00:21 +010068 "rtt_filter.cc",
69 "rtt_filter.h",
70 "session_info.cc",
71 "session_info.h",
72 "timestamp_map.cc",
73 "timestamp_map.h",
74 "timing.cc",
75 "timing.h",
Erik Språng08127a92016-11-16 16:41:30 +010076 "video_codec_initializer.cc",
Henrik Kjellander2557b862015-11-18 22:00:21 +010077 "video_coding_impl.cc",
78 "video_coding_impl.h",
79 "video_receiver.cc",
80 "video_sender.cc",
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +000081 ]
82
kjellander8f4419b2016-06-02 02:09:52 -070083 # TODO(jschuh): Bug 1348: fix this warning.
84 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
kjellander@webrtc.org8649fed2015-01-08 21:22:01 +000085
kjellandere40a7ee2016-10-16 23:56:12 -070086 if (!build_with_chromium && is_clang) {
87 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -070088 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellander@webrtc.org42ee5b52014-08-25 14:15:35 +000089 }
90
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +000091 deps = [
Rasmus Brandt88f080a2017-11-02 14:28:06 +010092 ":codec_globals_headers",
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +000093 ":video_coding_utility",
Zeke Chin71f6f442015-06-29 14:34:58 -070094 ":webrtc_h264",
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +000095 ":webrtc_i420",
Emircan Uysalerdbcac7f2017-10-30 23:10:12 -070096 ":webrtc_stereo",
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +000097 ":webrtc_vp8",
marpan@webrtc.org5b883172014-11-01 06:10:48 +000098 ":webrtc_vp9",
mbonadei1140f972017-04-26 03:38:35 -070099 "..:module_api",
kwiberg@webrtc.orgac2d27d2015-02-26 13:59:22 +0000100 "../..:webrtc_common",
kwiberg84f6a3f2017-09-05 08:43:13 -0700101 "../../api:optional",
aleloi440b6d92017-08-22 05:43:23 -0700102 "../../call:video_stream_api",
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +0000103 "../../common_video",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700104 "../../rtc_base:rtc_base",
105 "../../rtc_base:rtc_base_approved",
106 "../../rtc_base:rtc_numerics",
107 "../../rtc_base:rtc_task_queue",
108 "../../rtc_base:sequenced_task_checker",
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +0000109 "../../system_wrappers",
ilnik6d5b4d62017-08-30 03:32:14 -0700110 "../pacing",
ehmaldonado36df2d72016-12-08 09:56:16 -0800111 "../rtp_rtcp:rtp_rtcp",
112 "../utility:utility",
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +0000113 ]
114}
115
charujaincb728ea2017-09-18 03:08:08 -0700116rtc_source_set("mock_headers") {
117 testonly = true
stefan@webrtc.org73823ca2014-07-07 11:46:43 +0000118 sources = [
charujaincb728ea2017-09-18 03:08:08 -0700119 "codecs/interface/mock/mock_video_codec_interface.h",
120 "include/mock/mock_video_codec_interface.h",
121 ]
122 deps = [
123 ":video_coding_utility",
124 "../..:webrtc_common",
125 "../../test:test_support",
126 ]
127}
128
129rtc_source_set("codec_globals_headers") {
130 sources = [
131 "codecs/h264/include/h264_globals.h",
132 "codecs/interface/common_constants.h",
133 "codecs/vp8/include/vp8_globals.h",
134 "codecs/vp9/include/vp9_globals.h",
135 ]
136}
137
138rtc_source_set("video_coding_utility") {
139 sources = [
140 "codecs/interface/video_codec_interface.h",
141 "codecs/interface/video_error_codes.h",
Erik Språng08127a92016-11-16 16:41:30 +0100142 "utility/default_video_bitrate_allocator.cc",
143 "utility/default_video_bitrate_allocator.h",
stefan@webrtc.org73823ca2014-07-07 11:46:43 +0000144 "utility/frame_dropper.cc",
kjellander@webrtc.orgb7ce9642015-11-18 23:04:10 +0100145 "utility/frame_dropper.h",
sprang3911c262016-04-15 01:24:14 -0700146 "utility/ivf_file_writer.cc",
147 "utility/ivf_file_writer.h",
kthelgason194f40a2016-09-14 02:14:58 -0700148 "utility/moving_average.cc",
kjellander@webrtc.orgb7ce9642015-11-18 23:04:10 +0100149 "utility/moving_average.h",
kjellander@webrtc.orgb8caf6a2014-09-30 18:05:02 +0000150 "utility/quality_scaler.cc",
kjellander@webrtc.orgb7ce9642015-11-18 23:04:10 +0100151 "utility/quality_scaler.h",
jackychen98d8cf52015-05-21 11:12:02 -0700152 "utility/vp8_header_parser.cc",
kjellander@webrtc.orgb7ce9642015-11-18 23:04:10 +0100153 "utility/vp8_header_parser.h",
jianj20acdf22017-05-24 10:00:16 -0700154 "utility/vp9_uncompressed_header_parser.cc",
155 "utility/vp9_uncompressed_header_parser.h",
stefan@webrtc.org73823ca2014-07-07 11:46:43 +0000156 ]
157
kjellandere40a7ee2016-10-16 23:56:12 -0700158 if (!build_with_chromium && is_clang) {
159 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700160 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellander@webrtc.org42ee5b52014-08-25 14:15:35 +0000161 }
162
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200163 deps = [
mbonadei1140f972017-04-26 03:38:35 -0700164 "..:module_api",
ehmaldonado36df2d72016-12-08 09:56:16 -0800165 "../..:webrtc_common",
kwiberg84f6a3f2017-09-05 08:43:13 -0700166 "../../api:optional",
ilnikd60d06a2017-04-05 03:02:20 -0700167 "../../api/video_codecs:video_codecs_api",
perkj4e417b22016-07-14 23:35:55 -0700168 "../../common_video",
kjellandera8d8aad2017-03-08 05:42:26 -0800169 "../../modules/rtp_rtcp:rtp_rtcp",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700170 "../../rtc_base:rtc_base_approved",
171 "../../rtc_base:rtc_numerics",
172 "../../rtc_base:rtc_task_queue",
173 "../../rtc_base:sequenced_task_checker",
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200174 "../../system_wrappers",
175 ]
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +0000176}
177
kjellanderb62dbbe2016-09-23 00:38:52 -0700178rtc_static_library("webrtc_h264") {
Zeke Chin71f6f442015-06-29 14:34:58 -0700179 sources = [
180 "codecs/h264/h264.cc",
181 "codecs/h264/include/h264.h",
182 ]
183
kjellandere40a7ee2016-10-16 23:56:12 -0700184 if (!build_with_chromium && is_clang) {
185 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700186 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
Zeke Chin71f6f442015-06-29 14:34:58 -0700187 }
188
hbosbab934b2016-01-27 01:36:03 -0800189 defines = []
Zeke Chin71f6f442015-06-29 14:34:58 -0700190 deps = [
ehmaldonado36df2d72016-12-08 09:56:16 -0800191 ":video_coding_utility",
Magnus Jedvert849b3ae2017-09-29 17:54:09 +0200192 "../../api/video_codecs:video_codecs_api",
magjed21d110f2017-02-28 00:28:04 -0800193 "../../media:rtc_media_base",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700194 "../../rtc_base:rtc_base_approved",
Zeke Chin71f6f442015-06-29 14:34:58 -0700195 "../../system_wrappers",
196 ]
hbosa9a1d2a2016-01-11 10:19:02 -0800197
hbos902c03e2016-01-21 03:34:40 -0800198 if (rtc_use_h264) {
hbos9dc59282016-02-03 05:09:37 -0800199 defines += [ "WEBRTC_USE_H264" ]
hbosc5a39c22016-02-02 02:26:05 -0800200 if (rtc_initialize_ffmpeg) {
201 defines += [ "WEBRTC_INITIALIZE_FFMPEG" ]
202 }
hbosbab934b2016-01-27 01:36:03 -0800203 sources += [
204 "codecs/h264/h264_decoder_impl.cc",
205 "codecs/h264/h264_decoder_impl.h",
206 "codecs/h264/h264_encoder_impl.cc",
207 "codecs/h264/h264_encoder_impl.h",
208 ]
hbosa9a1d2a2016-01-11 10:19:02 -0800209 deps += [
kjellanderf6b55092016-02-07 23:04:26 -0800210 "../../common_video",
hta9aa96882016-12-06 05:36:03 -0800211 "../../media:rtc_media_base",
hbosa9a1d2a2016-01-11 10:19:02 -0800212 "//third_party/ffmpeg:ffmpeg",
213 "//third_party/openh264:encoder",
214 ]
215 }
Zeke Chin71f6f442015-06-29 14:34:58 -0700216}
217
kjellanderb62dbbe2016-09-23 00:38:52 -0700218rtc_static_library("webrtc_i420") {
stefan@webrtc.org73823ca2014-07-07 11:46:43 +0000219 sources = [
Henrik Kjellandera74c08d2015-10-22 12:23:11 +0200220 "codecs/i420/i420.cc",
221 "codecs/i420/include/i420.h",
stefan@webrtc.org73823ca2014-07-07 11:46:43 +0000222 ]
223
kjellandere40a7ee2016-10-16 23:56:12 -0700224 if (!build_with_chromium && is_clang) {
225 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700226 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellander@webrtc.org42ee5b52014-08-25 14:15:35 +0000227 }
228
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200229 deps = [
charujaincb728ea2017-09-18 03:08:08 -0700230 ":video_coding_utility",
ehmaldonado36df2d72016-12-08 09:56:16 -0800231 "../..:webrtc_common",
ehmaldonado36df2d72016-12-08 09:56:16 -0800232 "../../common_video:common_video",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700233 "../../rtc_base:rtc_base_approved",
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200234 "../../system_wrappers",
235 ]
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +0000236}
237
Emircan Uysalerdbcac7f2017-10-30 23:10:12 -0700238rtc_static_library("webrtc_stereo") {
239 sources = [
240 "codecs/stereo/include/stereo_decoder_adapter.h",
241 "codecs/stereo/include/stereo_encoder_adapter.h",
242 "codecs/stereo/stereo_decoder_adapter.cc",
243 "codecs/stereo/stereo_encoder_adapter.cc",
244 ]
245
246 if (!build_with_chromium && is_clang) {
247 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
248 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
249 }
250
251 deps = [
252 ":video_coding_utility",
253 "..:module_api",
254 "../..:webrtc_common",
255 "../../api/video_codecs:video_codecs_api",
256 "../../common_video:common_video",
257 "../../rtc_base:rtc_base_approved",
258 "../../system_wrappers",
259 ]
260}
261
kjellanderb62dbbe2016-09-23 00:38:52 -0700262rtc_static_library("webrtc_vp8") {
stefan@webrtc.org73823ca2014-07-07 11:46:43 +0000263 sources = [
kjellander@webrtc.orgb8caf6a2014-09-30 18:05:02 +0000264 "codecs/vp8/default_temporal_layers.cc",
265 "codecs/vp8/default_temporal_layers.h",
pbos@webrtc.org9115cde2014-12-09 10:36:40 +0000266 "codecs/vp8/include/vp8.h",
267 "codecs/vp8/include/vp8_common_types.h",
pbos@webrtc.org9115cde2014-12-09 10:36:40 +0000268 "codecs/vp8/screenshare_layers.cc",
269 "codecs/vp8/screenshare_layers.h",
kjellandera8d8aad2017-03-08 05:42:26 -0800270 "codecs/vp8/simulcast_rate_allocator.cc",
271 "codecs/vp8/simulcast_rate_allocator.h",
Ilya Nikolaevskiy58662912017-10-04 15:07:09 +0200272 "codecs/vp8/temporal_layers.cc",
stefan@webrtc.org73823ca2014-07-07 11:46:43 +0000273 "codecs/vp8/temporal_layers.h",
kjellander@webrtc.orgb8caf6a2014-09-30 18:05:02 +0000274 "codecs/vp8/vp8_impl.cc",
275 "codecs/vp8/vp8_impl.h",
stefan@webrtc.org73823ca2014-07-07 11:46:43 +0000276 ]
kjellander@webrtc.org42ee5b52014-08-25 14:15:35 +0000277
kjellander8f4419b2016-06-02 02:09:52 -0700278 # TODO(jschuh): Bug 1348: fix this warning.
279 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
280
kjellandere40a7ee2016-10-16 23:56:12 -0700281 if (!build_with_chromium && is_clang) {
282 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700283 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellander@webrtc.org42ee5b52014-08-25 14:15:35 +0000284 }
285
stefan@webrtc.org73823ca2014-07-07 11:46:43 +0000286 deps = [
287 ":video_coding_utility",
mbonadei1140f972017-04-26 03:38:35 -0700288 "..:module_api",
kwiberg@webrtc.orgac2d27d2015-02-26 13:59:22 +0000289 "../..:webrtc_common",
kwiberg84f6a3f2017-09-05 08:43:13 -0700290 "../../api:optional",
ilnikd60d06a2017-04-05 03:02:20 -0700291 "../../api/video_codecs:video_codecs_api",
stefan@webrtc.org73823ca2014-07-07 11:46:43 +0000292 "../../common_video",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700293 "../../rtc_base:rtc_base_approved",
asaperssone5d02f92017-08-09 23:37:05 -0700294 "../../rtc_base:rtc_numerics",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700295 "../../rtc_base:sequenced_task_checker",
stefan@webrtc.org73823ca2014-07-07 11:46:43 +0000296 "../../system_wrappers",
297 ]
kjellander@webrtc.orgb8caf6a2014-09-30 18:05:02 +0000298 if (rtc_build_libvpx) {
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200299 deps += [ rtc_libvpx_dir ]
kjellander@webrtc.orgb8caf6a2014-09-30 18:05:02 +0000300 }
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +0000301}
marpan@webrtc.org5b883172014-11-01 06:10:48 +0000302
kjellanderb62dbbe2016-09-23 00:38:52 -0700303rtc_static_library("webrtc_vp9") {
phoglund33603522016-10-05 06:52:22 -0700304 if (rtc_libvpx_build_vp9) {
305 sources = [
306 "codecs/vp9/include/vp9.h",
307 "codecs/vp9/screenshare_layers.cc",
308 "codecs/vp9/screenshare_layers.h",
309 "codecs/vp9/vp9_frame_buffer_pool.cc",
310 "codecs/vp9/vp9_frame_buffer_pool.h",
311 "codecs/vp9/vp9_impl.cc",
312 "codecs/vp9/vp9_impl.h",
313 ]
314 } else {
315 sources = [
316 "codecs/vp9/vp9_noop.cc",
317 ]
318 }
marpan@webrtc.org5b883172014-11-01 06:10:48 +0000319
kjellandere40a7ee2016-10-16 23:56:12 -0700320 if (!build_with_chromium && is_clang) {
321 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700322 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
marpan@webrtc.org5b883172014-11-01 06:10:48 +0000323 }
324
marpan@webrtc.org5b883172014-11-01 06:10:48 +0000325 deps = [
326 ":video_coding_utility",
mbonadei1140f972017-04-26 03:38:35 -0700327 "..:module_api",
marpan@webrtc.org5b883172014-11-01 06:10:48 +0000328 "../../common_video",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700329 "../../rtc_base:rtc_base_approved",
marpan@webrtc.org5b883172014-11-01 06:10:48 +0000330 "../../system_wrappers",
331 ]
332 if (rtc_build_libvpx) {
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200333 deps += [ rtc_libvpx_dir ]
marpan@webrtc.org5b883172014-11-01 06:10:48 +0000334 }
335}
kjellanderfb114242016-06-13 00:19:48 -0700336
337if (rtc_include_tests) {
magjed73c0eb52017-08-07 06:55:28 -0700338 if (is_ios || is_mac) {
kthelgason36d658d2017-08-24 05:43:45 -0700339 rtc_static_library("codec_test_objc") {
magjed73c0eb52017-08-07 06:55:28 -0700340 sources = [
341 "codecs/test/objc_codec_h264_test.h",
342 "codecs/test/objc_codec_h264_test.mm",
343 ]
344 deps = [
345 "../../api:video_frame_api",
346 "../../api/video_codecs:video_codecs_api",
347 "../../media:rtc_audio_video",
348 "../../modules:module_api",
kthelgason36d658d2017-08-24 05:43:45 -0700349 "../../sdk:common_objc",
350 "../../sdk:peerconnection_objc",
351 "../../sdk:peerconnectionfactory_objc",
352 "../../sdk:videotoolbox_objc",
353 "../../sdk:videotracksource_objc",
magjed73c0eb52017-08-07 06:55:28 -0700354 ]
355
356 if (!build_with_chromium && is_clang) {
357 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
358 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
359 }
360 }
361 }
362
magjed6cc25612017-07-10 03:26:36 -0700363 rtc_source_set("simulcast_test_utility") {
364 testonly = true
365 sources = [
366 "codecs/vp8/simulcast_test_utility.h",
367 ]
368
369 if (!build_with_chromium && is_clang) {
370 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
371 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
372 }
373
374 deps = [
charujaincb728ea2017-09-18 03:08:08 -0700375 ":mock_headers",
magjed6cc25612017-07-10 03:26:36 -0700376 ":video_coding",
377 ":webrtc_vp8",
378 "../../api:video_frame_api",
magjed6cc25612017-07-10 03:26:36 -0700379 "../../common_video:common_video",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700380 "../../rtc_base:rtc_base_approved",
magjed6cc25612017-07-10 03:26:36 -0700381 "../../test:test_support",
382 ]
383 }
384
ehmaldonado38a21322016-09-02 04:10:34 -0700385 rtc_source_set("video_codecs_test_framework") {
kjellanderfb114242016-06-13 00:19:48 -0700386 testonly = true
387 sources = [
388 "codecs/test/mock/mock_packet_manipulator.h",
389 "codecs/test/packet_manipulator.cc",
390 "codecs/test/packet_manipulator.h",
kjellanderfb114242016-06-13 00:19:48 -0700391 "codecs/test/stats.cc",
392 "codecs/test/stats.h",
Åsa Persson2d27fb52017-10-19 14:05:50 +0200393 "codecs/test/test_config.cc",
394 "codecs/test/test_config.h",
sakalb8102e02017-03-06 03:52:55 -0800395 "codecs/test/video_codec_test.cc",
396 "codecs/test/video_codec_test.h",
kjellanderfb114242016-06-13 00:19:48 -0700397 "codecs/test/videoprocessor.cc",
398 "codecs/test/videoprocessor.h",
399 ]
400
kjellandere40a7ee2016-10-16 23:56:12 -0700401 if (!build_with_chromium && is_clang) {
402 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700403 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellanderfb114242016-06-13 00:19:48 -0700404 }
405
406 deps = [
ssilkin612f8582017-09-28 09:23:17 -0700407 ":codec_globals_headers",
ehmaldonado36df2d72016-12-08 09:56:16 -0800408 ":video_coding",
409 ":video_coding_utility",
kjellandera8d8aad2017-03-08 05:42:26 -0800410 ":webrtc_vp8",
ehmaldonado36df2d72016-12-08 09:56:16 -0800411 "../..:webrtc_common",
ilnikd60d06a2017-04-05 03:02:20 -0700412 "../../api/video_codecs:video_codecs_api",
ehmaldonado36df2d72016-12-08 09:56:16 -0800413 "../../common_video:common_video",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700414 "../../rtc_base:rtc_base_approved",
brandtrc8c59052017-08-21 06:44:16 -0700415 "../../rtc_base:rtc_task_queue",
416 "../../rtc_base:sequenced_task_checker",
ehmaldonado36df2d72016-12-08 09:56:16 -0800417 "../../system_wrappers:system_wrappers",
kjellanderfb114242016-06-13 00:19:48 -0700418 "../../test:test_support",
sakalb8102e02017-03-06 03:52:55 -0800419 "../../test:video_test_common",
ehmaldonado656610f2017-02-06 02:21:11 -0800420 "../../test:video_test_support",
kjellanderfb114242016-06-13 00:19:48 -0700421 ]
422 }
ehmaldonado9cbb0a12017-01-30 03:07:03 -0800423
brandtrdf232992017-09-07 07:50:06 -0700424 video_coding_modules_tests_resources = [
Mirko Bonadei92ea95e2017-09-15 06:47:31 +0200425 "../../resources/foreman_128x96.yuv",
426 "../../resources/foreman_160x120.yuv",
427 "../../resources/foreman_176x144.yuv",
428 "../../resources/foreman_320x240.yuv",
brandtrdf232992017-09-07 07:50:06 -0700429 ]
brandtr6bb8e0e2017-02-20 04:35:52 -0800430
brandtrdf232992017-09-07 07:50:06 -0700431 if (is_ios || is_mac) {
432 bundle_data("video_coding_modules_tests_resources_bundle_data") {
433 testonly = true
434 sources = video_coding_modules_tests_resources
435 outputs = [
436 "{{bundle_resources_dir}}/{{source_file_part}}",
brandtr6bb8e0e2017-02-20 04:35:52 -0800437 ]
brandtr12a47f62017-09-01 00:10:27 -0700438 }
brandtr6bb8e0e2017-02-20 04:35:52 -0800439 }
440
441 rtc_source_set("video_coding_modules_tests") {
442 testonly = true
443
kjellandere0629c02017-04-25 04:04:50 -0700444 # Skip restricting visibility on mobile platforms since the tests on those
445 # gets additional generated targets which would require many lines here to
446 # cover (which would be confusing to read and hard to maintain).
447 if (!is_android && !is_ios) {
jianjun.zhuc0247402017-07-11 06:20:45 -0700448 visibility = [ "..:modules_tests" ]
kjellandere0629c02017-04-25 04:04:50 -0700449 }
brandtr6bb8e0e2017-02-20 04:35:52 -0800450 sources = [
sakalb8102e02017-03-06 03:52:55 -0800451 "codecs/h264/test/h264_impl_unittest.cc",
Emircan Uysalerdbcac7f2017-10-30 23:10:12 -0700452 "codecs/stereo/test/stereo_adapter_unittest.cc",
brandtrdf232992017-09-07 07:50:06 -0700453 "codecs/test/videoprocessor_integrationtest.cc",
454 "codecs/test/videoprocessor_integrationtest.h",
brandtr12a47f62017-09-01 00:10:27 -0700455 "codecs/test/videoprocessor_integrationtest_libvpx.cc",
456 "codecs/test/videoprocessor_integrationtest_openh264.cc",
brandtrdf232992017-09-07 07:50:06 -0700457 "codecs/test/videoprocessor_integrationtest_parameterized.cc",
brandtr6bb8e0e2017-02-20 04:35:52 -0800458 "codecs/vp8/test/vp8_impl_unittest.cc",
sakal7adadb12017-02-23 02:54:57 -0800459 "codecs/vp9/test/vp9_impl_unittest.cc",
brandtr6bb8e0e2017-02-20 04:35:52 -0800460 ]
461
462 deps = [
sakalb8102e02017-03-06 03:52:55 -0800463 ":video_codecs_test_framework",
brandtrdf232992017-09-07 07:50:06 -0700464 ":video_coding",
465 ":video_coding_utility",
sakalb8102e02017-03-06 03:52:55 -0800466 ":webrtc_h264",
Emircan Uysalerdbcac7f2017-10-30 23:10:12 -0700467 ":webrtc_stereo",
brandtr6bb8e0e2017-02-20 04:35:52 -0800468 ":webrtc_vp8",
sakal7adadb12017-02-23 02:54:57 -0800469 ":webrtc_vp9",
brandtrdf232992017-09-07 07:50:06 -0700470 "../..:webrtc_common",
Emircan Uysalerdbcac7f2017-10-30 23:10:12 -0700471 "../../api:mock_video_codec_factory",
kwiberg84f6a3f2017-09-05 08:43:13 -0700472 "../../api:optional",
ehmaldonado9cbb0a12017-01-30 03:07:03 -0800473 "../../api:video_frame_api",
brandtrdf232992017-09-07 07:50:06 -0700474 "../../common_video",
475 "../../media:rtc_audio_video",
Rasmus Brandtfb1a8662017-10-27 14:51:46 +0200476 "../../media:rtc_media_base",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700477 "../../rtc_base:rtc_base_approved",
Åsa Persson7173cf22017-10-19 12:14:09 +0200478 "../../rtc_base:rtc_base_tests_utils",
brandtrdf232992017-09-07 07:50:06 -0700479 "../../system_wrappers",
asapersson142fcc92017-08-17 08:58:54 -0700480 "../../test:field_trial",
ehmaldonado9cbb0a12017-01-30 03:07:03 -0800481 "../../test:test_support",
482 "../../test:video_test_common",
brandtrdf232992017-09-07 07:50:06 -0700483 "../../test:video_test_support",
ehmaldonado656610f2017-02-06 02:21:11 -0800484 "../video_capture",
ehmaldonado9cbb0a12017-01-30 03:07:03 -0800485 ]
brandtr6bb8e0e2017-02-20 04:35:52 -0800486
brandtrdf232992017-09-07 07:50:06 -0700487 data = video_coding_modules_tests_resources
brandtr6bb8e0e2017-02-20 04:35:52 -0800488
489 if (is_android) {
Rasmus Brandt31027342017-09-29 13:48:12 +0000490 sources += [
491 "codecs/test/android_test_initializer.cc",
492 "codecs/test/android_test_initializer.h",
493 "codecs/test/videoprocessor_integrationtest_mediacodec.cc",
494 ]
495
brandtrdf232992017-09-07 07:50:06 -0700496 deps += [
Rasmus Brandt31027342017-09-29 13:48:12 +0000497 "../../sdk/android:libjingle_peerconnection_jni",
498 "//base",
brandtrdf232992017-09-07 07:50:06 -0700499 ]
brandtr6bb8e0e2017-02-20 04:35:52 -0800500 }
501
502 if (is_ios || is_mac) {
Rasmus Brandtf7a35582017-10-24 10:16:33 +0200503 sources +=
504 [ "codecs/test/videoprocessor_integrationtest_videotoolbox.cc" ]
505
magjed73c0eb52017-08-07 06:55:28 -0700506 deps += [
kthelgason36d658d2017-08-24 05:43:45 -0700507 ":codec_test_objc",
brandtrdf232992017-09-07 07:50:06 -0700508 ":video_coding_modules_tests_resources_bundle_data",
Rasmus Brandt31027342017-09-29 13:48:12 +0000509 "../../media:rtc_media_base",
510 "../../sdk:videotoolbox_objc",
magjed73c0eb52017-08-07 06:55:28 -0700511 ]
brandtr6bb8e0e2017-02-20 04:35:52 -0800512 }
513
brandtrdf232992017-09-07 07:50:06 -0700514 if (rtc_use_h264) {
515 defines = [ "WEBRTC_USE_H264" ]
516 }
brandtr6bb8e0e2017-02-20 04:35:52 -0800517
ehmaldonado9cbb0a12017-01-30 03:07:03 -0800518 if (!build_with_chromium && is_clang) {
519 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
520 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
521 }
522 }
523
ehmaldonado36268652017-01-19 08:27:11 -0800524 rtc_source_set("video_coding_unittests") {
525 testonly = true
kjellandere0629c02017-04-25 04:04:50 -0700526
527 # Skip restricting visibility on mobile platforms since the tests on those
528 # gets additional generated targets which would require many lines here to
529 # cover (which would be confusing to read and hard to maintain).
530 if (!is_android && !is_ios) {
jianjun.zhuc0247402017-07-11 06:20:45 -0700531 visibility = [ "..:modules_unittests" ]
kjellandere0629c02017-04-25 04:04:50 -0700532 }
ehmaldonado36268652017-01-19 08:27:11 -0800533 sources = [
534 "codecs/test/packet_manipulator_unittest.cc",
535 "codecs/test/stats_unittest.cc",
Åsa Persson2d27fb52017-10-19 14:05:50 +0200536 "codecs/test/test_config_unittest.cc",
ehmaldonado36268652017-01-19 08:27:11 -0800537 "codecs/test/videoprocessor_unittest.cc",
538 "codecs/vp8/default_temporal_layers_unittest.cc",
ehmaldonado36268652017-01-19 08:27:11 -0800539 "codecs/vp8/screenshare_layers_unittest.cc",
ehmaldonado36268652017-01-19 08:27:11 -0800540 "codecs/vp8/simulcast_unittest.cc",
ehmaldonado36268652017-01-19 08:27:11 -0800541 "decoding_state_unittest.cc",
542 "frame_buffer2_unittest.cc",
ilnik04f4d122017-06-19 07:18:55 -0700543 "generic_encoder_unittest.cc",
ehmaldonado36268652017-01-19 08:27:11 -0800544 "h264_sprop_parameter_sets_unittest.cc",
545 "h264_sps_pps_tracker_unittest.cc",
546 "histogram_unittest.cc",
547 "include/mock/mock_vcm_callbacks.h",
548 "jitter_buffer_unittest.cc",
549 "jitter_estimator_tests.cc",
550 "nack_module_unittest.cc",
551 "protection_bitrate_calculator_unittest.cc",
552 "receiver_unittest.cc",
553 "rtp_frame_reference_finder_unittest.cc",
ehmaldonado36268652017-01-19 08:27:11 -0800554 "session_info_unittest.cc",
555 "test/stream_generator.cc",
556 "test/stream_generator.h",
charujaincb728ea2017-09-18 03:08:08 -0700557 "test/test_util.h",
ehmaldonado36268652017-01-19 08:27:11 -0800558 "timing_unittest.cc",
559 "utility/default_video_bitrate_allocator_unittest.cc",
560 "utility/frame_dropper_unittest.cc",
561 "utility/ivf_file_writer_unittest.cc",
charujaincb728ea2017-09-18 03:08:08 -0700562 "utility/mock/mock_frame_dropper.h",
ehmaldonado36268652017-01-19 08:27:11 -0800563 "utility/moving_average_unittest.cc",
564 "utility/quality_scaler_unittest.cc",
565 "utility/simulcast_rate_allocator_unittest.cc",
sprang429600d2017-01-26 06:12:26 -0800566 "video_codec_initializer_unittest.cc",
ehmaldonado36268652017-01-19 08:27:11 -0800567 "video_packet_buffer_unittest.cc",
568 "video_receiver_unittest.cc",
569 "video_sender_unittest.cc",
570 ]
571 if (rtc_libvpx_build_vp9) {
572 sources += [ "codecs/vp9/vp9_screenshare_layers_unittest.cc" ]
573 }
574 if (rtc_use_h264) {
575 sources += [ "codecs/h264/h264_encoder_impl_unittest.cc" ]
576 }
577 deps = [
charujaincb728ea2017-09-18 03:08:08 -0700578 ":mock_headers",
magjed6cc25612017-07-10 03:26:36 -0700579 ":simulcast_test_utility",
ehmaldonado36268652017-01-19 08:27:11 -0800580 ":video_codecs_test_framework",
581 ":video_coding",
582 ":video_coding_utility",
583 ":webrtc_h264",
584 ":webrtc_vp8",
585 ":webrtc_vp9",
mbonadei1140f972017-04-26 03:38:35 -0700586 "..:module_api",
ehmaldonado36268652017-01-19 08:27:11 -0800587 "../..:webrtc_common",
588 "../../api:video_frame_api",
ilnikd60d06a2017-04-05 03:02:20 -0700589 "../../api/video_codecs:video_codecs_api",
ehmaldonado36268652017-01-19 08:27:11 -0800590 "../../common_video:common_video",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700591 "../../rtc_base:rtc_base",
592 "../../rtc_base:rtc_base_approved",
Bjorn Tereliusa194e582017-10-25 13:07:09 +0200593 "../../rtc_base:rtc_numerics",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700594 "../../rtc_base:rtc_task_queue",
ehmaldonado36268652017-01-19 08:27:11 -0800595 "../../system_wrappers:metrics_default",
596 "../../system_wrappers:system_wrappers",
597 "../../test:field_trial",
598 "../../test:test_support",
599 "../../test:video_test_common",
ehmaldonado656610f2017-02-06 02:21:11 -0800600 "../../test:video_test_support",
ehmaldonado36268652017-01-19 08:27:11 -0800601 "../rtp_rtcp:rtp_rtcp",
602 "//testing/gmock",
603 ]
604 if (rtc_build_libvpx) {
605 deps += [ rtc_libvpx_dir ]
606 }
607 if (is_win) {
608 cflags = [
609 # TODO(kjellander): bugs.webrtc.org/261: Fix this warning.
610 "/wd4373", # virtual function override.
611 ]
612 }
613
614 # TODO(jschuh): bugs.webrtc.org/1348: fix this warning.
615 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
616 if (!build_with_chromium && is_clang) {
617 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
618 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
619 }
620 }
kjellanderfb114242016-06-13 00:19:48 -0700621}