OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef REMOTING_CAPTURER_VIDEO_FRAME_CAPTURER_FAKE_H_ | 5 #ifndef REMOTING_CAPTURER_VIDEO_FRAME_CAPTURER_FAKE_H_ |
6 #define REMOTING_CAPTURER_VIDEO_FRAME_CAPTURER_FAKE_H_ | 6 #define REMOTING_CAPTURER_VIDEO_FRAME_CAPTURER_FAKE_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "remoting/capturer/video_frame_capturer.h" | 9 #include "remoting/capturer/video_frame_capturer.h" |
10 #include "remoting/capturer/video_frame_capturer_helper.h" | 10 #include "remoting/capturer/video_frame_capturer_helper.h" |
11 | 11 |
12 namespace remoting { | 12 namespace remoting { |
13 | 13 |
14 // A VideoFrameCapturerFake generates artificial image for testing purpose. | 14 // A VideoFrameCapturerFake generates artificial image for testing purpose. |
15 // | 15 // |
16 // VideoFrameCapturerFake is double-buffered as required by VideoFrameCapturer. | 16 // VideoFrameCapturerFake is double-buffered as required by VideoFrameCapturer. |
17 // See remoting/host/video_frame_capturer.h. | 17 // See remoting/host/video_frame_capturer.h. |
18 class VideoFrameCapturerFake : public VideoFrameCapturer { | 18 class VideoFrameCapturerFake : public VideoFrameCapturer { |
19 public: | 19 public: |
| 20 // VideoFrameCapturerFake generates a picture of size kWidth x kHeight. |
| 21 static const int kWidth = 800; |
| 22 static const int kHeight = 600; |
| 23 |
20 VideoFrameCapturerFake(); | 24 VideoFrameCapturerFake(); |
21 virtual ~VideoFrameCapturerFake(); | 25 virtual ~VideoFrameCapturerFake(); |
22 | 26 |
23 // Overridden from VideoFrameCapturer: | 27 // Overridden from VideoFrameCapturer: |
24 virtual void Start(Delegate* delegate) OVERRIDE; | 28 virtual void Start(Delegate* delegate) OVERRIDE; |
25 virtual void Stop() OVERRIDE; | 29 virtual void Stop() OVERRIDE; |
26 virtual void InvalidateRegion(const SkRegion& invalid_region) OVERRIDE; | 30 virtual void InvalidateRegion(const SkRegion& invalid_region) OVERRIDE; |
27 virtual void CaptureFrame() OVERRIDE; | 31 virtual void CaptureFrame() OVERRIDE; |
28 virtual const SkISize& size_most_recent() const OVERRIDE; | 32 virtual const SkISize& size_most_recent() const OVERRIDE; |
29 | 33 |
(...skipping 21 matching lines...) Expand all Loading... |
51 | 55 |
52 // The current buffer with valid data for reading. | 56 // The current buffer with valid data for reading. |
53 int current_buffer_; | 57 int current_buffer_; |
54 | 58 |
55 DISALLOW_COPY_AND_ASSIGN(VideoFrameCapturerFake); | 59 DISALLOW_COPY_AND_ASSIGN(VideoFrameCapturerFake); |
56 }; | 60 }; |
57 | 61 |
58 } // namespace remoting | 62 } // namespace remoting |
59 | 63 |
60 #endif // REMOTING_CAPTURER_VIDEO_FRAME_CAPTURER_FAKE_H_ | 64 #endif // REMOTING_CAPTURER_VIDEO_FRAME_CAPTURER_FAKE_H_ |
OLD | NEW |