Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(70)

Side by Side Diff: remoting/host/fake_screen_capturer.h

Issue 455073004: Switch DesktopEnvironment to return a DesktopCapturer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove ShapedDesktopCapturer::Create() Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « remoting/host/fake_host_extension.cc ('k') | remoting/host/fake_screen_capturer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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.
4
5 #ifndef REMOTING_HOST_FAKE_SCREEN_CAPTURER_H_
6 #define REMOTING_HOST_FAKE_SCREEN_CAPTURER_H_
7
8 #include "base/callback.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "media/base/media_export.h"
11 #include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h"
12 #include "third_party/webrtc/modules/desktop_capture/screen_capture_frame_queue. h"
13 #include "third_party/webrtc/modules/desktop_capture/screen_capturer.h"
14
15 namespace remoting {
16
17 // A FakeScreenCapturer generates artificial image for testing purpose.
18 //
19 // FakeScreenCapturer is double-buffered as required by ScreenCapturer.
20 class FakeScreenCapturer : public webrtc::ScreenCapturer {
21 public:
22 // By default FakeScreenCapturer generates frames of size kWidth x kHeight,
23 // but custom frame generator set using set_frame_generator() may generate
24 // frames of different size.
25 static const int kWidth = 800;
26 static const int kHeight = 600;
27
28 typedef base::Callback<scoped_ptr<webrtc::DesktopFrame>(
29 webrtc::ScreenCapturer::Callback* callback)> FrameGenerator;
30
31 FakeScreenCapturer();
32 virtual ~FakeScreenCapturer();
33
34 void set_frame_generator(const FrameGenerator& frame_generator);
35
36 // webrtc::DesktopCapturer interface.
37 virtual void Start(Callback* callback) OVERRIDE;
38 virtual void Capture(const webrtc::DesktopRegion& rect) OVERRIDE;
39
40 // webrtc::ScreenCapturer interface.
41 virtual void SetMouseShapeObserver(
42 MouseShapeObserver* mouse_shape_observer) OVERRIDE;
43 virtual bool GetScreenList(ScreenList* screens) OVERRIDE;
44 virtual bool SelectScreen(webrtc::ScreenId id) OVERRIDE;
45
46 private:
47 FrameGenerator frame_generator_;
48
49 Callback* callback_;
50 MouseShapeObserver* mouse_shape_observer_;
51
52 DISALLOW_COPY_AND_ASSIGN(FakeScreenCapturer);
53 };
54
55 } // namespace remoting
56
57 #endif // REMOTING_HOST_FAKE_SCREEN_CAPTURER_H_
OLDNEW
« no previous file with comments | « remoting/host/fake_host_extension.cc ('k') | remoting/host/fake_screen_capturer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698