blob: bd4c5f7503413aa50c271714935b86a7606f4ea7 [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
kjellander@webrtc.org11bea892014-07-03 17:04:12 +000011config("common_video_config") {
Mirko Bonadei0250be52017-12-01 13:53:04 +010012 include_dirs = [ "include" ]
kjellander@webrtc.org11bea892014-07-03 17:04:12 +000013}
14
kjellanderb62dbbe2016-09-23 00:38:52 -070015rtc_static_library("common_video") {
Per Kjellandera7f2d842018-01-10 15:54:53 +000016 visibility = [ "*" ]
17
kjellander@webrtc.org11bea892014-07-03 17:04:12 +000018 sources = [
emircan55a401e2016-04-26 12:55:07 -070019 "bitrate_adjuster.cc",
kthelgasonb9061722016-10-26 02:48:16 -070020 "h264/h264_bitstream_parser.cc",
21 "h264/h264_bitstream_parser.h",
sprang52033d62016-06-02 02:43:32 -070022 "h264/h264_common.cc",
23 "h264/h264_common.h",
24 "h264/pps_parser.cc",
25 "h264/pps_parser.h",
magjedfffc1e52016-10-31 05:55:57 -070026 "h264/profile_level_id.h",
sprang52033d62016-06-02 02:43:32 -070027 "h264/sps_parser.cc",
28 "h264/sps_parser.h",
29 "h264/sps_vui_rewriter.cc",
30 "h264/sps_vui_rewriter.h",
magjed@webrtc.org73d763e2015-03-17 11:40:45 +000031 "i420_buffer_pool.cc",
emircan55a401e2016-04-26 12:55:07 -070032 "include/bitrate_adjuster.h",
pbosa96b60b2016-04-18 21:12:48 -070033 "include/frame_callback.h",
kjellander6f8ce062015-11-16 13:52:24 -080034 "include/i420_buffer_pool.h",
35 "include/incoming_video_stream.h",
Erik Språng08127a92016-11-16 16:41:30 +010036 "include/video_bitrate_allocator.h",
nisseea3a7982017-05-15 02:42:11 -070037 "include/video_frame.h",
kjellander6f8ce062015-11-16 13:52:24 -080038 "include/video_frame_buffer.h",
Peter Boström9a638662015-05-13 13:28:11 +020039 "incoming_video_stream.cc",
kjellander@webrtc.org11bea892014-07-03 17:04:12 +000040 "libyuv/include/webrtc_libyuv.h",
kjellander@webrtc.org11bea892014-07-03 17:04:12 +000041 "libyuv/webrtc_libyuv.cc",
Miguel Casas-Sanchez47650702015-05-29 17:21:40 -070042 "video_frame.cc",
magjed@webrtc.org2386d6d2015-03-05 14:03:08 +000043 "video_frame_buffer.cc",
Peter Boström9a638662015-05-13 13:28:11 +020044 "video_render_frames.cc",
45 "video_render_frames.h",
kjellander@webrtc.org11bea892014-07-03 17:04:12 +000046 ]
47
48 include_dirs = [ "../modules/interface" ]
49
ehmaldonadoe9cc6862016-09-05 06:10:18 -070050 public_configs = [ ":common_video_config" ]
kjellander@webrtc.org11bea892014-07-03 17:04:12 +000051
kjellandere40a7ee2016-10-16 23:56:12 -070052 if (!build_with_chromium && is_clang) {
53 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -070054 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellander@webrtc.org42ee5b52014-08-25 14:15:35 +000055 }
56
kwiberg@webrtc.orgac2d27d2015-02-26 13:59:22 +000057 deps = [
58 "..:webrtc_common",
Patrik Höglundbe214a22018-01-04 12:14:35 +010059 "../:typedefs",
kwiberg84f6a3f2017-09-05 08:43:13 -070060 "../api:optional",
Mirko Bonadei0594a7c2017-12-18 11:42:48 +010061 "../api:video_frame_api",
Patrik Höglundb5b5bce2017-11-13 10:19:58 +010062 "../api:video_frame_api_i420",
zhihuang130ca7e2017-06-21 01:02:59 -070063 "../media:rtc_h264_profile_id",
mbonadei1140f972017-04-26 03:38:35 -070064 "../modules:module_api",
Patrik Höglundbe214a22018-01-04 12:14:35 +010065 "../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -070066 "../rtc_base:rtc_base",
67 "../rtc_base:rtc_task_queue",
Karl Wiberg12edf4c2018-03-07 14:18:56 +010068 "../rtc_base:safe_minmax",
kwiberg@webrtc.orgac2d27d2015-02-26 13:59:22 +000069 "../system_wrappers",
Patrik Höglundbe214a22018-01-04 12:14:35 +010070 "//third_party/libyuv",
kwiberg@webrtc.orgac2d27d2015-02-26 13:59:22 +000071 ]
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +000072}
kjellander2a3892a2016-06-08 01:27:52 -070073
74if (rtc_include_tests) {
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020075 common_video_resources = [ "../resources/foreman_cif.yuv" ]
kjellander32c4a202016-08-30 02:53:49 -070076
77 if (is_ios) {
78 bundle_data("common_video_unittests_bundle_data") {
79 testonly = true
80 sources = common_video_resources
81 outputs = [
82 "{{bundle_resources_dir}}/{{source_file_part}}",
83 ]
84 }
85 }
86
ehmaldonado38a21322016-09-02 04:10:34 -070087 rtc_test("common_video_unittests") {
kjellander2a3892a2016-06-08 01:27:52 -070088 testonly = true
89
90 sources = [
91 "bitrate_adjuster_unittest.cc",
kthelgasonb9061722016-10-26 02:48:16 -070092 "h264/h264_bitstream_parser_unittest.cc",
kjellander2a3892a2016-06-08 01:27:52 -070093 "h264/pps_parser_unittest.cc",
magjedfffc1e52016-10-31 05:55:57 -070094 "h264/profile_level_id_unittest.cc",
kjellander2a3892a2016-06-08 01:27:52 -070095 "h264/sps_parser_unittest.cc",
96 "h264/sps_vui_rewriter_unittest.cc",
97 "i420_buffer_pool_unittest.cc",
98 "i420_video_frame_unittest.cc",
99 "libyuv/libyuv_unittest.cc",
kjellander2a3892a2016-06-08 01:27:52 -0700100 ]
101
kjellander2a3892a2016-06-08 01:27:52 -0700102 # TODO(jschuh): Bug 1348: fix this warning.
103 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
104
kjellandere40a7ee2016-10-16 23:56:12 -0700105 if (!build_with_chromium && is_clang) {
106 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700107 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellander2a3892a2016-06-08 01:27:52 -0700108 }
109
110 deps = [
111 ":common_video",
Mirko Bonadei0594a7c2017-12-18 11:42:48 +0100112 "../api:video_frame_api",
Patrik Höglundb5b5bce2017-11-13 10:19:58 +0100113 "../api:video_frame_api_i420",
ehmaldonado656610f2017-02-06 02:21:11 -0800114 "../modules/video_capture:video_capture",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700115 "../rtc_base:rtc_base",
116 "../rtc_base:rtc_base_approved",
kjellander2a3892a2016-06-08 01:27:52 -0700117 "../system_wrappers:system_wrappers",
Patrik Höglund7696bef2018-03-15 15:05:39 +0100118 "../test:fileutils",
ehmaldonado26bddb92016-11-30 06:12:01 -0800119 "../test:test_main",
kjellander2a3892a2016-06-08 01:27:52 -0700120 "../test:video_test_common",
kjellander2a3892a2016-06-08 01:27:52 -0700121 "//testing/gtest",
Mirko Bonadei401d0562017-12-14 11:24:00 +0100122 "//third_party/libyuv",
kjellander2a3892a2016-06-08 01:27:52 -0700123 ]
124
ehmaldonado3a7f35b2016-09-14 05:10:01 -0700125 data = common_video_resources
kjellander2a3892a2016-06-08 01:27:52 -0700126 if (is_android) {
127 deps += [ "//testing/android/native_test:native_test_support" ]
kjellander28a0ffd2016-08-24 07:48:42 -0700128 shard_timeout = 900
129 }
kjellander2a3892a2016-06-08 01:27:52 -0700130
kjellander32c4a202016-08-30 02:53:49 -0700131 if (is_ios) {
132 deps += [ ":common_video_unittests_bundle_data" ]
kjellander2a3892a2016-06-08 01:27:52 -0700133 }
134 }
135}