blob: cd4d3c91b88bd1e4b3036424edb33d506b1a7796 [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.
kjellanderb62dbbe2016-09-23 00:38:52 -070015rtc_static_library("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
36 if (is_clang) {
37 # Suppress warnings from Chrome's Clang plugins.
38 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
ehmaldonado38a21322016-09-02 04:10:34 -070039 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellander@webrtc.org788f0582014-08-28 13:51:08 +000040 }
andresp@webrtc.orga74eda12014-09-17 11:50:19 +000041}
kjellander@webrtc.org788f0582014-08-28 13:51:08 +000042
kjellanderb62dbbe2016-09-23 00:38:52 -070043rtc_static_library("video_capture") {
andresp@webrtc.orga74eda12014-09-17 11:50:19 +000044 sources = [
45 "external/device_info_external.cc",
46 "external/video_capture_external.cc",
kjellander@webrtc.org788f0582014-08-28 13:51:08 +000047 ]
andresp@webrtc.orga74eda12014-09-17 11:50:19 +000048
49 deps = [
kjellander@webrtc.orgf58fe0a2015-02-11 07:47:00 +000050 ":video_capture_module",
andresp@webrtc.orgc7134f82014-09-18 10:06:54 +000051 "../../system_wrappers",
andresp@webrtc.orga74eda12014-09-17 11:50:19 +000052 ]
53
54 if (is_clang) {
55 # Suppress warnings from Chrome's Clang plugins.
56 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
ehmaldonado38a21322016-09-02 04:10:34 -070057 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
andresp@webrtc.orga74eda12014-09-17 11:50:19 +000058 }
59}
60
kjellander@webrtc.org853049f2015-01-20 11:40:45 +000061if (!build_with_chromium) {
62 config("video_capture_internal_impl_config") {
kthelgason20a52e12016-09-30 00:43:12 -070063 if (is_ios || is_mac) {
kjellander@webrtc.org853049f2015-01-20 11:40:45 +000064 libs = [
65 "AVFoundation.framework",
66 "CoreMedia.framework",
67 "CoreVideo.framework",
68 ]
69 }
andresp@webrtc.orga74eda12014-09-17 11:50:19 +000070 }
71
ehmaldonadod02fe4b2016-08-26 13:31:24 -070072 config("video_capture_internal_impl_warnings_config") {
73 if (is_win && is_clang) {
74 cflags = [
75 "-Wno-comment",
76 "-Wno-ignored-attributes",
77
78 # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6269
79 # for -Wno-ignored-qualifiers
80 "-Wno-ignored-qualifiers",
81 "-Wno-microsoft-extra-qualification",
82 "-Wno-missing-braces",
83 "-Wno-overloaded-virtual",
84 "-Wno-reorder",
85 "-Wno-writable-strings",
86 ]
87 }
88 }
89
kjellanderb62dbbe2016-09-23 00:38:52 -070090 rtc_static_library("video_capture_internal_impl") {
ehmaldonadod02fe4b2016-08-26 13:31:24 -070091 configs += [ ":video_capture_internal_impl_warnings_config" ]
92
kjellander@webrtc.org853049f2015-01-20 11:40:45 +000093 deps = [
kjellander@webrtc.orgf58fe0a2015-02-11 07:47:00 +000094 ":video_capture_module",
kjellander@webrtc.org853049f2015-01-20 11:40:45 +000095 "../../system_wrappers",
96 ]
andresp@webrtc.orga74eda12014-09-17 11:50:19 +000097
kjellander@webrtc.org853049f2015-01-20 11:40:45 +000098 if (is_linux) {
99 sources = [
100 "linux/device_info_linux.cc",
101 "linux/device_info_linux.h",
102 "linux/video_capture_linux.cc",
103 "linux/video_capture_linux.h",
104 ]
kwiberg@webrtc.orgac2d27d2015-02-26 13:59:22 +0000105 deps += [ "../..:webrtc_common" ]
kjellander@webrtc.org853049f2015-01-20 11:40:45 +0000106 }
kjellander@webrtc.org853049f2015-01-20 11:40:45 +0000107 if (is_win) {
108 sources = [
109 "windows/device_info_ds.cc",
110 "windows/device_info_ds.h",
111 "windows/device_info_mf.cc",
112 "windows/device_info_mf.h",
113 "windows/help_functions_ds.cc",
114 "windows/help_functions_ds.h",
115 "windows/sink_filter_ds.cc",
116 "windows/sink_filter_ds.h",
117 "windows/video_capture_ds.cc",
118 "windows/video_capture_ds.h",
119 "windows/video_capture_factory_windows.cc",
120 "windows/video_capture_mf.cc",
121 "windows/video_capture_mf.h",
122 ]
123
124 libs = [ "Strmiids.lib" ]
125
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200126 deps += [ "//third_party/winsdk_samples" ]
kjellander@webrtc.org853049f2015-01-20 11:40:45 +0000127 }
kthelgason20a52e12016-09-30 00:43:12 -0700128 if (is_ios || is_mac) {
kjellander@webrtc.org853049f2015-01-20 11:40:45 +0000129 sources = [
kthelgason20a52e12016-09-30 00:43:12 -0700130 "objc/device_info.h",
131 "objc/device_info.mm",
132 "objc/device_info_objc.h",
133 "objc/device_info_objc.mm",
134 "objc/rtc_video_capture_objc.h",
135 "objc/rtc_video_capture_objc.mm",
136 "objc/video_capture.h",
137 "objc/video_capture.mm",
kjellander@webrtc.org853049f2015-01-20 11:40:45 +0000138 ]
139
140 cflags = [
141 "-fobjc-arc", # CLANG_ENABLE_OBJC_ARC = YES.
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200142
kjellander@webrtc.org853049f2015-01-20 11:40:45 +0000143 # To avoid warnings for deprecated videoMinFrameDuration and
144 # videoMaxFrameDuration properties in iOS 7.0.
145 # See webrtc:3705 for more details.
146 "-Wno-deprecated-declarations",
147 ]
148 }
149
150 all_dependent_configs = [ ":video_capture_internal_impl_config" ]
151
kjellander@webrtc.org853049f2015-01-20 11:40:45 +0000152 if (is_clang) {
153 # Suppress warnings from Chrome's Clang plugins.
154 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
ehmaldonado38a21322016-09-02 04:10:34 -0700155 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellander@webrtc.org853049f2015-01-20 11:40:45 +0000156 }
andresp@webrtc.orga74eda12014-09-17 11:50:19 +0000157 }
sakal06bfe1f2016-08-04 07:54:04 -0700158
kjellanderf96c51a2016-08-15 09:21:31 -0700159 if (!is_android && rtc_include_tests) {
ehmaldonado38a21322016-09-02 04:10:34 -0700160 rtc_test("video_capture_tests") {
sakal06bfe1f2016-08-04 07:54:04 -0700161 sources = [
sakal06bfe1f2016-08-04 07:54:04 -0700162 "test/video_capture_unittest.cc",
163 ]
164
165 cflags = []
166 if (is_linux || is_mac) {
167 cflags += [ "-Wno-write-strings" ]
168 }
169
170 ldflags = []
171 if (is_linux || is_mac) {
172 ldflags += [
173 "-lpthread",
174 "-lm",
175 ]
176 }
177 if (is_linux) {
178 ldflags += [
179 "-lrt",
180 "-lXext",
181 "-lX11",
182 ]
183 }
184
185 deps = [
186 ":video_capture_internal_impl",
187 ":video_capture_module",
kjellanderf96c51a2016-08-15 09:21:31 -0700188 "../../system_wrappers:system_wrappers_default",
189 "../../test:video_test_common",
190 "../utility",
191 "//testing/gtest",
sakal06bfe1f2016-08-04 07:54:04 -0700192 ]
kthelgason20a52e12016-09-30 00:43:12 -0700193 deps += [ "//webrtc/test:test_support_main" ]
sakal06bfe1f2016-08-04 07:54:04 -0700194
sakal06bfe1f2016-08-04 07:54:04 -0700195 if (is_clang) {
196 # Suppress warnings from Chrome's Clang plugins.
197 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
ehmaldonado38a21322016-09-02 04:10:34 -0700198 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
sakal06bfe1f2016-08-04 07:54:04 -0700199 }
200 }
201 }
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +0000202}