| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_FRAME_SCHEDULER_IMPL_H_ | 5 #ifndef MEDIA_FILTERS_VIDEO_FRAME_SCHEDULER_IMPL_H_ |
| 6 #define MEDIA_FILTERS_VIDEO_FRAME_SCHEDULER_IMPL_H_ | 6 #define MEDIA_FILTERS_VIDEO_FRAME_SCHEDULER_IMPL_H_ |
| 7 | 7 |
| 8 #include <queue> | 8 #include <queue> |
| 9 | 9 |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 // |task_runner| is used for scheduling the delayed tasks. | 29 // |task_runner| is used for scheduling the delayed tasks. |
| 30 // |display_cb| is run when a frame is to be displayed. | 30 // |display_cb| is run when a frame is to be displayed. |
| 31 VideoFrameSchedulerImpl( | 31 VideoFrameSchedulerImpl( |
| 32 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, | 32 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, |
| 33 const DisplayCB& display_cb); | 33 const DisplayCB& display_cb); |
| 34 virtual ~VideoFrameSchedulerImpl(); | 34 virtual ~VideoFrameSchedulerImpl(); |
| 35 | 35 |
| 36 // VideoFrameScheduler implementation. | 36 // VideoFrameScheduler implementation. |
| 37 virtual void ScheduleVideoFrame(const scoped_refptr<VideoFrame>& frame, | 37 virtual void ScheduleVideoFrame(const scoped_refptr<VideoFrame>& frame, |
| 38 base::TimeTicks wall_ticks, | 38 base::TimeTicks wall_ticks, |
| 39 const DoneCB& done_cb) OVERRIDE; | 39 const DoneCB& done_cb) override; |
| 40 virtual void Reset() OVERRIDE; | 40 virtual void Reset() override; |
| 41 | 41 |
| 42 void SetTickClockForTesting(scoped_ptr<base::TickClock> tick_clock); | 42 void SetTickClockForTesting(scoped_ptr<base::TickClock> tick_clock); |
| 43 | 43 |
| 44 private: | 44 private: |
| 45 void ResetTimerIfNecessary(); | 45 void ResetTimerIfNecessary(); |
| 46 void OnTimerFired(); | 46 void OnTimerFired(); |
| 47 | 47 |
| 48 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 48 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
| 49 DisplayCB display_cb_; | 49 DisplayCB display_cb_; |
| 50 scoped_ptr<base::TickClock> tick_clock_; | 50 scoped_ptr<base::TickClock> tick_clock_; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 65 }; | 65 }; |
| 66 typedef std::priority_queue<PendingFrame> PendingFrameQueue; | 66 typedef std::priority_queue<PendingFrame> PendingFrameQueue; |
| 67 PendingFrameQueue pending_frames_; | 67 PendingFrameQueue pending_frames_; |
| 68 | 68 |
| 69 DISALLOW_COPY_AND_ASSIGN(VideoFrameSchedulerImpl); | 69 DISALLOW_COPY_AND_ASSIGN(VideoFrameSchedulerImpl); |
| 70 }; | 70 }; |
| 71 | 71 |
| 72 } // namespace media | 72 } // namespace media |
| 73 | 73 |
| 74 #endif // MEDIA_FILTERS_VIDEO_FRAME_SCHEDULER_IMPL_H_ | 74 #endif // MEDIA_FILTERS_VIDEO_FRAME_SCHEDULER_IMPL_H_ |
| OLD | NEW |