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 | |
jiayl@webrtc.org | 93426cd | 2014-07-02 15:47:12 +0000 | [diff] [blame] | 9 | import("//build/config/ui.gni") |
mbonadei | 9aa3f0a | 2017-01-24 06:58:22 -0800 | [diff] [blame] | 10 | import("../../webrtc.gni") |
kjellander@webrtc.org | 1227ab8 | 2014-06-23 19:21:07 +0000 | [diff] [blame] | 11 | |
Sergey Ulanov | 1c062bf | 2016-11-22 16:07:10 -0800 | [diff] [blame] | 12 | use_desktop_capture_differ_sse2 = current_cpu == "x86" || current_cpu == "x64" |
jiayl@webrtc.org | 93426cd | 2014-07-02 15:47:12 +0000 | [diff] [blame] | 13 | |
kjellander | b62dbbe | 2016-09-23 00:38:52 -0700 | [diff] [blame] | 14 | rtc_static_library("primitives") { |
Sergey Ulanov | 098c1de | 2015-09-01 11:36:40 -0700 | [diff] [blame] | 15 | sources = [ |
| 16 | "desktop_capture_types.h", |
| 17 | "desktop_frame.cc", |
| 18 | "desktop_frame.h", |
| 19 | "desktop_geometry.cc", |
| 20 | "desktop_geometry.h", |
| 21 | "desktop_region.cc", |
| 22 | "desktop_region.h", |
Sergey Ulanov | 58000a0 | 2016-10-20 09:33:52 -0700 | [diff] [blame] | 23 | "shared_desktop_frame.cc", |
| 24 | "shared_desktop_frame.h", |
mbonadei | f423593 | 2016-12-29 03:35:56 -0800 | [diff] [blame] | 25 | "shared_memory.cc", |
| 26 | "shared_memory.h", |
Sergey Ulanov | 58000a0 | 2016-10-20 09:33:52 -0700 | [diff] [blame] | 27 | ] |
| 28 | |
| 29 | deps = [ |
mbonadei | f423593 | 2016-12-29 03:35:56 -0800 | [diff] [blame] | 30 | "../..:webrtc_common", |
Sergey Ulanov | 58000a0 | 2016-10-20 09:33:52 -0700 | [diff] [blame] | 31 | "../../base:rtc_base", # TODO(kjellander): Cleanup in bugs.webrtc.org/3806. |
Sergey Ulanov | 098c1de | 2015-09-01 11:36:40 -0700 | [diff] [blame] | 32 | ] |
Sergey Ulanov | 098c1de | 2015-09-01 11:36:40 -0700 | [diff] [blame] | 33 | } |
| 34 | |
zijiehe | 6be0a65 | 2016-10-27 16:50:35 -0700 | [diff] [blame] | 35 | if (rtc_include_tests) { |
ehmaldonado | 9cbb0a1 | 2017-01-30 03:07:03 -0800 | [diff] [blame] | 36 | rtc_source_set("desktop_capture_modules_tests") { |
| 37 | testonly = true |
| 38 | sources = [] |
| 39 | deps = [] |
| 40 | if (rtc_desktop_capture_supported) { |
| 41 | deps += [ |
| 42 | ":desktop_capture_mock", |
| 43 | ":primitives", |
| 44 | ":screen_drawer", |
| 45 | "../../base:rtc_base", |
| 46 | "../../base:rtc_base_approved", |
| 47 | "../../system_wrappers:system_wrappers", |
| 48 | "../../test:test_support", |
ehmaldonado | 656610f | 2017-02-06 02:21:11 -0800 | [diff] [blame] | 49 | "../../test:video_test_support", |
ehmaldonado | 9cbb0a1 | 2017-01-30 03:07:03 -0800 | [diff] [blame] | 50 | ] |
| 51 | sources += [ |
| 52 | "screen_capturer_integration_test.cc", |
| 53 | "screen_drawer_unittest.cc", |
| 54 | ] |
| 55 | } |
| 56 | } |
| 57 | |
ehmaldonado | 3626865 | 2017-01-19 08:27:11 -0800 | [diff] [blame] | 58 | rtc_source_set("desktop_capture_unittests") { |
| 59 | testonly = true |
ehmaldonado | 0d729b3 | 2017-02-10 01:38:23 -0800 | [diff] [blame^] | 60 | sources = [ |
| 61 | "desktop_and_cursor_composer_unittest.cc", |
| 62 | "desktop_capturer_differ_wrapper_unittest.cc", |
| 63 | "desktop_frame_rotation_unittest.cc", |
| 64 | "desktop_region_unittest.cc", |
| 65 | "differ_block_unittest.cc", |
| 66 | "mouse_cursor_monitor_unittest.cc", |
| 67 | "rgba_color_unittest.cc", |
| 68 | "test_utils.cc", |
| 69 | "test_utils.h", |
| 70 | "test_utils_unittest.cc", |
| 71 | "win/cursor_unittest.cc", |
| 72 | "win/cursor_unittest_resources.h", |
| 73 | "win/cursor_unittest_resources.rc", |
| 74 | ] |
| 75 | deps = [ |
| 76 | ":desktop_capture", |
| 77 | ":desktop_capture_mock", |
| 78 | ":primitives", |
| 79 | ":rgba_color", |
| 80 | "../..:webrtc_common", |
| 81 | "../../base:rtc_base_approved", |
| 82 | "../../system_wrappers:system_wrappers", |
| 83 | "../../test:test_support", |
| 84 | "//testing/gmock", |
| 85 | ] |
ehmaldonado | 3626865 | 2017-01-19 08:27:11 -0800 | [diff] [blame] | 86 | if (rtc_desktop_capture_supported) { |
| 87 | sources += [ |
ehmaldonado | 3626865 | 2017-01-19 08:27:11 -0800 | [diff] [blame] | 88 | "screen_capturer_helper_unittest.cc", |
| 89 | "screen_capturer_mac_unittest.cc", |
| 90 | "screen_capturer_unittest.cc", |
ehmaldonado | 3626865 | 2017-01-19 08:27:11 -0800 | [diff] [blame] | 91 | "window_capturer_unittest.cc", |
| 92 | ] |
| 93 | deps += [ ":desktop_capture_mock" ] |
| 94 | } |
| 95 | if (!build_with_chromium && is_clang) { |
| 96 | # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
| 97 | suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
| 98 | } |
| 99 | } |
| 100 | |
zijiehe | 54fd579 | 2016-11-02 14:49:35 -0700 | [diff] [blame] | 101 | source_set("rgba_color") { |
zijiehe | 6be0a65 | 2016-10-27 16:50:35 -0700 | [diff] [blame] | 102 | testonly = true |
| 103 | |
| 104 | public_deps = [ |
| 105 | ":desktop_capture", |
| 106 | ] |
| 107 | |
| 108 | sources = [ |
| 109 | "rgba_color.cc", |
| 110 | "rgba_color.h", |
zijiehe | 54fd579 | 2016-11-02 14:49:35 -0700 | [diff] [blame] | 111 | ] |
mbonadei | f423593 | 2016-12-29 03:35:56 -0800 | [diff] [blame] | 112 | |
| 113 | deps = [ |
| 114 | ":primitives", |
| 115 | "../..:webrtc_common", |
| 116 | ] |
zijiehe | 54fd579 | 2016-11-02 14:49:35 -0700 | [diff] [blame] | 117 | } |
| 118 | |
| 119 | source_set("screen_drawer") { |
| 120 | testonly = true |
| 121 | |
| 122 | public_deps = [ |
| 123 | ":rgba_color", |
| 124 | ] |
| 125 | |
| 126 | sources = [ |
zijiehe | 6be0a65 | 2016-10-27 16:50:35 -0700 | [diff] [blame] | 127 | "screen_drawer.cc", |
| 128 | "screen_drawer.h", |
| 129 | "screen_drawer_linux.cc", |
| 130 | "screen_drawer_mac.cc", |
| 131 | "screen_drawer_win.cc", |
| 132 | ] |
mbonadei | f423593 | 2016-12-29 03:35:56 -0800 | [diff] [blame] | 133 | |
| 134 | deps = [ |
| 135 | ":primitives", |
| 136 | "../../base:rtc_base_approved", |
| 137 | "../../system_wrappers", |
| 138 | ] |
zijiehe | 6be0a65 | 2016-10-27 16:50:35 -0700 | [diff] [blame] | 139 | } |
zijiehe | 54fd579 | 2016-11-02 14:49:35 -0700 | [diff] [blame] | 140 | |
| 141 | source_set("desktop_capture_mock") { |
| 142 | testonly = true |
| 143 | |
| 144 | public_deps = [ |
| 145 | ":desktop_capture", |
| 146 | ":rgba_color", |
zijiehe | 372719b | 2016-11-11 17:18:34 -0800 | [diff] [blame] | 147 | "//testing/gmock", |
zijiehe | 54fd579 | 2016-11-02 14:49:35 -0700 | [diff] [blame] | 148 | ] |
| 149 | |
| 150 | sources = [ |
| 151 | "desktop_frame_generator.cc", |
| 152 | "desktop_frame_generator.h", |
zijiehe | 98903d2 | 2016-11-10 21:57:10 -0800 | [diff] [blame] | 153 | "fake_desktop_capturer.cc", |
zijiehe | 54fd579 | 2016-11-02 14:49:35 -0700 | [diff] [blame] | 154 | "fake_desktop_capturer.h", |
zijiehe | 372719b | 2016-11-11 17:18:34 -0800 | [diff] [blame] | 155 | "mock_desktop_capturer_callback.cc", |
zijiehe | 54fd579 | 2016-11-02 14:49:35 -0700 | [diff] [blame] | 156 | "mock_desktop_capturer_callback.h", |
mbonadei | f423593 | 2016-12-29 03:35:56 -0800 | [diff] [blame] | 157 | ] |
| 158 | |
| 159 | deps = [ |
| 160 | ":primitives", |
| 161 | "../../base:rtc_base_approved", |
| 162 | "../../test:test_support", |
zijiehe | 54fd579 | 2016-11-02 14:49:35 -0700 | [diff] [blame] | 163 | ] |
| 164 | } |
zijiehe | 6be0a65 | 2016-10-27 16:50:35 -0700 | [diff] [blame] | 165 | } |
| 166 | |
kjellander | b62dbbe | 2016-09-23 00:38:52 -0700 | [diff] [blame] | 167 | rtc_static_library("desktop_capture") { |
jiayl@webrtc.org | 93426cd | 2014-07-02 15:47:12 +0000 | [diff] [blame] | 168 | sources = [ |
jiayl@webrtc.org | 0e71070 | 2014-11-11 18:15:55 +0000 | [diff] [blame] | 169 | "cropped_desktop_frame.cc", |
| 170 | "cropped_desktop_frame.h", |
| 171 | "cropping_window_capturer.cc", |
| 172 | "cropping_window_capturer.h", |
| 173 | "cropping_window_capturer_win.cc", |
jiayl@webrtc.org | 93426cd | 2014-07-02 15:47:12 +0000 | [diff] [blame] | 174 | "desktop_and_cursor_composer.cc", |
| 175 | "desktop_and_cursor_composer.h", |
Henrik Kjellander | 57e5fd2 | 2015-05-25 12:55:39 +0200 | [diff] [blame] | 176 | "desktop_capture_options.cc", |
| 177 | "desktop_capture_options.h", |
zijiehe | b68d655 | 2016-10-28 17:35:11 -0700 | [diff] [blame] | 178 | "desktop_capturer.cc", |
jiayl@webrtc.org | 93426cd | 2014-07-02 15:47:12 +0000 | [diff] [blame] | 179 | "desktop_capturer.h", |
Sergey Ulanov | 1c062bf | 2016-11-22 16:07:10 -0800 | [diff] [blame] | 180 | "desktop_capturer_differ_wrapper.cc", |
| 181 | "desktop_capturer_differ_wrapper.h", |
zijiehe | 90ea736 | 2016-11-22 17:17:09 -0800 | [diff] [blame] | 182 | "desktop_frame_rotation.cc", |
| 183 | "desktop_frame_rotation.h", |
jiayl@webrtc.org | 93426cd | 2014-07-02 15:47:12 +0000 | [diff] [blame] | 184 | "desktop_frame_win.cc", |
| 185 | "desktop_frame_win.h", |
Sergey Ulanov | 1c062bf | 2016-11-22 16:07:10 -0800 | [diff] [blame] | 186 | "differ_block.cc", |
| 187 | "differ_block.h", |
jiayl@webrtc.org | 93426cd | 2014-07-02 15:47:12 +0000 | [diff] [blame] | 188 | "mac/desktop_configuration.h", |
| 189 | "mac/desktop_configuration.mm", |
jiayl@webrtc.org | 93426cd | 2014-07-02 15:47:12 +0000 | [diff] [blame] | 190 | "mac/desktop_configuration_monitor.cc", |
Henrik Kjellander | 57e5fd2 | 2015-05-25 12:55:39 +0200 | [diff] [blame] | 191 | "mac/desktop_configuration_monitor.h", |
jiayl@webrtc.org | 12b4efe | 2014-07-08 22:05:24 +0000 | [diff] [blame] | 192 | "mac/full_screen_chrome_window_detector.cc", |
| 193 | "mac/full_screen_chrome_window_detector.h", |
jiayl@webrtc.org | 93426cd | 2014-07-02 15:47:12 +0000 | [diff] [blame] | 194 | "mac/scoped_pixel_buffer_object.cc", |
| 195 | "mac/scoped_pixel_buffer_object.h", |
jiayl@webrtc.org | 12b4efe | 2014-07-08 22:05:24 +0000 | [diff] [blame] | 196 | "mac/window_list_utils.cc", |
| 197 | "mac/window_list_utils.h", |
jiayl@webrtc.org | 93426cd | 2014-07-02 15:47:12 +0000 | [diff] [blame] | 198 | "mouse_cursor.cc", |
| 199 | "mouse_cursor.h", |
| 200 | "mouse_cursor_monitor.h", |
| 201 | "mouse_cursor_monitor_mac.mm", |
| 202 | "mouse_cursor_monitor_win.cc", |
jiayl@webrtc.org | 93426cd | 2014-07-02 15:47:12 +0000 | [diff] [blame] | 203 | "screen_capture_frame_queue.h", |
jiayl@webrtc.org | 93426cd | 2014-07-02 15:47:12 +0000 | [diff] [blame] | 204 | "screen_capturer_helper.cc", |
| 205 | "screen_capturer_helper.h", |
| 206 | "screen_capturer_mac.mm", |
| 207 | "screen_capturer_win.cc", |
jiayl@webrtc.org | 93426cd | 2014-07-02 15:47:12 +0000 | [diff] [blame] | 208 | "win/cursor.cc", |
| 209 | "win/cursor.h", |
zijiehe | 2d618de | 2016-08-08 17:50:21 -0700 | [diff] [blame] | 210 | "win/d3d_device.cc", |
| 211 | "win/d3d_device.h", |
jiayl@webrtc.org | 93426cd | 2014-07-02 15:47:12 +0000 | [diff] [blame] | 212 | "win/desktop.cc", |
| 213 | "win/desktop.h", |
zijiehe | 2d618de | 2016-08-08 17:50:21 -0700 | [diff] [blame] | 214 | "win/dxgi_adapter_duplicator.cc", |
| 215 | "win/dxgi_adapter_duplicator.h", |
| 216 | "win/dxgi_duplicator_controller.cc", |
| 217 | "win/dxgi_duplicator_controller.h", |
| 218 | "win/dxgi_output_duplicator.cc", |
| 219 | "win/dxgi_output_duplicator.h", |
| 220 | "win/dxgi_texture.cc", |
| 221 | "win/dxgi_texture.h", |
| 222 | "win/dxgi_texture_mapping.cc", |
| 223 | "win/dxgi_texture_mapping.h", |
| 224 | "win/dxgi_texture_staging.cc", |
| 225 | "win/dxgi_texture_staging.h", |
jiayl@webrtc.org | 93426cd | 2014-07-02 15:47:12 +0000 | [diff] [blame] | 226 | "win/scoped_gdi_object.h", |
| 227 | "win/scoped_thread_desktop.cc", |
| 228 | "win/scoped_thread_desktop.h", |
Henrik Kjellander | 57e5fd2 | 2015-05-25 12:55:39 +0200 | [diff] [blame] | 229 | "win/screen_capture_utils.cc", |
| 230 | "win/screen_capture_utils.h", |
zijiehe | 2970c2a | 2016-05-20 22:08:00 -0700 | [diff] [blame] | 231 | "win/screen_capturer_win_directx.cc", |
| 232 | "win/screen_capturer_win_directx.h", |
jiayl@webrtc.org | 93426cd | 2014-07-02 15:47:12 +0000 | [diff] [blame] | 233 | "win/screen_capturer_win_gdi.cc", |
| 234 | "win/screen_capturer_win_gdi.h", |
| 235 | "win/screen_capturer_win_magnifier.cc", |
| 236 | "win/screen_capturer_win_magnifier.h", |
jiayl@webrtc.org | 93426cd | 2014-07-02 15:47:12 +0000 | [diff] [blame] | 237 | "win/window_capture_utils.cc", |
| 238 | "win/window_capture_utils.h", |
jiayl@webrtc.org | 93426cd | 2014-07-02 15:47:12 +0000 | [diff] [blame] | 239 | "window_capturer_mac.mm", |
| 240 | "window_capturer_win.cc", |
| 241 | ] |
| 242 | |
| 243 | if (use_x11) { |
| 244 | sources += [ |
| 245 | "mouse_cursor_monitor_x11.cc", |
| 246 | "screen_capturer_x11.cc", |
| 247 | "window_capturer_x11.cc", |
jiayl@webrtc.org | 93426cd | 2014-07-02 15:47:12 +0000 | [diff] [blame] | 248 | "x11/shared_x_display.cc", |
Henrik Kjellander | 57e5fd2 | 2015-05-25 12:55:39 +0200 | [diff] [blame] | 249 | "x11/shared_x_display.h", |
jiayl@webrtc.org | 93426cd | 2014-07-02 15:47:12 +0000 | [diff] [blame] | 250 | "x11/x_error_trap.cc", |
| 251 | "x11/x_error_trap.h", |
| 252 | "x11/x_server_pixel_buffer.cc", |
| 253 | "x11/x_server_pixel_buffer.h", |
| 254 | ] |
Henrik Kjellander | 57e5fd2 | 2015-05-25 12:55:39 +0200 | [diff] [blame] | 255 | configs += [ "//build/config/linux:x11" ] |
jiayl@webrtc.org | 93426cd | 2014-07-02 15:47:12 +0000 | [diff] [blame] | 256 | } |
| 257 | |
| 258 | if (!is_win && !is_mac && !use_x11) { |
| 259 | sources += [ |
| 260 | "mouse_cursor_monitor_null.cc", |
| 261 | "screen_capturer_null.cc", |
| 262 | "window_capturer_null.cc", |
| 263 | ] |
| 264 | } |
| 265 | |
kjellander@webrtc.org | 556caff | 2014-12-19 13:28:37 +0000 | [diff] [blame] | 266 | if (is_mac) { |
| 267 | libs = [ |
| 268 | "AppKit.framework", |
| 269 | "IOKit.framework", |
| 270 | "OpenGL.framework", |
| 271 | ] |
| 272 | } |
| 273 | |
zijiehe | 2970c2a | 2016-05-20 22:08:00 -0700 | [diff] [blame] | 274 | if (is_win) { |
zijiehe | 2d618de | 2016-08-08 17:50:21 -0700 | [diff] [blame] | 275 | libs = [ |
| 276 | "d3d11.lib", |
| 277 | "dxgi.lib", |
| 278 | ] |
zijiehe | 2970c2a | 2016-05-20 22:08:00 -0700 | [diff] [blame] | 279 | } |
| 280 | |
andrew@webrtc.org | 6ae5a6d | 2014-09-16 01:03:29 +0000 | [diff] [blame] | 281 | deps = [ |
Sergey Ulanov | 098c1de | 2015-09-01 11:36:40 -0700 | [diff] [blame] | 282 | ":primitives", |
mbonadei | f423593 | 2016-12-29 03:35:56 -0800 | [diff] [blame] | 283 | "../..:webrtc_common", |
kjellander | fb11424 | 2016-06-13 00:19:48 -0700 | [diff] [blame] | 284 | "../../base:rtc_base", # TODO(kjellander): Cleanup in bugs.webrtc.org/3806. |
andrew@webrtc.org | 6ae5a6d | 2014-09-16 01:03:29 +0000 | [diff] [blame] | 285 | "../../system_wrappers", |
zijiehe | 90ea736 | 2016-11-22 17:17:09 -0800 | [diff] [blame] | 286 | "//third_party/libyuv", |
andrew@webrtc.org | 6ae5a6d | 2014-09-16 01:03:29 +0000 | [diff] [blame] | 287 | ] |
jiayl@webrtc.org | 93426cd | 2014-07-02 15:47:12 +0000 | [diff] [blame] | 288 | |
| 289 | if (use_desktop_capture_differ_sse2) { |
Henrik Kjellander | 57e5fd2 | 2015-05-25 12:55:39 +0200 | [diff] [blame] | 290 | deps += [ ":desktop_capture_differ_sse2" ] |
jiayl@webrtc.org | 93426cd | 2014-07-02 15:47:12 +0000 | [diff] [blame] | 291 | } |
kjellander@webrtc.org | 1227ab8 | 2014-06-23 19:21:07 +0000 | [diff] [blame] | 292 | } |
| 293 | |
jiayl@webrtc.org | 93426cd | 2014-07-02 15:47:12 +0000 | [diff] [blame] | 294 | if (use_desktop_capture_differ_sse2) { |
| 295 | # Have to be compiled as a separate target because it needs to be compiled |
| 296 | # with SSE2 enabled. |
kjellander | b62dbbe | 2016-09-23 00:38:52 -0700 | [diff] [blame] | 297 | rtc_static_library("desktop_capture_differ_sse2") { |
brettw@chromium.org | 0867f69 | 2014-09-10 16:24:11 +0000 | [diff] [blame] | 298 | visibility = [ ":*" ] |
jiayl@webrtc.org | 93426cd | 2014-07-02 15:47:12 +0000 | [diff] [blame] | 299 | sources = [ |
zijiehe | fef8653 | 2016-09-05 15:26:32 -0700 | [diff] [blame] | 300 | "differ_vector_sse2.cc", |
| 301 | "differ_vector_sse2.h", |
jiayl@webrtc.org | 93426cd | 2014-07-02 15:47:12 +0000 | [diff] [blame] | 302 | ] |
| 303 | |
ehmaldonado | 90920d5 | 2016-08-16 04:13:01 -0700 | [diff] [blame] | 304 | if (is_posix) { |
Henrik Kjellander | 57e5fd2 | 2015-05-25 12:55:39 +0200 | [diff] [blame] | 305 | cflags = [ "-msse2" ] |
jiayl@webrtc.org | 93426cd | 2014-07-02 15:47:12 +0000 | [diff] [blame] | 306 | } |
kjellander@webrtc.org | 1227ab8 | 2014-06-23 19:21:07 +0000 | [diff] [blame] | 307 | } |
| 308 | } |