OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 MEDIA_FILTERS_VIDEO_RENDERER_ALGORITHM_H_ | 5 #ifndef MEDIA_FILTERS_VIDEO_RENDERER_ALGORITHM_H_ |
6 #define MEDIA_FILTERS_VIDEO_RENDERER_ALGORITHM_H_ | 6 #define MEDIA_FILTERS_VIDEO_RENDERER_ALGORITHM_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 // |start_time|. | 254 // |start_time|. |
255 base::TimeDelta CalculateAbsoluteDriftForFrame(base::TimeTicks deadline_min, | 255 base::TimeDelta CalculateAbsoluteDriftForFrame(base::TimeTicks deadline_min, |
256 int frame_index) const; | 256 int frame_index) const; |
257 | 257 |
258 // Updates |effective_frames_queued_| which is typically called far more | 258 // Updates |effective_frames_queued_| which is typically called far more |
259 // frequently (~4x) than the value changes. This must be called whenever | 259 // frequently (~4x) than the value changes. This must be called whenever |
260 // frames are added or removed from the queue or when any property of a | 260 // frames are added or removed from the queue or when any property of a |
261 // ReadyFrame within the queue changes. | 261 // ReadyFrame within the queue changes. |
262 void UpdateEffectiveFramesQueued(); | 262 void UpdateEffectiveFramesQueued(); |
263 | 263 |
| 264 // Computes the unclamped count of effective frames. Used by |
| 265 // UpdateEffectiveFramesQueued(). |
| 266 size_t CountEffectiveFramesQueued() const; |
| 267 |
264 // Queue of incoming frames waiting for rendering. | 268 // Queue of incoming frames waiting for rendering. |
265 using VideoFrameQueue = std::deque<ReadyFrame>; | 269 using VideoFrameQueue = std::deque<ReadyFrame>; |
266 VideoFrameQueue frame_queue_; | 270 VideoFrameQueue frame_queue_; |
267 | 271 |
268 // Handles cadence detection and frame cadence assignments. | 272 // Handles cadence detection and frame cadence assignments. |
269 VideoCadenceEstimator cadence_estimator_; | 273 VideoCadenceEstimator cadence_estimator_; |
270 | 274 |
271 // Indicates if any calls to Render() have successfully yielded a frame yet. | 275 // Indicates if any calls to Render() have successfully yielded a frame yet. |
272 bool have_rendered_frames_; | 276 bool have_rendered_frames_; |
273 | 277 |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 // Current number of effective frames in the |frame_queue_|. Updated by calls | 331 // Current number of effective frames in the |frame_queue_|. Updated by calls |
328 // to UpdateEffectiveFramesQueued() whenever the |frame_queue_| is changed. | 332 // to UpdateEffectiveFramesQueued() whenever the |frame_queue_| is changed. |
329 size_t effective_frames_queued_; | 333 size_t effective_frames_queued_; |
330 | 334 |
331 DISALLOW_COPY_AND_ASSIGN(VideoRendererAlgorithm); | 335 DISALLOW_COPY_AND_ASSIGN(VideoRendererAlgorithm); |
332 }; | 336 }; |
333 | 337 |
334 } // namespace media | 338 } // namespace media |
335 | 339 |
336 #endif // MEDIA_FILTERS_VIDEO_RENDERER_ALGORITHM_H_ | 340 #endif // MEDIA_FILTERS_VIDEO_RENDERER_ALGORITHM_H_ |
OLD | NEW |