Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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. | |
| 4 | |
| 5 #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.
| |
| 6 #define CHROMECAST_MEDIA_CMA_BASE_BACKEND_CLIENT_CALLBACKS_H_ | |
| 7 | |
| 8 #include "base/callback.h" | |
| 9 #include "base/memory/ref_counted.h" | |
| 10 #include "chromecast/public/media/media_component_device.h" | |
| 11 #include "chromecast/public/media/video_pipeline_device.h" | |
| 12 | |
| 13 namespace base { | |
| 14 class SingleThreadTaskRunner; | |
| 15 } | |
| 16 | |
| 17 // Helper implementations of CMA backend client callback interfaces in | |
| 18 // chromecast/public/media. All implementations take a base::Callback | |
| 19 // and handle forwarding the callback to the CMA thread if necessary. | |
| 20 namespace chromecast { | |
| 21 namespace media { | |
| 22 | |
| 23 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
| |
| 24 public: | |
| 25 MediaComponentDeviceClientImpl(const base::Closure& eos_cb); | |
| 26 ~MediaComponentDeviceClientImpl() override; | |
| 27 | |
| 28 void OnEndOfStream() override; | |
| 29 | |
| 30 private: | |
| 31 base::Closure eos_cb_; | |
| 32 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | |
| 33 }; | |
| 34 | |
| 35 class VideoPipelineDeviceClientImpl : public VideoPipelineDevice::VideoClient { | |
| 36 public: | |
| 37 typedef base::Callback<void(const Size&)> SizeChangeCB; | |
| 38 | |
| 39 VideoPipelineDeviceClientImpl(const SizeChangeCB& size_change_cb); | |
| 40 ~VideoPipelineDeviceClientImpl() override; | |
| 41 | |
| 42 void OnNaturalSizeChanged(const Size& size) override; | |
| 43 | |
| 44 private: | |
| 45 SizeChangeCB size_change_cb_; | |
| 46 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | |
| 47 }; | |
| 48 | |
| 49 class FrameStatusCBImpl : public MediaComponentDevice::FrameStatusCB { | |
| 50 public: | |
| 51 typedef base::Callback<void(MediaComponentDevice::FrameStatus)> CallbackType; | |
| 52 | |
| 53 FrameStatusCBImpl(const CallbackType& cb); | |
| 54 ~FrameStatusCBImpl() override; | |
| 55 | |
| 56 void Run(MediaComponentDevice::FrameStatus status) override; | |
| 57 | |
| 58 private: | |
| 59 CallbackType cb_; | |
| 60 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | |
| 61 }; | |
| 62 | |
| 63 } // namespace media | |
| 64 } // namespace chromecast | |
| 65 | |
| 66 #endif // CHROMECAST_MEDIA_CMA_BASE_BACKEND_CLIENT_CALLBACKS_H_ | |
| OLD | NEW |