sergeyu@chromium.org | e032f9f | 2013-05-19 07:02:48 +0000 | [diff] [blame] | 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 | |
| 11 | #ifndef WEBRTC_MODULES_DESKTOP_CAPTURE_WINDOW_CAPTURER_H_ |
| 12 | #define WEBRTC_MODULES_DESKTOP_CAPTURE_WINDOW_CAPTURER_H_ |
| 13 | |
| 14 | #include <vector> |
| 15 | #include <string> |
| 16 | |
sergeyu@chromium.org | af54d4b | 2013-10-16 02:42:38 +0000 | [diff] [blame^] | 17 | #include "webrtc/modules/desktop_capture/desktop_capture_types.h" |
sergeyu@chromium.org | e032f9f | 2013-05-19 07:02:48 +0000 | [diff] [blame] | 18 | #include "webrtc/modules/desktop_capture/desktop_capturer.h" |
| 19 | #include "webrtc/system_wrappers/interface/constructor_magic.h" |
| 20 | #include "webrtc/typedefs.h" |
| 21 | |
| 22 | namespace webrtc { |
| 23 | |
sergeyu@chromium.org | 91685dc | 2013-10-12 22:40:05 +0000 | [diff] [blame] | 24 | class DesktopCaptureOptions; |
| 25 | |
sergeyu@chromium.org | e032f9f | 2013-05-19 07:02:48 +0000 | [diff] [blame] | 26 | class WindowCapturer : public DesktopCapturer { |
| 27 | public: |
sergeyu@chromium.org | af54d4b | 2013-10-16 02:42:38 +0000 | [diff] [blame^] | 28 | typedef webrtc::WindowId WindowId; |
sergeyu@chromium.org | e032f9f | 2013-05-19 07:02:48 +0000 | [diff] [blame] | 29 | |
| 30 | struct Window { |
| 31 | WindowId id; |
| 32 | |
| 33 | // Title of the window in UTF-8 encoding. |
| 34 | std::string title; |
| 35 | }; |
| 36 | |
| 37 | typedef std::vector<Window> WindowList; |
| 38 | |
sergeyu@chromium.org | 91685dc | 2013-10-12 22:40:05 +0000 | [diff] [blame] | 39 | static WindowCapturer* Create(const DesktopCaptureOptions& options); |
| 40 | |
| 41 | // TODO(sergeyu): Remove this method. crbug.com/172183 |
sergeyu@chromium.org | e032f9f | 2013-05-19 07:02:48 +0000 | [diff] [blame] | 42 | static WindowCapturer* Create(); |
| 43 | |
| 44 | virtual ~WindowCapturer() {} |
| 45 | |
| 46 | // Get list of windows. Returns false in case of a failure. |
| 47 | virtual bool GetWindowList(WindowList* windows) = 0; |
| 48 | |
| 49 | // Select window to be captured. Returns false in case of a failure (e.g. if |
| 50 | // there is no window with the specified id). |
| 51 | virtual bool SelectWindow(WindowId id) = 0; |
| 52 | }; |
| 53 | |
| 54 | } // namespace webrtc |
| 55 | |
| 56 | #endif // WEBRTC_MODULES_DESKTOP_CAPTURE_WINDOW_CAPTURER_H_ |
| 57 | |