summaryrefslogtreecommitdiffstats
path: root/remoting/host/shaped_screen_capturer.h
blob: 9751086a1bfcf98c98e64ff377f979da3c275284 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef REMOTING_HOST_SHAPED_SCREEN_CAPTURER_H_
#define REMOTING_HOST_SHAPED_SCREEN_CAPTURER_H_

#include "base/memory/scoped_ptr.h"
#include "third_party/webrtc/modules/desktop_capture/screen_capturer.h"

namespace remoting {

class DesktopShapeTracker;

// Screen capturer that also captures desktop shape.
class ShapedScreenCapturer : public webrtc::ScreenCapturer,
                             public webrtc::DesktopCapturer::Callback {
 public:
  static scoped_ptr<ShapedScreenCapturer> Create(
      webrtc::DesktopCaptureOptions options);

  ShapedScreenCapturer(scoped_ptr<webrtc::ScreenCapturer> screen_capturer,
                       scoped_ptr<DesktopShapeTracker> shape_tracker);
  virtual ~ShapedScreenCapturer();

  // webrtc::ScreenCapturer interface.
  virtual void Start(webrtc::ScreenCapturer::Callback* callback) OVERRIDE;
  virtual void Capture(const webrtc::DesktopRegion& region) OVERRIDE;
  virtual void SetMouseShapeObserver(
      MouseShapeObserver* mouse_shape_observer) OVERRIDE;

 private:
  // webrtc::ScreenCapturer::Callback interface.
  virtual webrtc::SharedMemory* CreateSharedMemory(size_t size) OVERRIDE;
  virtual void OnCaptureCompleted(webrtc::DesktopFrame* frame) OVERRIDE;

  scoped_ptr<webrtc::ScreenCapturer> screen_capturer_;
  scoped_ptr<DesktopShapeTracker> shape_tracker_;
  webrtc::ScreenCapturer::Callback* callback_;

  DISALLOW_COPY_AND_ASSIGN(ShapedScreenCapturer);
};

}  // namespace remoting

#endif  // REMOTING_HOST_SHAPED_SCREEN_CAPTURER_H_