blob: 17135ccb86d49b51a678b8d41aa06f56c268ce06 [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
Sergey Ulanov098c1de2015-09-01 11:36:40 -070015source_set("primitives") {
16 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",
24 ]
25
26 public_configs = [ "../..:common_inherited_config" ]
27}
28
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +000029source_set("desktop_capture") {
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +000030 sources = [
jiayl@webrtc.org0e710702014-11-11 18:15:55 +000031 "cropped_desktop_frame.cc",
32 "cropped_desktop_frame.h",
33 "cropping_window_capturer.cc",
34 "cropping_window_capturer.h",
35 "cropping_window_capturer_win.cc",
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +000036 "desktop_and_cursor_composer.cc",
37 "desktop_and_cursor_composer.h",
Henrik Kjellander57e5fd22015-05-25 12:55:39 +020038 "desktop_capture_options.cc",
39 "desktop_capture_options.h",
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +000040 "desktop_capturer.h",
Henrik Kjellander57e5fd22015-05-25 12:55:39 +020041 "desktop_capturer.h",
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +000042 "desktop_frame_win.cc",
43 "desktop_frame_win.h",
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +000044 "differ.cc",
45 "differ.h",
46 "differ_block.cc",
47 "differ_block.h",
48 "mac/desktop_configuration.h",
49 "mac/desktop_configuration.mm",
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +000050 "mac/desktop_configuration_monitor.cc",
Henrik Kjellander57e5fd22015-05-25 12:55:39 +020051 "mac/desktop_configuration_monitor.h",
jiayl@webrtc.org12b4efe2014-07-08 22:05:24 +000052 "mac/full_screen_chrome_window_detector.cc",
53 "mac/full_screen_chrome_window_detector.h",
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +000054 "mac/scoped_pixel_buffer_object.cc",
55 "mac/scoped_pixel_buffer_object.h",
jiayl@webrtc.org12b4efe2014-07-08 22:05:24 +000056 "mac/window_list_utils.cc",
57 "mac/window_list_utils.h",
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +000058 "mouse_cursor.cc",
59 "mouse_cursor.h",
60 "mouse_cursor_monitor.h",
61 "mouse_cursor_monitor_mac.mm",
62 "mouse_cursor_monitor_win.cc",
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +000063 "screen_capture_frame_queue.cc",
64 "screen_capture_frame_queue.h",
65 "screen_capturer.cc",
66 "screen_capturer.h",
67 "screen_capturer_helper.cc",
68 "screen_capturer_helper.h",
69 "screen_capturer_mac.mm",
70 "screen_capturer_win.cc",
71 "shared_desktop_frame.cc",
72 "shared_desktop_frame.h",
73 "shared_memory.cc",
74 "shared_memory.h",
75 "win/cursor.cc",
76 "win/cursor.h",
77 "win/desktop.cc",
78 "win/desktop.h",
79 "win/scoped_gdi_object.h",
80 "win/scoped_thread_desktop.cc",
81 "win/scoped_thread_desktop.h",
Henrik Kjellander57e5fd22015-05-25 12:55:39 +020082 "win/screen_capture_utils.cc",
83 "win/screen_capture_utils.h",
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +000084 "win/screen_capturer_win_gdi.cc",
85 "win/screen_capturer_win_gdi.h",
86 "win/screen_capturer_win_magnifier.cc",
87 "win/screen_capturer_win_magnifier.h",
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +000088 "win/window_capture_utils.cc",
89 "win/window_capture_utils.h",
90 "window_capturer.cc",
91 "window_capturer.h",
92 "window_capturer_mac.mm",
93 "window_capturer_win.cc",
94 ]
95
96 if (use_x11) {
97 sources += [
98 "mouse_cursor_monitor_x11.cc",
99 "screen_capturer_x11.cc",
100 "window_capturer_x11.cc",
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +0000101 "x11/shared_x_display.cc",
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200102 "x11/shared_x_display.h",
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +0000103 "x11/x_error_trap.cc",
104 "x11/x_error_trap.h",
105 "x11/x_server_pixel_buffer.cc",
106 "x11/x_server_pixel_buffer.h",
107 ]
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200108 configs += [ "//build/config/linux:x11" ]
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +0000109 }
110
111 if (!is_win && !is_mac && !use_x11) {
112 sources += [
113 "mouse_cursor_monitor_null.cc",
114 "screen_capturer_null.cc",
115 "window_capturer_null.cc",
116 ]
117 }
118
kjellander@webrtc.org556caff2014-12-19 13:28:37 +0000119 if (is_mac) {
120 libs = [
121 "AppKit.framework",
122 "IOKit.framework",
123 "OpenGL.framework",
124 ]
125 }
126
kjellander@webrtc.orgf21ea912014-09-28 17:37:22 +0000127 configs += [ "../..:common_config" ]
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200128 public_configs = [ "../..:common_inherited_config" ]
kjellander@webrtc.org9bef5512014-07-13 09:02:54 +0000129
kjellander@webrtc.org42ee5b52014-08-25 14:15:35 +0000130 if (is_clang) {
131 # Suppress warnings from Chrome's Clang plugins.
132 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
133 configs -= [ "//build/config/clang:find_bad_constructs" ]
134 }
135
andrew@webrtc.org6ae5a6d2014-09-16 01:03:29 +0000136 deps = [
Sergey Ulanov098c1de2015-09-01 11:36:40 -0700137 ":primitives",
kjellander@webrtc.orgc429b822015-01-21 20:22:33 +0000138 "../../base:rtc_base_approved",
andrew@webrtc.org6ae5a6d2014-09-16 01:03:29 +0000139 "../../system_wrappers",
andrew@webrtc.org6ae5a6d2014-09-16 01:03:29 +0000140 ]
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +0000141
142 if (use_desktop_capture_differ_sse2) {
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200143 deps += [ ":desktop_capture_differ_sse2" ]
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +0000144 }
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +0000145}
146
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +0000147if (use_desktop_capture_differ_sse2) {
148 # Have to be compiled as a separate target because it needs to be compiled
149 # with SSE2 enabled.
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +0000150 source_set("desktop_capture_differ_sse2") {
brettw@chromium.org0867f692014-09-10 16:24:11 +0000151 visibility = [ ":*" ]
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +0000152 sources = [
153 "differ_block_sse2.cc",
154 "differ_block_sse2.h",
155 ]
156
kjellander@webrtc.orgf21ea912014-09-28 17:37:22 +0000157 configs += [ "../..:common_config" ]
158 public_configs = [ "../..:common_inherited_config" ]
kjellander@webrtc.org9bef5512014-07-13 09:02:54 +0000159
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +0000160 if (is_posix && !is_mac) {
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200161 cflags = [ "-msse2" ]
jiayl@webrtc.org93426cd2014-07-02 15:47:12 +0000162 }
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +0000163 }
164}