blob: e2554d2eec8b5d4d971f744abdccff96a9d6895e [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
Tomas Popela318da512018-11-13 06:32:23 +01009import("//build/config/linux/pkg_config.gni")
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +000010import("//build/config/ui.gni")
Tomas Popela762543f2018-12-12 14:37:51 +010011import("//tools/generate_stubs/rules.gni")
mbonadei9aa3f0a2017-01-24 06:58:22 -080012import("../../webrtc.gni")
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +000013
Sergey Ulanov1c062bf2016-11-22 16:07:10 -080014use_desktop_capture_differ_sse2 = current_cpu == "x86" || current_cpu == "x64"
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +000015
Patrik Höglund0808a8c2019-12-12 11:20:07 +010016config("x11_config") {
17 if (rtc_use_x11_extensions) {
18 defines = [ "WEBRTC_USE_X11" ]
19 }
20}
21
Mirko Bonadei86d053c2019-10-17 21:32:04 +020022rtc_library("primitives") {
Per Kjellandera7f2d842018-01-10 15:54:53 +000023 visibility = [ "*" ]
Sergey Ulanov098c1de2015-09-01 11:36:40 -070024 sources = [
25 "desktop_capture_types.h",
26 "desktop_frame.cc",
27 "desktop_frame.h",
28 "desktop_geometry.cc",
29 "desktop_geometry.h",
30 "desktop_region.cc",
31 "desktop_region.h",
Sergey Ulanov58000a02016-10-20 09:33:52 -070032 "shared_desktop_frame.cc",
33 "shared_desktop_frame.h",
mbonadeif4235932016-12-29 03:35:56 -080034 "shared_memory.cc",
35 "shared_memory.h",
Sergey Ulanov58000a02016-10-20 09:33:52 -070036 ]
37
38 deps = [
Mirko Bonadeid9708072019-01-25 20:26:48 +010039 "../../api:scoped_refptr",
Patrik Höglunda8005cf2017-12-13 16:05:42 +010040 "../../rtc_base:checks",
Mirko Bonadei3d255302018-10-11 10:50:45 +020041 "../../rtc_base/system:rtc_export",
Sergey Ulanov098c1de2015-09-01 11:36:40 -070042 ]
Dan Minor9c686132018-01-15 10:20:00 -050043
44 if (!build_with_mozilla) {
Artem Titov94b57c02019-03-21 13:35:10 +010045 deps += [ "../../rtc_base" ] # TODO(kjellander): Cleanup in bugs.webrtc.org/3806.
Dan Minor9c686132018-01-15 10:20:00 -050046 }
Sergey Ulanov098c1de2015-09-01 11:36:40 -070047}
48
zijiehe6be0a652016-10-27 16:50:35 -070049if (rtc_include_tests) {
Mirko Bonadei86d053c2019-10-17 21:32:04 +020050 rtc_library("desktop_capture_modules_tests") {
ehmaldonado9cbb0a12017-01-30 03:07:03 -080051 testonly = true
kjellandere0629c02017-04-25 04:04:50 -070052
Patrik Höglund0808a8c2019-12-12 11:20:07 +010053 defines = []
ehmaldonado9cbb0a12017-01-30 03:07:03 -080054 sources = []
Patrik Höglunda8005cf2017-12-13 16:05:42 +010055 deps = [
Artem Titov741daaf2019-03-21 14:37:36 +010056 "../../api:function_view",
Mirko Bonadeid9708072019-01-25 20:26:48 +010057 "../../api:scoped_refptr",
Patrik Höglunda8005cf2017-12-13 16:05:42 +010058 "../../rtc_base:checks",
59 ]
ehmaldonado9cbb0a12017-01-30 03:07:03 -080060 if (rtc_desktop_capture_supported) {
61 deps += [
62 ":desktop_capture_mock",
63 ":primitives",
64 ":screen_drawer",
Artem Titov94b57c02019-03-21 13:35:10 +010065 "../../rtc_base",
ehmaldonadof6a861a2017-07-19 10:40:47 -070066 "../../rtc_base:rtc_base_approved",
Artem Titova76af0c2018-07-23 17:38:12 +020067 "../../rtc_base/third_party/base64",
zijieheccf57a72017-03-03 14:40:15 -080068 "../../system_wrappers",
ehmaldonado9cbb0a12017-01-30 03:07:03 -080069 "../../test:test_support",
ehmaldonado656610f2017-02-06 02:21:11 -080070 "../../test:video_test_support",
ehmaldonado9cbb0a12017-01-30 03:07:03 -080071 ]
72 sources += [
73 "screen_capturer_integration_test.cc",
74 "screen_drawer_unittest.cc",
Zijie He77b7a1d2017-09-01 15:51:14 -070075 "window_finder_unittest.cc",
ehmaldonado9cbb0a12017-01-30 03:07:03 -080076 ]
Patrik Höglund0808a8c2019-12-12 11:20:07 +010077 public_configs = [ ":x11_config" ]
ehmaldonado9cbb0a12017-01-30 03:07:03 -080078 }
79 }
80
Mirko Bonadei86d053c2019-10-17 21:32:04 +020081 rtc_library("desktop_capture_unittests") {
ehmaldonado36268652017-01-19 08:27:11 -080082 testonly = true
kjellandere0629c02017-04-25 04:04:50 -070083
Patrik Höglund0808a8c2019-12-12 11:20:07 +010084 defines = []
ehmaldonado0d729b32017-02-10 01:38:23 -080085 sources = [
zijieheccf57a72017-03-03 14:40:15 -080086 "blank_detector_desktop_capturer_wrapper_unittest.cc",
Zijie He05ec1782017-09-06 14:09:20 -070087 "cropped_desktop_frame_unittest.cc",
ehmaldonado0d729b32017-02-10 01:38:23 -080088 "desktop_and_cursor_composer_unittest.cc",
89 "desktop_capturer_differ_wrapper_unittest.cc",
90 "desktop_frame_rotation_unittest.cc",
Bryan Fergusone8ef87b2019-08-20 17:12:52 -070091 "desktop_frame_unittest.cc",
zijiehe8eef7aa2017-05-18 12:27:16 -070092 "desktop_geometry_unittest.cc",
ehmaldonado0d729b32017-02-10 01:38:23 -080093 "desktop_region_unittest.cc",
94 "differ_block_unittest.cc",
zijiehe8fefe982017-02-17 14:32:04 -080095 "fallback_desktop_capturer_wrapper_unittest.cc",
ehmaldonado0d729b32017-02-10 01:38:23 -080096 "mouse_cursor_monitor_unittest.cc",
97 "rgba_color_unittest.cc",
98 "test_utils.cc",
99 "test_utils.h",
100 "test_utils_unittest.cc",
ehmaldonado0d729b32017-02-10 01:38:23 -0800101 ]
Mirko Bonadei470b2d52019-10-29 19:39:17 +0100102 if (is_win) {
103 sources += [
104 "win/cursor_unittest.cc",
105 "win/cursor_unittest_resources.h",
106 "win/cursor_unittest_resources.rc",
107 "win/screen_capture_utils_unittest.cc",
108 "win/screen_capturer_win_directx_unittest.cc",
109 ]
110 }
ehmaldonado0d729b32017-02-10 01:38:23 -0800111 deps = [
112 ":desktop_capture",
113 ":desktop_capture_mock",
114 ":primitives",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100115 "../../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700116 "../../rtc_base:rtc_base_approved",
Mirko Bonadeia498ae82017-12-06 09:17:14 +0100117 "../../system_wrappers:cpu_features_api",
ehmaldonado0d729b32017-02-10 01:38:23 -0800118 "../../test:test_support",
ehmaldonado0d729b32017-02-10 01:38:23 -0800119 ]
ehmaldonado36268652017-01-19 08:27:11 -0800120 if (rtc_desktop_capture_supported) {
121 sources += [
ehmaldonado36268652017-01-19 08:27:11 -0800122 "screen_capturer_helper_unittest.cc",
123 "screen_capturer_mac_unittest.cc",
124 "screen_capturer_unittest.cc",
ehmaldonado36268652017-01-19 08:27:11 -0800125 "window_capturer_unittest.cc",
126 ]
127 deps += [ ":desktop_capture_mock" ]
Patrik Höglund0808a8c2019-12-12 11:20:07 +0100128 public_configs = [ ":x11_config" ]
ehmaldonado36268652017-01-19 08:27:11 -0800129 }
ehmaldonado36268652017-01-19 08:27:11 -0800130 }
131
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200132 rtc_library("screen_drawer") {
perkj528a8342017-03-03 00:01:48 -0800133 testonly = true
134
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +0100135 public_deps = [ ":desktop_capture" ] # no-presubmit-check TODO(webrtc:8603)
perkj528a8342017-03-03 00:01:48 -0800136
137 sources = [
zijiehe6be0a652016-10-27 16:50:35 -0700138 "screen_drawer.cc",
139 "screen_drawer.h",
zijiehe6be0a652016-10-27 16:50:35 -0700140 ]
mbonadeif4235932016-12-29 03:35:56 -0800141
Mirko Bonadei470b2d52019-10-29 19:39:17 +0100142 if (is_linux) {
143 sources += [ "screen_drawer_linux.cc" ]
144 }
145
146 if (is_mac) {
147 sources += [ "screen_drawer_mac.cc" ]
148 }
149
150 if (is_win) {
151 sources += [ "screen_drawer_win.cc" ]
152 }
153
mbonadeif4235932016-12-29 03:35:56 -0800154 deps = [
155 ":primitives",
Mirko Bonadeid9708072019-01-25 20:26:48 +0100156 "../../api:scoped_refptr",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100157 "../../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700158 "../../rtc_base:rtc_base_approved",
mbonadeif4235932016-12-29 03:35:56 -0800159 "../../system_wrappers",
160 ]
Fabrice de Gans-Riberi450cdf32018-04-17 12:56:01 -0700161
162 if (is_posix || is_fuchsia) {
163 sources += [
164 "screen_drawer_lock_posix.cc",
165 "screen_drawer_lock_posix.h",
166 ]
167 }
zijiehe6be0a652016-10-27 16:50:35 -0700168 }
zijiehe54fd5792016-11-02 14:49:35 -0700169
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200170 rtc_library("desktop_capture_mock") {
zijiehe54fd5792016-11-02 14:49:35 -0700171 testonly = true
172
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +0100173 public_deps = [ ":desktop_capture" ] # no-presubmit-check TODO(webrtc:8603)
zijiehe54fd5792016-11-02 14:49:35 -0700174
175 sources = [
zijiehe372719b2016-11-11 17:18:34 -0800176 "mock_desktop_capturer_callback.cc",
zijiehe54fd5792016-11-02 14:49:35 -0700177 "mock_desktop_capturer_callback.h",
mbonadeif4235932016-12-29 03:35:56 -0800178 ]
179
180 deps = [
181 ":primitives",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700182 "../../rtc_base:rtc_base_approved",
mbonadeif4235932016-12-29 03:35:56 -0800183 "../../test:test_support",
zijiehe54fd5792016-11-02 14:49:35 -0700184 ]
185 }
zijiehe6be0a652016-10-27 16:50:35 -0700186}
187
Tomas Popela318da512018-11-13 06:32:23 +0100188if (is_linux) {
189 if (rtc_use_pipewire) {
Tomas Popela318da512018-11-13 06:32:23 +0100190 pkg_config("gio") {
191 packages = [
192 "gio-2.0",
193 "gio-unix-2.0",
194 ]
195 }
Tomas Popela762543f2018-12-12 14:37:51 +0100196
197 if (rtc_link_pipewire) {
198 pkg_config("pipewire") {
199 packages = [ "libpipewire-0.2" ]
200 }
201 } else {
202 # When libpipewire is not directly linked, use stubs to allow for dlopening of
203 # the binary.
204 generate_stubs("pipewire_stubs") {
205 configs = [ "../../:common_config" ]
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +0100206 deps = [ "../../rtc_base" ]
Tomas Popela762543f2018-12-12 14:37:51 +0100207 extra_header = "linux/pipewire_stub_header.fragment"
208 logging_function = "RTC_LOG(LS_VERBOSE)"
209 logging_include = "rtc_base/logging.h"
210 output_name = "linux/pipewire_stubs"
211 path_from_source = "modules/desktop_capture/linux"
212 sigs = [ "linux/pipewire.sigs" ]
213 }
214 }
215
216 config("pipewire_config") {
217 defines = [ "WEBRTC_USE_PIPEWIRE" ]
218 if (!rtc_link_pipewire) {
219 defines += [ "WEBRTC_DLOPEN_PIPEWIRE" ]
220 }
221 }
Tomas Popela318da512018-11-13 06:32:23 +0100222 }
223}
224
mbonadei13b98822017-08-30 07:24:43 -0700225rtc_source_set("desktop_capture") {
Per Kjellandera7f2d842018-01-10 15:54:53 +0000226 visibility = [ "*" ]
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +0100227 public_deps = [ ":desktop_capture_generic" ] # no-presubmit-check TODO(webrtc:8603)
mbonadei13b98822017-08-30 07:24:43 -0700228 if (is_mac) {
mbonadeiedb84292017-09-04 07:58:29 -0700229 public_deps += [ ":desktop_capture_objc" ]
mbonadei13b98822017-08-30 07:24:43 -0700230 }
231}
232
233if (is_mac) {
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200234 rtc_library("desktop_capture_objc") {
mbonadeiedb84292017-09-04 07:58:29 -0700235 visibility = [ ":desktop_capture" ]
mbonadei13b98822017-08-30 07:24:43 -0700236 sources = [
237 "mac/desktop_configuration.mm",
Julien Isorcec0719ce2018-03-29 22:35:44 +0100238 "mac/desktop_frame_cgimage.h",
239 "mac/desktop_frame_cgimage.mm",
Julien Isorce1c4bbba2018-04-09 15:57:55 -0700240 "mac/desktop_frame_iosurface.h",
241 "mac/desktop_frame_iosurface.mm",
242 "mac/desktop_frame_provider.h",
243 "mac/desktop_frame_provider.mm",
Julien Isorce370228c2018-03-27 08:39:11 +0100244 "mac/screen_capturer_mac.h",
245 "mac/screen_capturer_mac.mm",
mbonadei13b98822017-08-30 07:24:43 -0700246 "mouse_cursor_monitor_mac.mm",
Julien Isorce370228c2018-03-27 08:39:11 +0100247 "screen_capturer_darwin.mm",
mbonadei13b98822017-08-30 07:24:43 -0700248 "window_capturer_mac.mm",
Mirko Bonadei080832e2017-09-19 15:44:23 +0200249 "window_finder_mac.h",
250 "window_finder_mac.mm",
mbonadei13b98822017-08-30 07:24:43 -0700251 ]
mbonadei13b98822017-08-30 07:24:43 -0700252 deps = [
mbonadeiedb84292017-09-04 07:58:29 -0700253 ":desktop_capture_generic",
mbonadei13b98822017-08-30 07:24:43 -0700254 ":primitives",
Mirko Bonadeid9708072019-01-25 20:26:48 +0100255 "../../api:scoped_refptr",
Artem Titov94b57c02019-03-21 13:35:10 +0100256 "../../rtc_base",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100257 "../../rtc_base:checks",
mbonadei13b98822017-08-30 07:24:43 -0700258 "../../rtc_base:rtc_base_approved",
Julien Isorce1c4bbba2018-04-09 15:57:55 -0700259 "../../rtc_base/synchronization:rw_lock_wrapper",
Mirko Bonadeic66e0042019-10-18 09:52:22 +0200260 "../../rtc_base/system:rtc_export",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200261 "../../sdk:helpers_objc",
mbonadei13b98822017-08-30 07:24:43 -0700262 ]
263 libs = [
264 "AppKit.framework",
265 "IOKit.framework",
Julien Isorce1c4bbba2018-04-09 15:57:55 -0700266 "IOSurface.framework",
mbonadei13b98822017-08-30 07:24:43 -0700267 ]
268 }
269}
270
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200271rtc_library("desktop_capture_generic") {
Patrik Höglund0808a8c2019-12-12 11:20:07 +0100272 defines = []
273 public_configs = [ ":x11_config" ]
mbonadeiedb84292017-09-04 07:58:29 -0700274 visibility = [
275 ":desktop_capture",
276 ":desktop_capture_objc",
277 ]
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +0000278 sources = [
zijieheccf57a72017-03-03 14:40:15 -0800279 "blank_detector_desktop_capturer_wrapper.cc",
280 "blank_detector_desktop_capturer_wrapper.h",
Zijie Hea7567a92017-09-15 09:12:25 -0700281 "capture_result_desktop_capturer_wrapper.cc",
282 "capture_result_desktop_capturer_wrapper.h",
jiayl@webrtc.org0e710702014-11-11 18:15:55 +0000283 "cropped_desktop_frame.cc",
284 "cropped_desktop_frame.h",
285 "cropping_window_capturer.cc",
286 "cropping_window_capturer.h",
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +0000287 "desktop_and_cursor_composer.cc",
288 "desktop_and_cursor_composer.h",
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200289 "desktop_capture_options.cc",
290 "desktop_capture_options.h",
zijieheb68d6552016-10-28 17:35:11 -0700291 "desktop_capturer.cc",
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +0000292 "desktop_capturer.h",
Sergey Ulanov1c062bf2016-11-22 16:07:10 -0800293 "desktop_capturer_differ_wrapper.cc",
294 "desktop_capturer_differ_wrapper.h",
Zijie Hea7567a92017-09-15 09:12:25 -0700295 "desktop_capturer_wrapper.cc",
296 "desktop_capturer_wrapper.h",
braveyao99206df2017-11-27 12:15:53 -0800297 "desktop_frame_generator.cc",
298 "desktop_frame_generator.h",
zijiehe90ea7362016-11-22 17:17:09 -0800299 "desktop_frame_rotation.cc",
300 "desktop_frame_rotation.h",
Sergey Ulanov1c062bf2016-11-22 16:07:10 -0800301 "differ_block.cc",
302 "differ_block.h",
braveyao99206df2017-11-27 12:15:53 -0800303 "fake_desktop_capturer.cc",
304 "fake_desktop_capturer.h",
zijiehe8fefe982017-02-17 14:32:04 -0800305 "fallback_desktop_capturer_wrapper.cc",
306 "fallback_desktop_capturer_wrapper.h",
Roman Gaiub5883532019-10-07 11:57:01 -0700307 "full_screen_application_handler.cc",
308 "full_screen_application_handler.h",
309 "full_screen_window_detector.cc",
310 "full_screen_window_detector.h",
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +0000311 "mouse_cursor.cc",
312 "mouse_cursor.h",
313 "mouse_cursor_monitor.h",
Zijie He7e1c24c2017-07-27 18:06:12 -0700314 "resolution_tracker.cc",
315 "resolution_tracker.h",
zijieheccf57a72017-03-03 14:40:15 -0800316 "rgba_color.cc",
317 "rgba_color.h",
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +0000318 "screen_capture_frame_queue.h",
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +0000319 "screen_capturer_helper.cc",
320 "screen_capturer_helper.h",
Zijie He411582b2017-11-06 16:40:51 -0800321 "window_finder.cc",
Zijie He70fbbad2017-08-15 15:45:00 -0700322 "window_finder.h",
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +0000323 ]
324
Mirko Bonadei470b2d52019-10-29 19:39:17 +0100325 if (is_mac) {
326 sources += [
327 "mac/desktop_configuration.h",
328 "mac/desktop_configuration_monitor.cc",
329 "mac/desktop_configuration_monitor.h",
Roman Gaiub5883532019-10-07 11:57:01 -0700330 "mac/full_screen_mac_application_handler.cc",
331 "mac/full_screen_mac_application_handler.h",
Mirko Bonadei470b2d52019-10-29 19:39:17 +0100332 "mac/window_list_utils.cc",
333 "mac/window_list_utils.h",
334 ]
335 }
336
Dan Minor9c686132018-01-15 10:20:00 -0500337 if (build_with_mozilla) {
338 sources += [
Dan Minor9c686132018-01-15 10:20:00 -0500339 "desktop_device_info.cc",
340 "desktop_device_info.h",
Dan Minor9c686132018-01-15 10:20:00 -0500341 ]
Mirko Bonadei470b2d52019-10-29 19:39:17 +0100342 if (is_win) {
343 sources += [
344 "app_capturer_win.cc",
345 "win/desktop_device_info_win.cc",
346 "win/win_shared.cc",
347 ]
348 }
Dan Minor9c686132018-01-15 10:20:00 -0500349 }
350
Oleh Prypin240b8932019-06-07 13:27:07 +0200351 if (rtc_use_x11_extensions || rtc_use_pipewire) {
Tomas Popela318da512018-11-13 06:32:23 +0100352 sources += [
353 "mouse_cursor_monitor_linux.cc",
354 "screen_capturer_linux.cc",
355 "window_capturer_linux.cc",
356 ]
357
Mirko Bonadei470b2d52019-10-29 19:39:17 +0100358 if (build_with_mozilla && is_linux) {
359 sources += [
360 "app_capturer_linux.cc",
361 "linux/app_capturer_x11.cc",
362 "linux/desktop_device_info_linux.cc",
363 "linux/desktop_device_info_linux.h",
364 "linux/shared_x_util.cc",
365 "linux/shared_x_util.h",
366 ]
Tomas Popela318da512018-11-13 06:32:23 +0100367 }
368 }
369
Oleh Prypin240b8932019-06-07 13:27:07 +0200370 if (rtc_use_x11_extensions) {
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +0000371 sources += [
Tomas Popela318da512018-11-13 06:32:23 +0100372 "linux/mouse_cursor_monitor_x11.cc",
373 "linux/mouse_cursor_monitor_x11.h",
374 "linux/screen_capturer_x11.cc",
375 "linux/screen_capturer_x11.h",
376 "linux/shared_x_display.cc",
377 "linux/shared_x_display.h",
378 "linux/window_capturer_x11.cc",
379 "linux/window_capturer_x11.h",
380 "linux/window_finder_x11.cc",
381 "linux/window_finder_x11.h",
382 "linux/window_list_utils.cc",
383 "linux/window_list_utils.h",
384 "linux/x_atom_cache.cc",
385 "linux/x_atom_cache.h",
386 "linux/x_error_trap.cc",
387 "linux/x_error_trap.h",
388 "linux/x_server_pixel_buffer.cc",
389 "linux/x_server_pixel_buffer.h",
Julien Isorce62acb5a2019-04-19 14:32:56 -0700390 "linux/x_window_property.cc",
391 "linux/x_window_property.h",
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +0000392 ]
Oleh Prypin240b8932019-06-07 13:27:07 +0200393 libs = [
394 "X11",
395 "Xcomposite",
396 "Xdamage",
397 "Xext",
398 "Xfixes",
399 "Xrender",
400 ]
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +0000401 }
402
Oleh Prypin240b8932019-06-07 13:27:07 +0200403 if (!is_win && !is_mac && !rtc_use_x11_extensions && !rtc_use_pipewire) {
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +0000404 sources += [
405 "mouse_cursor_monitor_null.cc",
406 "screen_capturer_null.cc",
407 "window_capturer_null.cc",
408 ]
409 }
410
zijiehe2970c2a2016-05-20 22:08:00 -0700411 if (is_win) {
Mirko Bonadei470b2d52019-10-29 19:39:17 +0100412 sources += [
413 "cropping_window_capturer_win.cc",
414 "desktop_frame_win.cc",
415 "desktop_frame_win.h",
416 "mouse_cursor_monitor_win.cc",
417 "screen_capturer_win.cc",
418 "win/cursor.cc",
419 "win/cursor.h",
420 "win/d3d_device.cc",
421 "win/d3d_device.h",
422 "win/desktop.cc",
423 "win/desktop.h",
424 "win/display_configuration_monitor.cc",
425 "win/display_configuration_monitor.h",
426 "win/dxgi_adapter_duplicator.cc",
427 "win/dxgi_adapter_duplicator.h",
428 "win/dxgi_context.cc",
429 "win/dxgi_context.h",
430 "win/dxgi_duplicator_controller.cc",
431 "win/dxgi_duplicator_controller.h",
432 "win/dxgi_frame.cc",
433 "win/dxgi_frame.h",
434 "win/dxgi_output_duplicator.cc",
435 "win/dxgi_output_duplicator.h",
436 "win/dxgi_texture.cc",
437 "win/dxgi_texture.h",
438 "win/dxgi_texture_mapping.cc",
439 "win/dxgi_texture_mapping.h",
440 "win/dxgi_texture_staging.cc",
441 "win/dxgi_texture_staging.h",
Roman Gaiub5883532019-10-07 11:57:01 -0700442 "win/full_screen_win_application_handler.cc",
443 "win/full_screen_win_application_handler.h",
Mirko Bonadei470b2d52019-10-29 19:39:17 +0100444 "win/scoped_gdi_object.h",
445 "win/scoped_thread_desktop.cc",
446 "win/scoped_thread_desktop.h",
447 "win/screen_capture_utils.cc",
448 "win/screen_capture_utils.h",
449 "win/screen_capturer_win_directx.cc",
450 "win/screen_capturer_win_directx.h",
451 "win/screen_capturer_win_gdi.cc",
452 "win/screen_capturer_win_gdi.h",
453 "win/screen_capturer_win_magnifier.cc",
454 "win/screen_capturer_win_magnifier.h",
455 "win/selected_window_context.cc",
456 "win/selected_window_context.h",
457 "win/window_capture_utils.cc",
458 "win/window_capture_utils.h",
459 "window_capturer_win.cc",
460 "window_finder_win.cc",
461 "window_finder_win.h",
462 ]
zijiehe2d618de2016-08-08 17:50:21 -0700463 libs = [
464 "d3d11.lib",
465 "dxgi.lib",
466 ]
zijiehe2970c2a2016-05-20 22:08:00 -0700467 }
468
andrew@webrtc.org6ae5a6d2014-09-16 01:03:29 +0000469 deps = [
Sergey Ulanov098c1de2015-09-01 11:36:40 -0700470 ":primitives",
Artem Titov741daaf2019-03-21 14:37:36 +0100471 "../../api:function_view",
Niels Möller9155e492017-10-23 11:22:30 +0200472 "../../api:refcountedbase",
Mirko Bonadeid9708072019-01-25 20:26:48 +0100473 "../../api:scoped_refptr",
Artem Titov94b57c02019-03-21 13:35:10 +0100474 "../../rtc_base", # TODO(kjellander): Cleanup in bugs.webrtc.org/3806.
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100475 "../../rtc_base:checks",
Karl Wiberg2b857922018-03-23 14:53:54 +0100476 "../../rtc_base/synchronization:rw_lock_wrapper",
Niels Möllera12c42a2018-07-25 16:05:48 +0200477 "../../rtc_base/system:arch",
Mirko Bonadei3d255302018-10-11 10:50:45 +0200478 "../../rtc_base/system:rtc_export",
andrew@webrtc.org6ae5a6d2014-09-16 01:03:29 +0000479 "../../system_wrappers",
Mirko Bonadeia498ae82017-12-06 09:17:14 +0100480 "../../system_wrappers:cpu_features_api",
Mirko Bonadei17f48782018-09-28 08:51:10 +0200481 "../../system_wrappers:metrics",
Karl Wiberg918f50c2018-07-05 11:40:33 +0200482 "//third_party/abseil-cpp/absl/memory",
Roman Gaiub5883532019-10-07 11:57:01 -0700483 "//third_party/abseil-cpp/absl/strings",
andrew@webrtc.org6ae5a6d2014-09-16 01:03:29 +0000484 ]
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +0000485
Dan Minor9c686132018-01-15 10:20:00 -0500486 if (build_with_mozilla) {
487 deps += [ "../../rtc_base:rtc_base_approved" ]
488 } else {
489 deps += [ "//third_party/libyuv" ]
490 }
491
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +0000492 if (use_desktop_capture_differ_sse2) {
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200493 deps += [ ":desktop_capture_differ_sse2" ]
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +0000494 }
Tomas Popela762543f2018-12-12 14:37:51 +0100495
496 if (rtc_use_pipewire) {
497 sources += [
498 "linux/base_capturer_pipewire.cc",
499 "linux/base_capturer_pipewire.h",
500 "linux/screen_capturer_pipewire.cc",
501 "linux/screen_capturer_pipewire.h",
502 "linux/window_capturer_pipewire.cc",
503 "linux/window_capturer_pipewire.h",
504 ]
505
506 configs += [
507 ":pipewire_config",
508 ":gio",
509 ]
510
511 if (rtc_link_pipewire) {
512 configs += [ ":pipewire" ]
513 } else {
514 deps += [ ":pipewire_stubs" ]
515 }
516 }
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +0000517}
518
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +0000519if (use_desktop_capture_differ_sse2) {
520 # Have to be compiled as a separate target because it needs to be compiled
521 # with SSE2 enabled.
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200522 rtc_library("desktop_capture_differ_sse2") {
brettw@chromium.org0867f692014-09-10 16:24:11 +0000523 visibility = [ ":*" ]
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +0000524 sources = [
zijiehefef86532016-09-05 15:26:32 -0700525 "differ_vector_sse2.cc",
526 "differ_vector_sse2.h",
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +0000527 ]
528
Fabrice de Gans-Riberi09a6cd52018-03-30 10:38:06 -0700529 if (is_posix || is_fuchsia) {
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200530 cflags = [ "-msse2" ]
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +0000531 }
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +0000532 }
533}