• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef REMOTING_HOST_SHAPED_DESKTOP_CAPTURER_H_
6 #define REMOTING_HOST_SHAPED_DESKTOP_CAPTURER_H_
7 
8 #include "base/memory/scoped_ptr.h"
9 #include "third_party/webrtc/modules/desktop_capture/desktop_capturer.h"
10 
11 namespace remoting {
12 
13 class DesktopShapeTracker;
14 
15 // Screen capturer that also captures desktop shape.
16 class ShapedDesktopCapturer : public webrtc::DesktopCapturer,
17                               public webrtc::DesktopCapturer::Callback {
18  public:
19   ShapedDesktopCapturer(scoped_ptr<webrtc::DesktopCapturer> screen_capturer,
20                         scoped_ptr<DesktopShapeTracker> shape_tracker);
21   virtual ~ShapedDesktopCapturer();
22 
23   // webrtc::DesktopCapturer interface.
24   virtual void Start(webrtc::DesktopCapturer::Callback* callback) OVERRIDE;
25   virtual void Capture(const webrtc::DesktopRegion& region) OVERRIDE;
26 
27  private:
28   // webrtc::DesktopCapturer::Callback interface.
29   virtual webrtc::SharedMemory* CreateSharedMemory(size_t size) OVERRIDE;
30   virtual void OnCaptureCompleted(webrtc::DesktopFrame* frame) OVERRIDE;
31 
32   scoped_ptr<webrtc::DesktopCapturer> desktop_capturer_;
33   scoped_ptr<DesktopShapeTracker> shape_tracker_;
34   webrtc::DesktopCapturer::Callback* callback_;
35 
36   DISALLOW_COPY_AND_ASSIGN(ShapedDesktopCapturer);
37 };
38 
39 }  // namespace remoting
40 
41 #endif  // REMOTING_HOST_SHAPED_DESKTOP_CAPTURER_H_
42