| 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 "base/callback_forward.h" | 8 #include "base/callback_forward.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 | 78 |
| 79 // Stores the last |event_time| from the last observation/decision. Used to | 79 // Stores the last |event_time| from the last observation/decision. Used to |
| 80 // sanity-check that event times are monotonically non-decreasing. | 80 // sanity-check that event times are monotonically non-decreasing. |
| 81 base::TimeTicks last_event_time_[kNumEvents]; | 81 base::TimeTicks last_event_time_[kNumEvents]; |
| 82 | 82 |
| 83 // Updated by the last call to ObserveEventAndDecideCapture() with the | 83 // Updated by the last call to ObserveEventAndDecideCapture() with the |
| 84 // estimated duration of the next frame to sample. This is zero if the method | 84 // estimated duration of the next frame to sample. This is zero if the method |
| 85 // returned false. | 85 // returned false. |
| 86 base::TimeDelta duration_of_next_frame_; | 86 base::TimeDelta duration_of_next_frame_; |
| 87 | 87 |
| 88 // Stores the frame number from the last delivered frame. | 88 // Stores the frame number from the last successfully delivered frame. |
| 89 int last_delivered_frame_number_; | 89 int last_successfully_delivered_frame_number_; |
| 90 |
| 91 // Stores the number of pending frame captures. |
| 92 int num_frames_pending_; |
| 90 | 93 |
| 91 // These track present/paint history and propose whether to sample each event | 94 // These track present/paint history and propose whether to sample each event |
| 92 // for capture. |smoothing_sampler_| uses a "works for all" heuristic, while | 95 // for capture. |smoothing_sampler_| uses a "works for all" heuristic, while |
| 93 // |content_sampler_| specifically detects animated content (e.g., video | 96 // |content_sampler_| specifically detects animated content (e.g., video |
| 94 // playback) and decides which events to sample to "lock into" that content. | 97 // playback) and decides which events to sample to "lock into" that content. |
| 95 SmoothEventSampler smoothing_sampler_; | 98 SmoothEventSampler smoothing_sampler_; |
| 96 AnimatedContentSampler content_sampler_; | 99 AnimatedContentSampler content_sampler_; |
| 97 | 100 |
| 98 // Recent history of frame timestamps proposed by VideoCaptureOracle. This is | 101 // Recent history of frame timestamps proposed by VideoCaptureOracle. This is |
| 99 // a ring-buffer, and should only be accessed by the Get/SetFrameTimestamp() | 102 // a ring-buffer, and should only be accessed by the Get/SetFrameTimestamp() |
| 100 // methods. | 103 // methods. |
| 101 enum { kMaxFrameTimestamps = 16 }; | 104 enum { kMaxFrameTimestamps = 16 }; |
| 102 base::TimeTicks frame_timestamps_[kMaxFrameTimestamps]; | 105 base::TimeTicks frame_timestamps_[kMaxFrameTimestamps]; |
| 103 }; | 106 }; |
| 104 | 107 |
| 105 } // namespace content | 108 } // namespace content |
| 106 | 109 |
| 107 #endif // CONTENT_BROWSER_MEDIA_CAPTURE_VIDEO_CAPTURE_ORACLE_H_ | 110 #endif // CONTENT_BROWSER_MEDIA_CAPTURE_VIDEO_CAPTURE_ORACLE_H_ |
| OLD | NEW |