blob: 8edac8941a1afcc45cfcd2919a6a4077db0ec175 [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")
sakal06bfe1f2016-08-04 07:54:04 -070010import("//testing/test.gni")
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +000011
andresp@webrtc.orga74eda12014-09-17 11:50:19 +000012# Note this target is missing an implementation for the video capture.
kjellander@webrtc.orgf58fe0a2015-02-11 07:47:00 +000013# Targets must link with either 'video_capture' or
andresp@webrtc.orga74eda12014-09-17 11:50:19 +000014# 'video_capture_internal_impl' depending on whether they want to
15# use the internal capturer.
kjellander@webrtc.orgf58fe0a2015-02-11 07:47:00 +000016source_set("video_capture_module") {
kjellander@webrtc.org788f0582014-08-28 13:51:08 +000017 sources = [
18 "device_info_impl.cc",
19 "device_info_impl.h",
Henrik Kjellander5dda80a2015-11-12 12:46:09 +010020 "video_capture.h",
kjellander@webrtc.org788f0582014-08-28 13:51:08 +000021 "video_capture_config.h",
Henrik Kjellander5dda80a2015-11-12 12:46:09 +010022 "video_capture_defines.h",
kjellander@webrtc.org788f0582014-08-28 13:51:08 +000023 "video_capture_delay.h",
guidou41bce132016-08-04 06:48:17 -070024 "video_capture_factory.cc",
sakal06bfe1f2016-08-04 07:54:04 -070025 "video_capture_factory.h",
kjellander@webrtc.org788f0582014-08-28 13:51:08 +000026 "video_capture_impl.cc",
27 "video_capture_impl.h",
28 ]
29
andresp@webrtc.orga74eda12014-09-17 11:50:19 +000030 deps = [
kwiberg@webrtc.orgac2d27d2015-02-26 13:59:22 +000031 "../..:webrtc_common",
andresp@webrtc.orga74eda12014-09-17 11:50:19 +000032 "../../common_video",
33 "../../system_wrappers",
34 "../utility",
35 ]
kjellander@webrtc.org788f0582014-08-28 13:51:08 +000036
kjellander@webrtc.orgf21ea912014-09-28 17:37:22 +000037 configs += [ "../..:common_config" ]
38 public_configs = [ "../..:common_inherited_config" ]
39
kjellander@webrtc.org788f0582014-08-28 13:51:08 +000040 if (is_clang) {
41 # Suppress warnings from Chrome's Clang plugins.
42 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
43 configs -= [ "//build/config/clang:find_bad_constructs" ]
44 }
andresp@webrtc.orga74eda12014-09-17 11:50:19 +000045}
kjellander@webrtc.org788f0582014-08-28 13:51:08 +000046
kjellander@webrtc.orgf58fe0a2015-02-11 07:47:00 +000047source_set("video_capture") {
andresp@webrtc.orga74eda12014-09-17 11:50:19 +000048 sources = [
49 "external/device_info_external.cc",
50 "external/video_capture_external.cc",
kjellander@webrtc.org788f0582014-08-28 13:51:08 +000051 ]
andresp@webrtc.orga74eda12014-09-17 11:50:19 +000052
53 deps = [
kjellander@webrtc.orgf58fe0a2015-02-11 07:47:00 +000054 ":video_capture_module",
andresp@webrtc.orgc7134f82014-09-18 10:06:54 +000055 "../../system_wrappers",
andresp@webrtc.orga74eda12014-09-17 11:50:19 +000056 ]
57
kjellander@webrtc.orgf21ea912014-09-28 17:37:22 +000058 configs += [ "../..:common_config" ]
59 public_configs = [ "../..:common_inherited_config" ]
60
andresp@webrtc.orga74eda12014-09-17 11:50:19 +000061 if (is_clang) {
62 # Suppress warnings from Chrome's Clang plugins.
63 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
64 configs -= [ "//build/config/clang:find_bad_constructs" ]
65 }
66}
67
kjellander@webrtc.org853049f2015-01-20 11:40:45 +000068if (!build_with_chromium) {
69 config("video_capture_internal_impl_config") {
70 if (is_ios) {
71 libs = [
72 "AVFoundation.framework",
73 "CoreMedia.framework",
74 "CoreVideo.framework",
75 ]
76 }
andresp@webrtc.orga74eda12014-09-17 11:50:19 +000077 }
78
kjellander@webrtc.org853049f2015-01-20 11:40:45 +000079 source_set("video_capture_internal_impl") {
80 deps = [
kjellander@webrtc.orgf58fe0a2015-02-11 07:47:00 +000081 ":video_capture_module",
kjellander@webrtc.org853049f2015-01-20 11:40:45 +000082 "../../system_wrappers",
83 ]
andresp@webrtc.orga74eda12014-09-17 11:50:19 +000084
kjellander@webrtc.org853049f2015-01-20 11:40:45 +000085 if (is_linux) {
86 sources = [
87 "linux/device_info_linux.cc",
88 "linux/device_info_linux.h",
89 "linux/video_capture_linux.cc",
90 "linux/video_capture_linux.h",
91 ]
kwiberg@webrtc.orgac2d27d2015-02-26 13:59:22 +000092 deps += [ "../..:webrtc_common" ]
kjellander@webrtc.org853049f2015-01-20 11:40:45 +000093 }
94 if (is_mac) {
95 sources = [
96 "mac/qtkit/video_capture_qtkit.h",
97 "mac/qtkit/video_capture_qtkit.mm",
98 "mac/qtkit/video_capture_qtkit_info.h",
99 "mac/qtkit/video_capture_qtkit_info.mm",
100 "mac/qtkit/video_capture_qtkit_info_objc.h",
101 "mac/qtkit/video_capture_qtkit_info_objc.mm",
102 "mac/qtkit/video_capture_qtkit_objc.h",
103 "mac/qtkit/video_capture_qtkit_objc.mm",
104 "mac/qtkit/video_capture_qtkit_utility.h",
105 "mac/video_capture_mac.mm",
106 ]
kjellander@webrtc.orgf21ea912014-09-28 17:37:22 +0000107
kjellander@webrtc.org853049f2015-01-20 11:40:45 +0000108 libs = [
kjellanderf96c51a2016-08-15 09:21:31 -0700109 # For NSAlert in video_capture_qtkit_info_objc.mm.
110 "Cocoa.framework",
111
112 # For GetGestalt in video_capture_mac.mm.
113 "CoreServices.framework",
kjellander@webrtc.org853049f2015-01-20 11:40:45 +0000114 "CoreVideo.framework",
115 "QTKit.framework",
116 ]
117 }
118 if (is_win) {
119 sources = [
120 "windows/device_info_ds.cc",
121 "windows/device_info_ds.h",
122 "windows/device_info_mf.cc",
123 "windows/device_info_mf.h",
124 "windows/help_functions_ds.cc",
125 "windows/help_functions_ds.h",
126 "windows/sink_filter_ds.cc",
127 "windows/sink_filter_ds.h",
128 "windows/video_capture_ds.cc",
129 "windows/video_capture_ds.h",
130 "windows/video_capture_factory_windows.cc",
131 "windows/video_capture_mf.cc",
132 "windows/video_capture_mf.h",
133 ]
134
135 libs = [ "Strmiids.lib" ]
136
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200137 deps += [ "//third_party/winsdk_samples" ]
kjellander@webrtc.org853049f2015-01-20 11:40:45 +0000138 }
ehmaldonado4bc4d272016-08-25 04:15:40 -0700139 if (is_win && is_clang) {
140 cflags = [
141 "-Wno-comment",
142 "-Wno-ignored-attributes",
143 "-Wno-microsoft-extra-qualification",
144 "-Wno-missing-braces",
145 "-Wno-overloaded-virtual",
146 "-Wno-reorder",
147 "-Wno-writable-strings",
148 ]
149 }
kjellander@webrtc.org853049f2015-01-20 11:40:45 +0000150 if (is_ios) {
151 sources = [
152 "ios/device_info_ios.h",
153 "ios/device_info_ios.mm",
154 "ios/device_info_ios_objc.h",
155 "ios/device_info_ios_objc.mm",
156 "ios/rtc_video_capture_ios_objc.h",
157 "ios/rtc_video_capture_ios_objc.mm",
158 "ios/video_capture_ios.h",
159 "ios/video_capture_ios.mm",
160 ]
161
162 cflags = [
163 "-fobjc-arc", # CLANG_ENABLE_OBJC_ARC = YES.
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200164
kjellander@webrtc.org853049f2015-01-20 11:40:45 +0000165 # To avoid warnings for deprecated videoMinFrameDuration and
166 # videoMaxFrameDuration properties in iOS 7.0.
167 # See webrtc:3705 for more details.
168 "-Wno-deprecated-declarations",
169 ]
170 }
171
172 all_dependent_configs = [ ":video_capture_internal_impl_config" ]
173
174 configs += [ "../..:common_config" ]
175 public_configs = [ "../..:common_inherited_config" ]
176
177 if (is_clang) {
178 # Suppress warnings from Chrome's Clang plugins.
179 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
180 configs -= [ "//build/config/clang:find_bad_constructs" ]
181 }
andresp@webrtc.orga74eda12014-09-17 11:50:19 +0000182 }
sakal06bfe1f2016-08-04 07:54:04 -0700183
kjellanderf96c51a2016-08-15 09:21:31 -0700184 if (!is_android && rtc_include_tests) {
sakal06bfe1f2016-08-04 07:54:04 -0700185 test("video_capture_tests") {
186 sources = [
187 "test/video_capture_main_mac.mm",
188 "test/video_capture_unittest.cc",
189 ]
190
191 cflags = []
192 if (is_linux || is_mac) {
193 cflags += [ "-Wno-write-strings" ]
194 }
195
196 ldflags = []
197 if (is_linux || is_mac) {
198 ldflags += [
199 "-lpthread",
200 "-lm",
201 ]
202 }
203 if (is_linux) {
204 ldflags += [
205 "-lrt",
206 "-lXext",
207 "-lX11",
208 ]
209 }
210
211 deps = [
212 ":video_capture_internal_impl",
213 ":video_capture_module",
kjellanderf96c51a2016-08-15 09:21:31 -0700214 "../../system_wrappers:system_wrappers_default",
215 "../../test:video_test_common",
216 "../utility",
217 "//testing/gtest",
sakal06bfe1f2016-08-04 07:54:04 -0700218 ]
kjellanderf96c51a2016-08-15 09:21:31 -0700219 if (is_mac) {
220 deps += [ "//webrtc/test:test_support_main_threaded_mac" ]
221 } else {
sakal06bfe1f2016-08-04 07:54:04 -0700222 deps += [ "//webrtc/test:test_support_main" ]
223 }
224
sakal06bfe1f2016-08-04 07:54:04 -0700225 if (is_clang) {
226 # Suppress warnings from Chrome's Clang plugins.
227 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
228 configs -= [ "//build/config/clang:find_bad_constructs" ]
229 }
230 }
231 }
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +0000232}