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. |
kjellander | b62dbbe | 2016-09-23 00:38:52 -0700 | [diff] [blame] | 15 | rtc_static_library("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 | |
| 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. |
ehmaldonado | 38a2132 | 2016-09-02 04:10:34 -0700 | [diff] [blame] | 39 | suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
kjellander@webrtc.org | 788f058 | 2014-08-28 13:51:08 +0000 | [diff] [blame] | 40 | } |
andresp@webrtc.org | a74eda1 | 2014-09-17 11:50:19 +0000 | [diff] [blame] | 41 | } |
kjellander@webrtc.org | 788f058 | 2014-08-28 13:51:08 +0000 | [diff] [blame] | 42 | |
kjellander | b62dbbe | 2016-09-23 00:38:52 -0700 | [diff] [blame] | 43 | rtc_static_library("video_capture") { |
andresp@webrtc.org | a74eda1 | 2014-09-17 11:50:19 +0000 | [diff] [blame] | 44 | sources = [ |
| 45 | "external/device_info_external.cc", |
| 46 | "external/video_capture_external.cc", |
kjellander@webrtc.org | 788f058 | 2014-08-28 13:51:08 +0000 | [diff] [blame] | 47 | ] |
andresp@webrtc.org | a74eda1 | 2014-09-17 11:50:19 +0000 | [diff] [blame] | 48 | |
| 49 | deps = [ |
kjellander@webrtc.org | f58fe0a | 2015-02-11 07:47:00 +0000 | [diff] [blame] | 50 | ":video_capture_module", |
andresp@webrtc.org | c7134f8 | 2014-09-18 10:06:54 +0000 | [diff] [blame] | 51 | "../../system_wrappers", |
andresp@webrtc.org | a74eda1 | 2014-09-17 11:50:19 +0000 | [diff] [blame] | 52 | ] |
| 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. |
ehmaldonado | 38a2132 | 2016-09-02 04:10:34 -0700 | [diff] [blame] | 57 | suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
andresp@webrtc.org | a74eda1 | 2014-09-17 11:50:19 +0000 | [diff] [blame] | 58 | } |
| 59 | } |
| 60 | |
kjellander@webrtc.org | 853049f | 2015-01-20 11:40:45 +0000 | [diff] [blame] | 61 | if (!build_with_chromium) { |
| 62 | config("video_capture_internal_impl_config") { |
kthelgason | eddb757 | 2016-09-29 02:43:23 -0700 | [diff] [blame] | 63 | if (is_ios) { |
kjellander@webrtc.org | 853049f | 2015-01-20 11:40:45 +0000 | [diff] [blame] | 64 | libs = [ |
| 65 | "AVFoundation.framework", |
| 66 | "CoreMedia.framework", |
| 67 | "CoreVideo.framework", |
| 68 | ] |
| 69 | } |
andresp@webrtc.org | a74eda1 | 2014-09-17 11:50:19 +0000 | [diff] [blame] | 70 | } |
| 71 | |
ehmaldonado | d02fe4b | 2016-08-26 13:31:24 -0700 | [diff] [blame] | 72 | 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 | |
kjellander | b62dbbe | 2016-09-23 00:38:52 -0700 | [diff] [blame] | 90 | rtc_static_library("video_capture_internal_impl") { |
ehmaldonado | d02fe4b | 2016-08-26 13:31:24 -0700 | [diff] [blame] | 91 | configs += [ ":video_capture_internal_impl_warnings_config" ] |
| 92 | |
kjellander@webrtc.org | 853049f | 2015-01-20 11:40:45 +0000 | [diff] [blame] | 93 | deps = [ |
kjellander@webrtc.org | f58fe0a | 2015-02-11 07:47:00 +0000 | [diff] [blame] | 94 | ":video_capture_module", |
kjellander@webrtc.org | 853049f | 2015-01-20 11:40:45 +0000 | [diff] [blame] | 95 | "../../system_wrappers", |
| 96 | ] |
andresp@webrtc.org | a74eda1 | 2014-09-17 11:50:19 +0000 | [diff] [blame] | 97 | |
kjellander@webrtc.org | 853049f | 2015-01-20 11:40:45 +0000 | [diff] [blame] | 98 | 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.org | ac2d27d | 2015-02-26 13:59:22 +0000 | [diff] [blame] | 105 | deps += [ "../..:webrtc_common" ] |
kjellander@webrtc.org | 853049f | 2015-01-20 11:40:45 +0000 | [diff] [blame] | 106 | } |
kthelgason | eddb757 | 2016-09-29 02:43:23 -0700 | [diff] [blame] | 107 | if (is_mac) { |
| 108 | sources = [ |
| 109 | "mac/qtkit/video_capture_qtkit.h", |
| 110 | "mac/qtkit/video_capture_qtkit.mm", |
| 111 | "mac/qtkit/video_capture_qtkit_info.h", |
| 112 | "mac/qtkit/video_capture_qtkit_info.mm", |
| 113 | "mac/qtkit/video_capture_qtkit_info_objc.h", |
| 114 | "mac/qtkit/video_capture_qtkit_info_objc.mm", |
| 115 | "mac/qtkit/video_capture_qtkit_objc.h", |
| 116 | "mac/qtkit/video_capture_qtkit_objc.mm", |
| 117 | "mac/qtkit/video_capture_qtkit_utility.h", |
| 118 | "mac/video_capture_mac.mm", |
| 119 | ] |
| 120 | |
| 121 | libs = [ |
| 122 | # For NSAlert in video_capture_qtkit_info_objc.mm. |
| 123 | "Cocoa.framework", |
| 124 | |
| 125 | # For GetGestalt in video_capture_mac.mm. |
| 126 | "CoreServices.framework", |
| 127 | "CoreVideo.framework", |
| 128 | "QTKit.framework", |
| 129 | ] |
| 130 | } |
kjellander@webrtc.org | 853049f | 2015-01-20 11:40:45 +0000 | [diff] [blame] | 131 | if (is_win) { |
| 132 | sources = [ |
| 133 | "windows/device_info_ds.cc", |
| 134 | "windows/device_info_ds.h", |
| 135 | "windows/device_info_mf.cc", |
| 136 | "windows/device_info_mf.h", |
| 137 | "windows/help_functions_ds.cc", |
| 138 | "windows/help_functions_ds.h", |
| 139 | "windows/sink_filter_ds.cc", |
| 140 | "windows/sink_filter_ds.h", |
| 141 | "windows/video_capture_ds.cc", |
| 142 | "windows/video_capture_ds.h", |
| 143 | "windows/video_capture_factory_windows.cc", |
| 144 | "windows/video_capture_mf.cc", |
| 145 | "windows/video_capture_mf.h", |
| 146 | ] |
| 147 | |
| 148 | libs = [ "Strmiids.lib" ] |
| 149 | |
Henrik Kjellander | 57e5fd2 | 2015-05-25 12:55:39 +0200 | [diff] [blame] | 150 | deps += [ "//third_party/winsdk_samples" ] |
kjellander@webrtc.org | 853049f | 2015-01-20 11:40:45 +0000 | [diff] [blame] | 151 | } |
kthelgason | eddb757 | 2016-09-29 02:43:23 -0700 | [diff] [blame] | 152 | if (is_ios) { |
kjellander@webrtc.org | 853049f | 2015-01-20 11:40:45 +0000 | [diff] [blame] | 153 | sources = [ |
kthelgason | eddb757 | 2016-09-29 02:43:23 -0700 | [diff] [blame] | 154 | "ios/device_info_ios.h", |
| 155 | "ios/device_info_ios.mm", |
| 156 | "ios/device_info_ios_objc.h", |
| 157 | "ios/device_info_ios_objc.mm", |
| 158 | "ios/rtc_video_capture_ios_objc.h", |
| 159 | "ios/rtc_video_capture_ios_objc.mm", |
| 160 | "ios/video_capture_ios.h", |
| 161 | "ios/video_capture_ios.mm", |
kjellander@webrtc.org | 853049f | 2015-01-20 11:40:45 +0000 | [diff] [blame] | 162 | ] |
| 163 | |
| 164 | cflags = [ |
| 165 | "-fobjc-arc", # CLANG_ENABLE_OBJC_ARC = YES. |
Henrik Kjellander | 57e5fd2 | 2015-05-25 12:55:39 +0200 | [diff] [blame] | 166 | |
kjellander@webrtc.org | 853049f | 2015-01-20 11:40:45 +0000 | [diff] [blame] | 167 | # To avoid warnings for deprecated videoMinFrameDuration and |
| 168 | # videoMaxFrameDuration properties in iOS 7.0. |
| 169 | # See webrtc:3705 for more details. |
| 170 | "-Wno-deprecated-declarations", |
| 171 | ] |
| 172 | } |
| 173 | |
| 174 | all_dependent_configs = [ ":video_capture_internal_impl_config" ] |
| 175 | |
kjellander@webrtc.org | 853049f | 2015-01-20 11:40:45 +0000 | [diff] [blame] | 176 | if (is_clang) { |
| 177 | # Suppress warnings from Chrome's Clang plugins. |
| 178 | # See http://code.google.com/p/webrtc/issues/detail?id=163 for details. |
ehmaldonado | 38a2132 | 2016-09-02 04:10:34 -0700 | [diff] [blame] | 179 | suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
kjellander@webrtc.org | 853049f | 2015-01-20 11:40:45 +0000 | [diff] [blame] | 180 | } |
andresp@webrtc.org | a74eda1 | 2014-09-17 11:50:19 +0000 | [diff] [blame] | 181 | } |
sakal | 06bfe1f | 2016-08-04 07:54:04 -0700 | [diff] [blame] | 182 | |
kjellander | f96c51a | 2016-08-15 09:21:31 -0700 | [diff] [blame] | 183 | if (!is_android && rtc_include_tests) { |
ehmaldonado | 38a2132 | 2016-09-02 04:10:34 -0700 | [diff] [blame] | 184 | rtc_test("video_capture_tests") { |
sakal | 06bfe1f | 2016-08-04 07:54:04 -0700 | [diff] [blame] | 185 | sources = [ |
kthelgason | eddb757 | 2016-09-29 02:43:23 -0700 | [diff] [blame] | 186 | "test/video_capture_main_mac.mm", |
sakal | 06bfe1f | 2016-08-04 07:54:04 -0700 | [diff] [blame] | 187 | "test/video_capture_unittest.cc", |
| 188 | ] |
| 189 | |
| 190 | cflags = [] |
| 191 | if (is_linux || is_mac) { |
| 192 | cflags += [ "-Wno-write-strings" ] |
| 193 | } |
| 194 | |
| 195 | ldflags = [] |
| 196 | if (is_linux || is_mac) { |
| 197 | ldflags += [ |
| 198 | "-lpthread", |
| 199 | "-lm", |
| 200 | ] |
| 201 | } |
| 202 | if (is_linux) { |
| 203 | ldflags += [ |
| 204 | "-lrt", |
| 205 | "-lXext", |
| 206 | "-lX11", |
| 207 | ] |
| 208 | } |
| 209 | |
| 210 | deps = [ |
| 211 | ":video_capture_internal_impl", |
| 212 | ":video_capture_module", |
kjellander | f96c51a | 2016-08-15 09:21:31 -0700 | [diff] [blame] | 213 | "../../system_wrappers:system_wrappers_default", |
| 214 | "../../test:video_test_common", |
| 215 | "../utility", |
| 216 | "//testing/gtest", |
sakal | 06bfe1f | 2016-08-04 07:54:04 -0700 | [diff] [blame] | 217 | ] |
kthelgason | eddb757 | 2016-09-29 02:43:23 -0700 | [diff] [blame] | 218 | if (is_mac) { |
| 219 | deps += [ "//webrtc/test:test_support_main_threaded_mac" ] |
| 220 | } else { |
| 221 | deps += [ "//webrtc/test:test_support_main" ] |
| 222 | } |
sakal | 06bfe1f | 2016-08-04 07:54:04 -0700 | [diff] [blame] | 223 | |
sakal | 06bfe1f | 2016-08-04 07:54:04 -0700 | [diff] [blame] | 224 | if (is_clang) { |
| 225 | # Suppress warnings from Chrome's Clang plugins. |
| 226 | # See http://code.google.com/p/webrtc/issues/detail?id=163 for details. |
ehmaldonado | 38a2132 | 2016-09-02 04:10:34 -0700 | [diff] [blame] | 227 | suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
sakal | 06bfe1f | 2016-08-04 07:54:04 -0700 | [diff] [blame] | 228 | } |
| 229 | } |
| 230 | } |
kjellander@webrtc.org | 1227ab8 | 2014-06-23 19:21:07 +0000 | [diff] [blame] | 231 | } |