Fix mouse warp with 2x displays
[chromium-blink-merge.git] / remoting / host / shaped_desktop_capturer.h
blob7b37ed7186b17fff16fea6a01a754ca85d16b11d
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.
5 #ifndef REMOTING_HOST_SHAPED_DESKTOP_CAPTURER_H_
6 #define REMOTING_HOST_SHAPED_DESKTOP_CAPTURER_H_
8 #include "base/memory/scoped_ptr.h"
9 #include "third_party/webrtc/modules/desktop_capture/desktop_capturer.h"
11 namespace remoting {
13 class DesktopShapeTracker;
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 ~ShapedDesktopCapturer() override;
23 // webrtc::DesktopCapturer interface.
24 void Start(webrtc::DesktopCapturer::Callback* callback) override;
25 void Capture(const webrtc::DesktopRegion& region) override;
27 private:
28 // webrtc::DesktopCapturer::Callback interface.
29 webrtc::SharedMemory* CreateSharedMemory(size_t size) override;
30 void OnCaptureCompleted(webrtc::DesktopFrame* frame) override;
32 scoped_ptr<webrtc::DesktopCapturer> desktop_capturer_;
33 scoped_ptr<DesktopShapeTracker> shape_tracker_;
34 webrtc::DesktopCapturer::Callback* callback_;
36 DISALLOW_COPY_AND_ASSIGN(ShapedDesktopCapturer);
39 } // namespace remoting
41 #endif // REMOTING_HOST_SHAPED_DESKTOP_CAPTURER_H_