blob: ca1e66ec9234c1f4e407b05a95a3ca7e3a5f8446 [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
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +000015source_set("desktop_capture") {
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +000016 sources = [
jiayl@webrtc.org0e710702014-11-11 18:15:55 +000017 "cropped_desktop_frame.cc",
18 "cropped_desktop_frame.h",
19 "cropping_window_capturer.cc",
20 "cropping_window_capturer.h",
21 "cropping_window_capturer_win.cc",
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +000022 "desktop_and_cursor_composer.cc",
23 "desktop_and_cursor_composer.h",
Henrik Kjellander57e5fd22015-05-25 12:55:39 +020024 "desktop_capture_options.cc",
25 "desktop_capture_options.h",
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +000026 "desktop_capture_types.h",
27 "desktop_capturer.h",
Henrik Kjellander57e5fd22015-05-25 12:55:39 +020028 "desktop_capturer.h",
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +000029 "desktop_frame.cc",
30 "desktop_frame.h",
31 "desktop_frame_win.cc",
32 "desktop_frame_win.h",
33 "desktop_geometry.cc",
34 "desktop_geometry.h",
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +000035 "desktop_region.cc",
36 "desktop_region.h",
37 "differ.cc",
38 "differ.h",
39 "differ_block.cc",
40 "differ_block.h",
41 "mac/desktop_configuration.h",
42 "mac/desktop_configuration.mm",
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +000043 "mac/desktop_configuration_monitor.cc",
Henrik Kjellander57e5fd22015-05-25 12:55:39 +020044 "mac/desktop_configuration_monitor.h",
jiayl@webrtc.org12b4efe2014-07-08 22:05:24 +000045 "mac/full_screen_chrome_window_detector.cc",
46 "mac/full_screen_chrome_window_detector.h",
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +000047 "mac/scoped_pixel_buffer_object.cc",
48 "mac/scoped_pixel_buffer_object.h",
jiayl@webrtc.org12b4efe2014-07-08 22:05:24 +000049 "mac/window_list_utils.cc",
50 "mac/window_list_utils.h",
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +000051 "mouse_cursor.cc",
52 "mouse_cursor.h",
53 "mouse_cursor_monitor.h",
54 "mouse_cursor_monitor_mac.mm",
55 "mouse_cursor_monitor_win.cc",
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +000056 "screen_capture_frame_queue.cc",
57 "screen_capture_frame_queue.h",
58 "screen_capturer.cc",
59 "screen_capturer.h",
60 "screen_capturer_helper.cc",
61 "screen_capturer_helper.h",
62 "screen_capturer_mac.mm",
63 "screen_capturer_win.cc",
64 "shared_desktop_frame.cc",
65 "shared_desktop_frame.h",
66 "shared_memory.cc",
67 "shared_memory.h",
68 "win/cursor.cc",
69 "win/cursor.h",
70 "win/desktop.cc",
71 "win/desktop.h",
72 "win/scoped_gdi_object.h",
73 "win/scoped_thread_desktop.cc",
74 "win/scoped_thread_desktop.h",
Henrik Kjellander57e5fd22015-05-25 12:55:39 +020075 "win/screen_capture_utils.cc",
76 "win/screen_capture_utils.h",
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +000077 "win/screen_capturer_win_gdi.cc",
78 "win/screen_capturer_win_gdi.h",
79 "win/screen_capturer_win_magnifier.cc",
80 "win/screen_capturer_win_magnifier.h",
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +000081 "win/window_capture_utils.cc",
82 "win/window_capture_utils.h",
83 "window_capturer.cc",
84 "window_capturer.h",
85 "window_capturer_mac.mm",
86 "window_capturer_win.cc",
87 ]
88
89 if (use_x11) {
90 sources += [
91 "mouse_cursor_monitor_x11.cc",
92 "screen_capturer_x11.cc",
93 "window_capturer_x11.cc",
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +000094 "x11/shared_x_display.cc",
Henrik Kjellander57e5fd22015-05-25 12:55:39 +020095 "x11/shared_x_display.h",
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +000096 "x11/x_error_trap.cc",
97 "x11/x_error_trap.h",
98 "x11/x_server_pixel_buffer.cc",
99 "x11/x_server_pixel_buffer.h",
100 ]
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200101 configs += [ "//build/config/linux:x11" ]
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +0000102 }
103
104 if (!is_win && !is_mac && !use_x11) {
105 sources += [
106 "mouse_cursor_monitor_null.cc",
107 "screen_capturer_null.cc",
108 "window_capturer_null.cc",
109 ]
110 }
111
kjellander@webrtc.org556caff2014-12-19 13:28:37 +0000112 if (is_mac) {
113 libs = [
114 "AppKit.framework",
115 "IOKit.framework",
116 "OpenGL.framework",
117 ]
118 }
119
kjellander@webrtc.orgf21ea912014-09-28 17:37:22 +0000120 configs += [ "../..:common_config" ]
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200121 public_configs = [ "../..:common_inherited_config" ]
kjellander@webrtc.org9bef5512014-07-13 09:02:54 +0000122
kjellander@webrtc.org42ee5b52014-08-25 14:15:35 +0000123 if (is_clang) {
124 # Suppress warnings from Chrome's Clang plugins.
125 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
126 configs -= [ "//build/config/clang:find_bad_constructs" ]
127 }
128
andrew@webrtc.org6ae5a6d2014-09-16 01:03:29 +0000129 deps = [
kjellander@webrtc.orgc429b822015-01-21 20:22:33 +0000130 "../../base:rtc_base_approved",
andrew@webrtc.org6ae5a6d2014-09-16 01:03:29 +0000131 "../../system_wrappers",
andrew@webrtc.org6ae5a6d2014-09-16 01:03:29 +0000132 ]
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +0000133
134 if (use_desktop_capture_differ_sse2) {
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200135 deps += [ ":desktop_capture_differ_sse2" ]
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +0000136 }
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +0000137}
138
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +0000139if (use_desktop_capture_differ_sse2) {
140 # Have to be compiled as a separate target because it needs to be compiled
141 # with SSE2 enabled.
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +0000142 source_set("desktop_capture_differ_sse2") {
brettw@chromium.org0867f692014-09-10 16:24:11 +0000143 visibility = [ ":*" ]
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +0000144 sources = [
145 "differ_block_sse2.cc",
146 "differ_block_sse2.h",
147 ]
148
kjellander@webrtc.orgf21ea912014-09-28 17:37:22 +0000149 configs += [ "../..:common_config" ]
150 public_configs = [ "../..:common_inherited_config" ]
kjellander@webrtc.org9bef5512014-07-13 09:02:54 +0000151
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +0000152 if (is_posix && !is_mac) {
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200153 cflags = [ "-msse2" ]
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +0000154 }
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +0000155 }
156}