OLD | NEW |
| (Empty) |
1 // Copyright (c) 2012 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 MEDIA_VIDEO_CAPTURE_SCREEN_SCREEN_CAPTURER_FAKE_H_ | |
6 #define MEDIA_VIDEO_CAPTURE_SCREEN_SCREEN_CAPTURER_FAKE_H_ | |
7 | |
8 #include "base/memory/scoped_ptr.h" | |
9 #include "media/base/media_export.h" | |
10 #include "media/video/capture/screen/screen_capture_frame_queue.h" | |
11 #include "media/video/capture/screen/screen_capturer.h" | |
12 #include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h" | |
13 | |
14 namespace media { | |
15 | |
16 // A ScreenCapturerFake generates artificial image for testing purpose. | |
17 // | |
18 // ScreenCapturerFake is double-buffered as required by ScreenCapturer. | |
19 class MEDIA_EXPORT ScreenCapturerFake : public ScreenCapturer { | |
20 public: | |
21 // ScreenCapturerFake generates a picture of size kWidth x kHeight. | |
22 static const int kWidth = 800; | |
23 static const int kHeight = 600; | |
24 | |
25 ScreenCapturerFake(); | |
26 virtual ~ScreenCapturerFake(); | |
27 | |
28 // webrtc::DesktopCapturer interface. | |
29 virtual void Start(Callback* callback) OVERRIDE; | |
30 virtual void Capture(const webrtc::DesktopRegion& rect) OVERRIDE; | |
31 | |
32 // ScreenCapturer interface. | |
33 virtual void SetMouseShapeObserver( | |
34 MouseShapeObserver* mouse_shape_observer) OVERRIDE; | |
35 | |
36 private: | |
37 // Generates an image in the front buffer. | |
38 void GenerateImage(); | |
39 | |
40 // Called when the screen configuration is changed. | |
41 void ScreenConfigurationChanged(); | |
42 | |
43 Callback* callback_; | |
44 MouseShapeObserver* mouse_shape_observer_; | |
45 | |
46 webrtc::DesktopSize size_; | |
47 int bytes_per_row_; | |
48 int box_pos_x_; | |
49 int box_pos_y_; | |
50 int box_speed_x_; | |
51 int box_speed_y_; | |
52 | |
53 ScreenCaptureFrameQueue queue_; | |
54 | |
55 DISALLOW_COPY_AND_ASSIGN(ScreenCapturerFake); | |
56 }; | |
57 | |
58 } // namespace media | |
59 | |
60 #endif // MEDIA_VIDEO_CAPTURE_SCREEN_SCREEN_CAPTURER_FAKE_H_ | |
OLD | NEW |