blob: 7bb1247ea9df0d88bd8b94c6e59e00a8d0b472c4 [file] [log] [blame]
sergeyu@chromium.orge032f9f2013-05-19 07:02:48 +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
11#include "webrtc/modules/desktop_capture/window_capturer.h"
12
pbos@webrtc.org3f45c2e2013-08-05 16:22:53 +000013#include <assert.h>
sergeyu@chromium.orge032f9f2013-05-19 07:02:48 +000014
15#include "webrtc/modules/desktop_capture/desktop_frame.h"
16
17namespace webrtc {
18
19namespace {
20
sergeyu@chromium.orge562e022013-08-23 18:22:12 +000021class WindowCapturerNull : public WindowCapturer {
sergeyu@chromium.orge032f9f2013-05-19 07:02:48 +000022 public:
sergeyu@chromium.orge562e022013-08-23 18:22:12 +000023 WindowCapturerNull();
24 virtual ~WindowCapturerNull();
sergeyu@chromium.orge032f9f2013-05-19 07:02:48 +000025
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
sergeyu@chromium.orge562e022013-08-23 18:22:12 +000037 DISALLOW_COPY_AND_ASSIGN(WindowCapturerNull);
sergeyu@chromium.orge032f9f2013-05-19 07:02:48 +000038};
39
sergeyu@chromium.orge562e022013-08-23 18:22:12 +000040WindowCapturerNull::WindowCapturerNull()
sergeyu@chromium.orge032f9f2013-05-19 07:02:48 +000041 : callback_(NULL) {
42}
43
sergeyu@chromium.orge562e022013-08-23 18:22:12 +000044WindowCapturerNull::~WindowCapturerNull() {
sergeyu@chromium.orge032f9f2013-05-19 07:02:48 +000045}
46
sergeyu@chromium.orge562e022013-08-23 18:22:12 +000047bool WindowCapturerNull::GetWindowList(WindowList* windows) {
sergeyu@chromium.orge032f9f2013-05-19 07:02:48 +000048 // Not implemented yet.
49 return false;
50}
51
sergeyu@chromium.orge562e022013-08-23 18:22:12 +000052bool WindowCapturerNull::SelectWindow(WindowId id) {
sergeyu@chromium.orge032f9f2013-05-19 07:02:48 +000053 // Not implemented yet.
54 return false;
55}
56
sergeyu@chromium.orge562e022013-08-23 18:22:12 +000057void WindowCapturerNull::Start(Callback* callback) {
sergeyu@chromium.orge032f9f2013-05-19 07:02:48 +000058 assert(!callback_);
59 assert(callback);
60
61 callback_ = callback;
62}
63
sergeyu@chromium.orge562e022013-08-23 18:22:12 +000064void WindowCapturerNull::Capture(const DesktopRegion& region) {
sergeyu@chromium.orge032f9f2013-05-19 07:02:48 +000065 // Not implemented yet.
66 callback_->OnCaptureCompleted(NULL);
67}
68
69} // namespace
70
71// static
sergeyu@chromium.org91685dc2013-10-12 22:40:05 +000072WindowCapturer* WindowCapturer::Create(const DesktopCaptureOptions& options) {
sergeyu@chromium.orge562e022013-08-23 18:22:12 +000073 return new WindowCapturerNull();
sergeyu@chromium.orge032f9f2013-05-19 07:02:48 +000074}
75
76} // namespace webrtc