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") { |
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", |
guidou | 41bce13 | 2016-08-04 06:48:17 -0700 | [diff] [blame] | 22 | "video_capture_factory.cc", |
sakal | 06bfe1f | 2016-08-04 07:54:04 -0700 | [diff] [blame] | 23 | "video_capture_factory.h", |
kjellander@webrtc.org | 788f058 | 2014-08-28 13:51:08 +0000 | [diff] [blame] | 24 | "video_capture_impl.cc", |
| 25 | "video_capture_impl.h", |
| 26 | ] |
| 27 | |
andresp@webrtc.org | a74eda1 | 2014-09-17 11:50:19 +0000 | [diff] [blame] | 28 | deps = [ |
mbonadei | 1140f97 | 2017-04-26 03:38:35 -0700 | [diff] [blame] | 29 | "..:module_api", |
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", |
ehmaldonado | f6a861a | 2017-07-19 10:40:47 -0700 | [diff] [blame] | 32 | "../../rtc_base:rtc_base_approved", |
andresp@webrtc.org | a74eda1 | 2014-09-17 11:50:19 +0000 | [diff] [blame] | 33 | "../../system_wrappers", |
andresp@webrtc.org | a74eda1 | 2014-09-17 11:50:19 +0000 | [diff] [blame] | 34 | ] |
kjellander@webrtc.org | 788f058 | 2014-08-28 13:51:08 +0000 | [diff] [blame] | 35 | |
kjellander | e40a7ee | 2016-10-16 23:56:12 -0700 | [diff] [blame] | 36 | if (!build_with_chromium && is_clang) { |
| 37 | # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
ehmaldonado | 38a2132 | 2016-09-02 04:10:34 -0700 | [diff] [blame] | 38 | suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
kjellander@webrtc.org | 788f058 | 2014-08-28 13:51:08 +0000 | [diff] [blame] | 39 | } |
andresp@webrtc.org | a74eda1 | 2014-09-17 11:50:19 +0000 | [diff] [blame] | 40 | } |
kjellander@webrtc.org | 788f058 | 2014-08-28 13:51:08 +0000 | [diff] [blame] | 41 | |
kjellander | b62dbbe | 2016-09-23 00:38:52 -0700 | [diff] [blame] | 42 | rtc_static_library("video_capture") { |
andresp@webrtc.org | a74eda1 | 2014-09-17 11:50:19 +0000 | [diff] [blame] | 43 | sources = [ |
| 44 | "external/device_info_external.cc", |
| 45 | "external/video_capture_external.cc", |
kjellander@webrtc.org | 788f058 | 2014-08-28 13:51:08 +0000 | [diff] [blame] | 46 | ] |
andresp@webrtc.org | a74eda1 | 2014-09-17 11:50:19 +0000 | [diff] [blame] | 47 | |
| 48 | deps = [ |
kjellander@webrtc.org | f58fe0a | 2015-02-11 07:47:00 +0000 | [diff] [blame] | 49 | ":video_capture_module", |
ehmaldonado | f6a861a | 2017-07-19 10:40:47 -0700 | [diff] [blame] | 50 | "../../rtc_base:rtc_base_approved", |
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 | |
kjellander | e40a7ee | 2016-10-16 23:56:12 -0700 | [diff] [blame] | 54 | if (!build_with_chromium && is_clang) { |
| 55 | # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
ehmaldonado | 38a2132 | 2016-09-02 04:10:34 -0700 | [diff] [blame] | 56 | suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
andresp@webrtc.org | a74eda1 | 2014-09-17 11:50:19 +0000 | [diff] [blame] | 57 | } |
| 58 | } |
| 59 | |
kjellander@webrtc.org | 853049f | 2015-01-20 11:40:45 +0000 | [diff] [blame] | 60 | if (!build_with_chromium) { |
| 61 | config("video_capture_internal_impl_config") { |
kthelgason | 20a52e1 | 2016-09-30 00:43:12 -0700 | [diff] [blame] | 62 | if (is_ios || is_mac) { |
kjellander@webrtc.org | 853049f | 2015-01-20 11:40:45 +0000 | [diff] [blame] | 63 | libs = [ |
| 64 | "AVFoundation.framework", |
| 65 | "CoreMedia.framework", |
| 66 | "CoreVideo.framework", |
| 67 | ] |
| 68 | } |
andresp@webrtc.org | a74eda1 | 2014-09-17 11:50:19 +0000 | [diff] [blame] | 69 | } |
| 70 | |
ehmaldonado | d02fe4b | 2016-08-26 13:31:24 -0700 | [diff] [blame] | 71 | config("video_capture_internal_impl_warnings_config") { |
| 72 | if (is_win && is_clang) { |
| 73 | cflags = [ |
| 74 | "-Wno-comment", |
| 75 | "-Wno-ignored-attributes", |
| 76 | |
| 77 | # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6269 |
| 78 | # for -Wno-ignored-qualifiers |
| 79 | "-Wno-ignored-qualifiers", |
| 80 | "-Wno-microsoft-extra-qualification", |
| 81 | "-Wno-missing-braces", |
| 82 | "-Wno-overloaded-virtual", |
| 83 | "-Wno-reorder", |
| 84 | "-Wno-writable-strings", |
| 85 | ] |
| 86 | } |
| 87 | } |
| 88 | |
mbonadei | 054b108 | 2017-09-04 06:54:54 -0700 | [diff] [blame] | 89 | if (is_ios || is_mac) { |
| 90 | rtc_source_set("video_capture_internal_impl_objc") { |
| 91 | visibility = [ ":video_capture_internal_impl" ] |
| 92 | configs += [ ":video_capture_internal_impl_warnings_config" ] |
| 93 | |
| 94 | deps = [ |
| 95 | ":video_capture_module", |
| 96 | "../../rtc_base:rtc_base_approved", |
| 97 | "../../system_wrappers", |
| 98 | ] |
| 99 | |
| 100 | sources = [ |
| 101 | "objc/device_info.h", |
| 102 | "objc/device_info.mm", |
| 103 | "objc/device_info_objc.h", |
| 104 | "objc/device_info_objc.mm", |
| 105 | "objc/rtc_video_capture_objc.h", |
| 106 | "objc/rtc_video_capture_objc.mm", |
| 107 | "objc/video_capture.h", |
| 108 | "objc/video_capture.mm", |
| 109 | ] |
| 110 | |
| 111 | all_dependent_configs = [ ":video_capture_internal_impl_config" ] |
| 112 | |
| 113 | if (!build_with_chromium && is_clang) { |
| 114 | # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
| 115 | suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
| 116 | } |
| 117 | } |
| 118 | } |
| 119 | |
| 120 | rtc_source_set("video_capture_internal_impl") { |
ehmaldonado | d02fe4b | 2016-08-26 13:31:24 -0700 | [diff] [blame] | 121 | configs += [ ":video_capture_internal_impl_warnings_config" ] |
| 122 | |
kjellander@webrtc.org | 853049f | 2015-01-20 11:40:45 +0000 | [diff] [blame] | 123 | deps = [ |
kjellander@webrtc.org | f58fe0a | 2015-02-11 07:47:00 +0000 | [diff] [blame] | 124 | ":video_capture_module", |
ehmaldonado | f6a861a | 2017-07-19 10:40:47 -0700 | [diff] [blame] | 125 | "../../rtc_base:rtc_base_approved", |
kjellander@webrtc.org | 853049f | 2015-01-20 11:40:45 +0000 | [diff] [blame] | 126 | "../../system_wrappers", |
| 127 | ] |
andresp@webrtc.org | a74eda1 | 2014-09-17 11:50:19 +0000 | [diff] [blame] | 128 | |
kjellander@webrtc.org | 853049f | 2015-01-20 11:40:45 +0000 | [diff] [blame] | 129 | if (is_linux) { |
| 130 | sources = [ |
| 131 | "linux/device_info_linux.cc", |
| 132 | "linux/device_info_linux.h", |
| 133 | "linux/video_capture_linux.cc", |
| 134 | "linux/video_capture_linux.h", |
| 135 | ] |
Sam Zackrisson | 2ed6e4f | 2017-08-16 13:39:25 +0200 | [diff] [blame] | 136 | deps += [ |
| 137 | "../..:webrtc_common", |
| 138 | "../../media:rtc_media_base", |
| 139 | ] |
kjellander@webrtc.org | 853049f | 2015-01-20 11:40:45 +0000 | [diff] [blame] | 140 | } |
kjellander@webrtc.org | 853049f | 2015-01-20 11:40:45 +0000 | [diff] [blame] | 141 | if (is_win) { |
| 142 | sources = [ |
| 143 | "windows/device_info_ds.cc", |
| 144 | "windows/device_info_ds.h", |
| 145 | "windows/device_info_mf.cc", |
| 146 | "windows/device_info_mf.h", |
| 147 | "windows/help_functions_ds.cc", |
| 148 | "windows/help_functions_ds.h", |
| 149 | "windows/sink_filter_ds.cc", |
| 150 | "windows/sink_filter_ds.h", |
| 151 | "windows/video_capture_ds.cc", |
| 152 | "windows/video_capture_ds.h", |
| 153 | "windows/video_capture_factory_windows.cc", |
| 154 | "windows/video_capture_mf.cc", |
| 155 | "windows/video_capture_mf.h", |
| 156 | ] |
| 157 | |
| 158 | libs = [ "Strmiids.lib" ] |
| 159 | |
Henrik Kjellander | 57e5fd2 | 2015-05-25 12:55:39 +0200 | [diff] [blame] | 160 | deps += [ "//third_party/winsdk_samples" ] |
kjellander@webrtc.org | 853049f | 2015-01-20 11:40:45 +0000 | [diff] [blame] | 161 | } |
kthelgason | 20a52e1 | 2016-09-30 00:43:12 -0700 | [diff] [blame] | 162 | if (is_ios || is_mac) { |
mbonadei | 054b108 | 2017-09-04 06:54:54 -0700 | [diff] [blame] | 163 | deps += [ ":video_capture_internal_impl_objc" ] |
kjellander@webrtc.org | 853049f | 2015-01-20 11:40:45 +0000 | [diff] [blame] | 164 | } |
| 165 | |
| 166 | all_dependent_configs = [ ":video_capture_internal_impl_config" ] |
| 167 | |
kjellander | e40a7ee | 2016-10-16 23:56:12 -0700 | [diff] [blame] | 168 | if (!build_with_chromium && is_clang) { |
| 169 | # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
ehmaldonado | 38a2132 | 2016-09-02 04:10:34 -0700 | [diff] [blame] | 170 | suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
kjellander@webrtc.org | 853049f | 2015-01-20 11:40:45 +0000 | [diff] [blame] | 171 | } |
andresp@webrtc.org | a74eda1 | 2014-09-17 11:50:19 +0000 | [diff] [blame] | 172 | } |
sakal | 06bfe1f | 2016-08-04 07:54:04 -0700 | [diff] [blame] | 173 | |
kjellander | f96c51a | 2016-08-15 09:21:31 -0700 | [diff] [blame] | 174 | if (!is_android && rtc_include_tests) { |
ehmaldonado | 38a2132 | 2016-09-02 04:10:34 -0700 | [diff] [blame] | 175 | rtc_test("video_capture_tests") { |
sakal | 06bfe1f | 2016-08-04 07:54:04 -0700 | [diff] [blame] | 176 | sources = [ |
sakal | 06bfe1f | 2016-08-04 07:54:04 -0700 | [diff] [blame] | 177 | "test/video_capture_unittest.cc", |
| 178 | ] |
| 179 | |
| 180 | cflags = [] |
| 181 | if (is_linux || is_mac) { |
| 182 | cflags += [ "-Wno-write-strings" ] |
| 183 | } |
| 184 | |
| 185 | ldflags = [] |
| 186 | if (is_linux || is_mac) { |
| 187 | ldflags += [ |
| 188 | "-lpthread", |
| 189 | "-lm", |
| 190 | ] |
| 191 | } |
| 192 | if (is_linux) { |
| 193 | ldflags += [ |
| 194 | "-lrt", |
| 195 | "-lXext", |
| 196 | "-lX11", |
| 197 | ] |
| 198 | } |
| 199 | |
| 200 | deps = [ |
| 201 | ":video_capture_internal_impl", |
| 202 | ":video_capture_module", |
ehmaldonado | 36df2d7 | 2016-12-08 09:56:16 -0800 | [diff] [blame] | 203 | "../../common_video:common_video", |
ehmaldonado | f6a861a | 2017-07-19 10:40:47 -0700 | [diff] [blame] | 204 | "../../rtc_base:rtc_base_approved", |
ehmaldonado | 36df2d7 | 2016-12-08 09:56:16 -0800 | [diff] [blame] | 205 | "../../system_wrappers:system_wrappers", |
kjellander | f96c51a | 2016-08-15 09:21:31 -0700 | [diff] [blame] | 206 | "../../system_wrappers:system_wrappers_default", |
| 207 | "../../test:video_test_common", |
| 208 | "../utility", |
| 209 | "//testing/gtest", |
sakal | 06bfe1f | 2016-08-04 07:54:04 -0700 | [diff] [blame] | 210 | ] |
jianjun.zhu | c024740 | 2017-07-11 06:20:45 -0700 | [diff] [blame] | 211 | deps += [ "../../test:test_main" ] |
sakal | 06bfe1f | 2016-08-04 07:54:04 -0700 | [diff] [blame] | 212 | |
kjellander | e40a7ee | 2016-10-16 23:56:12 -0700 | [diff] [blame] | 213 | if (!build_with_chromium && is_clang) { |
| 214 | # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
ehmaldonado | 38a2132 | 2016-09-02 04:10:34 -0700 | [diff] [blame] | 215 | suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
sakal | 06bfe1f | 2016-08-04 07:54:04 -0700 | [diff] [blame] | 216 | } |
| 217 | } |
| 218 | } |
kjellander@webrtc.org | 1227ab8 | 2014-06-23 19:21:07 +0000 | [diff] [blame] | 219 | } |