blob: 9830c8b942f344096102665782d16adac003b95e [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
kjellanderb62dbbe2016-09-23 00:38:52 -070018rtc_static_library("common_video") {
kjellander@webrtc.org11bea892014-07-03 17:04:12 +000019 sources = [
emircan55a401e2016-04-26 12:55:07 -070020 "bitrate_adjuster.cc",
kthelgasonb9061722016-10-26 02:48:16 -070021 "h264/h264_bitstream_parser.cc",
22 "h264/h264_bitstream_parser.h",
sprang52033d62016-06-02 02:43:32 -070023 "h264/h264_common.cc",
24 "h264/h264_common.h",
25 "h264/pps_parser.cc",
26 "h264/pps_parser.h",
27 "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",
36 "include/video_frame_buffer.h",
Peter Boström9a638662015-05-13 13:28:11 +020037 "incoming_video_stream.cc",
kjellander@webrtc.org11bea892014-07-03 17:04:12 +000038 "libyuv/include/webrtc_libyuv.h",
kjellander@webrtc.org11bea892014-07-03 17:04:12 +000039 "libyuv/webrtc_libyuv.cc",
Miguel Casas-Sanchez47650702015-05-29 17:21:40 -070040 "video_frame.cc",
magjed@webrtc.org2386d6d2015-03-05 14:03:08 +000041 "video_frame_buffer.cc",
Peter Boström9a638662015-05-13 13:28:11 +020042 "video_render_frames.cc",
43 "video_render_frames.h",
kjellander@webrtc.org11bea892014-07-03 17:04:12 +000044 ]
45
46 include_dirs = [ "../modules/interface" ]
47
ehmaldonadoe9cc6862016-09-05 06:10:18 -070048 public_configs = [ ":common_video_config" ]
kjellander@webrtc.org11bea892014-07-03 17:04:12 +000049
kjellandere40a7ee2016-10-16 23:56:12 -070050 if (!build_with_chromium && is_clang) {
51 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -070052 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellander@webrtc.org42ee5b52014-08-25 14:15:35 +000053 }
54
kwiberg@webrtc.orgac2d27d2015-02-26 13:59:22 +000055 deps = [
56 "..:webrtc_common",
perkj4e417b22016-07-14 23:35:55 -070057 "../base:rtc_task_queue",
kwiberg@webrtc.orgac2d27d2015-02-26 13:59:22 +000058 "../system_wrappers",
59 ]
kjellander@webrtc.org11bea892014-07-03 17:04:12 +000060
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +000061 if (rtc_build_libyuv) {
kjellander@webrtc.orgce22f132015-02-16 12:47:20 +000062 deps += [ "$rtc_libyuv_dir" ]
Henrik Kjellander57e5fd22015-05-25 12:55:39 +020063 public_deps = [
64 "$rtc_libyuv_dir",
65 ]
kjellander@webrtc.org11bea892014-07-03 17:04:12 +000066 } else {
67 # Need to add a directory normally exported by libyuv.
kjellander@webrtc.orgce22f132015-02-16 12:47:20 +000068 include_dirs += [ "$rtc_libyuv_dir/include" ]
kjellander@webrtc.org11bea892014-07-03 17:04:12 +000069 }
tkchin7d06a8c2016-04-04 14:10:43 -070070
71 if (is_ios || is_mac) {
72 sources += [
73 "corevideo_frame_buffer.cc",
74 "include/corevideo_frame_buffer.h",
75 ]
76 libs = [ "CoreVideo.framework" ]
77 }
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +000078}
kjellander2a3892a2016-06-08 01:27:52 -070079
80if (rtc_include_tests) {
ehmaldonado3a7f35b2016-09-14 05:10:01 -070081 common_video_resources = [ "//resources/foreman_cif.yuv" ]
kjellander32c4a202016-08-30 02:53:49 -070082
83 if (is_ios) {
84 bundle_data("common_video_unittests_bundle_data") {
85 testonly = true
86 sources = common_video_resources
87 outputs = [
88 "{{bundle_resources_dir}}/{{source_file_part}}",
89 ]
90 }
91 }
92
ehmaldonado38a21322016-09-02 04:10:34 -070093 rtc_test("common_video_unittests") {
kjellander2a3892a2016-06-08 01:27:52 -070094 testonly = true
95
96 sources = [
97 "bitrate_adjuster_unittest.cc",
kthelgasonb9061722016-10-26 02:48:16 -070098 "h264/h264_bitstream_parser_unittest.cc",
kjellander2a3892a2016-06-08 01:27:52 -070099 "h264/pps_parser_unittest.cc",
100 "h264/sps_parser_unittest.cc",
101 "h264/sps_vui_rewriter_unittest.cc",
102 "i420_buffer_pool_unittest.cc",
103 "i420_video_frame_unittest.cc",
104 "libyuv/libyuv_unittest.cc",
kjellander2a3892a2016-06-08 01:27:52 -0700105 ]
106
kjellander2a3892a2016-06-08 01:27:52 -0700107 # TODO(jschuh): Bug 1348: fix this warning.
108 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
109
kjellandere40a7ee2016-10-16 23:56:12 -0700110 if (!build_with_chromium && is_clang) {
111 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700112 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellander2a3892a2016-06-08 01:27:52 -0700113 }
114
115 deps = [
116 ":common_video",
117 "../system_wrappers:system_wrappers",
118 "../test:test_support_main",
119 "../test:video_test_common",
120 "//testing/gmock",
121 "//testing/gtest",
122 ]
123
ehmaldonado3a7f35b2016-09-14 05:10:01 -0700124 data = common_video_resources
kjellander2a3892a2016-06-08 01:27:52 -0700125 if (is_android) {
126 deps += [ "//testing/android/native_test:native_test_support" ]
kjellander28a0ffd2016-08-24 07:48:42 -0700127 shard_timeout = 900
128 }
kjellander2a3892a2016-06-08 01:27:52 -0700129
kjellander32c4a202016-08-30 02:53:49 -0700130 if (is_ios) {
131 deps += [ ":common_video_unittests_bundle_data" ]
kjellander2a3892a2016-06-08 01:27:52 -0700132 }
133 }
134}