blob: ebf337d055f3320284376def944717c8e9899cef [file] [log] [blame]
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +00001# 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.org93426cd2014-07-02 15:47:12 +00009import("//build/config/ui.gni")
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +000010import("../../build/webrtc.gni")
11
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +000012use_desktop_capture_differ_sse2 =
Henrik Kjellander57e5fd22015-05-25 12:55:39 +020013 !is_ios && (current_cpu == "x86" || current_cpu == "x64")
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +000014
kjellanderb62dbbe2016-09-23 00:38:52 -070015rtc_static_library("primitives") {
Sergey Ulanov098c1de2015-09-01 11:36:40 -070016 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 Ulanov58000a02016-10-20 09:33:52 -070024 "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 Ulanov098c1de2015-09-01 11:36:40 -070030 ]
Sergey Ulanov098c1de2015-09-01 11:36:40 -070031}
32
zijiehe6be0a652016-10-27 16:50:35 -070033if (rtc_include_tests) {
zijiehe54fd5792016-11-02 14:49:35 -070034 source_set("rgba_color") {
zijiehe6be0a652016-10-27 16:50:35 -070035 testonly = true
36
37 public_deps = [
38 ":desktop_capture",
39 ]
40
41 sources = [
42 "rgba_color.cc",
43 "rgba_color.h",
zijiehe54fd5792016-11-02 14:49:35 -070044 ]
45 }
46
47 source_set("screen_drawer") {
48 testonly = true
49
50 public_deps = [
51 ":rgba_color",
52 ]
53
54 sources = [
zijiehe6be0a652016-10-27 16:50:35 -070055 "screen_drawer.cc",
56 "screen_drawer.h",
57 "screen_drawer_linux.cc",
58 "screen_drawer_mac.cc",
59 "screen_drawer_win.cc",
60 ]
61 }
zijiehe54fd5792016-11-02 14:49:35 -070062
63 source_set("desktop_capture_mock") {
64 testonly = true
65
66 public_deps = [
67 ":desktop_capture",
68 ":rgba_color",
69 ]
70
71 sources = [
72 "desktop_frame_generator.cc",
73 "desktop_frame_generator.h",
zijiehe98903d22016-11-10 21:57:10 -080074 "fake_desktop_capturer.cc",
zijiehe54fd5792016-11-02 14:49:35 -070075 "fake_desktop_capturer.h",
zijiehe54fd5792016-11-02 14:49:35 -070076 "mock_desktop_capturer_callback.h",
77 "screen_capturer_mock_objects.h",
78 ]
79 }
zijiehe6be0a652016-10-27 16:50:35 -070080}
81
kjellanderb62dbbe2016-09-23 00:38:52 -070082rtc_static_library("desktop_capture") {
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +000083 sources = [
jiayl@webrtc.org0e710702014-11-11 18:15:55 +000084 "cropped_desktop_frame.cc",
85 "cropped_desktop_frame.h",
86 "cropping_window_capturer.cc",
87 "cropping_window_capturer.h",
88 "cropping_window_capturer_win.cc",
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +000089 "desktop_and_cursor_composer.cc",
90 "desktop_and_cursor_composer.h",
Henrik Kjellander57e5fd22015-05-25 12:55:39 +020091 "desktop_capture_options.cc",
92 "desktop_capture_options.h",
zijieheb68d6552016-10-28 17:35:11 -070093 "desktop_capturer.cc",
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +000094 "desktop_capturer.h",
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +000095 "desktop_frame_win.cc",
96 "desktop_frame_win.h",
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +000097 "mac/desktop_configuration.h",
98 "mac/desktop_configuration.mm",
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +000099 "mac/desktop_configuration_monitor.cc",
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200100 "mac/desktop_configuration_monitor.h",
jiayl@webrtc.org12b4efe2014-07-08 22:05:24 +0000101 "mac/full_screen_chrome_window_detector.cc",
102 "mac/full_screen_chrome_window_detector.h",
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +0000103 "mac/scoped_pixel_buffer_object.cc",
104 "mac/scoped_pixel_buffer_object.h",
jiayl@webrtc.org12b4efe2014-07-08 22:05:24 +0000105 "mac/window_list_utils.cc",
106 "mac/window_list_utils.h",
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +0000107 "mouse_cursor.cc",
108 "mouse_cursor.h",
109 "mouse_cursor_monitor.h",
110 "mouse_cursor_monitor_mac.mm",
111 "mouse_cursor_monitor_win.cc",
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +0000112 "screen_capture_frame_queue.h",
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +0000113 "screen_capturer_helper.cc",
114 "screen_capturer_helper.h",
115 "screen_capturer_mac.mm",
116 "screen_capturer_win.cc",
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +0000117 "shared_memory.cc",
118 "shared_memory.h",
119 "win/cursor.cc",
120 "win/cursor.h",
zijiehe2d618de2016-08-08 17:50:21 -0700121 "win/d3d_device.cc",
122 "win/d3d_device.h",
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +0000123 "win/desktop.cc",
124 "win/desktop.h",
zijiehe2d618de2016-08-08 17:50:21 -0700125 "win/dxgi_adapter_duplicator.cc",
126 "win/dxgi_adapter_duplicator.h",
127 "win/dxgi_duplicator_controller.cc",
128 "win/dxgi_duplicator_controller.h",
129 "win/dxgi_output_duplicator.cc",
130 "win/dxgi_output_duplicator.h",
131 "win/dxgi_texture.cc",
132 "win/dxgi_texture.h",
133 "win/dxgi_texture_mapping.cc",
134 "win/dxgi_texture_mapping.h",
135 "win/dxgi_texture_staging.cc",
136 "win/dxgi_texture_staging.h",
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +0000137 "win/scoped_gdi_object.h",
138 "win/scoped_thread_desktop.cc",
139 "win/scoped_thread_desktop.h",
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200140 "win/screen_capture_utils.cc",
141 "win/screen_capture_utils.h",
zijiehe2970c2a2016-05-20 22:08:00 -0700142 "win/screen_capturer_win_directx.cc",
143 "win/screen_capturer_win_directx.h",
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +0000144 "win/screen_capturer_win_gdi.cc",
145 "win/screen_capturer_win_gdi.h",
146 "win/screen_capturer_win_magnifier.cc",
147 "win/screen_capturer_win_magnifier.h",
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +0000148 "win/window_capture_utils.cc",
149 "win/window_capture_utils.h",
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +0000150 "window_capturer_mac.mm",
151 "window_capturer_win.cc",
152 ]
153
154 if (use_x11) {
155 sources += [
156 "mouse_cursor_monitor_x11.cc",
157 "screen_capturer_x11.cc",
158 "window_capturer_x11.cc",
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +0000159 "x11/shared_x_display.cc",
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200160 "x11/shared_x_display.h",
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +0000161 "x11/x_error_trap.cc",
162 "x11/x_error_trap.h",
163 "x11/x_server_pixel_buffer.cc",
164 "x11/x_server_pixel_buffer.h",
165 ]
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200166 configs += [ "//build/config/linux:x11" ]
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +0000167 }
168
169 if (!is_win && !is_mac && !use_x11) {
170 sources += [
171 "mouse_cursor_monitor_null.cc",
172 "screen_capturer_null.cc",
173 "window_capturer_null.cc",
174 ]
175 }
176
kjellander131c9582016-08-30 04:23:58 -0700177 if (!is_ios) {
178 sources += [
zijiehe54fd5792016-11-02 14:49:35 -0700179 "desktop_capturer_differ_wrapper.cc",
180 "desktop_capturer_differ_wrapper.h",
kjellander131c9582016-08-30 04:23:58 -0700181 "differ_block.cc",
182 "differ_block.h",
183 ]
184 }
185
kjellander@webrtc.org556caff2014-12-19 13:28:37 +0000186 if (is_mac) {
187 libs = [
188 "AppKit.framework",
189 "IOKit.framework",
190 "OpenGL.framework",
191 ]
192 }
193
zijiehe2970c2a2016-05-20 22:08:00 -0700194 if (is_win) {
zijiehe2d618de2016-08-08 17:50:21 -0700195 libs = [
196 "d3d11.lib",
197 "dxgi.lib",
198 ]
zijiehe2970c2a2016-05-20 22:08:00 -0700199 }
200
andrew@webrtc.org6ae5a6d2014-09-16 01:03:29 +0000201 deps = [
Sergey Ulanov098c1de2015-09-01 11:36:40 -0700202 ":primitives",
kjellanderfb114242016-06-13 00:19:48 -0700203 "../../base:rtc_base", # TODO(kjellander): Cleanup in bugs.webrtc.org/3806.
andrew@webrtc.org6ae5a6d2014-09-16 01:03:29 +0000204 "../../system_wrappers",
andrew@webrtc.org6ae5a6d2014-09-16 01:03:29 +0000205 ]
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +0000206
207 if (use_desktop_capture_differ_sse2) {
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200208 deps += [ ":desktop_capture_differ_sse2" ]
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +0000209 }
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +0000210}
211
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +0000212if (use_desktop_capture_differ_sse2) {
213 # Have to be compiled as a separate target because it needs to be compiled
214 # with SSE2 enabled.
kjellanderb62dbbe2016-09-23 00:38:52 -0700215 rtc_static_library("desktop_capture_differ_sse2") {
brettw@chromium.org0867f692014-09-10 16:24:11 +0000216 visibility = [ ":*" ]
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +0000217 sources = [
zijiehefef86532016-09-05 15:26:32 -0700218 "differ_vector_sse2.cc",
219 "differ_vector_sse2.h",
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +0000220 ]
221
ehmaldonado90920d52016-08-16 04:13:01 -0700222 if (is_posix) {
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200223 cflags = [ "-msse2" ]
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +0000224 }
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +0000225 }
226}