Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(460)

Unified Diff: media/filters/video_frame_scheduler.h

Issue 237093007: Introduce VideoFrameScheduler{Impl}. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: media/filters/video_frame_scheduler.h
diff --git a/media/filters/video_frame_scheduler.h b/media/filters/video_frame_scheduler.h
new file mode 100644
index 0000000000000000000000000000000000000000..375c7ccbedbde3d0971846bdb46c428568b38eee
--- /dev/null
+++ b/media/filters/video_frame_scheduler.h
@@ -0,0 +1,46 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef MEDIA_FILTERS_VIDEO_FRAME_SCHEDULER_H_
+#define MEDIA_FILTERS_VIDEO_FRAME_SCHEDULER_H_
+
+#include "base/callback.h"
+#include "base/memory/ref_counted.h"
+#include "media/base/media_export.h"
+
+namespace media {
+
+class VideoFrame;
+
+// Defines an abstract video frame scheduler that is capable of managing the
+// display of video frames at explicit times.
+class MEDIA_EXPORT VideoFrameScheduler {
+ public:
+ VideoFrameScheduler() {}
+ virtual ~VideoFrameScheduler() {}
+
+ enum Reason {
+ DISPLAYED, // Frame was displayed.
+ DROPPED, // Frame was dropped.
+ RESET, // Scheduler was reset and frames are being returned.
acolwell GONE FROM CHROMIUM 2014/04/14 21:17:59 nit: Frames are returned in all cases so this comm
scherkus (not reviewing) 2014/04/14 21:35:31 Done.
+ };
+ typedef base::Callback<void(const scoped_refptr<VideoFrame>&, Reason)> DoneCB;
+
+ // Schedule |frame| to be displayed at |wall_ticks|, firing |done_cb| when
+ // the scheduler has finished with the frame.
+ //
+ // Assuming Reset() wasn't called, frames will be returned as either DISPLAYED
+ // or DROPPED.
acolwell GONE FROM CHROMIUM 2014/04/14 21:17:59 This part of the comment doesn't seem that helpful
scherkus (not reviewing) 2014/04/14 21:35:31 yeah -- removed
+ virtual void ScheduleVideoFrame(const scoped_refptr<VideoFrame>& frame,
+ base::TimeTicks wall_ticks,
+ const DoneCB& done_cb) = 0;
+
+ // Causes the scheduler to release all previously scheduled frames. Frames
+ // will be returned as RESET.
+ virtual void Reset() = 0;
+};
+
+} // namespace media
+
+#endif // MEDIA_FILTERS_VIDEO_FRAME_SCHEDULER_H_
« no previous file with comments | « no previous file | media/filters/video_frame_scheduler_impl.h » ('j') | media/filters/video_frame_scheduler_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698