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 #include "media/filters/video_renderer_algorithm.h" | 5 #include "media/filters/video_renderer_algorithm.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 | 9 |
10 namespace media { | 10 namespace media { |
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
419 | 419 |
420 void VideoRendererAlgorithm::AccountForMissedIntervals( | 420 void VideoRendererAlgorithm::AccountForMissedIntervals( |
421 base::TimeTicks deadline_min, | 421 base::TimeTicks deadline_min, |
422 base::TimeTicks deadline_max) { | 422 base::TimeTicks deadline_max) { |
423 if (last_deadline_max_.is_null() || deadline_min <= last_deadline_max_ || | 423 if (last_deadline_max_.is_null() || deadline_min <= last_deadline_max_ || |
424 !have_rendered_frames_ || !was_time_moving_) { | 424 !have_rendered_frames_ || !was_time_moving_) { |
425 return; | 425 return; |
426 } | 426 } |
427 | 427 |
428 DCHECK_GT(render_interval_, base::TimeDelta()); | 428 DCHECK_GT(render_interval_, base::TimeDelta()); |
429 const int64 render_cycle_count = | 429 const int64_t render_cycle_count = |
430 (deadline_min - last_deadline_max_) / render_interval_; | 430 (deadline_min - last_deadline_max_) / render_interval_; |
431 | 431 |
432 // In the ideal case this value will be zero. | 432 // In the ideal case this value will be zero. |
433 if (!render_cycle_count) | 433 if (!render_cycle_count) |
434 return; | 434 return; |
435 | 435 |
436 DVLOG(2) << "Missed " << render_cycle_count << " Render() intervals."; | 436 DVLOG(2) << "Missed " << render_cycle_count << " Render() intervals."; |
437 | 437 |
438 // Only update render count if the frame was rendered at all; it may not have | 438 // Only update render count if the frame was rendered at all; it may not have |
439 // been if the frame is at the head because we haven't rendered anything yet | 439 // been if the frame is at the head because we haven't rendered anything yet |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
683 if (frame.start_time > deadline_min) | 683 if (frame.start_time > deadline_min) |
684 return frame.start_time - deadline_min; | 684 return frame.start_time - deadline_min; |
685 | 685 |
686 // Drift is zero for frames which overlap the deadline interval. | 686 // Drift is zero for frames which overlap the deadline interval. |
687 DCHECK_GE(deadline_min, frame.start_time); | 687 DCHECK_GE(deadline_min, frame.start_time); |
688 DCHECK_GE(frame.end_time, deadline_min); | 688 DCHECK_GE(frame.end_time, deadline_min); |
689 return base::TimeDelta(); | 689 return base::TimeDelta(); |
690 } | 690 } |
691 | 691 |
692 } // namespace media | 692 } // namespace media |
OLD | NEW |