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 | |
mbonadei | 9aa3f0a | 2017-01-24 06:58:22 -0800 | [diff] [blame] | 9 | import("../../webrtc.gni") |
kjellander@webrtc.org | 1227ab8 | 2014-06-23 19:21:07 +0000 | [diff] [blame] | 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") { |
Per Kjellander | a0f5f60 | 2018-01-10 15:57:32 +0000 | [diff] [blame] | 16 | visibility = [ "*" ] |
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", |
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 = [ |
mbonadei | 1140f97 | 2017-04-26 03:38:35 -0700 | [diff] [blame] | 30 | "..:module_api", |
kwiberg@webrtc.org | ac2d27d | 2015-02-26 13:59:22 +0000 | [diff] [blame] | 31 | "../..:webrtc_common", |
Patrik Höglund | 3e11343 | 2017-12-15 14:40:10 +0100 | [diff] [blame] | 32 | "../../:typedefs", |
Patrik Höglund | be214a2 | 2018-01-04 12:14:35 +0100 | [diff] [blame] | 33 | "../../api:libjingle_peerconnection_api", |
Niels Möller | c6ce9c5 | 2018-05-11 11:15:30 +0200 | [diff] [blame^] | 34 | "../../api/video:video_frame", |
| 35 | "../../api/video:video_frame_i420", |
andresp@webrtc.org | a74eda1 | 2014-09-17 11:50:19 +0000 | [diff] [blame] | 36 | "../../common_video", |
Mirko Bonadei | ad62792 | 2017-11-30 17:16:21 +0100 | [diff] [blame] | 37 | "../../media:rtc_media_base", |
ehmaldonado | f6a861a | 2017-07-19 10:40:47 -0700 | [diff] [blame] | 38 | "../../rtc_base:rtc_base_approved", |
Patrik Höglund | 3e11343 | 2017-12-15 14:40:10 +0100 | [diff] [blame] | 39 | "../../rtc_base:stringutils", |
Karl Wiberg | 2b85792 | 2018-03-23 14:53:54 +0100 | [diff] [blame] | 40 | "../../rtc_base/synchronization:rw_lock_wrapper", |
andresp@webrtc.org | a74eda1 | 2014-09-17 11:50:19 +0000 | [diff] [blame] | 41 | "../../system_wrappers", |
Mirko Bonadei | 401d056 | 2017-12-14 11:24:00 +0100 | [diff] [blame] | 42 | "//third_party/libyuv", |
andresp@webrtc.org | a74eda1 | 2014-09-17 11:50:19 +0000 | [diff] [blame] | 43 | ] |
kjellander@webrtc.org | 788f058 | 2014-08-28 13:51:08 +0000 | [diff] [blame] | 44 | |
kjellander | e40a7ee | 2016-10-16 23:56:12 -0700 | [diff] [blame] | 45 | if (!build_with_chromium && is_clang) { |
| 46 | # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
ehmaldonado | 38a2132 | 2016-09-02 04:10:34 -0700 | [diff] [blame] | 47 | suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
kjellander@webrtc.org | 788f058 | 2014-08-28 13:51:08 +0000 | [diff] [blame] | 48 | } |
andresp@webrtc.org | a74eda1 | 2014-09-17 11:50:19 +0000 | [diff] [blame] | 49 | } |
kjellander@webrtc.org | 788f058 | 2014-08-28 13:51:08 +0000 | [diff] [blame] | 50 | |
kjellander | b62dbbe | 2016-09-23 00:38:52 -0700 | [diff] [blame] | 51 | rtc_static_library("video_capture") { |
Per Kjellander | a7f2d84 | 2018-01-10 15:54:53 +0000 | [diff] [blame] | 52 | visibility = [ "*" ] |
andresp@webrtc.org | a74eda1 | 2014-09-17 11:50:19 +0000 | [diff] [blame] | 53 | sources = [ |
| 54 | "external/device_info_external.cc", |
| 55 | "external/video_capture_external.cc", |
kjellander@webrtc.org | 788f058 | 2014-08-28 13:51:08 +0000 | [diff] [blame] | 56 | ] |
andresp@webrtc.org | a74eda1 | 2014-09-17 11:50:19 +0000 | [diff] [blame] | 57 | |
| 58 | deps = [ |
kjellander@webrtc.org | f58fe0a | 2015-02-11 07:47:00 +0000 | [diff] [blame] | 59 | ":video_capture_module", |
ehmaldonado | f6a861a | 2017-07-19 10:40:47 -0700 | [diff] [blame] | 60 | "../../rtc_base:rtc_base_approved", |
andresp@webrtc.org | c7134f8 | 2014-09-18 10:06:54 +0000 | [diff] [blame] | 61 | "../../system_wrappers", |
andresp@webrtc.org | a74eda1 | 2014-09-17 11:50:19 +0000 | [diff] [blame] | 62 | ] |
| 63 | |
kjellander | e40a7ee | 2016-10-16 23:56:12 -0700 | [diff] [blame] | 64 | if (!build_with_chromium && is_clang) { |
| 65 | # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
ehmaldonado | 38a2132 | 2016-09-02 04:10:34 -0700 | [diff] [blame] | 66 | suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
andresp@webrtc.org | a74eda1 | 2014-09-17 11:50:19 +0000 | [diff] [blame] | 67 | } |
| 68 | } |
| 69 | |
kjellander@webrtc.org | 853049f | 2015-01-20 11:40:45 +0000 | [diff] [blame] | 70 | if (!build_with_chromium) { |
| 71 | config("video_capture_internal_impl_config") { |
kthelgason | 20a52e1 | 2016-09-30 00:43:12 -0700 | [diff] [blame] | 72 | if (is_ios || is_mac) { |
kjellander@webrtc.org | 853049f | 2015-01-20 11:40:45 +0000 | [diff] [blame] | 73 | libs = [ |
| 74 | "AVFoundation.framework", |
| 75 | "CoreMedia.framework", |
| 76 | "CoreVideo.framework", |
| 77 | ] |
| 78 | } |
andresp@webrtc.org | a74eda1 | 2014-09-17 11:50:19 +0000 | [diff] [blame] | 79 | } |
| 80 | |
ehmaldonado | d02fe4b | 2016-08-26 13:31:24 -0700 | [diff] [blame] | 81 | config("video_capture_internal_impl_warnings_config") { |
| 82 | if (is_win && is_clang) { |
| 83 | cflags = [ |
ehmaldonado | d02fe4b | 2016-08-26 13:31:24 -0700 | [diff] [blame] | 84 | "-Wno-ignored-attributes", |
| 85 | |
| 86 | # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6269 |
| 87 | # for -Wno-ignored-qualifiers |
| 88 | "-Wno-ignored-qualifiers", |
| 89 | "-Wno-microsoft-extra-qualification", |
ehmaldonado | d02fe4b | 2016-08-26 13:31:24 -0700 | [diff] [blame] | 90 | "-Wno-overloaded-virtual", |
| 91 | "-Wno-reorder", |
| 92 | "-Wno-writable-strings", |
| 93 | ] |
| 94 | } |
| 95 | } |
| 96 | |
mbonadei | 054b108 | 2017-09-04 06:54:54 -0700 | [diff] [blame] | 97 | if (is_ios || is_mac) { |
| 98 | rtc_source_set("video_capture_internal_impl_objc") { |
| 99 | visibility = [ ":video_capture_internal_impl" ] |
| 100 | configs += [ ":video_capture_internal_impl_warnings_config" ] |
| 101 | |
| 102 | deps = [ |
| 103 | ":video_capture_module", |
| 104 | "../../rtc_base:rtc_base_approved", |
| 105 | "../../system_wrappers", |
| 106 | ] |
| 107 | |
| 108 | sources = [ |
| 109 | "objc/device_info.h", |
| 110 | "objc/device_info.mm", |
| 111 | "objc/device_info_objc.h", |
| 112 | "objc/device_info_objc.mm", |
| 113 | "objc/rtc_video_capture_objc.h", |
| 114 | "objc/rtc_video_capture_objc.mm", |
| 115 | "objc/video_capture.h", |
| 116 | "objc/video_capture.mm", |
| 117 | ] |
| 118 | |
| 119 | all_dependent_configs = [ ":video_capture_internal_impl_config" ] |
| 120 | |
| 121 | if (!build_with_chromium && is_clang) { |
| 122 | # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
| 123 | suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
| 124 | } |
| 125 | } |
| 126 | } |
| 127 | |
| 128 | rtc_source_set("video_capture_internal_impl") { |
ehmaldonado | d02fe4b | 2016-08-26 13:31:24 -0700 | [diff] [blame] | 129 | configs += [ ":video_capture_internal_impl_warnings_config" ] |
| 130 | |
kjellander@webrtc.org | 853049f | 2015-01-20 11:40:45 +0000 | [diff] [blame] | 131 | deps = [ |
kjellander@webrtc.org | f58fe0a | 2015-02-11 07:47:00 +0000 | [diff] [blame] | 132 | ":video_capture_module", |
Patrik Höglund | a8005cf | 2017-12-13 16:05:42 +0100 | [diff] [blame] | 133 | "../../rtc_base:checks", |
ehmaldonado | f6a861a | 2017-07-19 10:40:47 -0700 | [diff] [blame] | 134 | "../../rtc_base:rtc_base_approved", |
kjellander@webrtc.org | 853049f | 2015-01-20 11:40:45 +0000 | [diff] [blame] | 135 | "../../system_wrappers", |
| 136 | ] |
andresp@webrtc.org | a74eda1 | 2014-09-17 11:50:19 +0000 | [diff] [blame] | 137 | |
kjellander@webrtc.org | 853049f | 2015-01-20 11:40:45 +0000 | [diff] [blame] | 138 | if (is_linux) { |
| 139 | sources = [ |
| 140 | "linux/device_info_linux.cc", |
| 141 | "linux/device_info_linux.h", |
| 142 | "linux/video_capture_linux.cc", |
| 143 | "linux/video_capture_linux.h", |
| 144 | ] |
Sam Zackrisson | 2ed6e4f | 2017-08-16 13:39:25 +0200 | [diff] [blame] | 145 | deps += [ |
| 146 | "../..:webrtc_common", |
| 147 | "../../media:rtc_media_base", |
| 148 | ] |
kjellander@webrtc.org | 853049f | 2015-01-20 11:40:45 +0000 | [diff] [blame] | 149 | } |
kjellander@webrtc.org | 853049f | 2015-01-20 11:40:45 +0000 | [diff] [blame] | 150 | if (is_win) { |
| 151 | sources = [ |
| 152 | "windows/device_info_ds.cc", |
| 153 | "windows/device_info_ds.h", |
| 154 | "windows/device_info_mf.cc", |
| 155 | "windows/device_info_mf.h", |
| 156 | "windows/help_functions_ds.cc", |
| 157 | "windows/help_functions_ds.h", |
| 158 | "windows/sink_filter_ds.cc", |
| 159 | "windows/sink_filter_ds.h", |
| 160 | "windows/video_capture_ds.cc", |
| 161 | "windows/video_capture_ds.h", |
| 162 | "windows/video_capture_factory_windows.cc", |
| 163 | "windows/video_capture_mf.cc", |
| 164 | "windows/video_capture_mf.h", |
| 165 | ] |
| 166 | |
Mirko Bonadei | 903dc86 | 2018-03-27 20:30:52 +0200 | [diff] [blame] | 167 | libs = [ "strmiids.lib" ] |
kjellander@webrtc.org | 853049f | 2015-01-20 11:40:45 +0000 | [diff] [blame] | 168 | |
Dan Minor | 9c68613 | 2018-01-15 10:20:00 -0500 | [diff] [blame] | 169 | if (build_with_mozilla) { |
| 170 | sources += [ |
| 171 | "windows/BaseFilter.cpp", |
| 172 | "windows/BaseInputPin.cpp", |
| 173 | "windows/BasePin.cpp", |
| 174 | "windows/MediaType.cpp", |
| 175 | ] |
| 176 | } else { |
| 177 | deps += [ "//third_party/winsdk_samples" ] |
| 178 | } |
kjellander@webrtc.org | 853049f | 2015-01-20 11:40:45 +0000 | [diff] [blame] | 179 | } |
kthelgason | 20a52e1 | 2016-09-30 00:43:12 -0700 | [diff] [blame] | 180 | if (is_ios || is_mac) { |
mbonadei | 054b108 | 2017-09-04 06:54:54 -0700 | [diff] [blame] | 181 | deps += [ ":video_capture_internal_impl_objc" ] |
kjellander@webrtc.org | 853049f | 2015-01-20 11:40:45 +0000 | [diff] [blame] | 182 | } |
| 183 | |
| 184 | all_dependent_configs = [ ":video_capture_internal_impl_config" ] |
| 185 | |
kjellander | e40a7ee | 2016-10-16 23:56:12 -0700 | [diff] [blame] | 186 | if (!build_with_chromium && is_clang) { |
| 187 | # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
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 | } |
Dan Minor | 9c68613 | 2018-01-15 10:20:00 -0500 | [diff] [blame] | 190 | |
| 191 | if (build_with_mozilla && is_android) { |
| 192 | include_dirs = [ |
| 193 | "/config/external/nspr", |
| 194 | "/nsprpub/lib/ds", |
| 195 | "/nsprpub/pr/include", |
| 196 | ] |
| 197 | |
| 198 | sources = [ |
| 199 | "android/device_info_android.cc", |
| 200 | "android/video_capture_android.cc", |
| 201 | ] |
| 202 | } |
andresp@webrtc.org | a74eda1 | 2014-09-17 11:50:19 +0000 | [diff] [blame] | 203 | } |
sakal | 06bfe1f | 2016-08-04 07:54:04 -0700 | [diff] [blame] | 204 | |
kjellander | f96c51a | 2016-08-15 09:21:31 -0700 | [diff] [blame] | 205 | if (!is_android && rtc_include_tests) { |
ehmaldonado | 38a2132 | 2016-09-02 04:10:34 -0700 | [diff] [blame] | 206 | rtc_test("video_capture_tests") { |
sakal | 06bfe1f | 2016-08-04 07:54:04 -0700 | [diff] [blame] | 207 | sources = [ |
sakal | 06bfe1f | 2016-08-04 07:54:04 -0700 | [diff] [blame] | 208 | "test/video_capture_unittest.cc", |
| 209 | ] |
| 210 | |
| 211 | cflags = [] |
| 212 | if (is_linux || is_mac) { |
| 213 | cflags += [ "-Wno-write-strings" ] |
| 214 | } |
| 215 | |
| 216 | ldflags = [] |
| 217 | if (is_linux || is_mac) { |
| 218 | ldflags += [ |
| 219 | "-lpthread", |
| 220 | "-lm", |
| 221 | ] |
| 222 | } |
| 223 | if (is_linux) { |
| 224 | ldflags += [ |
| 225 | "-lrt", |
| 226 | "-lXext", |
| 227 | "-lX11", |
| 228 | ] |
| 229 | } |
| 230 | |
| 231 | deps = [ |
| 232 | ":video_capture_internal_impl", |
| 233 | ":video_capture_module", |
Niels Möller | c6ce9c5 | 2018-05-11 11:15:30 +0200 | [diff] [blame^] | 234 | "../../api/video:video_frame", |
| 235 | "../../api/video:video_frame_i420", |
ehmaldonado | 36df2d7 | 2016-12-08 09:56:16 -0800 | [diff] [blame] | 236 | "../../common_video:common_video", |
ehmaldonado | f6a861a | 2017-07-19 10:40:47 -0700 | [diff] [blame] | 237 | "../../rtc_base:rtc_base_approved", |
ehmaldonado | 36df2d7 | 2016-12-08 09:56:16 -0800 | [diff] [blame] | 238 | "../../system_wrappers:system_wrappers", |
kjellander | f96c51a | 2016-08-15 09:21:31 -0700 | [diff] [blame] | 239 | "../../system_wrappers:system_wrappers_default", |
| 240 | "../../test:video_test_common", |
| 241 | "../utility", |
| 242 | "//testing/gtest", |
sakal | 06bfe1f | 2016-08-04 07:54:04 -0700 | [diff] [blame] | 243 | ] |
jianjun.zhu | c024740 | 2017-07-11 06:20:45 -0700 | [diff] [blame] | 244 | deps += [ "../../test:test_main" ] |
sakal | 06bfe1f | 2016-08-04 07:54:04 -0700 | [diff] [blame] | 245 | |
kjellander | e40a7ee | 2016-10-16 23:56:12 -0700 | [diff] [blame] | 246 | if (!build_with_chromium && is_clang) { |
| 247 | # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
ehmaldonado | 38a2132 | 2016-09-02 04:10:34 -0700 | [diff] [blame] | 248 | suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
sakal | 06bfe1f | 2016-08-04 07:54:04 -0700 | [diff] [blame] | 249 | } |
| 250 | } |
| 251 | } |
kjellander@webrtc.org | 1227ab8 | 2014-06-23 19:21:07 +0000 | [diff] [blame] | 252 | } |