1 // Copyright 2013 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.
5 #ifndef REMOTING_HOST_SHAPED_SCREEN_CAPTURER_H_
6 #define REMOTING_HOST_SHAPED_SCREEN_CAPTURER_H_
8 #include "base/memory/scoped_ptr.h"
9 #include "third_party/webrtc/modules/desktop_capture/screen_capturer.h"
13 class DesktopShapeTracker
;
15 // Screen capturer that also captures desktop shape.
16 class ShapedScreenCapturer
: public webrtc::ScreenCapturer
,
17 public webrtc::DesktopCapturer::Callback
{
19 static scoped_ptr
<ShapedScreenCapturer
> Create(
20 webrtc::DesktopCaptureOptions options
);
22 ShapedScreenCapturer(scoped_ptr
<webrtc::ScreenCapturer
> screen_capturer
,
23 scoped_ptr
<DesktopShapeTracker
> shape_tracker
);
24 virtual ~ShapedScreenCapturer();
26 // webrtc::ScreenCapturer interface.
27 virtual void Start(webrtc::ScreenCapturer::Callback
* callback
) OVERRIDE
;
28 virtual void Capture(const webrtc::DesktopRegion
& region
) OVERRIDE
;
29 virtual void SetMouseShapeObserver(
30 MouseShapeObserver
* mouse_shape_observer
) OVERRIDE
;
31 virtual bool GetScreenList(ScreenList
* screens
) OVERRIDE
;
32 virtual bool SelectScreen(webrtc::ScreenId id
) OVERRIDE
;
35 // webrtc::ScreenCapturer::Callback interface.
36 virtual webrtc::SharedMemory
* CreateSharedMemory(size_t size
) OVERRIDE
;
37 virtual void OnCaptureCompleted(webrtc::DesktopFrame
* frame
) OVERRIDE
;
39 scoped_ptr
<webrtc::ScreenCapturer
> screen_capturer_
;
40 scoped_ptr
<DesktopShapeTracker
> shape_tracker_
;
41 webrtc::ScreenCapturer::Callback
* callback_
;
43 DISALLOW_COPY_AND_ASSIGN(ShapedScreenCapturer
);
46 } // namespace remoting
48 #endif // REMOTING_HOST_SHAPED_SCREEN_CAPTURER_H_