blob: c4edeaf0b122e247f64232320314e738dd77499f [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
9import("../build/webrtc.gni")
kjellander2a3892a2016-06-08 01:27:52 -070010import("//testing/test.gni")
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +000011
kjellander@webrtc.org11bea892014-07-03 17:04:12 +000012config("common_video_config") {
13 include_dirs = [
kjellander6f8ce062015-11-16 13:52:24 -080014 "include",
kjellander@webrtc.org11bea892014-07-03 17:04:12 +000015 "libyuv/include",
16 ]
17}
18
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +000019source_set("common_video") {
kjellander@webrtc.org11bea892014-07-03 17:04:12 +000020 sources = [
emircan55a401e2016-04-26 12:55:07 -070021 "bitrate_adjuster.cc",
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",
26 "h264/sps_parser.cc",
27 "h264/sps_parser.h",
28 "h264/sps_vui_rewriter.cc",
29 "h264/sps_vui_rewriter.h",
magjed@webrtc.org73d763e2015-03-17 11:40:45 +000030 "i420_buffer_pool.cc",
emircan55a401e2016-04-26 12:55:07 -070031 "include/bitrate_adjuster.h",
pbosa96b60b2016-04-18 21:12:48 -070032 "include/frame_callback.h",
kjellander6f8ce062015-11-16 13:52:24 -080033 "include/i420_buffer_pool.h",
34 "include/incoming_video_stream.h",
35 "include/video_frame_buffer.h",
Peter Boström9a638662015-05-13 13:28:11 +020036 "incoming_video_stream.cc",
kjellander@webrtc.org11bea892014-07-03 17:04:12 +000037 "libyuv/include/webrtc_libyuv.h",
kjellander@webrtc.org11bea892014-07-03 17:04:12 +000038 "libyuv/webrtc_libyuv.cc",
Miguel Casas-Sanchez47650702015-05-29 17:21:40 -070039 "video_frame.cc",
magjed@webrtc.org2386d6d2015-03-05 14:03:08 +000040 "video_frame_buffer.cc",
Peter Boström9a638662015-05-13 13:28:11 +020041 "video_render_frames.cc",
42 "video_render_frames.h",
kjellander@webrtc.org11bea892014-07-03 17:04:12 +000043 ]
44
45 include_dirs = [ "../modules/interface" ]
46
kjellander@webrtc.orgf21ea912014-09-28 17:37:22 +000047 configs += [ "..:common_config" ]
48 public_configs = [
49 "..:common_inherited_config",
50 ":common_video_config",
51 ]
kjellander@webrtc.org11bea892014-07-03 17:04:12 +000052
kjellander@webrtc.org42ee5b52014-08-25 14:15:35 +000053 if (is_clang) {
54 # Suppress warnings from Chrome's Clang plugins.
55 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
56 configs -= [ "//build/config/clang:find_bad_constructs" ]
57 }
58
kwiberg@webrtc.orgac2d27d2015-02-26 13:59:22 +000059 deps = [
60 "..:webrtc_common",
perkj4e417b22016-07-14 23:35:55 -070061 "../base:rtc_task_queue",
kwiberg@webrtc.orgac2d27d2015-02-26 13:59:22 +000062 "../system_wrappers",
63 ]
kjellander@webrtc.org11bea892014-07-03 17:04:12 +000064
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +000065 if (rtc_build_libyuv) {
kjellander@webrtc.orgce22f132015-02-16 12:47:20 +000066 deps += [ "$rtc_libyuv_dir" ]
Henrik Kjellander57e5fd22015-05-25 12:55:39 +020067 public_deps = [
68 "$rtc_libyuv_dir",
69 ]
kjellander@webrtc.org11bea892014-07-03 17:04:12 +000070 } else {
71 # Need to add a directory normally exported by libyuv.
kjellander@webrtc.orgce22f132015-02-16 12:47:20 +000072 include_dirs += [ "$rtc_libyuv_dir/include" ]
kjellander@webrtc.org11bea892014-07-03 17:04:12 +000073 }
tkchin7d06a8c2016-04-04 14:10:43 -070074
75 if (is_ios || is_mac) {
76 sources += [
77 "corevideo_frame_buffer.cc",
78 "include/corevideo_frame_buffer.h",
79 ]
80 libs = [ "CoreVideo.framework" ]
81 }
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +000082}
kjellander2a3892a2016-06-08 01:27:52 -070083
84if (rtc_include_tests) {
85 test("common_video_unittests") {
86 testonly = true
87
88 sources = [
89 "bitrate_adjuster_unittest.cc",
90 "h264/pps_parser_unittest.cc",
91 "h264/sps_parser_unittest.cc",
92 "h264/sps_vui_rewriter_unittest.cc",
93 "i420_buffer_pool_unittest.cc",
94 "i420_video_frame_unittest.cc",
95 "libyuv/libyuv_unittest.cc",
kjellander2a3892a2016-06-08 01:27:52 -070096 ]
97
98 configs += [ "..:common_config" ]
99 public_configs = [ "..:common_inherited_config" ]
100
101 # TODO(jschuh): Bug 1348: fix this warning.
102 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
103
104 if (is_clang) {
105 # Suppress warnings from the Chromium Clang plugin.
106 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
107 configs -= [ "//build/config/clang:find_bad_constructs" ]
108 }
109
110 deps = [
111 ":common_video",
112 "../system_wrappers:system_wrappers",
113 "../test:test_support_main",
114 "../test:video_test_common",
115 "//testing/gmock",
116 "//testing/gtest",
117 ]
118
119 if (is_android) {
120 deps += [ "//testing/android/native_test:native_test_support" ]
121
122 # This needs to be kept in sync with the .isolate file.
123 # TODO(kjellander); Move this to android_assets targets instead.
124 data = [
125 "//resources/foreman_cif.yuv",
126 ]
127 }
128 }
129}