sergeyu@chromium.org | b10ccbe | 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 | #include "webrtc/modules/desktop_capture/window_capturer.h" |
| 12 | |
pbos@webrtc.org | 12dc1a3 | 2013-08-05 16:22:53 +0000 | [diff] [blame^] | 13 | #include <assert.h> |
sergeyu@chromium.org | b10ccbe | 2013-05-19 07:02:48 +0000 | [diff] [blame] | 14 | |
| 15 | #include "webrtc/modules/desktop_capture/desktop_frame.h" |
| 16 | |
| 17 | namespace webrtc { |
| 18 | |
| 19 | namespace { |
| 20 | |
| 21 | class WindowCapturerLinux : public WindowCapturer { |
| 22 | public: |
| 23 | WindowCapturerLinux(); |
| 24 | virtual ~WindowCapturerLinux(); |
| 25 | |
| 26 | // WindowCapturer interface. |
| 27 | virtual bool GetWindowList(WindowList* windows) OVERRIDE; |
| 28 | virtual bool SelectWindow(WindowId id) OVERRIDE; |
| 29 | |
| 30 | // DesktopCapturer interface. |
| 31 | virtual void Start(Callback* callback) OVERRIDE; |
| 32 | virtual void Capture(const DesktopRegion& region) OVERRIDE; |
| 33 | |
| 34 | private: |
| 35 | Callback* callback_; |
| 36 | |
| 37 | DISALLOW_COPY_AND_ASSIGN(WindowCapturerLinux); |
| 38 | }; |
| 39 | |
| 40 | WindowCapturerLinux::WindowCapturerLinux() |
| 41 | : callback_(NULL) { |
| 42 | } |
| 43 | |
| 44 | WindowCapturerLinux::~WindowCapturerLinux() { |
| 45 | } |
| 46 | |
| 47 | bool WindowCapturerLinux::GetWindowList(WindowList* windows) { |
| 48 | // Not implemented yet. |
| 49 | return false; |
| 50 | } |
| 51 | |
| 52 | bool WindowCapturerLinux::SelectWindow(WindowId id) { |
| 53 | // Not implemented yet. |
| 54 | return false; |
| 55 | } |
| 56 | |
| 57 | void WindowCapturerLinux::Start(Callback* callback) { |
| 58 | assert(!callback_); |
| 59 | assert(callback); |
| 60 | |
| 61 | callback_ = callback; |
| 62 | } |
| 63 | |
| 64 | void WindowCapturerLinux::Capture(const DesktopRegion& region) { |
| 65 | // Not implemented yet. |
| 66 | callback_->OnCaptureCompleted(NULL); |
| 67 | } |
| 68 | |
| 69 | } // namespace |
| 70 | |
| 71 | // static |
| 72 | WindowCapturer* WindowCapturer::Create() { |
| 73 | return new WindowCapturerLinux(); |
| 74 | } |
| 75 | |
| 76 | } // namespace webrtc |