| 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_
|
|
|