blob: 23b978bf8f399bfbd3206dbac80887e90d014d1e [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
andresp@webrtc.orga74eda12014-09-17 11:50:19 +000011# Note this target is missing an implementation for the video capture.
kjellander@webrtc.orgf58fe0a2015-02-11 07:47:00 +000012# Targets must link with either 'video_capture' or
andresp@webrtc.orga74eda12014-09-17 11:50:19 +000013# 'video_capture_internal_impl' depending on whether they want to
14# use the internal capturer.
ehmaldonado38a21322016-09-02 04:10:34 -070015rtc_source_set("video_capture_module") {
kjellander@webrtc.org788f0582014-08-28 13:51:08 +000016 sources = [
17 "device_info_impl.cc",
18 "device_info_impl.h",
Henrik Kjellander5dda80a2015-11-12 12:46:09 +010019 "video_capture.h",
kjellander@webrtc.org788f0582014-08-28 13:51:08 +000020 "video_capture_config.h",
Henrik Kjellander5dda80a2015-11-12 12:46:09 +010021 "video_capture_defines.h",
kjellander@webrtc.org788f0582014-08-28 13:51:08 +000022 "video_capture_delay.h",
guidou41bce132016-08-04 06:48:17 -070023 "video_capture_factory.cc",
sakal06bfe1f2016-08-04 07:54:04 -070024 "video_capture_factory.h",
kjellander@webrtc.org788f0582014-08-28 13:51:08 +000025 "video_capture_impl.cc",
26 "video_capture_impl.h",
27 ]
28
andresp@webrtc.orga74eda12014-09-17 11:50:19 +000029 deps = [
kwiberg@webrtc.orgac2d27d2015-02-26 13:59:22 +000030 "../..:webrtc_common",
andresp@webrtc.orga74eda12014-09-17 11:50:19 +000031 "../../common_video",
32 "../../system_wrappers",
33 "../utility",
34 ]
kjellander@webrtc.org788f0582014-08-28 13:51:08 +000035
kjellander@webrtc.orgf21ea912014-09-28 17:37:22 +000036 configs += [ "../..:common_config" ]
37 public_configs = [ "../..:common_inherited_config" ]
38
kjellander@webrtc.org788f0582014-08-28 13:51:08 +000039 if (is_clang) {
40 # Suppress warnings from Chrome's Clang plugins.
41 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
ehmaldonado38a21322016-09-02 04:10:34 -070042 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellander@webrtc.org788f0582014-08-28 13:51:08 +000043 }
andresp@webrtc.orga74eda12014-09-17 11:50:19 +000044}
kjellander@webrtc.org788f0582014-08-28 13:51:08 +000045
ehmaldonado38a21322016-09-02 04:10:34 -070046rtc_source_set("video_capture") {
andresp@webrtc.orga74eda12014-09-17 11:50:19 +000047 sources = [
48 "external/device_info_external.cc",
49 "external/video_capture_external.cc",
kjellander@webrtc.org788f0582014-08-28 13:51:08 +000050 ]
andresp@webrtc.orga74eda12014-09-17 11:50:19 +000051
52 deps = [
kjellander@webrtc.orgf58fe0a2015-02-11 07:47:00 +000053 ":video_capture_module",
andresp@webrtc.orgc7134f82014-09-18 10:06:54 +000054 "../../system_wrappers",
andresp@webrtc.orga74eda12014-09-17 11:50:19 +000055 ]
56
kjellander@webrtc.orgf21ea912014-09-28 17:37:22 +000057 configs += [ "../..:common_config" ]
58 public_configs = [ "../..:common_inherited_config" ]
59
andresp@webrtc.orga74eda12014-09-17 11:50:19 +000060 if (is_clang) {
61 # Suppress warnings from Chrome's Clang plugins.
62 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
ehmaldonado38a21322016-09-02 04:10:34 -070063 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
andresp@webrtc.orga74eda12014-09-17 11:50:19 +000064 }
65}
66
kjellander@webrtc.org853049f2015-01-20 11:40:45 +000067if (!build_with_chromium) {
68 config("video_capture_internal_impl_config") {
69 if (is_ios) {
70 libs = [
71 "AVFoundation.framework",
72 "CoreMedia.framework",
73 "CoreVideo.framework",
74 ]
75 }
andresp@webrtc.orga74eda12014-09-17 11:50:19 +000076 }
77
ehmaldonadod02fe4b2016-08-26 13:31:24 -070078 config("video_capture_internal_impl_warnings_config") {
79 if (is_win && is_clang) {
80 cflags = [
81 "-Wno-comment",
82 "-Wno-ignored-attributes",
83
84 # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6269
85 # for -Wno-ignored-qualifiers
86 "-Wno-ignored-qualifiers",
87 "-Wno-microsoft-extra-qualification",
88 "-Wno-missing-braces",
89 "-Wno-overloaded-virtual",
90 "-Wno-reorder",
91 "-Wno-writable-strings",
92 ]
93 }
94 }
95
ehmaldonado38a21322016-09-02 04:10:34 -070096 rtc_source_set("video_capture_internal_impl") {
ehmaldonadod02fe4b2016-08-26 13:31:24 -070097 configs += [ ":video_capture_internal_impl_warnings_config" ]
98
kjellander@webrtc.org853049f2015-01-20 11:40:45 +000099 deps = [
kjellander@webrtc.orgf58fe0a2015-02-11 07:47:00 +0000100 ":video_capture_module",
kjellander@webrtc.org853049f2015-01-20 11:40:45 +0000101 "../../system_wrappers",
102 ]
andresp@webrtc.orga74eda12014-09-17 11:50:19 +0000103
kjellander@webrtc.org853049f2015-01-20 11:40:45 +0000104 if (is_linux) {
105 sources = [
106 "linux/device_info_linux.cc",
107 "linux/device_info_linux.h",
108 "linux/video_capture_linux.cc",
109 "linux/video_capture_linux.h",
110 ]
kwiberg@webrtc.orgac2d27d2015-02-26 13:59:22 +0000111 deps += [ "../..:webrtc_common" ]
kjellander@webrtc.org853049f2015-01-20 11:40:45 +0000112 }
113 if (is_mac) {
114 sources = [
115 "mac/qtkit/video_capture_qtkit.h",
116 "mac/qtkit/video_capture_qtkit.mm",
117 "mac/qtkit/video_capture_qtkit_info.h",
118 "mac/qtkit/video_capture_qtkit_info.mm",
119 "mac/qtkit/video_capture_qtkit_info_objc.h",
120 "mac/qtkit/video_capture_qtkit_info_objc.mm",
121 "mac/qtkit/video_capture_qtkit_objc.h",
122 "mac/qtkit/video_capture_qtkit_objc.mm",
123 "mac/qtkit/video_capture_qtkit_utility.h",
124 "mac/video_capture_mac.mm",
125 ]
kjellander@webrtc.orgf21ea912014-09-28 17:37:22 +0000126
kjellander@webrtc.org853049f2015-01-20 11:40:45 +0000127 libs = [
kjellanderf96c51a2016-08-15 09:21:31 -0700128 # For NSAlert in video_capture_qtkit_info_objc.mm.
129 "Cocoa.framework",
130
131 # For GetGestalt in video_capture_mac.mm.
132 "CoreServices.framework",
kjellander@webrtc.org853049f2015-01-20 11:40:45 +0000133 "CoreVideo.framework",
134 "QTKit.framework",
135 ]
136 }
137 if (is_win) {
138 sources = [
139 "windows/device_info_ds.cc",
140 "windows/device_info_ds.h",
141 "windows/device_info_mf.cc",
142 "windows/device_info_mf.h",
143 "windows/help_functions_ds.cc",
144 "windows/help_functions_ds.h",
145 "windows/sink_filter_ds.cc",
146 "windows/sink_filter_ds.h",
147 "windows/video_capture_ds.cc",
148 "windows/video_capture_ds.h",
149 "windows/video_capture_factory_windows.cc",
150 "windows/video_capture_mf.cc",
151 "windows/video_capture_mf.h",
152 ]
153
154 libs = [ "Strmiids.lib" ]
155
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200156 deps += [ "//third_party/winsdk_samples" ]
kjellander@webrtc.org853049f2015-01-20 11:40:45 +0000157 }
kjellander@webrtc.org853049f2015-01-20 11:40:45 +0000158 if (is_ios) {
159 sources = [
160 "ios/device_info_ios.h",
161 "ios/device_info_ios.mm",
162 "ios/device_info_ios_objc.h",
163 "ios/device_info_ios_objc.mm",
164 "ios/rtc_video_capture_ios_objc.h",
165 "ios/rtc_video_capture_ios_objc.mm",
166 "ios/video_capture_ios.h",
167 "ios/video_capture_ios.mm",
168 ]
169
170 cflags = [
171 "-fobjc-arc", # CLANG_ENABLE_OBJC_ARC = YES.
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200172
kjellander@webrtc.org853049f2015-01-20 11:40:45 +0000173 # To avoid warnings for deprecated videoMinFrameDuration and
174 # videoMaxFrameDuration properties in iOS 7.0.
175 # See webrtc:3705 for more details.
176 "-Wno-deprecated-declarations",
177 ]
178 }
179
180 all_dependent_configs = [ ":video_capture_internal_impl_config" ]
181
182 configs += [ "../..:common_config" ]
183 public_configs = [ "../..:common_inherited_config" ]
184
185 if (is_clang) {
186 # Suppress warnings from Chrome's Clang plugins.
187 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
ehmaldonado38a21322016-09-02 04:10:34 -0700188 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellander@webrtc.org853049f2015-01-20 11:40:45 +0000189 }
andresp@webrtc.orga74eda12014-09-17 11:50:19 +0000190 }
sakal06bfe1f2016-08-04 07:54:04 -0700191
kjellanderf96c51a2016-08-15 09:21:31 -0700192 if (!is_android && rtc_include_tests) {
ehmaldonado38a21322016-09-02 04:10:34 -0700193 rtc_test("video_capture_tests") {
sakal06bfe1f2016-08-04 07:54:04 -0700194 sources = [
195 "test/video_capture_main_mac.mm",
196 "test/video_capture_unittest.cc",
197 ]
198
199 cflags = []
200 if (is_linux || is_mac) {
201 cflags += [ "-Wno-write-strings" ]
202 }
203
204 ldflags = []
205 if (is_linux || is_mac) {
206 ldflags += [
207 "-lpthread",
208 "-lm",
209 ]
210 }
211 if (is_linux) {
212 ldflags += [
213 "-lrt",
214 "-lXext",
215 "-lX11",
216 ]
217 }
218
219 deps = [
220 ":video_capture_internal_impl",
221 ":video_capture_module",
kjellanderf96c51a2016-08-15 09:21:31 -0700222 "../../system_wrappers:system_wrappers_default",
223 "../../test:video_test_common",
224 "../utility",
225 "//testing/gtest",
sakal06bfe1f2016-08-04 07:54:04 -0700226 ]
kjellanderf96c51a2016-08-15 09:21:31 -0700227 if (is_mac) {
228 deps += [ "//webrtc/test:test_support_main_threaded_mac" ]
229 } else {
sakal06bfe1f2016-08-04 07:54:04 -0700230 deps += [ "//webrtc/test:test_support_main" ]
231 }
232
sakal06bfe1f2016-08-04 07:54:04 -0700233 if (is_clang) {
234 # Suppress warnings from Chrome's Clang plugins.
235 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
ehmaldonado38a21322016-09-02 04:10:34 -0700236 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
sakal06bfe1f2016-08-04 07:54:04 -0700237 }
238 }
239 }
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +0000240}