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") |
sakal | 06bfe1f | 2016-08-04 07:54:04 -0700 | [diff] [blame] | 10 | import("//testing/test.gni") |
kjellander@webrtc.org | 1227ab8 | 2014-06-23 19:21:07 +0000 | [diff] [blame] | 11 | |
andresp@webrtc.org | a74eda1 | 2014-09-17 11:50:19 +0000 | [diff] [blame] | 12 | # Note this target is missing an implementation for the video capture. |
kjellander@webrtc.org | f58fe0a | 2015-02-11 07:47:00 +0000 | [diff] [blame] | 13 | # Targets must link with either 'video_capture' or |
andresp@webrtc.org | a74eda1 | 2014-09-17 11:50:19 +0000 | [diff] [blame] | 14 | # 'video_capture_internal_impl' depending on whether they want to |
| 15 | # use the internal capturer. |
kjellander@webrtc.org | f58fe0a | 2015-02-11 07:47:00 +0000 | [diff] [blame] | 16 | source_set("video_capture_module") { |
kjellander@webrtc.org | 788f058 | 2014-08-28 13:51:08 +0000 | [diff] [blame] | 17 | sources = [ |
| 18 | "device_info_impl.cc", |
| 19 | "device_info_impl.h", |
Henrik Kjellander | 5dda80a | 2015-11-12 12:46:09 +0100 | [diff] [blame] | 20 | "video_capture.h", |
kjellander@webrtc.org | 788f058 | 2014-08-28 13:51:08 +0000 | [diff] [blame] | 21 | "video_capture_config.h", |
Henrik Kjellander | 5dda80a | 2015-11-12 12:46:09 +0100 | [diff] [blame] | 22 | "video_capture_defines.h", |
kjellander@webrtc.org | 788f058 | 2014-08-28 13:51:08 +0000 | [diff] [blame] | 23 | "video_capture_delay.h", |
guidou | 41bce13 | 2016-08-04 06:48:17 -0700 | [diff] [blame] | 24 | "video_capture_factory.cc", |
sakal | 06bfe1f | 2016-08-04 07:54:04 -0700 | [diff] [blame] | 25 | "video_capture_factory.h", |
kjellander@webrtc.org | 788f058 | 2014-08-28 13:51:08 +0000 | [diff] [blame] | 26 | "video_capture_impl.cc", |
| 27 | "video_capture_impl.h", |
| 28 | ] |
| 29 | |
andresp@webrtc.org | a74eda1 | 2014-09-17 11:50:19 +0000 | [diff] [blame] | 30 | deps = [ |
kwiberg@webrtc.org | ac2d27d | 2015-02-26 13:59:22 +0000 | [diff] [blame] | 31 | "../..:webrtc_common", |
andresp@webrtc.org | a74eda1 | 2014-09-17 11:50:19 +0000 | [diff] [blame] | 32 | "../../common_video", |
| 33 | "../../system_wrappers", |
| 34 | "../utility", |
| 35 | ] |
kjellander@webrtc.org | 788f058 | 2014-08-28 13:51:08 +0000 | [diff] [blame] | 36 | |
kjellander@webrtc.org | f21ea91 | 2014-09-28 17:37:22 +0000 | [diff] [blame] | 37 | configs += [ "../..:common_config" ] |
| 38 | public_configs = [ "../..:common_inherited_config" ] |
| 39 | |
kjellander@webrtc.org | 788f058 | 2014-08-28 13:51:08 +0000 | [diff] [blame] | 40 | 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.org | a74eda1 | 2014-09-17 11:50:19 +0000 | [diff] [blame] | 45 | } |
kjellander@webrtc.org | 788f058 | 2014-08-28 13:51:08 +0000 | [diff] [blame] | 46 | |
kjellander@webrtc.org | f58fe0a | 2015-02-11 07:47:00 +0000 | [diff] [blame] | 47 | source_set("video_capture") { |
andresp@webrtc.org | a74eda1 | 2014-09-17 11:50:19 +0000 | [diff] [blame] | 48 | sources = [ |
| 49 | "external/device_info_external.cc", |
| 50 | "external/video_capture_external.cc", |
kjellander@webrtc.org | 788f058 | 2014-08-28 13:51:08 +0000 | [diff] [blame] | 51 | ] |
andresp@webrtc.org | a74eda1 | 2014-09-17 11:50:19 +0000 | [diff] [blame] | 52 | |
| 53 | deps = [ |
kjellander@webrtc.org | f58fe0a | 2015-02-11 07:47:00 +0000 | [diff] [blame] | 54 | ":video_capture_module", |
andresp@webrtc.org | c7134f8 | 2014-09-18 10:06:54 +0000 | [diff] [blame] | 55 | "../../system_wrappers", |
andresp@webrtc.org | a74eda1 | 2014-09-17 11:50:19 +0000 | [diff] [blame] | 56 | ] |
| 57 | |
kjellander@webrtc.org | f21ea91 | 2014-09-28 17:37:22 +0000 | [diff] [blame] | 58 | configs += [ "../..:common_config" ] |
| 59 | public_configs = [ "../..:common_inherited_config" ] |
| 60 | |
andresp@webrtc.org | a74eda1 | 2014-09-17 11:50:19 +0000 | [diff] [blame] | 61 | 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.org | 853049f | 2015-01-20 11:40:45 +0000 | [diff] [blame] | 68 | if (!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.org | a74eda1 | 2014-09-17 11:50:19 +0000 | [diff] [blame] | 77 | } |
| 78 | |
kjellander@webrtc.org | 853049f | 2015-01-20 11:40:45 +0000 | [diff] [blame] | 79 | source_set("video_capture_internal_impl") { |
| 80 | deps = [ |
kjellander@webrtc.org | f58fe0a | 2015-02-11 07:47:00 +0000 | [diff] [blame] | 81 | ":video_capture_module", |
kjellander@webrtc.org | 853049f | 2015-01-20 11:40:45 +0000 | [diff] [blame] | 82 | "../../system_wrappers", |
| 83 | ] |
andresp@webrtc.org | a74eda1 | 2014-09-17 11:50:19 +0000 | [diff] [blame] | 84 | |
kjellander@webrtc.org | 853049f | 2015-01-20 11:40:45 +0000 | [diff] [blame] | 85 | 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.org | ac2d27d | 2015-02-26 13:59:22 +0000 | [diff] [blame] | 92 | deps += [ "../..:webrtc_common" ] |
kjellander@webrtc.org | 853049f | 2015-01-20 11:40:45 +0000 | [diff] [blame] | 93 | } |
| 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.org | f21ea91 | 2014-09-28 17:37:22 +0000 | [diff] [blame] | 107 | |
kjellander@webrtc.org | 853049f | 2015-01-20 11:40:45 +0000 | [diff] [blame] | 108 | libs = [ |
kjellander | f96c51a | 2016-08-15 09:21:31 -0700 | [diff] [blame] | 109 | # 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.org | 853049f | 2015-01-20 11:40:45 +0000 | [diff] [blame] | 114 | "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 Kjellander | 57e5fd2 | 2015-05-25 12:55:39 +0200 | [diff] [blame] | 137 | deps += [ "//third_party/winsdk_samples" ] |
kjellander@webrtc.org | 853049f | 2015-01-20 11:40:45 +0000 | [diff] [blame] | 138 | } |
ehmaldonado | 4bc4d27 | 2016-08-25 04:15:40 -0700 | [diff] [blame^] | 139 | 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.org | 853049f | 2015-01-20 11:40:45 +0000 | [diff] [blame] | 150 | 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 Kjellander | 57e5fd2 | 2015-05-25 12:55:39 +0200 | [diff] [blame] | 164 | |
kjellander@webrtc.org | 853049f | 2015-01-20 11:40:45 +0000 | [diff] [blame] | 165 | # 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.org | a74eda1 | 2014-09-17 11:50:19 +0000 | [diff] [blame] | 182 | } |
sakal | 06bfe1f | 2016-08-04 07:54:04 -0700 | [diff] [blame] | 183 | |
kjellander | f96c51a | 2016-08-15 09:21:31 -0700 | [diff] [blame] | 184 | if (!is_android && rtc_include_tests) { |
sakal | 06bfe1f | 2016-08-04 07:54:04 -0700 | [diff] [blame] | 185 | 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", |
kjellander | f96c51a | 2016-08-15 09:21:31 -0700 | [diff] [blame] | 214 | "../../system_wrappers:system_wrappers_default", |
| 215 | "../../test:video_test_common", |
| 216 | "../utility", |
| 217 | "//testing/gtest", |
sakal | 06bfe1f | 2016-08-04 07:54:04 -0700 | [diff] [blame] | 218 | ] |
kjellander | f96c51a | 2016-08-15 09:21:31 -0700 | [diff] [blame] | 219 | if (is_mac) { |
| 220 | deps += [ "//webrtc/test:test_support_main_threaded_mac" ] |
| 221 | } else { |
sakal | 06bfe1f | 2016-08-04 07:54:04 -0700 | [diff] [blame] | 222 | deps += [ "//webrtc/test:test_support_main" ] |
| 223 | } |
| 224 | |
sakal | 06bfe1f | 2016-08-04 07:54:04 -0700 | [diff] [blame] | 225 | 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.org | 1227ab8 | 2014-06-23 19:21:07 +0000 | [diff] [blame] | 232 | } |