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") |
kjellander@webrtc.org | 1227ab8 | 2014-06-23 19:21:07 +0000 | [diff] [blame] | 10 | import("../../build/webrtc.gni") |
| 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) { |
zijiehe | 54fd579 | 2016-11-02 14:49:35 -0700 | [diff] [blame] | 36 | source_set("rgba_color") { |
zijiehe | 6be0a65 | 2016-10-27 16:50:35 -0700 | [diff] [blame] | 37 | testonly = true |
| 38 | |
| 39 | public_deps = [ |
| 40 | ":desktop_capture", |
| 41 | ] |
| 42 | |
| 43 | sources = [ |
| 44 | "rgba_color.cc", |
| 45 | "rgba_color.h", |
zijiehe | 54fd579 | 2016-11-02 14:49:35 -0700 | [diff] [blame] | 46 | ] |
mbonadei | f423593 | 2016-12-29 03:35:56 -0800 | [diff] [blame^] | 47 | |
| 48 | deps = [ |
| 49 | ":primitives", |
| 50 | "../..:webrtc_common", |
| 51 | ] |
zijiehe | 54fd579 | 2016-11-02 14:49:35 -0700 | [diff] [blame] | 52 | } |
| 53 | |
| 54 | source_set("screen_drawer") { |
| 55 | testonly = true |
| 56 | |
| 57 | public_deps = [ |
| 58 | ":rgba_color", |
| 59 | ] |
| 60 | |
| 61 | sources = [ |
zijiehe | 6be0a65 | 2016-10-27 16:50:35 -0700 | [diff] [blame] | 62 | "screen_drawer.cc", |
| 63 | "screen_drawer.h", |
| 64 | "screen_drawer_linux.cc", |
| 65 | "screen_drawer_mac.cc", |
| 66 | "screen_drawer_win.cc", |
| 67 | ] |
mbonadei | f423593 | 2016-12-29 03:35:56 -0800 | [diff] [blame^] | 68 | |
| 69 | deps = [ |
| 70 | ":primitives", |
| 71 | "../../base:rtc_base_approved", |
| 72 | "../../system_wrappers", |
| 73 | ] |
zijiehe | 6be0a65 | 2016-10-27 16:50:35 -0700 | [diff] [blame] | 74 | } |
zijiehe | 54fd579 | 2016-11-02 14:49:35 -0700 | [diff] [blame] | 75 | |
| 76 | source_set("desktop_capture_mock") { |
| 77 | testonly = true |
| 78 | |
| 79 | public_deps = [ |
| 80 | ":desktop_capture", |
| 81 | ":rgba_color", |
zijiehe | 372719b | 2016-11-11 17:18:34 -0800 | [diff] [blame] | 82 | "//testing/gmock", |
zijiehe | 54fd579 | 2016-11-02 14:49:35 -0700 | [diff] [blame] | 83 | ] |
| 84 | |
| 85 | sources = [ |
| 86 | "desktop_frame_generator.cc", |
| 87 | "desktop_frame_generator.h", |
zijiehe | 98903d2 | 2016-11-10 21:57:10 -0800 | [diff] [blame] | 88 | "fake_desktop_capturer.cc", |
zijiehe | 54fd579 | 2016-11-02 14:49:35 -0700 | [diff] [blame] | 89 | "fake_desktop_capturer.h", |
zijiehe | 372719b | 2016-11-11 17:18:34 -0800 | [diff] [blame] | 90 | "mock_desktop_capturer_callback.cc", |
zijiehe | 54fd579 | 2016-11-02 14:49:35 -0700 | [diff] [blame] | 91 | "mock_desktop_capturer_callback.h", |
mbonadei | f423593 | 2016-12-29 03:35:56 -0800 | [diff] [blame^] | 92 | ] |
| 93 | |
| 94 | deps = [ |
| 95 | ":primitives", |
| 96 | "../../base:rtc_base_approved", |
| 97 | "../../test:test_support", |
zijiehe | 54fd579 | 2016-11-02 14:49:35 -0700 | [diff] [blame] | 98 | ] |
| 99 | } |
zijiehe | 6be0a65 | 2016-10-27 16:50:35 -0700 | [diff] [blame] | 100 | } |
| 101 | |
kjellander | b62dbbe | 2016-09-23 00:38:52 -0700 | [diff] [blame] | 102 | rtc_static_library("desktop_capture") { |
jiayl@webrtc.org | 93426cd | 2014-07-02 15:47:12 +0000 | [diff] [blame] | 103 | sources = [ |
jiayl@webrtc.org | 0e71070 | 2014-11-11 18:15:55 +0000 | [diff] [blame] | 104 | "cropped_desktop_frame.cc", |
| 105 | "cropped_desktop_frame.h", |
| 106 | "cropping_window_capturer.cc", |
| 107 | "cropping_window_capturer.h", |
| 108 | "cropping_window_capturer_win.cc", |
jiayl@webrtc.org | 93426cd | 2014-07-02 15:47:12 +0000 | [diff] [blame] | 109 | "desktop_and_cursor_composer.cc", |
| 110 | "desktop_and_cursor_composer.h", |
Henrik Kjellander | 57e5fd2 | 2015-05-25 12:55:39 +0200 | [diff] [blame] | 111 | "desktop_capture_options.cc", |
| 112 | "desktop_capture_options.h", |
zijiehe | b68d655 | 2016-10-28 17:35:11 -0700 | [diff] [blame] | 113 | "desktop_capturer.cc", |
jiayl@webrtc.org | 93426cd | 2014-07-02 15:47:12 +0000 | [diff] [blame] | 114 | "desktop_capturer.h", |
Sergey Ulanov | 1c062bf | 2016-11-22 16:07:10 -0800 | [diff] [blame] | 115 | "desktop_capturer_differ_wrapper.cc", |
| 116 | "desktop_capturer_differ_wrapper.h", |
zijiehe | 90ea736 | 2016-11-22 17:17:09 -0800 | [diff] [blame] | 117 | "desktop_frame_rotation.cc", |
| 118 | "desktop_frame_rotation.h", |
jiayl@webrtc.org | 93426cd | 2014-07-02 15:47:12 +0000 | [diff] [blame] | 119 | "desktop_frame_win.cc", |
| 120 | "desktop_frame_win.h", |
Sergey Ulanov | 1c062bf | 2016-11-22 16:07:10 -0800 | [diff] [blame] | 121 | "differ_block.cc", |
| 122 | "differ_block.h", |
jiayl@webrtc.org | 93426cd | 2014-07-02 15:47:12 +0000 | [diff] [blame] | 123 | "mac/desktop_configuration.h", |
| 124 | "mac/desktop_configuration.mm", |
jiayl@webrtc.org | 93426cd | 2014-07-02 15:47:12 +0000 | [diff] [blame] | 125 | "mac/desktop_configuration_monitor.cc", |
Henrik Kjellander | 57e5fd2 | 2015-05-25 12:55:39 +0200 | [diff] [blame] | 126 | "mac/desktop_configuration_monitor.h", |
jiayl@webrtc.org | 12b4efe | 2014-07-08 22:05:24 +0000 | [diff] [blame] | 127 | "mac/full_screen_chrome_window_detector.cc", |
| 128 | "mac/full_screen_chrome_window_detector.h", |
jiayl@webrtc.org | 93426cd | 2014-07-02 15:47:12 +0000 | [diff] [blame] | 129 | "mac/scoped_pixel_buffer_object.cc", |
| 130 | "mac/scoped_pixel_buffer_object.h", |
jiayl@webrtc.org | 12b4efe | 2014-07-08 22:05:24 +0000 | [diff] [blame] | 131 | "mac/window_list_utils.cc", |
| 132 | "mac/window_list_utils.h", |
jiayl@webrtc.org | 93426cd | 2014-07-02 15:47:12 +0000 | [diff] [blame] | 133 | "mouse_cursor.cc", |
| 134 | "mouse_cursor.h", |
| 135 | "mouse_cursor_monitor.h", |
| 136 | "mouse_cursor_monitor_mac.mm", |
| 137 | "mouse_cursor_monitor_win.cc", |
jiayl@webrtc.org | 93426cd | 2014-07-02 15:47:12 +0000 | [diff] [blame] | 138 | "screen_capture_frame_queue.h", |
jiayl@webrtc.org | 93426cd | 2014-07-02 15:47:12 +0000 | [diff] [blame] | 139 | "screen_capturer_helper.cc", |
| 140 | "screen_capturer_helper.h", |
| 141 | "screen_capturer_mac.mm", |
| 142 | "screen_capturer_win.cc", |
jiayl@webrtc.org | 93426cd | 2014-07-02 15:47:12 +0000 | [diff] [blame] | 143 | "win/cursor.cc", |
| 144 | "win/cursor.h", |
zijiehe | 2d618de | 2016-08-08 17:50:21 -0700 | [diff] [blame] | 145 | "win/d3d_device.cc", |
| 146 | "win/d3d_device.h", |
jiayl@webrtc.org | 93426cd | 2014-07-02 15:47:12 +0000 | [diff] [blame] | 147 | "win/desktop.cc", |
| 148 | "win/desktop.h", |
zijiehe | 2d618de | 2016-08-08 17:50:21 -0700 | [diff] [blame] | 149 | "win/dxgi_adapter_duplicator.cc", |
| 150 | "win/dxgi_adapter_duplicator.h", |
| 151 | "win/dxgi_duplicator_controller.cc", |
| 152 | "win/dxgi_duplicator_controller.h", |
| 153 | "win/dxgi_output_duplicator.cc", |
| 154 | "win/dxgi_output_duplicator.h", |
| 155 | "win/dxgi_texture.cc", |
| 156 | "win/dxgi_texture.h", |
| 157 | "win/dxgi_texture_mapping.cc", |
| 158 | "win/dxgi_texture_mapping.h", |
| 159 | "win/dxgi_texture_staging.cc", |
| 160 | "win/dxgi_texture_staging.h", |
jiayl@webrtc.org | 93426cd | 2014-07-02 15:47:12 +0000 | [diff] [blame] | 161 | "win/scoped_gdi_object.h", |
| 162 | "win/scoped_thread_desktop.cc", |
| 163 | "win/scoped_thread_desktop.h", |
Henrik Kjellander | 57e5fd2 | 2015-05-25 12:55:39 +0200 | [diff] [blame] | 164 | "win/screen_capture_utils.cc", |
| 165 | "win/screen_capture_utils.h", |
zijiehe | 2970c2a | 2016-05-20 22:08:00 -0700 | [diff] [blame] | 166 | "win/screen_capturer_win_directx.cc", |
| 167 | "win/screen_capturer_win_directx.h", |
jiayl@webrtc.org | 93426cd | 2014-07-02 15:47:12 +0000 | [diff] [blame] | 168 | "win/screen_capturer_win_gdi.cc", |
| 169 | "win/screen_capturer_win_gdi.h", |
| 170 | "win/screen_capturer_win_magnifier.cc", |
| 171 | "win/screen_capturer_win_magnifier.h", |
jiayl@webrtc.org | 93426cd | 2014-07-02 15:47:12 +0000 | [diff] [blame] | 172 | "win/window_capture_utils.cc", |
| 173 | "win/window_capture_utils.h", |
jiayl@webrtc.org | 93426cd | 2014-07-02 15:47:12 +0000 | [diff] [blame] | 174 | "window_capturer_mac.mm", |
| 175 | "window_capturer_win.cc", |
| 176 | ] |
| 177 | |
| 178 | if (use_x11) { |
| 179 | sources += [ |
| 180 | "mouse_cursor_monitor_x11.cc", |
| 181 | "screen_capturer_x11.cc", |
| 182 | "window_capturer_x11.cc", |
jiayl@webrtc.org | 93426cd | 2014-07-02 15:47:12 +0000 | [diff] [blame] | 183 | "x11/shared_x_display.cc", |
Henrik Kjellander | 57e5fd2 | 2015-05-25 12:55:39 +0200 | [diff] [blame] | 184 | "x11/shared_x_display.h", |
jiayl@webrtc.org | 93426cd | 2014-07-02 15:47:12 +0000 | [diff] [blame] | 185 | "x11/x_error_trap.cc", |
| 186 | "x11/x_error_trap.h", |
| 187 | "x11/x_server_pixel_buffer.cc", |
| 188 | "x11/x_server_pixel_buffer.h", |
| 189 | ] |
Henrik Kjellander | 57e5fd2 | 2015-05-25 12:55:39 +0200 | [diff] [blame] | 190 | configs += [ "//build/config/linux:x11" ] |
jiayl@webrtc.org | 93426cd | 2014-07-02 15:47:12 +0000 | [diff] [blame] | 191 | } |
| 192 | |
| 193 | if (!is_win && !is_mac && !use_x11) { |
| 194 | sources += [ |
| 195 | "mouse_cursor_monitor_null.cc", |
| 196 | "screen_capturer_null.cc", |
| 197 | "window_capturer_null.cc", |
| 198 | ] |
| 199 | } |
| 200 | |
kjellander@webrtc.org | 556caff | 2014-12-19 13:28:37 +0000 | [diff] [blame] | 201 | if (is_mac) { |
| 202 | libs = [ |
| 203 | "AppKit.framework", |
| 204 | "IOKit.framework", |
| 205 | "OpenGL.framework", |
| 206 | ] |
| 207 | } |
| 208 | |
zijiehe | 2970c2a | 2016-05-20 22:08:00 -0700 | [diff] [blame] | 209 | if (is_win) { |
zijiehe | 2d618de | 2016-08-08 17:50:21 -0700 | [diff] [blame] | 210 | libs = [ |
| 211 | "d3d11.lib", |
| 212 | "dxgi.lib", |
| 213 | ] |
zijiehe | 2970c2a | 2016-05-20 22:08:00 -0700 | [diff] [blame] | 214 | } |
| 215 | |
andrew@webrtc.org | 6ae5a6d | 2014-09-16 01:03:29 +0000 | [diff] [blame] | 216 | deps = [ |
Sergey Ulanov | 098c1de | 2015-09-01 11:36:40 -0700 | [diff] [blame] | 217 | ":primitives", |
mbonadei | f423593 | 2016-12-29 03:35:56 -0800 | [diff] [blame^] | 218 | "../..:webrtc_common", |
kjellander | fb11424 | 2016-06-13 00:19:48 -0700 | [diff] [blame] | 219 | "../../base:rtc_base", # TODO(kjellander): Cleanup in bugs.webrtc.org/3806. |
andrew@webrtc.org | 6ae5a6d | 2014-09-16 01:03:29 +0000 | [diff] [blame] | 220 | "../../system_wrappers", |
zijiehe | 90ea736 | 2016-11-22 17:17:09 -0800 | [diff] [blame] | 221 | "//third_party/libyuv", |
andrew@webrtc.org | 6ae5a6d | 2014-09-16 01:03:29 +0000 | [diff] [blame] | 222 | ] |
jiayl@webrtc.org | 93426cd | 2014-07-02 15:47:12 +0000 | [diff] [blame] | 223 | |
| 224 | if (use_desktop_capture_differ_sse2) { |
Henrik Kjellander | 57e5fd2 | 2015-05-25 12:55:39 +0200 | [diff] [blame] | 225 | deps += [ ":desktop_capture_differ_sse2" ] |
jiayl@webrtc.org | 93426cd | 2014-07-02 15:47:12 +0000 | [diff] [blame] | 226 | } |
kjellander@webrtc.org | 1227ab8 | 2014-06-23 19:21:07 +0000 | [diff] [blame] | 227 | } |
| 228 | |
jiayl@webrtc.org | 93426cd | 2014-07-02 15:47:12 +0000 | [diff] [blame] | 229 | if (use_desktop_capture_differ_sse2) { |
| 230 | # Have to be compiled as a separate target because it needs to be compiled |
| 231 | # with SSE2 enabled. |
kjellander | b62dbbe | 2016-09-23 00:38:52 -0700 | [diff] [blame] | 232 | rtc_static_library("desktop_capture_differ_sse2") { |
brettw@chromium.org | 0867f69 | 2014-09-10 16:24:11 +0000 | [diff] [blame] | 233 | visibility = [ ":*" ] |
jiayl@webrtc.org | 93426cd | 2014-07-02 15:47:12 +0000 | [diff] [blame] | 234 | sources = [ |
zijiehe | fef8653 | 2016-09-05 15:26:32 -0700 | [diff] [blame] | 235 | "differ_vector_sse2.cc", |
| 236 | "differ_vector_sse2.h", |
jiayl@webrtc.org | 93426cd | 2014-07-02 15:47:12 +0000 | [diff] [blame] | 237 | ] |
| 238 | |
ehmaldonado | 90920d5 | 2016-08-16 04:13:01 -0700 | [diff] [blame] | 239 | if (is_posix) { |
Henrik Kjellander | 57e5fd2 | 2015-05-25 12:55:39 +0200 | [diff] [blame] | 240 | cflags = [ "-msse2" ] |
jiayl@webrtc.org | 93426cd | 2014-07-02 15:47:12 +0000 | [diff] [blame] | 241 | } |
kjellander@webrtc.org | 1227ab8 | 2014-06-23 19:21:07 +0000 | [diff] [blame] | 242 | } |
| 243 | } |