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 { |
11 | 11 |
12 // The number of frames to store for moving average calculations. Value picked | 12 // The number of frames to store for moving average calculations. Value picked |
13 // after experimenting with playback of various local media and YouTube clips. | 13 // after experimenting with playback of various local media and YouTube clips. |
14 const int kMovingAverageSamples = 32; | 14 const int kMovingAverageSamples = 32; |
15 | 15 |
16 VideoRendererAlgorithm::ReadyFrame::ReadyFrame( | 16 VideoRendererAlgorithm::ReadyFrame::ReadyFrame( |
17 const scoped_refptr<VideoFrame>& ready_frame) | 17 const scoped_refptr<VideoFrame>& ready_frame) |
18 : frame(ready_frame), | 18 : frame(ready_frame), |
19 has_estimated_end_time(true), | 19 has_estimated_end_time(true), |
20 ideal_render_count(0), | 20 ideal_render_count(0), |
21 render_count(0), | 21 render_count(0), |
22 drop_count(0) { | 22 drop_count(0) { |
23 } | 23 } |
24 | 24 |
| 25 VideoRendererAlgorithm::ReadyFrame::ReadyFrame(const ReadyFrame& other) = |
| 26 default; |
| 27 |
25 VideoRendererAlgorithm::ReadyFrame::~ReadyFrame() { | 28 VideoRendererAlgorithm::ReadyFrame::~ReadyFrame() { |
26 } | 29 } |
27 | 30 |
28 bool VideoRendererAlgorithm::ReadyFrame::operator<( | 31 bool VideoRendererAlgorithm::ReadyFrame::operator<( |
29 const ReadyFrame& other) const { | 32 const ReadyFrame& other) const { |
30 return frame->timestamp() < other.frame->timestamp(); | 33 return frame->timestamp() < other.frame->timestamp(); |
31 } | 34 } |
32 | 35 |
33 VideoRendererAlgorithm::VideoRendererAlgorithm( | 36 VideoRendererAlgorithm::VideoRendererAlgorithm( |
34 const TimeSource::WallClockTimeCB& wall_clock_time_cb) | 37 const TimeSource::WallClockTimeCB& wall_clock_time_cb) |
(...skipping 648 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
683 if (frame.start_time > deadline_min) | 686 if (frame.start_time > deadline_min) |
684 return frame.start_time - deadline_min; | 687 return frame.start_time - deadline_min; |
685 | 688 |
686 // Drift is zero for frames which overlap the deadline interval. | 689 // Drift is zero for frames which overlap the deadline interval. |
687 DCHECK_GE(deadline_min, frame.start_time); | 690 DCHECK_GE(deadline_min, frame.start_time); |
688 DCHECK_GE(frame.end_time, deadline_min); | 691 DCHECK_GE(frame.end_time, deadline_min); |
689 return base::TimeDelta(); | 692 return base::TimeDelta(); |
690 } | 693 } |
691 | 694 |
692 } // namespace media | 695 } // namespace media |
OLD | NEW |