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