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

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

Issue 11363128: Converted VideoFrameCapturer callbacks into a VideoFrameCapturer::Delegate interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More Mac compilation issues. Created 8 years, 1 month 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/video_frame_capturer.h ('k') | remoting/host/video_frame_capturer_fake.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_HOST_VIDEO_FRAME_CAPTURER_FAKE_H_ 5 #ifndef REMOTING_HOST_VIDEO_FRAME_CAPTURER_FAKE_H_
6 #define REMOTING_HOST_VIDEO_FRAME_CAPTURER_FAKE_H_ 6 #define REMOTING_HOST_VIDEO_FRAME_CAPTURER_FAKE_H_
7 7
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "remoting/host/video_frame_capturer.h" 9 #include "remoting/host/video_frame_capturer.h"
10 #include "remoting/host/video_frame_capturer_helper.h" 10 #include "remoting/host/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(); 20 VideoFrameCapturerFake();
21 virtual ~VideoFrameCapturerFake(); 21 virtual ~VideoFrameCapturerFake();
22 22
23 // Overridden from VideoFrameCapturer: 23 // Overridden from VideoFrameCapturer:
24 virtual void Start( 24 virtual void Start(Delegate* delegate) OVERRIDE;
25 const CursorShapeChangedCallback& callback) OVERRIDE;
26 virtual void Stop() OVERRIDE; 25 virtual void Stop() OVERRIDE;
27 virtual media::VideoFrame::Format pixel_format() const OVERRIDE; 26 virtual media::VideoFrame::Format pixel_format() const OVERRIDE;
28 virtual void InvalidateRegion(const SkRegion& invalid_region) OVERRIDE; 27 virtual void InvalidateRegion(const SkRegion& invalid_region) OVERRIDE;
29 virtual void CaptureInvalidRegion( 28 virtual void CaptureInvalidRegion() OVERRIDE;
30 const CaptureCompletedCallback& callback) OVERRIDE;
31 virtual const SkISize& size_most_recent() const OVERRIDE; 29 virtual const SkISize& size_most_recent() const OVERRIDE;
32 30
33 private: 31 private:
34 // Generates an image in the front buffer. 32 // Generates an image in the front buffer.
35 void GenerateImage(); 33 void GenerateImage();
36 34
37 // Called when the screen configuration is changed. 35 // Called when the screen configuration is changed.
38 void ScreenConfigurationChanged(); 36 void ScreenConfigurationChanged();
39 37
38 Delegate* delegate_;
39
40 SkISize size_; 40 SkISize size_;
41 int bytes_per_row_; 41 int bytes_per_row_;
42 int box_pos_x_; 42 int box_pos_x_;
43 int box_pos_y_; 43 int box_pos_y_;
44 int box_speed_x_; 44 int box_speed_x_;
45 int box_speed_y_; 45 int box_speed_y_;
46 46
47 VideoFrameCapturerHelper helper_; 47 VideoFrameCapturerHelper helper_;
48 48
49 // We have two buffers for the screen images as required by Capturer. 49 // We have two buffers for the screen images as required by Capturer.
50 static const int kNumBuffers = 2; 50 static const int kNumBuffers = 2;
51 scoped_array<uint8> buffers_[kNumBuffers]; 51 scoped_array<uint8> buffers_[kNumBuffers];
52 52
53 // The current buffer with valid data for reading. 53 // The current buffer with valid data for reading.
54 int current_buffer_; 54 int current_buffer_;
55 55
56 // Format of pixels returned in buffer. 56 // Format of pixels returned in buffer.
57 media::VideoFrame::Format pixel_format_; 57 media::VideoFrame::Format pixel_format_;
58 58
59 DISALLOW_COPY_AND_ASSIGN(VideoFrameCapturerFake); 59 DISALLOW_COPY_AND_ASSIGN(VideoFrameCapturerFake);
60 }; 60 };
61 61
62 } // namespace remoting 62 } // namespace remoting
63 63
64 #endif // REMOTING_HOST_VIDEO_FRAME_CAPTURER_FAKE_H_ 64 #endif // REMOTING_HOST_VIDEO_FRAME_CAPTURER_FAKE_H_
OLDNEW
« no previous file with comments | « remoting/host/video_frame_capturer.h ('k') | remoting/host/video_frame_capturer_fake.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698