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 #include "media/base/media_log.h" | 10 #include "media/base/media_log.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 VideoRendererAlgorithm::ReadyFrame::~ReadyFrame() { | 32 VideoRendererAlgorithm::ReadyFrame::~ReadyFrame() { |
33 } | 33 } |
34 | 34 |
35 bool VideoRendererAlgorithm::ReadyFrame::operator<( | 35 bool VideoRendererAlgorithm::ReadyFrame::operator<( |
36 const ReadyFrame& other) const { | 36 const ReadyFrame& other) const { |
37 return frame->timestamp() < other.frame->timestamp(); | 37 return frame->timestamp() < other.frame->timestamp(); |
38 } | 38 } |
39 | 39 |
40 VideoRendererAlgorithm::VideoRendererAlgorithm( | 40 VideoRendererAlgorithm::VideoRendererAlgorithm( |
41 const TimeSource::WallClockTimeCB& wall_clock_time_cb, | 41 const TimeSource::WallClockTimeCB& wall_clock_time_cb, |
42 scoped_refptr<MediaLog> media_log) | 42 MediaLog* media_log) |
43 : media_log_(std::move(media_log)), | 43 : media_log_(media_log), |
44 cadence_estimator_(base::TimeDelta::FromSeconds( | 44 cadence_estimator_(base::TimeDelta::FromSeconds( |
45 kMinimumAcceptableTimeBetweenGlitchesSecs)), | 45 kMinimumAcceptableTimeBetweenGlitchesSecs)), |
46 wall_clock_time_cb_(wall_clock_time_cb), | 46 wall_clock_time_cb_(wall_clock_time_cb), |
47 frame_duration_calculator_(kMovingAverageSamples), | 47 frame_duration_calculator_(kMovingAverageSamples), |
48 frame_dropping_disabled_(false) { | 48 frame_dropping_disabled_(false) { |
49 DCHECK(!wall_clock_time_cb_.is_null()); | 49 DCHECK(!wall_clock_time_cb_.is_null()); |
50 Reset(); | 50 Reset(); |
51 } | 51 } |
52 | 52 |
53 VideoRendererAlgorithm::~VideoRendererAlgorithm() {} | 53 VideoRendererAlgorithm::~VideoRendererAlgorithm() {} |
(...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
744 const ReadyFrame& frame = frame_queue_[i]; | 744 const ReadyFrame& frame = frame_queue_[i]; |
745 if (frame.render_count < frame.ideal_render_count && | 745 if (frame.render_count < frame.ideal_render_count && |
746 (frame.end_time.is_null() || frame.end_time > minimum_start_time)) { | 746 (frame.end_time.is_null() || frame.end_time > minimum_start_time)) { |
747 ++renderable_frame_count; | 747 ++renderable_frame_count; |
748 } | 748 } |
749 } | 749 } |
750 return renderable_frame_count; | 750 return renderable_frame_count; |
751 } | 751 } |
752 | 752 |
753 } // namespace media | 753 } // namespace media |
OLD | NEW |