kjellander@webrtc.org | 1227ab8 | 2014-06-23 19:21:07 +0000 | [diff] [blame] | 1 | # 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 | |
| 9 | import("../../build/webrtc.gni") |
| 10 | |
andresp@webrtc.org | a74eda1 | 2014-09-17 11:50:19 +0000 | [diff] [blame] | 11 | # Note this target is missing an implementation for the video capture. |
kjellander@webrtc.org | f58fe0a | 2015-02-11 07:47:00 +0000 | [diff] [blame] | 12 | # Targets must link with either 'video_capture' or |
andresp@webrtc.org | a74eda1 | 2014-09-17 11:50:19 +0000 | [diff] [blame] | 13 | # 'video_capture_internal_impl' depending on whether they want to |
| 14 | # use the internal capturer. |
ehmaldonado | 38a2132 | 2016-09-02 04:10:34 -0700 | [diff] [blame^] | 15 | rtc_source_set("video_capture_module") { |
kjellander@webrtc.org | 788f058 | 2014-08-28 13:51:08 +0000 | [diff] [blame] | 16 | sources = [ |
| 17 | "device_info_impl.cc", |
| 18 | "device_info_impl.h", |
Henrik Kjellander | 5dda80a | 2015-11-12 12:46:09 +0100 | [diff] [blame] | 19 | "video_capture.h", |
kjellander@webrtc.org | 788f058 | 2014-08-28 13:51:08 +0000 | [diff] [blame] | 20 | "video_capture_config.h", |
Henrik Kjellander | 5dda80a | 2015-11-12 12:46:09 +0100 | [diff] [blame] | 21 | "video_capture_defines.h", |
kjellander@webrtc.org | 788f058 | 2014-08-28 13:51:08 +0000 | [diff] [blame] | 22 | "video_capture_delay.h", |
guidou | 41bce13 | 2016-08-04 06:48:17 -0700 | [diff] [blame] | 23 | "video_capture_factory.cc", |
sakal | 06bfe1f | 2016-08-04 07:54:04 -0700 | [diff] [blame] | 24 | "video_capture_factory.h", |
kjellander@webrtc.org | 788f058 | 2014-08-28 13:51:08 +0000 | [diff] [blame] | 25 | "video_capture_impl.cc", |
| 26 | "video_capture_impl.h", |
| 27 | ] |
| 28 | |
andresp@webrtc.org | a74eda1 | 2014-09-17 11:50:19 +0000 | [diff] [blame] | 29 | deps = [ |
kwiberg@webrtc.org | ac2d27d | 2015-02-26 13:59:22 +0000 | [diff] [blame] | 30 | "../..:webrtc_common", |
andresp@webrtc.org | a74eda1 | 2014-09-17 11:50:19 +0000 | [diff] [blame] | 31 | "../../common_video", |
| 32 | "../../system_wrappers", |
| 33 | "../utility", |
| 34 | ] |
kjellander@webrtc.org | 788f058 | 2014-08-28 13:51:08 +0000 | [diff] [blame] | 35 | |
kjellander@webrtc.org | f21ea91 | 2014-09-28 17:37:22 +0000 | [diff] [blame] | 36 | configs += [ "../..:common_config" ] |
| 37 | public_configs = [ "../..:common_inherited_config" ] |
| 38 | |
kjellander@webrtc.org | 788f058 | 2014-08-28 13:51:08 +0000 | [diff] [blame] | 39 | 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. |
ehmaldonado | 38a2132 | 2016-09-02 04:10:34 -0700 | [diff] [blame^] | 42 | suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
kjellander@webrtc.org | 788f058 | 2014-08-28 13:51:08 +0000 | [diff] [blame] | 43 | } |
andresp@webrtc.org | a74eda1 | 2014-09-17 11:50:19 +0000 | [diff] [blame] | 44 | } |
kjellander@webrtc.org | 788f058 | 2014-08-28 13:51:08 +0000 | [diff] [blame] | 45 | |
ehmaldonado | 38a2132 | 2016-09-02 04:10:34 -0700 | [diff] [blame^] | 46 | rtc_source_set("video_capture") { |
andresp@webrtc.org | a74eda1 | 2014-09-17 11:50:19 +0000 | [diff] [blame] | 47 | sources = [ |
| 48 | "external/device_info_external.cc", |
| 49 | "external/video_capture_external.cc", |
kjellander@webrtc.org | 788f058 | 2014-08-28 13:51:08 +0000 | [diff] [blame] | 50 | ] |
andresp@webrtc.org | a74eda1 | 2014-09-17 11:50:19 +0000 | [diff] [blame] | 51 | |
| 52 | deps = [ |
kjellander@webrtc.org | f58fe0a | 2015-02-11 07:47:00 +0000 | [diff] [blame] | 53 | ":video_capture_module", |
andresp@webrtc.org | c7134f8 | 2014-09-18 10:06:54 +0000 | [diff] [blame] | 54 | "../../system_wrappers", |
andresp@webrtc.org | a74eda1 | 2014-09-17 11:50:19 +0000 | [diff] [blame] | 55 | ] |
| 56 | |
kjellander@webrtc.org | f21ea91 | 2014-09-28 17:37:22 +0000 | [diff] [blame] | 57 | configs += [ "../..:common_config" ] |
| 58 | public_configs = [ "../..:common_inherited_config" ] |
| 59 | |
andresp@webrtc.org | a74eda1 | 2014-09-17 11:50:19 +0000 | [diff] [blame] | 60 | 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. |
ehmaldonado | 38a2132 | 2016-09-02 04:10:34 -0700 | [diff] [blame^] | 63 | suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
andresp@webrtc.org | a74eda1 | 2014-09-17 11:50:19 +0000 | [diff] [blame] | 64 | } |
| 65 | } |
| 66 | |
kjellander@webrtc.org | 853049f | 2015-01-20 11:40:45 +0000 | [diff] [blame] | 67 | if (!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.org | a74eda1 | 2014-09-17 11:50:19 +0000 | [diff] [blame] | 76 | } |
| 77 | |
ehmaldonado | d02fe4b | 2016-08-26 13:31:24 -0700 | [diff] [blame] | 78 | 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 | |
ehmaldonado | 38a2132 | 2016-09-02 04:10:34 -0700 | [diff] [blame^] | 96 | rtc_source_set("video_capture_internal_impl") { |
ehmaldonado | d02fe4b | 2016-08-26 13:31:24 -0700 | [diff] [blame] | 97 | configs += [ ":video_capture_internal_impl_warnings_config" ] |
| 98 | |
kjellander@webrtc.org | 853049f | 2015-01-20 11:40:45 +0000 | [diff] [blame] | 99 | deps = [ |
kjellander@webrtc.org | f58fe0a | 2015-02-11 07:47:00 +0000 | [diff] [blame] | 100 | ":video_capture_module", |
kjellander@webrtc.org | 853049f | 2015-01-20 11:40:45 +0000 | [diff] [blame] | 101 | "../../system_wrappers", |
| 102 | ] |
andresp@webrtc.org | a74eda1 | 2014-09-17 11:50:19 +0000 | [diff] [blame] | 103 | |
kjellander@webrtc.org | 853049f | 2015-01-20 11:40:45 +0000 | [diff] [blame] | 104 | 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.org | ac2d27d | 2015-02-26 13:59:22 +0000 | [diff] [blame] | 111 | deps += [ "../..:webrtc_common" ] |
kjellander@webrtc.org | 853049f | 2015-01-20 11:40:45 +0000 | [diff] [blame] | 112 | } |
| 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.org | f21ea91 | 2014-09-28 17:37:22 +0000 | [diff] [blame] | 126 | |
kjellander@webrtc.org | 853049f | 2015-01-20 11:40:45 +0000 | [diff] [blame] | 127 | libs = [ |
kjellander | f96c51a | 2016-08-15 09:21:31 -0700 | [diff] [blame] | 128 | # 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.org | 853049f | 2015-01-20 11:40:45 +0000 | [diff] [blame] | 133 | "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 Kjellander | 57e5fd2 | 2015-05-25 12:55:39 +0200 | [diff] [blame] | 156 | deps += [ "//third_party/winsdk_samples" ] |
kjellander@webrtc.org | 853049f | 2015-01-20 11:40:45 +0000 | [diff] [blame] | 157 | } |
kjellander@webrtc.org | 853049f | 2015-01-20 11:40:45 +0000 | [diff] [blame] | 158 | 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 Kjellander | 57e5fd2 | 2015-05-25 12:55:39 +0200 | [diff] [blame] | 172 | |
kjellander@webrtc.org | 853049f | 2015-01-20 11:40:45 +0000 | [diff] [blame] | 173 | # 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. |
ehmaldonado | 38a2132 | 2016-09-02 04:10:34 -0700 | [diff] [blame^] | 188 | suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
kjellander@webrtc.org | 853049f | 2015-01-20 11:40:45 +0000 | [diff] [blame] | 189 | } |
andresp@webrtc.org | a74eda1 | 2014-09-17 11:50:19 +0000 | [diff] [blame] | 190 | } |
sakal | 06bfe1f | 2016-08-04 07:54:04 -0700 | [diff] [blame] | 191 | |
kjellander | f96c51a | 2016-08-15 09:21:31 -0700 | [diff] [blame] | 192 | if (!is_android && rtc_include_tests) { |
ehmaldonado | 38a2132 | 2016-09-02 04:10:34 -0700 | [diff] [blame^] | 193 | rtc_test("video_capture_tests") { |
sakal | 06bfe1f | 2016-08-04 07:54:04 -0700 | [diff] [blame] | 194 | 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", |
kjellander | f96c51a | 2016-08-15 09:21:31 -0700 | [diff] [blame] | 222 | "../../system_wrappers:system_wrappers_default", |
| 223 | "../../test:video_test_common", |
| 224 | "../utility", |
| 225 | "//testing/gtest", |
sakal | 06bfe1f | 2016-08-04 07:54:04 -0700 | [diff] [blame] | 226 | ] |
kjellander | f96c51a | 2016-08-15 09:21:31 -0700 | [diff] [blame] | 227 | if (is_mac) { |
| 228 | deps += [ "//webrtc/test:test_support_main_threaded_mac" ] |
| 229 | } else { |
sakal | 06bfe1f | 2016-08-04 07:54:04 -0700 | [diff] [blame] | 230 | deps += [ "//webrtc/test:test_support_main" ] |
| 231 | } |
| 232 | |
sakal | 06bfe1f | 2016-08-04 07:54:04 -0700 | [diff] [blame] | 233 | 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. |
ehmaldonado | 38a2132 | 2016-09-02 04:10:34 -0700 | [diff] [blame^] | 236 | suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
sakal | 06bfe1f | 2016-08-04 07:54:04 -0700 | [diff] [blame] | 237 | } |
| 238 | } |
| 239 | } |
kjellander@webrtc.org | 1227ab8 | 2014-06-23 19:21:07 +0000 | [diff] [blame] | 240 | } |