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