blob: 5529537f5f3550e25aa222fc7f4d8868c9a1f370 [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) {
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
kjellanderb62dbbe2016-09-23 00:38:52 -070053rtc_static_library("desktop_capture") {
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +000054 sources = [
jiayl@webrtc.org0e710702014-11-11 18:15:55 +000055 "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.org93426cd2014-07-02 15:47:12 +000060 "desktop_and_cursor_composer.cc",
61 "desktop_and_cursor_composer.h",
Henrik Kjellander57e5fd22015-05-25 12:55:39 +020062 "desktop_capture_options.cc",
63 "desktop_capture_options.h",
zijieheb68d6552016-10-28 17:35:11 -070064 "desktop_capturer.cc",
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +000065 "desktop_capturer.h",
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +000066 "desktop_frame_win.cc",
67 "desktop_frame_win.h",
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +000068 "mac/desktop_configuration.h",
69 "mac/desktop_configuration.mm",
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +000070 "mac/desktop_configuration_monitor.cc",
Henrik Kjellander57e5fd22015-05-25 12:55:39 +020071 "mac/desktop_configuration_monitor.h",
jiayl@webrtc.org12b4efe2014-07-08 22:05:24 +000072 "mac/full_screen_chrome_window_detector.cc",
73 "mac/full_screen_chrome_window_detector.h",
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +000074 "mac/scoped_pixel_buffer_object.cc",
75 "mac/scoped_pixel_buffer_object.h",
jiayl@webrtc.org12b4efe2014-07-08 22:05:24 +000076 "mac/window_list_utils.cc",
77 "mac/window_list_utils.h",
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +000078 "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.org93426cd2014-07-02 15:47:12 +000083 "screen_capture_frame_queue.h",
zijieheb68d6552016-10-28 17:35:11 -070084 "screen_capturer.cc",
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +000085 "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.org93426cd2014-07-02 15:47:12 +000090 "shared_memory.cc",
91 "shared_memory.h",
92 "win/cursor.cc",
93 "win/cursor.h",
zijiehe2d618de2016-08-08 17:50:21 -070094 "win/d3d_device.cc",
95 "win/d3d_device.h",
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +000096 "win/desktop.cc",
97 "win/desktop.h",
zijiehe2d618de2016-08-08 17:50:21 -070098 "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.org93426cd2014-07-02 15:47:12 +0000110 "win/scoped_gdi_object.h",
111 "win/scoped_thread_desktop.cc",
112 "win/scoped_thread_desktop.h",
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200113 "win/screen_capture_utils.cc",
114 "win/screen_capture_utils.h",
zijiehe2970c2a2016-05-20 22:08:00 -0700115 "win/screen_capturer_win_directx.cc",
116 "win/screen_capturer_win_directx.h",
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +0000117 "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.org93426cd2014-07-02 15:47:12 +0000121 "win/window_capture_utils.cc",
122 "win/window_capture_utils.h",
zijieheb68d6552016-10-28 17:35:11 -0700123 "window_capturer.cc",
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +0000124 "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.org93426cd2014-07-02 15:47:12 +0000134 "x11/shared_x_display.cc",
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200135 "x11/shared_x_display.h",
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +0000136 "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 Kjellander57e5fd22015-05-25 12:55:39 +0200141 configs += [ "//build/config/linux:x11" ]
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +0000142 }
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
kjellander131c9582016-08-30 04:23:58 -0700152 if (!is_ios) {
153 sources += [
kjellander131c9582016-08-30 04:23:58 -0700154 "differ_block.cc",
155 "differ_block.h",
zijiehefef86532016-09-05 15:26:32 -0700156 "screen_capturer_differ_wrapper.cc",
157 "screen_capturer_differ_wrapper.h",
kjellander131c9582016-08-30 04:23:58 -0700158 ]
159 }
160
kjellander@webrtc.org556caff2014-12-19 13:28:37 +0000161 if (is_mac) {
162 libs = [
163 "AppKit.framework",
164 "IOKit.framework",
165 "OpenGL.framework",
166 ]
167 }
168
zijiehe2970c2a2016-05-20 22:08:00 -0700169 if (is_win) {
zijiehe2d618de2016-08-08 17:50:21 -0700170 libs = [
171 "d3d11.lib",
172 "dxgi.lib",
173 ]
zijiehe2970c2a2016-05-20 22:08:00 -0700174 }
175
andrew@webrtc.org6ae5a6d2014-09-16 01:03:29 +0000176 deps = [
Sergey Ulanov098c1de2015-09-01 11:36:40 -0700177 ":primitives",
kjellanderfb114242016-06-13 00:19:48 -0700178 "../../base:rtc_base", # TODO(kjellander): Cleanup in bugs.webrtc.org/3806.
andrew@webrtc.org6ae5a6d2014-09-16 01:03:29 +0000179 "../../system_wrappers",
andrew@webrtc.org6ae5a6d2014-09-16 01:03:29 +0000180 ]
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +0000181
182 if (use_desktop_capture_differ_sse2) {
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200183 deps += [ ":desktop_capture_differ_sse2" ]
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +0000184 }
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +0000185}
186
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +0000187if (use_desktop_capture_differ_sse2) {
188 # Have to be compiled as a separate target because it needs to be compiled
189 # with SSE2 enabled.
kjellanderb62dbbe2016-09-23 00:38:52 -0700190 rtc_static_library("desktop_capture_differ_sse2") {
brettw@chromium.org0867f692014-09-10 16:24:11 +0000191 visibility = [ ":*" ]
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +0000192 sources = [
zijiehefef86532016-09-05 15:26:32 -0700193 "differ_vector_sse2.cc",
194 "differ_vector_sse2.h",
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +0000195 ]
196
ehmaldonado90920d52016-08-16 04:13:01 -0700197 if (is_posix) {
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200198 cflags = [ "-msse2" ]
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +0000199 }
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +0000200 }
201}