blob: cb1f024723c65e1bb13e0a5ea7ba903153380cd5 [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")
10
kjellander@webrtc.org11bea892014-07-03 17:04:12 +000011config("common_video_config") {
12 include_dirs = [
kjellander6f8ce062015-11-16 13:52:24 -080013 "include",
kjellander@webrtc.org11bea892014-07-03 17:04:12 +000014 "libyuv/include",
15 ]
16}
17
ehmaldonado38a21322016-09-02 04:10:34 -070018rtc_source_set("common_video") {
kjellander@webrtc.org11bea892014-07-03 17:04:12 +000019 sources = [
emircan55a401e2016-04-26 12:55:07 -070020 "bitrate_adjuster.cc",
sprang52033d62016-06-02 02:43:32 -070021 "h264/h264_common.cc",
22 "h264/h264_common.h",
23 "h264/pps_parser.cc",
24 "h264/pps_parser.h",
25 "h264/sps_parser.cc",
26 "h264/sps_parser.h",
27 "h264/sps_vui_rewriter.cc",
28 "h264/sps_vui_rewriter.h",
magjed@webrtc.org73d763e2015-03-17 11:40:45 +000029 "i420_buffer_pool.cc",
emircan55a401e2016-04-26 12:55:07 -070030 "include/bitrate_adjuster.h",
pbosa96b60b2016-04-18 21:12:48 -070031 "include/frame_callback.h",
kjellander6f8ce062015-11-16 13:52:24 -080032 "include/i420_buffer_pool.h",
33 "include/incoming_video_stream.h",
34 "include/video_frame_buffer.h",
Peter Boström9a638662015-05-13 13:28:11 +020035 "incoming_video_stream.cc",
kjellander@webrtc.org11bea892014-07-03 17:04:12 +000036 "libyuv/include/webrtc_libyuv.h",
kjellander@webrtc.org11bea892014-07-03 17:04:12 +000037 "libyuv/webrtc_libyuv.cc",
Miguel Casas-Sanchez47650702015-05-29 17:21:40 -070038 "video_frame.cc",
magjed@webrtc.org2386d6d2015-03-05 14:03:08 +000039 "video_frame_buffer.cc",
Peter Boström9a638662015-05-13 13:28:11 +020040 "video_render_frames.cc",
41 "video_render_frames.h",
kjellander@webrtc.org11bea892014-07-03 17:04:12 +000042 ]
43
44 include_dirs = [ "../modules/interface" ]
45
kjellander@webrtc.orgf21ea912014-09-28 17:37:22 +000046 configs += [ "..:common_config" ]
47 public_configs = [
48 "..:common_inherited_config",
49 ":common_video_config",
50 ]
kjellander@webrtc.org11bea892014-07-03 17:04:12 +000051
kjellander@webrtc.org42ee5b52014-08-25 14:15:35 +000052 if (is_clang) {
53 # Suppress warnings from Chrome's Clang plugins.
54 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
ehmaldonado38a21322016-09-02 04:10:34 -070055 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellander@webrtc.org42ee5b52014-08-25 14:15:35 +000056 }
57
kwiberg@webrtc.orgac2d27d2015-02-26 13:59:22 +000058 deps = [
59 "..:webrtc_common",
perkj4e417b22016-07-14 23:35:55 -070060 "../base:rtc_task_queue",
kwiberg@webrtc.orgac2d27d2015-02-26 13:59:22 +000061 "../system_wrappers",
62 ]
kjellander@webrtc.org11bea892014-07-03 17:04:12 +000063
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +000064 if (rtc_build_libyuv) {
kjellander@webrtc.orgce22f132015-02-16 12:47:20 +000065 deps += [ "$rtc_libyuv_dir" ]
Henrik Kjellander57e5fd22015-05-25 12:55:39 +020066 public_deps = [
67 "$rtc_libyuv_dir",
68 ]
kjellander@webrtc.org11bea892014-07-03 17:04:12 +000069 } else {
70 # Need to add a directory normally exported by libyuv.
kjellander@webrtc.orgce22f132015-02-16 12:47:20 +000071 include_dirs += [ "$rtc_libyuv_dir/include" ]
kjellander@webrtc.org11bea892014-07-03 17:04:12 +000072 }
tkchin7d06a8c2016-04-04 14:10:43 -070073
74 if (is_ios || is_mac) {
75 sources += [
76 "corevideo_frame_buffer.cc",
77 "include/corevideo_frame_buffer.h",
78 ]
79 libs = [ "CoreVideo.framework" ]
80 }
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +000081}
kjellander2a3892a2016-06-08 01:27:52 -070082
83if (rtc_include_tests) {
kjellander32c4a202016-08-30 02:53:49 -070084 if (is_android || is_ios) {
85 common_video_resources = [ "//resources/foreman_cif.yuv" ]
86 }
87
88 if (is_ios) {
89 bundle_data("common_video_unittests_bundle_data") {
90 testonly = true
91 sources = common_video_resources
92 outputs = [
93 "{{bundle_resources_dir}}/{{source_file_part}}",
94 ]
95 }
96 }
97
ehmaldonado38a21322016-09-02 04:10:34 -070098 rtc_test("common_video_unittests") {
kjellander2a3892a2016-06-08 01:27:52 -070099 testonly = true
100
101 sources = [
102 "bitrate_adjuster_unittest.cc",
103 "h264/pps_parser_unittest.cc",
104 "h264/sps_parser_unittest.cc",
105 "h264/sps_vui_rewriter_unittest.cc",
106 "i420_buffer_pool_unittest.cc",
107 "i420_video_frame_unittest.cc",
108 "libyuv/libyuv_unittest.cc",
kjellander2a3892a2016-06-08 01:27:52 -0700109 ]
110
111 configs += [ "..:common_config" ]
112 public_configs = [ "..:common_inherited_config" ]
113
114 # TODO(jschuh): Bug 1348: fix this warning.
115 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
116
117 if (is_clang) {
118 # Suppress warnings from the Chromium Clang plugin.
119 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
ehmaldonado38a21322016-09-02 04:10:34 -0700120 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellander2a3892a2016-06-08 01:27:52 -0700121 }
122
123 deps = [
124 ":common_video",
125 "../system_wrappers:system_wrappers",
126 "../test:test_support_main",
127 "../test:video_test_common",
128 "//testing/gmock",
129 "//testing/gtest",
130 ]
131
132 if (is_android) {
133 deps += [ "//testing/android/native_test:native_test_support" ]
kjellander32c4a202016-08-30 02:53:49 -0700134 data = common_video_resources
kjellander28a0ffd2016-08-24 07:48:42 -0700135 shard_timeout = 900
136 }
kjellander2a3892a2016-06-08 01:27:52 -0700137
kjellander32c4a202016-08-30 02:53:49 -0700138 if (is_ios) {
139 deps += [ ":common_video_unittests_bundle_data" ]
kjellander2a3892a2016-06-08 01:27:52 -0700140 }
141 }
142}