Stop using legacy GrContext member function aliases.
[chromium-blink-merge.git] / media / filters / test_video_frame_scheduler.h
blobbfe97719e592e588012a05191ffbf51bc1ba3327
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
3 // found in the LICENSE file.
5 #ifndef MEDIA_FILTERS_TEST_VIDEO_FRAME_SCHEDULER_H_
6 #define MEDIA_FILTERS_TEST_VIDEO_FRAME_SCHEDULER_H_
8 #include <vector>
10 #include "media/filters/video_frame_scheduler.h"
12 namespace media {
14 // A scheduler that queues frames until told otherwise.
15 class TestVideoFrameScheduler : public VideoFrameScheduler {
16 public:
17 struct ScheduledFrame {
18 ScheduledFrame(const scoped_refptr<VideoFrame> frame,
19 base::TimeTicks wall_ticks,
20 const DoneCB& done_cb);
21 ~ScheduledFrame();
23 scoped_refptr<VideoFrame> frame;
24 base::TimeTicks wall_ticks;
25 DoneCB done_cb;
28 TestVideoFrameScheduler();
29 virtual ~TestVideoFrameScheduler();
31 // VideoFrameScheduler implementation.
32 virtual void ScheduleVideoFrame(const scoped_refptr<VideoFrame>& frame,
33 base::TimeTicks wall_ticks,
34 const DoneCB& done_cb) override;
35 virtual void Reset() override;
37 // Displays all frames with scheduled times <= |wall_ticks|.
38 void DisplayFramesUpTo(base::TimeTicks wall_ticks);
40 // Drops all frames with scheduled times <= |wall_ticks|.
41 void DropFramesUpTo(base::TimeTicks wall_ticks);
43 const std::vector<ScheduledFrame>& scheduled_frames() const {
44 return scheduled_frames_;
47 private:
48 void RunDoneCBForFramesUpTo(base::TimeTicks wall_ticks, Reason reason);
50 std::vector<ScheduledFrame> scheduled_frames_;
52 DISALLOW_COPY_AND_ASSIGN(TestVideoFrameScheduler);
55 } // namespace media
57 #endif // MEDIA_FILTERS_TEST_VIDEO_FRAME_SCHEDULER_H_