blob: 2a188a03a36b05ac8e9c561910d871c1b71d1155 [file] [log] [blame]
sergeyu@chromium.org91685dc2013-10-12 22:40:05 +00001/*
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
3 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10#ifndef WEBRTC_MODULES_DESKTOP_CAPTURE_DESKTOP_CAPTURE_OPTIONS_H_
11#define WEBRTC_MODULES_DESKTOP_CAPTURE_DESKTOP_CAPTURE_OPTIONS_H_
12
13#include "webrtc/system_wrappers/interface/constructor_magic.h"
jiayl@webrtc.org54ad9292014-01-29 21:59:12 +000014#include "webrtc/system_wrappers/interface/scoped_refptr.h"
sergeyu@chromium.org91685dc2013-10-12 22:40:05 +000015
16#if defined(USE_X11)
17#include "webrtc/modules/desktop_capture/x11/shared_x_display.h"
18#endif
19
jiayl@webrtc.org54ad9292014-01-29 21:59:12 +000020#if defined(WEBRTC_MAC) && !defined(WEBRTC_IOS)
21#include "webrtc/modules/desktop_capture/mac/desktop_configuration_monitor.h"
22#endif
23
sergeyu@chromium.org91685dc2013-10-12 22:40:05 +000024namespace webrtc {
25
26// An object that stores initialization parameters for screen and window
27// capturers.
28class DesktopCaptureOptions {
29 public:
30 // Creates an empty Options instance (e.g. without X display).
31 DesktopCaptureOptions();
32 ~DesktopCaptureOptions();
33
34 // Returns instance of DesktopCaptureOptions with default parameters. On Linux
35 // also initializes X window connection. x_display() will be set to null if
36 // X11 connection failed (e.g. DISPLAY isn't set).
37 static DesktopCaptureOptions CreateDefault();
38
39#if defined(USE_X11)
40 SharedXDisplay* x_display() const { return x_display_; }
41 void set_x_display(scoped_refptr<SharedXDisplay> x_display) {
42 x_display_ = x_display;
43 }
44#endif
45
jiayl@webrtc.org54ad9292014-01-29 21:59:12 +000046#if defined(WEBRTC_MAC) && !defined(WEBRTC_IOS)
47 DesktopConfigurationMonitor* configuration_monitor() const {
48 return configuration_monitor_;
49 }
50 void set_configuration_monitor(scoped_refptr<DesktopConfigurationMonitor> m) {
51 configuration_monitor_ = m;
52 }
53#endif
54
sergeyu@chromium.org91685dc2013-10-12 22:40:05 +000055 // Flag indicating that the capturer should use screen change notifications.
56 // Enables/disables use of XDAMAGE in the X11 capturer.
57 bool use_update_notifications() const { return use_update_notifications_; }
58 void set_use_update_notifications(bool use_update_notifications) {
59 use_update_notifications_ = use_update_notifications;
60 }
61
62 // Flag indicating if desktop effects (e.g. Aero) should be disabled when the
63 // capturer is active. Currently used only on Windows.
64 bool disable_effects() const { return disable_effects_; }
65 void set_disable_effects(bool disable_effects) {
66 disable_effects_ = disable_effects;
67 }
68
69 private:
70#if defined(USE_X11)
71 scoped_refptr<SharedXDisplay> x_display_;
72#endif
jiayl@webrtc.org54ad9292014-01-29 21:59:12 +000073
74#if defined(WEBRTC_MAC) && !defined(WEBRTC_IOS)
75 scoped_refptr<DesktopConfigurationMonitor> configuration_monitor_;
76#endif
sergeyu@chromium.org91685dc2013-10-12 22:40:05 +000077 bool use_update_notifications_;
78 bool disable_effects_;
79};
80
81} // namespace webrtc
82
83#endif // WEBRTC_MODULES_DESKTOP_CAPTURE_DESKTOP_CAPTURE_OPTIONS_H_