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
13#include <assert.h>
14
15#include "webrtc/modules/desktop_capture/desktop_frame.h"
16
17namespace webrtc {
18
19namespace {
20
21class WindowCapturerNull : public WindowCapturer {
22 public:
23  WindowCapturerNull();
24  virtual ~WindowCapturerNull();
25
26  // WindowCapturer interface.
27  virtual bool GetWindowList(WindowList* windows) OVERRIDE;
28  virtual bool SelectWindow(WindowId id) OVERRIDE;
29  virtual bool BringSelectedWindowToFront() OVERRIDE;
30
31  // DesktopCapturer interface.
32  virtual void Start(Callback* callback) OVERRIDE;
33  virtual void Capture(const DesktopRegion& region) OVERRIDE;
34
35 private:
36  Callback* callback_;
37
38  DISALLOW_COPY_AND_ASSIGN(WindowCapturerNull);
39};
40
41WindowCapturerNull::WindowCapturerNull()
42    : callback_(NULL) {
43}
44
45WindowCapturerNull::~WindowCapturerNull() {
46}
47
48bool WindowCapturerNull::GetWindowList(WindowList* windows) {
49  // Not implemented yet.
50  return false;
51}
52
53bool WindowCapturerNull::SelectWindow(WindowId id) {
54  // Not implemented yet.
55  return false;
56}
57
58bool WindowCapturerNull::BringSelectedWindowToFront() {
59  // Not implemented yet.
60  return false;
61}
62
63void WindowCapturerNull::Start(Callback* callback) {
64  assert(!callback_);
65  assert(callback);
66
67  callback_ = callback;
68}
69
70void WindowCapturerNull::Capture(const DesktopRegion& region) {
71  // Not implemented yet.
72  callback_->OnCaptureCompleted(NULL);
73}
74
75}  // namespace
76
77// static
78WindowCapturer* WindowCapturer::Create(const DesktopCaptureOptions& options) {
79  return new WindowCapturerNull();
80}
81
82}  // namespace webrtc
83