- add third_party src.
[platform/framework/web/crosswalk.git] / src / third_party / webrtc / modules / desktop_capture / desktop_capture_options.h
1 /*
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"
14
15 #if defined(USE_X11)
16 #include "webrtc/modules/desktop_capture/x11/shared_x_display.h"
17 #endif
18
19 namespace webrtc {
20
21 // An object that stores initialization parameters for screen and window
22 // capturers.
23 class DesktopCaptureOptions {
24  public:
25   // Creates an empty Options instance (e.g. without X display).
26   DesktopCaptureOptions();
27   ~DesktopCaptureOptions();
28
29   // Returns instance of DesktopCaptureOptions with default parameters. On Linux
30   // also initializes X window connection. x_display() will be set to null if
31   // X11 connection failed (e.g. DISPLAY isn't set).
32   static DesktopCaptureOptions CreateDefault();
33
34 #if defined(USE_X11)
35   SharedXDisplay* x_display() const { return x_display_; }
36   void set_x_display(scoped_refptr<SharedXDisplay> x_display) {
37     x_display_ = x_display;
38   }
39 #endif
40
41   // Flag indicating that the capturer should use screen change notifications.
42   // Enables/disables use of XDAMAGE in the X11 capturer.
43   bool use_update_notifications() const { return use_update_notifications_; }
44   void set_use_update_notifications(bool use_update_notifications) {
45     use_update_notifications_ = use_update_notifications;
46   }
47
48   // Flag indicating if desktop effects (e.g. Aero) should be disabled when the
49   // capturer is active. Currently used only on Windows.
50   bool disable_effects() const { return disable_effects_; }
51   void set_disable_effects(bool disable_effects) {
52     disable_effects_ = disable_effects;
53   }
54
55  private:
56 #if defined(USE_X11)
57   scoped_refptr<SharedXDisplay> x_display_;
58 #endif
59   bool use_update_notifications_;
60   bool disable_effects_;
61 };
62
63 }  // namespace webrtc
64
65 #endif  // WEBRTC_MODULES_DESKTOP_CAPTURE_DESKTOP_CAPTURE_OPTIONS_H_