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_HELPER_H_ | 5 #ifndef MEDIA_VIDEO_CAPTURE_SCREEN_SCREEN_CAPTURER_HELPER_H_ |
6 #define REMOTING_CAPTURER_VIDEO_FRAME_CAPTURER_HELPER_H_ | 6 #define MEDIA_VIDEO_CAPTURE_SCREEN_SCREEN_CAPTURER_HELPER_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/synchronization/lock.h" | 9 #include "base/synchronization/lock.h" |
| 10 #include "media/base/media_export.h" |
10 #include "third_party/skia/include/core/SkRegion.h" | 11 #include "third_party/skia/include/core/SkRegion.h" |
11 | 12 |
12 namespace remoting { | 13 namespace media { |
13 | 14 |
14 // VideoFrameCapturerHelper is intended to be used by an implementation of the | 15 // ScreenCapturerHelper is intended to be used by an implementation of the |
15 // VideoFrameCapturer interface. It maintains a thread-safe invalid region, and | 16 // ScreenCapturer interface. It maintains a thread-safe invalid region, and |
16 // the size of the most recently captured screen, on behalf of the | 17 // the size of the most recently captured screen, on behalf of the |
17 // VideoFrameCapturer that owns it. | 18 // ScreenCapturer that owns it. |
18 class VideoFrameCapturerHelper { | 19 class MEDIA_EXPORT ScreenCapturerHelper { |
19 public: | 20 public: |
20 VideoFrameCapturerHelper(); | 21 ScreenCapturerHelper(); |
21 ~VideoFrameCapturerHelper(); | 22 ~ScreenCapturerHelper(); |
22 | 23 |
23 // Clear out the invalid region. | 24 // Clear out the invalid region. |
24 void ClearInvalidRegion(); | 25 void ClearInvalidRegion(); |
25 | 26 |
26 // Invalidate the specified region. | 27 // Invalidate the specified region. |
27 void InvalidateRegion(const SkRegion& invalid_region); | 28 void InvalidateRegion(const SkRegion& invalid_region); |
28 | 29 |
29 // Invalidate the entire screen, of a given size. | 30 // Invalidate the entire screen, of a given size. |
30 void InvalidateScreen(const SkISize& size); | 31 void InvalidateScreen(const SkISize& size); |
31 | 32 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 base::Lock invalid_region_lock_; | 69 base::Lock invalid_region_lock_; |
69 | 70 |
70 // The size of the most recently captured screen. | 71 // The size of the most recently captured screen. |
71 SkISize size_most_recent_; | 72 SkISize size_most_recent_; |
72 | 73 |
73 // The log (base 2) of the size of the grid to which the invalid region is | 74 // The log (base 2) of the size of the grid to which the invalid region is |
74 // expanded. | 75 // expanded. |
75 // If the value is <= 0, then the invalid region is not expanded to a grid. | 76 // If the value is <= 0, then the invalid region is not expanded to a grid. |
76 int log_grid_size_; | 77 int log_grid_size_; |
77 | 78 |
78 DISALLOW_COPY_AND_ASSIGN(VideoFrameCapturerHelper); | 79 DISALLOW_COPY_AND_ASSIGN(ScreenCapturerHelper); |
79 }; | 80 }; |
80 | 81 |
81 } // namespace remoting | 82 } // namespace media |
82 | 83 |
83 #endif // REMOTING_CAPTURER_VIDEO_FRAME_CAPTURER_HELPER_H_ | 84 #endif // MEDIA_VIDEO_CAPTURE_SCREEN_SCREEN_CAPTURER_HELPER_H_ |
OLD | NEW |