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

Unified Diff: media/filters/video_frame_scheduler_proxy.h

Issue 237093007: Introduce VideoFrameScheduler{Impl}. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nits 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
« no previous file with comments | « media/filters/video_frame_scheduler_impl_unittest.cc ('k') | media/filters/video_frame_scheduler_proxy.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/video_frame_scheduler_proxy.h
diff --git a/media/filters/video_frame_scheduler_proxy.h b/media/filters/video_frame_scheduler_proxy.h
new file mode 100644
index 0000000000000000000000000000000000000000..d17fb5632bc3e9a3ce1dc32b4659e1f38b60b7f5
--- /dev/null
+++ b/media/filters/video_frame_scheduler_proxy.h
@@ -0,0 +1,51 @@
+// 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_PROXY_H_
+#define MEDIA_FILTERS_VIDEO_FRAME_SCHEDULER_PROXY_H_
+
+#include "base/memory/weak_ptr.h"
+#include "media/filters/video_frame_scheduler.h"
+
+namespace base {
+class SingleThreadTaskRunner;
+}
+
+namespace media {
+
+// Provides a thread-safe proxy for a VideoFrameScheduler. Typical use is to
+// use a real VideoFrameScheduler on the task runner responsible for graphics
+// display and provide a proxy on the task runner responsible for background
+// video decoding.
+class MEDIA_EXPORT VideoFrameSchedulerProxy : public VideoFrameScheduler {
+ public:
+ // |task_runner| is the runner that this object will be called on.
+ // |scheduler_runner| is the runner that |scheduler| will be called on.
+ // |scheduler| must out-live the lifetime of this object.
+ VideoFrameSchedulerProxy(
+ const scoped_refptr<base::SingleThreadTaskRunner>& task_runner,
+ const scoped_refptr<base::SingleThreadTaskRunner>& scheduler_runner,
+ VideoFrameScheduler* scheduler);
+ virtual ~VideoFrameSchedulerProxy();
+
+ // VideoFrameScheduler implementation.
+ virtual void ScheduleVideoFrame(const scoped_refptr<VideoFrame>& frame,
+ base::TimeTicks wall_ticks,
+ const DoneCB& done_cb) OVERRIDE;
+ virtual void Reset() OVERRIDE;
+
+ private:
+ scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
+ scoped_refptr<base::SingleThreadTaskRunner> scheduler_runner_;
+ VideoFrameScheduler* scheduler_; // Not owned.
+
+ // NOTE: Weak pointers must be invalidated before all other member variables.
+ base::WeakPtrFactory<VideoFrameSchedulerProxy> weak_factory_;
+
+ DISALLOW_COPY_AND_ASSIGN(VideoFrameSchedulerProxy);
+};
+
+} // namespace media
+
+#endif // MEDIA_FILTERS_VIDEO_FRAME_SCHEDULER_PROXY_H_
« no previous file with comments | « media/filters/video_frame_scheduler_impl_unittest.cc ('k') | media/filters/video_frame_scheduler_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698