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 | |
Tomas Popela | 318da51 | 2018-11-13 06:32:23 +0100 | [diff] [blame] | 9 | import("//build/config/linux/pkg_config.gni") |
jiayl@webrtc.org | 93426cd | 2014-07-02 15:47:12 +0000 | [diff] [blame] | 10 | import("//build/config/ui.gni") |
Tomas Popela | 762543f | 2018-12-12 14:37:51 +0100 | [diff] [blame] | 11 | import("//tools/generate_stubs/rules.gni") |
mbonadei | 9aa3f0a | 2017-01-24 06:58:22 -0800 | [diff] [blame] | 12 | import("../../webrtc.gni") |
kjellander@webrtc.org | 1227ab8 | 2014-06-23 19:21:07 +0000 | [diff] [blame] | 13 | |
Sergey Ulanov | 1c062bf | 2016-11-22 16:07:10 -0800 | [diff] [blame] | 14 | use_desktop_capture_differ_sse2 = current_cpu == "x86" || current_cpu == "x64" |
jiayl@webrtc.org | 93426cd | 2014-07-02 15:47:12 +0000 | [diff] [blame] | 15 | |
Patrik Höglund | 0808a8c | 2019-12-12 11:20:07 +0100 | [diff] [blame] | 16 | config("x11_config") { |
| 17 | if (rtc_use_x11_extensions) { |
| 18 | defines = [ "WEBRTC_USE_X11" ] |
| 19 | } |
| 20 | } |
| 21 | |
Mirko Bonadei | 86d053c | 2019-10-17 21:32:04 +0200 | [diff] [blame] | 22 | rtc_library("primitives") { |
Per Kjellander | a7f2d84 | 2018-01-10 15:54:53 +0000 | [diff] [blame] | 23 | visibility = [ "*" ] |
Sergey Ulanov | 098c1de | 2015-09-01 11:36:40 -0700 | [diff] [blame] | 24 | 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 Ulanov | 58000a0 | 2016-10-20 09:33:52 -0700 | [diff] [blame] | 32 | "shared_desktop_frame.cc", |
| 33 | "shared_desktop_frame.h", |
mbonadei | f423593 | 2016-12-29 03:35:56 -0800 | [diff] [blame] | 34 | "shared_memory.cc", |
| 35 | "shared_memory.h", |
Sergey Ulanov | 58000a0 | 2016-10-20 09:33:52 -0700 | [diff] [blame] | 36 | ] |
| 37 | |
| 38 | deps = [ |
Mirko Bonadei | d970807 | 2019-01-25 20:26:48 +0100 | [diff] [blame] | 39 | "../../api:scoped_refptr", |
Patrik Höglund | a8005cf | 2017-12-13 16:05:42 +0100 | [diff] [blame] | 40 | "../../rtc_base:checks", |
Mirko Bonadei | 3d25530 | 2018-10-11 10:50:45 +0200 | [diff] [blame] | 41 | "../../rtc_base/system:rtc_export", |
Sergey Ulanov | 098c1de | 2015-09-01 11:36:40 -0700 | [diff] [blame] | 42 | ] |
Dan Minor | 9c68613 | 2018-01-15 10:20:00 -0500 | [diff] [blame] | 43 | |
| 44 | if (!build_with_mozilla) { |
Artem Titov | 94b57c0 | 2019-03-21 13:35:10 +0100 | [diff] [blame] | 45 | deps += [ "../../rtc_base" ] # TODO(kjellander): Cleanup in bugs.webrtc.org/3806. |
Dan Minor | 9c68613 | 2018-01-15 10:20:00 -0500 | [diff] [blame] | 46 | } |
Sergey Ulanov | 098c1de | 2015-09-01 11:36:40 -0700 | [diff] [blame] | 47 | } |
| 48 | |
zijiehe | 6be0a65 | 2016-10-27 16:50:35 -0700 | [diff] [blame] | 49 | if (rtc_include_tests) { |
Mirko Bonadei | 86d053c | 2019-10-17 21:32:04 +0200 | [diff] [blame] | 50 | rtc_library("desktop_capture_modules_tests") { |
ehmaldonado | 9cbb0a1 | 2017-01-30 03:07:03 -0800 | [diff] [blame] | 51 | testonly = true |
kjellander | e0629c0 | 2017-04-25 04:04:50 -0700 | [diff] [blame] | 52 | |
Patrik Höglund | 0808a8c | 2019-12-12 11:20:07 +0100 | [diff] [blame] | 53 | defines = [] |
ehmaldonado | 9cbb0a1 | 2017-01-30 03:07:03 -0800 | [diff] [blame] | 54 | sources = [] |
Patrik Höglund | a8005cf | 2017-12-13 16:05:42 +0100 | [diff] [blame] | 55 | deps = [ |
Artem Titov | 741daaf | 2019-03-21 14:37:36 +0100 | [diff] [blame] | 56 | "../../api:function_view", |
Mirko Bonadei | d970807 | 2019-01-25 20:26:48 +0100 | [diff] [blame] | 57 | "../../api:scoped_refptr", |
Patrik Höglund | a8005cf | 2017-12-13 16:05:42 +0100 | [diff] [blame] | 58 | "../../rtc_base:checks", |
| 59 | ] |
ehmaldonado | 9cbb0a1 | 2017-01-30 03:07:03 -0800 | [diff] [blame] | 60 | if (rtc_desktop_capture_supported) { |
| 61 | deps += [ |
| 62 | ":desktop_capture_mock", |
| 63 | ":primitives", |
| 64 | ":screen_drawer", |
Artem Titov | 94b57c0 | 2019-03-21 13:35:10 +0100 | [diff] [blame] | 65 | "../../rtc_base", |
ehmaldonado | f6a861a | 2017-07-19 10:40:47 -0700 | [diff] [blame] | 66 | "../../rtc_base:rtc_base_approved", |
Artem Titov | a76af0c | 2018-07-23 17:38:12 +0200 | [diff] [blame] | 67 | "../../rtc_base/third_party/base64", |
zijiehe | ccf57a7 | 2017-03-03 14:40:15 -0800 | [diff] [blame] | 68 | "../../system_wrappers", |
ehmaldonado | 9cbb0a1 | 2017-01-30 03:07:03 -0800 | [diff] [blame] | 69 | "../../test:test_support", |
ehmaldonado | 656610f | 2017-02-06 02:21:11 -0800 | [diff] [blame] | 70 | "../../test:video_test_support", |
ehmaldonado | 9cbb0a1 | 2017-01-30 03:07:03 -0800 | [diff] [blame] | 71 | ] |
| 72 | sources += [ |
| 73 | "screen_capturer_integration_test.cc", |
| 74 | "screen_drawer_unittest.cc", |
Zijie He | 77b7a1d | 2017-09-01 15:51:14 -0700 | [diff] [blame] | 75 | "window_finder_unittest.cc", |
ehmaldonado | 9cbb0a1 | 2017-01-30 03:07:03 -0800 | [diff] [blame] | 76 | ] |
Patrik Höglund | 0808a8c | 2019-12-12 11:20:07 +0100 | [diff] [blame] | 77 | public_configs = [ ":x11_config" ] |
ehmaldonado | 9cbb0a1 | 2017-01-30 03:07:03 -0800 | [diff] [blame] | 78 | } |
| 79 | } |
| 80 | |
Mirko Bonadei | 86d053c | 2019-10-17 21:32:04 +0200 | [diff] [blame] | 81 | rtc_library("desktop_capture_unittests") { |
ehmaldonado | 3626865 | 2017-01-19 08:27:11 -0800 | [diff] [blame] | 82 | testonly = true |
kjellander | e0629c0 | 2017-04-25 04:04:50 -0700 | [diff] [blame] | 83 | |
Patrik Höglund | 0808a8c | 2019-12-12 11:20:07 +0100 | [diff] [blame] | 84 | defines = [] |
ehmaldonado | 0d729b3 | 2017-02-10 01:38:23 -0800 | [diff] [blame] | 85 | sources = [ |
zijiehe | ccf57a7 | 2017-03-03 14:40:15 -0800 | [diff] [blame] | 86 | "blank_detector_desktop_capturer_wrapper_unittest.cc", |
Zijie He | 05ec178 | 2017-09-06 14:09:20 -0700 | [diff] [blame] | 87 | "cropped_desktop_frame_unittest.cc", |
ehmaldonado | 0d729b3 | 2017-02-10 01:38:23 -0800 | [diff] [blame] | 88 | "desktop_and_cursor_composer_unittest.cc", |
| 89 | "desktop_capturer_differ_wrapper_unittest.cc", |
| 90 | "desktop_frame_rotation_unittest.cc", |
Bryan Ferguson | e8ef87b | 2019-08-20 17:12:52 -0700 | [diff] [blame] | 91 | "desktop_frame_unittest.cc", |
zijiehe | 8eef7aa | 2017-05-18 12:27:16 -0700 | [diff] [blame] | 92 | "desktop_geometry_unittest.cc", |
ehmaldonado | 0d729b3 | 2017-02-10 01:38:23 -0800 | [diff] [blame] | 93 | "desktop_region_unittest.cc", |
| 94 | "differ_block_unittest.cc", |
zijiehe | 8fefe98 | 2017-02-17 14:32:04 -0800 | [diff] [blame] | 95 | "fallback_desktop_capturer_wrapper_unittest.cc", |
ehmaldonado | 0d729b3 | 2017-02-10 01:38:23 -0800 | [diff] [blame] | 96 | "mouse_cursor_monitor_unittest.cc", |
| 97 | "rgba_color_unittest.cc", |
| 98 | "test_utils.cc", |
| 99 | "test_utils.h", |
| 100 | "test_utils_unittest.cc", |
ehmaldonado | 0d729b3 | 2017-02-10 01:38:23 -0800 | [diff] [blame] | 101 | ] |
Mirko Bonadei | 470b2d5 | 2019-10-29 19:39:17 +0100 | [diff] [blame] | 102 | 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 | } |
ehmaldonado | 0d729b3 | 2017-02-10 01:38:23 -0800 | [diff] [blame] | 111 | deps = [ |
| 112 | ":desktop_capture", |
| 113 | ":desktop_capture_mock", |
| 114 | ":primitives", |
Patrik Höglund | a8005cf | 2017-12-13 16:05:42 +0100 | [diff] [blame] | 115 | "../../rtc_base:checks", |
ehmaldonado | f6a861a | 2017-07-19 10:40:47 -0700 | [diff] [blame] | 116 | "../../rtc_base:rtc_base_approved", |
Mirko Bonadei | a498ae8 | 2017-12-06 09:17:14 +0100 | [diff] [blame] | 117 | "../../system_wrappers:cpu_features_api", |
ehmaldonado | 0d729b3 | 2017-02-10 01:38:23 -0800 | [diff] [blame] | 118 | "../../test:test_support", |
ehmaldonado | 0d729b3 | 2017-02-10 01:38:23 -0800 | [diff] [blame] | 119 | ] |
ehmaldonado | 3626865 | 2017-01-19 08:27:11 -0800 | [diff] [blame] | 120 | if (rtc_desktop_capture_supported) { |
| 121 | sources += [ |
ehmaldonado | 3626865 | 2017-01-19 08:27:11 -0800 | [diff] [blame] | 122 | "screen_capturer_helper_unittest.cc", |
| 123 | "screen_capturer_mac_unittest.cc", |
| 124 | "screen_capturer_unittest.cc", |
ehmaldonado | 3626865 | 2017-01-19 08:27:11 -0800 | [diff] [blame] | 125 | "window_capturer_unittest.cc", |
| 126 | ] |
| 127 | deps += [ ":desktop_capture_mock" ] |
Patrik Höglund | 0808a8c | 2019-12-12 11:20:07 +0100 | [diff] [blame] | 128 | public_configs = [ ":x11_config" ] |
ehmaldonado | 3626865 | 2017-01-19 08:27:11 -0800 | [diff] [blame] | 129 | } |
ehmaldonado | 3626865 | 2017-01-19 08:27:11 -0800 | [diff] [blame] | 130 | } |
| 131 | |
Mirko Bonadei | 86d053c | 2019-10-17 21:32:04 +0200 | [diff] [blame] | 132 | rtc_library("screen_drawer") { |
perkj | 528a834 | 2017-03-03 00:01:48 -0800 | [diff] [blame] | 133 | testonly = true |
| 134 | |
Mirko Bonadei | ccbe95f | 2020-01-21 12:10:10 +0100 | [diff] [blame] | 135 | public_deps = [ ":desktop_capture" ] # no-presubmit-check TODO(webrtc:8603) |
perkj | 528a834 | 2017-03-03 00:01:48 -0800 | [diff] [blame] | 136 | |
| 137 | sources = [ |
zijiehe | 6be0a65 | 2016-10-27 16:50:35 -0700 | [diff] [blame] | 138 | "screen_drawer.cc", |
| 139 | "screen_drawer.h", |
zijiehe | 6be0a65 | 2016-10-27 16:50:35 -0700 | [diff] [blame] | 140 | ] |
mbonadei | f423593 | 2016-12-29 03:35:56 -0800 | [diff] [blame] | 141 | |
Mirko Bonadei | 470b2d5 | 2019-10-29 19:39:17 +0100 | [diff] [blame] | 142 | 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 | |
mbonadei | f423593 | 2016-12-29 03:35:56 -0800 | [diff] [blame] | 154 | deps = [ |
| 155 | ":primitives", |
Mirko Bonadei | d970807 | 2019-01-25 20:26:48 +0100 | [diff] [blame] | 156 | "../../api:scoped_refptr", |
Patrik Höglund | a8005cf | 2017-12-13 16:05:42 +0100 | [diff] [blame] | 157 | "../../rtc_base:checks", |
ehmaldonado | f6a861a | 2017-07-19 10:40:47 -0700 | [diff] [blame] | 158 | "../../rtc_base:rtc_base_approved", |
mbonadei | f423593 | 2016-12-29 03:35:56 -0800 | [diff] [blame] | 159 | "../../system_wrappers", |
| 160 | ] |
Fabrice de Gans-Riberi | 450cdf3 | 2018-04-17 12:56:01 -0700 | [diff] [blame] | 161 | |
| 162 | if (is_posix || is_fuchsia) { |
| 163 | sources += [ |
| 164 | "screen_drawer_lock_posix.cc", |
| 165 | "screen_drawer_lock_posix.h", |
| 166 | ] |
| 167 | } |
zijiehe | 6be0a65 | 2016-10-27 16:50:35 -0700 | [diff] [blame] | 168 | } |
zijiehe | 54fd579 | 2016-11-02 14:49:35 -0700 | [diff] [blame] | 169 | |
Mirko Bonadei | 86d053c | 2019-10-17 21:32:04 +0200 | [diff] [blame] | 170 | rtc_library("desktop_capture_mock") { |
zijiehe | 54fd579 | 2016-11-02 14:49:35 -0700 | [diff] [blame] | 171 | testonly = true |
| 172 | |
Mirko Bonadei | ccbe95f | 2020-01-21 12:10:10 +0100 | [diff] [blame] | 173 | public_deps = [ ":desktop_capture" ] # no-presubmit-check TODO(webrtc:8603) |
zijiehe | 54fd579 | 2016-11-02 14:49:35 -0700 | [diff] [blame] | 174 | |
| 175 | sources = [ |
zijiehe | 372719b | 2016-11-11 17:18:34 -0800 | [diff] [blame] | 176 | "mock_desktop_capturer_callback.cc", |
zijiehe | 54fd579 | 2016-11-02 14:49:35 -0700 | [diff] [blame] | 177 | "mock_desktop_capturer_callback.h", |
mbonadei | f423593 | 2016-12-29 03:35:56 -0800 | [diff] [blame] | 178 | ] |
| 179 | |
| 180 | deps = [ |
| 181 | ":primitives", |
ehmaldonado | f6a861a | 2017-07-19 10:40:47 -0700 | [diff] [blame] | 182 | "../../rtc_base:rtc_base_approved", |
mbonadei | f423593 | 2016-12-29 03:35:56 -0800 | [diff] [blame] | 183 | "../../test:test_support", |
zijiehe | 54fd579 | 2016-11-02 14:49:35 -0700 | [diff] [blame] | 184 | ] |
| 185 | } |
zijiehe | 6be0a65 | 2016-10-27 16:50:35 -0700 | [diff] [blame] | 186 | } |
| 187 | |
Tomas Popela | 318da51 | 2018-11-13 06:32:23 +0100 | [diff] [blame] | 188 | if (is_linux) { |
| 189 | if (rtc_use_pipewire) { |
Tomas Popela | 318da51 | 2018-11-13 06:32:23 +0100 | [diff] [blame] | 190 | pkg_config("gio") { |
| 191 | packages = [ |
| 192 | "gio-2.0", |
| 193 | "gio-unix-2.0", |
| 194 | ] |
| 195 | } |
Tomas Popela | 762543f | 2018-12-12 14:37:51 +0100 | [diff] [blame] | 196 | |
| 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 Bonadei | ccbe95f | 2020-01-21 12:10:10 +0100 | [diff] [blame] | 206 | deps = [ "../../rtc_base" ] |
Tomas Popela | 762543f | 2018-12-12 14:37:51 +0100 | [diff] [blame] | 207 | 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 Popela | 318da51 | 2018-11-13 06:32:23 +0100 | [diff] [blame] | 222 | } |
| 223 | } |
| 224 | |
mbonadei | 13b9882 | 2017-08-30 07:24:43 -0700 | [diff] [blame] | 225 | rtc_source_set("desktop_capture") { |
Per Kjellander | a7f2d84 | 2018-01-10 15:54:53 +0000 | [diff] [blame] | 226 | visibility = [ "*" ] |
Mirko Bonadei | ccbe95f | 2020-01-21 12:10:10 +0100 | [diff] [blame] | 227 | public_deps = [ ":desktop_capture_generic" ] # no-presubmit-check TODO(webrtc:8603) |
mbonadei | 13b9882 | 2017-08-30 07:24:43 -0700 | [diff] [blame] | 228 | if (is_mac) { |
mbonadei | edb8429 | 2017-09-04 07:58:29 -0700 | [diff] [blame] | 229 | public_deps += [ ":desktop_capture_objc" ] |
mbonadei | 13b9882 | 2017-08-30 07:24:43 -0700 | [diff] [blame] | 230 | } |
| 231 | } |
| 232 | |
| 233 | if (is_mac) { |
Mirko Bonadei | 86d053c | 2019-10-17 21:32:04 +0200 | [diff] [blame] | 234 | rtc_library("desktop_capture_objc") { |
mbonadei | edb8429 | 2017-09-04 07:58:29 -0700 | [diff] [blame] | 235 | visibility = [ ":desktop_capture" ] |
mbonadei | 13b9882 | 2017-08-30 07:24:43 -0700 | [diff] [blame] | 236 | sources = [ |
| 237 | "mac/desktop_configuration.mm", |
Julien Isorce | c0719ce | 2018-03-29 22:35:44 +0100 | [diff] [blame] | 238 | "mac/desktop_frame_cgimage.h", |
| 239 | "mac/desktop_frame_cgimage.mm", |
Julien Isorce | 1c4bbba | 2018-04-09 15:57:55 -0700 | [diff] [blame] | 240 | "mac/desktop_frame_iosurface.h", |
| 241 | "mac/desktop_frame_iosurface.mm", |
| 242 | "mac/desktop_frame_provider.h", |
| 243 | "mac/desktop_frame_provider.mm", |
Julien Isorce | 370228c | 2018-03-27 08:39:11 +0100 | [diff] [blame] | 244 | "mac/screen_capturer_mac.h", |
| 245 | "mac/screen_capturer_mac.mm", |
mbonadei | 13b9882 | 2017-08-30 07:24:43 -0700 | [diff] [blame] | 246 | "mouse_cursor_monitor_mac.mm", |
Julien Isorce | 370228c | 2018-03-27 08:39:11 +0100 | [diff] [blame] | 247 | "screen_capturer_darwin.mm", |
mbonadei | 13b9882 | 2017-08-30 07:24:43 -0700 | [diff] [blame] | 248 | "window_capturer_mac.mm", |
Mirko Bonadei | 080832e | 2017-09-19 15:44:23 +0200 | [diff] [blame] | 249 | "window_finder_mac.h", |
| 250 | "window_finder_mac.mm", |
mbonadei | 13b9882 | 2017-08-30 07:24:43 -0700 | [diff] [blame] | 251 | ] |
mbonadei | 13b9882 | 2017-08-30 07:24:43 -0700 | [diff] [blame] | 252 | deps = [ |
mbonadei | edb8429 | 2017-09-04 07:58:29 -0700 | [diff] [blame] | 253 | ":desktop_capture_generic", |
mbonadei | 13b9882 | 2017-08-30 07:24:43 -0700 | [diff] [blame] | 254 | ":primitives", |
Mirko Bonadei | d970807 | 2019-01-25 20:26:48 +0100 | [diff] [blame] | 255 | "../../api:scoped_refptr", |
Artem Titov | 94b57c0 | 2019-03-21 13:35:10 +0100 | [diff] [blame] | 256 | "../../rtc_base", |
Patrik Höglund | a8005cf | 2017-12-13 16:05:42 +0100 | [diff] [blame] | 257 | "../../rtc_base:checks", |
mbonadei | 13b9882 | 2017-08-30 07:24:43 -0700 | [diff] [blame] | 258 | "../../rtc_base:rtc_base_approved", |
Julien Isorce | 1c4bbba | 2018-04-09 15:57:55 -0700 | [diff] [blame] | 259 | "../../rtc_base/synchronization:rw_lock_wrapper", |
Mirko Bonadei | c66e004 | 2019-10-18 09:52:22 +0200 | [diff] [blame] | 260 | "../../rtc_base/system:rtc_export", |
Anders Carlsson | 7bca8ca | 2018-08-30 09:30:29 +0200 | [diff] [blame] | 261 | "../../sdk:helpers_objc", |
mbonadei | 13b9882 | 2017-08-30 07:24:43 -0700 | [diff] [blame] | 262 | ] |
| 263 | libs = [ |
| 264 | "AppKit.framework", |
| 265 | "IOKit.framework", |
Julien Isorce | 1c4bbba | 2018-04-09 15:57:55 -0700 | [diff] [blame] | 266 | "IOSurface.framework", |
mbonadei | 13b9882 | 2017-08-30 07:24:43 -0700 | [diff] [blame] | 267 | ] |
| 268 | } |
| 269 | } |
| 270 | |
Mirko Bonadei | 86d053c | 2019-10-17 21:32:04 +0200 | [diff] [blame] | 271 | rtc_library("desktop_capture_generic") { |
Patrik Höglund | 0808a8c | 2019-12-12 11:20:07 +0100 | [diff] [blame] | 272 | defines = [] |
| 273 | public_configs = [ ":x11_config" ] |
mbonadei | edb8429 | 2017-09-04 07:58:29 -0700 | [diff] [blame] | 274 | visibility = [ |
| 275 | ":desktop_capture", |
| 276 | ":desktop_capture_objc", |
| 277 | ] |
jiayl@webrtc.org | 93426cd | 2014-07-02 15:47:12 +0000 | [diff] [blame] | 278 | sources = [ |
zijiehe | ccf57a7 | 2017-03-03 14:40:15 -0800 | [diff] [blame] | 279 | "blank_detector_desktop_capturer_wrapper.cc", |
| 280 | "blank_detector_desktop_capturer_wrapper.h", |
Zijie He | a7567a9 | 2017-09-15 09:12:25 -0700 | [diff] [blame] | 281 | "capture_result_desktop_capturer_wrapper.cc", |
| 282 | "capture_result_desktop_capturer_wrapper.h", |
jiayl@webrtc.org | 0e71070 | 2014-11-11 18:15:55 +0000 | [diff] [blame] | 283 | "cropped_desktop_frame.cc", |
| 284 | "cropped_desktop_frame.h", |
| 285 | "cropping_window_capturer.cc", |
| 286 | "cropping_window_capturer.h", |
jiayl@webrtc.org | 93426cd | 2014-07-02 15:47:12 +0000 | [diff] [blame] | 287 | "desktop_and_cursor_composer.cc", |
| 288 | "desktop_and_cursor_composer.h", |
Henrik Kjellander | 57e5fd2 | 2015-05-25 12:55:39 +0200 | [diff] [blame] | 289 | "desktop_capture_options.cc", |
| 290 | "desktop_capture_options.h", |
zijiehe | b68d655 | 2016-10-28 17:35:11 -0700 | [diff] [blame] | 291 | "desktop_capturer.cc", |
jiayl@webrtc.org | 93426cd | 2014-07-02 15:47:12 +0000 | [diff] [blame] | 292 | "desktop_capturer.h", |
Sergey Ulanov | 1c062bf | 2016-11-22 16:07:10 -0800 | [diff] [blame] | 293 | "desktop_capturer_differ_wrapper.cc", |
| 294 | "desktop_capturer_differ_wrapper.h", |
Zijie He | a7567a9 | 2017-09-15 09:12:25 -0700 | [diff] [blame] | 295 | "desktop_capturer_wrapper.cc", |
| 296 | "desktop_capturer_wrapper.h", |
braveyao | 99206df | 2017-11-27 12:15:53 -0800 | [diff] [blame] | 297 | "desktop_frame_generator.cc", |
| 298 | "desktop_frame_generator.h", |
zijiehe | 90ea736 | 2016-11-22 17:17:09 -0800 | [diff] [blame] | 299 | "desktop_frame_rotation.cc", |
| 300 | "desktop_frame_rotation.h", |
Sergey Ulanov | 1c062bf | 2016-11-22 16:07:10 -0800 | [diff] [blame] | 301 | "differ_block.cc", |
| 302 | "differ_block.h", |
braveyao | 99206df | 2017-11-27 12:15:53 -0800 | [diff] [blame] | 303 | "fake_desktop_capturer.cc", |
| 304 | "fake_desktop_capturer.h", |
zijiehe | 8fefe98 | 2017-02-17 14:32:04 -0800 | [diff] [blame] | 305 | "fallback_desktop_capturer_wrapper.cc", |
| 306 | "fallback_desktop_capturer_wrapper.h", |
Roman Gaiu | b588353 | 2019-10-07 11:57:01 -0700 | [diff] [blame] | 307 | "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.org | 93426cd | 2014-07-02 15:47:12 +0000 | [diff] [blame] | 311 | "mouse_cursor.cc", |
| 312 | "mouse_cursor.h", |
| 313 | "mouse_cursor_monitor.h", |
Zijie He | 7e1c24c | 2017-07-27 18:06:12 -0700 | [diff] [blame] | 314 | "resolution_tracker.cc", |
| 315 | "resolution_tracker.h", |
zijiehe | ccf57a7 | 2017-03-03 14:40:15 -0800 | [diff] [blame] | 316 | "rgba_color.cc", |
| 317 | "rgba_color.h", |
jiayl@webrtc.org | 93426cd | 2014-07-02 15:47:12 +0000 | [diff] [blame] | 318 | "screen_capture_frame_queue.h", |
jiayl@webrtc.org | 93426cd | 2014-07-02 15:47:12 +0000 | [diff] [blame] | 319 | "screen_capturer_helper.cc", |
| 320 | "screen_capturer_helper.h", |
Zijie He | 411582b | 2017-11-06 16:40:51 -0800 | [diff] [blame] | 321 | "window_finder.cc", |
Zijie He | 70fbbad | 2017-08-15 15:45:00 -0700 | [diff] [blame] | 322 | "window_finder.h", |
jiayl@webrtc.org | 93426cd | 2014-07-02 15:47:12 +0000 | [diff] [blame] | 323 | ] |
| 324 | |
Mirko Bonadei | 470b2d5 | 2019-10-29 19:39:17 +0100 | [diff] [blame] | 325 | if (is_mac) { |
| 326 | sources += [ |
| 327 | "mac/desktop_configuration.h", |
| 328 | "mac/desktop_configuration_monitor.cc", |
| 329 | "mac/desktop_configuration_monitor.h", |
Roman Gaiu | b588353 | 2019-10-07 11:57:01 -0700 | [diff] [blame] | 330 | "mac/full_screen_mac_application_handler.cc", |
| 331 | "mac/full_screen_mac_application_handler.h", |
Mirko Bonadei | 470b2d5 | 2019-10-29 19:39:17 +0100 | [diff] [blame] | 332 | "mac/window_list_utils.cc", |
| 333 | "mac/window_list_utils.h", |
| 334 | ] |
| 335 | } |
| 336 | |
Dan Minor | 9c68613 | 2018-01-15 10:20:00 -0500 | [diff] [blame] | 337 | if (build_with_mozilla) { |
| 338 | sources += [ |
Dan Minor | 9c68613 | 2018-01-15 10:20:00 -0500 | [diff] [blame] | 339 | "desktop_device_info.cc", |
| 340 | "desktop_device_info.h", |
Dan Minor | 9c68613 | 2018-01-15 10:20:00 -0500 | [diff] [blame] | 341 | ] |
Mirko Bonadei | 470b2d5 | 2019-10-29 19:39:17 +0100 | [diff] [blame] | 342 | 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 Minor | 9c68613 | 2018-01-15 10:20:00 -0500 | [diff] [blame] | 349 | } |
| 350 | |
Oleh Prypin | 240b893 | 2019-06-07 13:27:07 +0200 | [diff] [blame] | 351 | if (rtc_use_x11_extensions || rtc_use_pipewire) { |
Tomas Popela | 318da51 | 2018-11-13 06:32:23 +0100 | [diff] [blame] | 352 | sources += [ |
| 353 | "mouse_cursor_monitor_linux.cc", |
| 354 | "screen_capturer_linux.cc", |
| 355 | "window_capturer_linux.cc", |
| 356 | ] |
| 357 | |
Mirko Bonadei | 470b2d5 | 2019-10-29 19:39:17 +0100 | [diff] [blame] | 358 | 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 Popela | 318da51 | 2018-11-13 06:32:23 +0100 | [diff] [blame] | 367 | } |
| 368 | } |
| 369 | |
Oleh Prypin | 240b893 | 2019-06-07 13:27:07 +0200 | [diff] [blame] | 370 | if (rtc_use_x11_extensions) { |
jiayl@webrtc.org | 93426cd | 2014-07-02 15:47:12 +0000 | [diff] [blame] | 371 | sources += [ |
Tomas Popela | 318da51 | 2018-11-13 06:32:23 +0100 | [diff] [blame] | 372 | "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 Isorce | 62acb5a | 2019-04-19 14:32:56 -0700 | [diff] [blame] | 390 | "linux/x_window_property.cc", |
| 391 | "linux/x_window_property.h", |
jiayl@webrtc.org | 93426cd | 2014-07-02 15:47:12 +0000 | [diff] [blame] | 392 | ] |
Oleh Prypin | 240b893 | 2019-06-07 13:27:07 +0200 | [diff] [blame] | 393 | libs = [ |
| 394 | "X11", |
| 395 | "Xcomposite", |
| 396 | "Xdamage", |
| 397 | "Xext", |
| 398 | "Xfixes", |
| 399 | "Xrender", |
| 400 | ] |
jiayl@webrtc.org | 93426cd | 2014-07-02 15:47:12 +0000 | [diff] [blame] | 401 | } |
| 402 | |
Oleh Prypin | 240b893 | 2019-06-07 13:27:07 +0200 | [diff] [blame] | 403 | if (!is_win && !is_mac && !rtc_use_x11_extensions && !rtc_use_pipewire) { |
jiayl@webrtc.org | 93426cd | 2014-07-02 15:47:12 +0000 | [diff] [blame] | 404 | sources += [ |
| 405 | "mouse_cursor_monitor_null.cc", |
| 406 | "screen_capturer_null.cc", |
| 407 | "window_capturer_null.cc", |
| 408 | ] |
| 409 | } |
| 410 | |
zijiehe | 2970c2a | 2016-05-20 22:08:00 -0700 | [diff] [blame] | 411 | if (is_win) { |
Mirko Bonadei | 470b2d5 | 2019-10-29 19:39:17 +0100 | [diff] [blame] | 412 | 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 Gaiu | b588353 | 2019-10-07 11:57:01 -0700 | [diff] [blame] | 442 | "win/full_screen_win_application_handler.cc", |
| 443 | "win/full_screen_win_application_handler.h", |
Mirko Bonadei | 470b2d5 | 2019-10-29 19:39:17 +0100 | [diff] [blame] | 444 | "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 | ] |
zijiehe | 2d618de | 2016-08-08 17:50:21 -0700 | [diff] [blame] | 463 | libs = [ |
| 464 | "d3d11.lib", |
| 465 | "dxgi.lib", |
| 466 | ] |
zijiehe | 2970c2a | 2016-05-20 22:08:00 -0700 | [diff] [blame] | 467 | } |
| 468 | |
andrew@webrtc.org | 6ae5a6d | 2014-09-16 01:03:29 +0000 | [diff] [blame] | 469 | deps = [ |
Sergey Ulanov | 098c1de | 2015-09-01 11:36:40 -0700 | [diff] [blame] | 470 | ":primitives", |
Artem Titov | 741daaf | 2019-03-21 14:37:36 +0100 | [diff] [blame] | 471 | "../../api:function_view", |
Niels Möller | 9155e49 | 2017-10-23 11:22:30 +0200 | [diff] [blame] | 472 | "../../api:refcountedbase", |
Mirko Bonadei | d970807 | 2019-01-25 20:26:48 +0100 | [diff] [blame] | 473 | "../../api:scoped_refptr", |
Artem Titov | 94b57c0 | 2019-03-21 13:35:10 +0100 | [diff] [blame] | 474 | "../../rtc_base", # TODO(kjellander): Cleanup in bugs.webrtc.org/3806. |
Patrik Höglund | a8005cf | 2017-12-13 16:05:42 +0100 | [diff] [blame] | 475 | "../../rtc_base:checks", |
Karl Wiberg | 2b85792 | 2018-03-23 14:53:54 +0100 | [diff] [blame] | 476 | "../../rtc_base/synchronization:rw_lock_wrapper", |
Niels Möller | a12c42a | 2018-07-25 16:05:48 +0200 | [diff] [blame] | 477 | "../../rtc_base/system:arch", |
Mirko Bonadei | 3d25530 | 2018-10-11 10:50:45 +0200 | [diff] [blame] | 478 | "../../rtc_base/system:rtc_export", |
andrew@webrtc.org | 6ae5a6d | 2014-09-16 01:03:29 +0000 | [diff] [blame] | 479 | "../../system_wrappers", |
Mirko Bonadei | a498ae8 | 2017-12-06 09:17:14 +0100 | [diff] [blame] | 480 | "../../system_wrappers:cpu_features_api", |
Mirko Bonadei | 17f4878 | 2018-09-28 08:51:10 +0200 | [diff] [blame] | 481 | "../../system_wrappers:metrics", |
Karl Wiberg | 918f50c | 2018-07-05 11:40:33 +0200 | [diff] [blame] | 482 | "//third_party/abseil-cpp/absl/memory", |
Roman Gaiu | b588353 | 2019-10-07 11:57:01 -0700 | [diff] [blame] | 483 | "//third_party/abseil-cpp/absl/strings", |
andrew@webrtc.org | 6ae5a6d | 2014-09-16 01:03:29 +0000 | [diff] [blame] | 484 | ] |
jiayl@webrtc.org | 93426cd | 2014-07-02 15:47:12 +0000 | [diff] [blame] | 485 | |
Dan Minor | 9c68613 | 2018-01-15 10:20:00 -0500 | [diff] [blame] | 486 | if (build_with_mozilla) { |
| 487 | deps += [ "../../rtc_base:rtc_base_approved" ] |
| 488 | } else { |
| 489 | deps += [ "//third_party/libyuv" ] |
| 490 | } |
| 491 | |
jiayl@webrtc.org | 93426cd | 2014-07-02 15:47:12 +0000 | [diff] [blame] | 492 | if (use_desktop_capture_differ_sse2) { |
Henrik Kjellander | 57e5fd2 | 2015-05-25 12:55:39 +0200 | [diff] [blame] | 493 | deps += [ ":desktop_capture_differ_sse2" ] |
jiayl@webrtc.org | 93426cd | 2014-07-02 15:47:12 +0000 | [diff] [blame] | 494 | } |
Tomas Popela | 762543f | 2018-12-12 14:37:51 +0100 | [diff] [blame] | 495 | |
| 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.org | 1227ab8 | 2014-06-23 19:21:07 +0000 | [diff] [blame] | 517 | } |
| 518 | |
jiayl@webrtc.org | 93426cd | 2014-07-02 15:47:12 +0000 | [diff] [blame] | 519 | if (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 Bonadei | 86d053c | 2019-10-17 21:32:04 +0200 | [diff] [blame] | 522 | rtc_library("desktop_capture_differ_sse2") { |
brettw@chromium.org | 0867f69 | 2014-09-10 16:24:11 +0000 | [diff] [blame] | 523 | visibility = [ ":*" ] |
jiayl@webrtc.org | 93426cd | 2014-07-02 15:47:12 +0000 | [diff] [blame] | 524 | sources = [ |
zijiehe | fef8653 | 2016-09-05 15:26:32 -0700 | [diff] [blame] | 525 | "differ_vector_sse2.cc", |
| 526 | "differ_vector_sse2.h", |
jiayl@webrtc.org | 93426cd | 2014-07-02 15:47:12 +0000 | [diff] [blame] | 527 | ] |
| 528 | |
Fabrice de Gans-Riberi | 09a6cd5 | 2018-03-30 10:38:06 -0700 | [diff] [blame] | 529 | if (is_posix || is_fuchsia) { |
Henrik Kjellander | 57e5fd2 | 2015-05-25 12:55:39 +0200 | [diff] [blame] | 530 | cflags = [ "-msse2" ] |
jiayl@webrtc.org | 93426cd | 2014-07-02 15:47:12 +0000 | [diff] [blame] | 531 | } |
kjellander@webrtc.org | 1227ab8 | 2014-06-23 19:21:07 +0000 | [diff] [blame] | 532 | } |
| 533 | } |