Chromium Code Reviews| Index: chromecast/media/cma/base/backend_client_callbacks.h |
| diff --git a/chromecast/media/cma/base/backend_client_callbacks.h b/chromecast/media/cma/base/backend_client_callbacks.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..35dc86143cbd898319ede59910fb569b1d604b9d |
| --- /dev/null |
| +++ b/chromecast/media/cma/base/backend_client_callbacks.h |
| @@ -0,0 +1,66 @@ |
| +// Copyright 2015 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 CHROMECAST_MEDIA_CMA_BASE_BACKEND_CLIENT_CALLBACKS_H_ |
|
gunsch
2015/07/27 17:14:49
Let's put these somewhere a little higher level. M
halliwell
2015/07/28 02:19:35
Done.
|
| +#define CHROMECAST_MEDIA_CMA_BASE_BACKEND_CLIENT_CALLBACKS_H_ |
| + |
| +#include "base/callback.h" |
| +#include "base/memory/ref_counted.h" |
| +#include "chromecast/public/media/media_component_device.h" |
| +#include "chromecast/public/media/video_pipeline_device.h" |
| + |
| +namespace base { |
| +class SingleThreadTaskRunner; |
| +} |
| + |
| +// Helper implementations of CMA backend client callback interfaces in |
| +// chromecast/public/media. All implementations take a base::Callback |
| +// and handle forwarding the callback to the CMA thread if necessary. |
| +namespace chromecast { |
| +namespace media { |
| + |
| +class MediaComponentDeviceClientImpl : public MediaComponentDevice::Client { |
|
gunsch
2015/07/27 17:14:49
file nit: can we split these into three files? I k
halliwell
2015/07/28 02:19:35
Yes I hate that too ... was being lazy here ... do
|
| + public: |
| + MediaComponentDeviceClientImpl(const base::Closure& eos_cb); |
| + ~MediaComponentDeviceClientImpl() override; |
| + |
| + void OnEndOfStream() override; |
| + |
| + private: |
| + base::Closure eos_cb_; |
| + scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
| +}; |
| + |
| +class VideoPipelineDeviceClientImpl : public VideoPipelineDevice::VideoClient { |
| + public: |
| + typedef base::Callback<void(const Size&)> SizeChangeCB; |
| + |
| + VideoPipelineDeviceClientImpl(const SizeChangeCB& size_change_cb); |
| + ~VideoPipelineDeviceClientImpl() override; |
| + |
| + void OnNaturalSizeChanged(const Size& size) override; |
| + |
| + private: |
| + SizeChangeCB size_change_cb_; |
| + scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
| +}; |
| + |
| +class FrameStatusCBImpl : public MediaComponentDevice::FrameStatusCB { |
| + public: |
| + typedef base::Callback<void(MediaComponentDevice::FrameStatus)> CallbackType; |
| + |
| + FrameStatusCBImpl(const CallbackType& cb); |
| + ~FrameStatusCBImpl() override; |
| + |
| + void Run(MediaComponentDevice::FrameStatus status) override; |
| + |
| + private: |
| + CallbackType cb_; |
| + scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
| +}; |
| + |
| +} // namespace media |
| +} // namespace chromecast |
| + |
| +#endif // CHROMECAST_MEDIA_CMA_BASE_BACKEND_CLIENT_CALLBACKS_H_ |