| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 CONTENT_BROWSER_MEDIA_CAPTURE_VIDEO_CAPTURE_ORACLE_H_ | 5 #ifndef CONTENT_BROWSER_MEDIA_CAPTURE_VIDEO_CAPTURE_ORACLE_H_ |
| 6 #define CONTENT_BROWSER_MEDIA_CAPTURE_VIDEO_CAPTURE_ORACLE_H_ | 6 #define CONTENT_BROWSER_MEDIA_CAPTURE_VIDEO_CAPTURE_ORACLE_H_ |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 | 9 |
| 10 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 | 168 |
| 169 // VideoCaptureOracle manages the producer-side throttling of captured frames | 169 // VideoCaptureOracle manages the producer-side throttling of captured frames |
| 170 // from a video capture device. It is informed of every update by the device; | 170 // from a video capture device. It is informed of every update by the device; |
| 171 // this empowers it to look into the future and decide if a particular frame | 171 // this empowers it to look into the future and decide if a particular frame |
| 172 // ought to be captured in order to achieve its target frame rate. | 172 // ought to be captured in order to achieve its target frame rate. |
| 173 class CONTENT_EXPORT VideoCaptureOracle { | 173 class CONTENT_EXPORT VideoCaptureOracle { |
| 174 public: | 174 public: |
| 175 enum Event { | 175 enum Event { |
| 176 kTimerPoll, | 176 kTimerPoll, |
| 177 kCompositorUpdate, | 177 kCompositorUpdate, |
| 178 kSoftwarePaint, | |
| 179 kNumEvents, | 178 kNumEvents, |
| 180 }; | 179 }; |
| 181 | 180 |
| 182 explicit VideoCaptureOracle(base::TimeDelta min_capture_period); | 181 explicit VideoCaptureOracle(base::TimeDelta min_capture_period); |
| 183 virtual ~VideoCaptureOracle(); | 182 virtual ~VideoCaptureOracle(); |
| 184 | 183 |
| 185 // Record a event of type |event|, and decide whether the caller should do a | 184 // Record a event of type |event|, and decide whether the caller should do a |
| 186 // frame capture. |damage_rect| is the region of a frame about to be drawn, | 185 // frame capture. |damage_rect| is the region of a frame about to be drawn, |
| 187 // and may be an empty Rect, if this is not known. If the caller accepts the | 186 // and may be an empty Rect, if this is not known. If the caller accepts the |
| 188 // oracle's proposal, it should call RecordCapture() to indicate this. | 187 // oracle's proposal, it should call RecordCapture() to indicate this. |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 // Recent history of frame timestamps proposed by VideoCaptureOracle. This is | 227 // Recent history of frame timestamps proposed by VideoCaptureOracle. This is |
| 229 // a ring-buffer, and should only be accessed by the Get/SetFrameTimestamp() | 228 // a ring-buffer, and should only be accessed by the Get/SetFrameTimestamp() |
| 230 // methods. | 229 // methods. |
| 231 enum { kMaxFrameTimestamps = 16 }; | 230 enum { kMaxFrameTimestamps = 16 }; |
| 232 base::TimeTicks frame_timestamps_[kMaxFrameTimestamps]; | 231 base::TimeTicks frame_timestamps_[kMaxFrameTimestamps]; |
| 233 }; | 232 }; |
| 234 | 233 |
| 235 } // namespace content | 234 } // namespace content |
| 236 | 235 |
| 237 #endif // CONTENT_BROWSER_MEDIA_CAPTURE_VIDEO_CAPTURE_ORACLE_H_ | 236 #endif // CONTENT_BROWSER_MEDIA_CAPTURE_VIDEO_CAPTURE_ORACLE_H_ |
| OLD | NEW |