blob: 3df74b62e13355dd8b5cc7de5c4c2a6faef8b147 [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 = [
109 "CoreVideo.framework",
110 "QTKit.framework",
111 ]
112 }
113 if (is_win) {
114 sources = [
115 "windows/device_info_ds.cc",
116 "windows/device_info_ds.h",
117 "windows/device_info_mf.cc",
118 "windows/device_info_mf.h",
119 "windows/help_functions_ds.cc",
120 "windows/help_functions_ds.h",
121 "windows/sink_filter_ds.cc",
122 "windows/sink_filter_ds.h",
123 "windows/video_capture_ds.cc",
124 "windows/video_capture_ds.h",
125 "windows/video_capture_factory_windows.cc",
126 "windows/video_capture_mf.cc",
127 "windows/video_capture_mf.h",
128 ]
129
130 libs = [ "Strmiids.lib" ]
131
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200132 deps += [ "//third_party/winsdk_samples" ]
kjellander@webrtc.org853049f2015-01-20 11:40:45 +0000133 }
kjellander@webrtc.org853049f2015-01-20 11:40:45 +0000134 if (is_ios) {
135 sources = [
136 "ios/device_info_ios.h",
137 "ios/device_info_ios.mm",
138 "ios/device_info_ios_objc.h",
139 "ios/device_info_ios_objc.mm",
140 "ios/rtc_video_capture_ios_objc.h",
141 "ios/rtc_video_capture_ios_objc.mm",
142 "ios/video_capture_ios.h",
143 "ios/video_capture_ios.mm",
144 ]
145
146 cflags = [
147 "-fobjc-arc", # CLANG_ENABLE_OBJC_ARC = YES.
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200148
kjellander@webrtc.org853049f2015-01-20 11:40:45 +0000149 # To avoid warnings for deprecated videoMinFrameDuration and
150 # videoMaxFrameDuration properties in iOS 7.0.
151 # See webrtc:3705 for more details.
152 "-Wno-deprecated-declarations",
153 ]
154 }
155
156 all_dependent_configs = [ ":video_capture_internal_impl_config" ]
157
158 configs += [ "../..:common_config" ]
159 public_configs = [ "../..:common_inherited_config" ]
160
161 if (is_clang) {
162 # Suppress warnings from Chrome's Clang plugins.
163 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
164 configs -= [ "//build/config/clang:find_bad_constructs" ]
165 }
andresp@webrtc.orga74eda12014-09-17 11:50:19 +0000166 }
sakal06bfe1f2016-08-04 07:54:04 -0700167
168 # TODO(mflodman): Change to "if (!is_android)" when tests are working on Mac
169 if (is_linux && rtc_include_tests) {
170 test("video_capture_tests") {
171 sources = [
172 "test/video_capture_main_mac.mm",
173 "test/video_capture_unittest.cc",
174 ]
175
176 cflags = []
177 if (is_linux || is_mac) {
178 cflags += [ "-Wno-write-strings" ]
179 }
180
181 ldflags = []
182 if (is_linux || is_mac) {
183 ldflags += [
184 "-lpthread",
185 "-lm",
186 ]
187 }
188 if (is_linux) {
189 ldflags += [
190 "-lrt",
191 "-lXext",
192 "-lX11",
193 ]
194 }
195
196 deps = [
197 ":video_capture_internal_impl",
198 ":video_capture_module",
199 "//webrtc/modules/utility",
200 "//webrtc/system_wrappers",
201 "//webrtc/test:video_test_common",
202 ]
203 if (!is_mac) {
204 deps += [ "//webrtc/test:test_support_main" ]
205 }
206
207 # TODO(mflodman): Add Mac dependencies / xcode_settings.
208
209 if (is_clang) {
210 # Suppress warnings from Chrome's Clang plugins.
211 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
212 configs -= [ "//build/config/clang:find_bad_constructs" ]
213 }
214 }
215 }
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +0000216}