Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / chromecast / media / cma / pipeline / frame_status_cb_impl.h
blob9cd3de765a6c7d4a48b3232a28c5ecbd3df561d6
1 // Copyright 2015 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 CHROMECAST_MEDIA_CMA_PIPELINE_FRAME_STATUS_CB_IMPL_H_
6 #define CHROMECAST_MEDIA_CMA_PIPELINE_FRAME_STATUS_CB_IMPL_H_
8 #include "base/callback.h"
9 #include "base/memory/ref_counted.h"
10 #include "chromecast/public/media/media_component_device.h"
12 namespace base {
13 class SingleThreadTaskRunner;
16 namespace chromecast {
17 namespace media {
19 // Helper for implementing MediaComponentDevice::FrameStatusCB with
20 // a base::Callback.
21 class FrameStatusCBImpl : public MediaComponentDevice::FrameStatusCB {
22 public:
23 typedef base::Callback<void(MediaComponentDevice::FrameStatus)> CallbackType;
25 FrameStatusCBImpl(const CallbackType& cb);
26 ~FrameStatusCBImpl() override;
28 void Run(MediaComponentDevice::FrameStatus status) override;
30 private:
31 CallbackType cb_;
32 scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
35 } // namespace media
36 } // namespace chromecast
38 #endif // CHROMECAST_MEDIA_CMA_PIPELINE_FRAME_STATUS_CB_IMPL_H_