| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROMECAST_RENDERER_MEDIA_VIDEO_PIPELINE_PROXY_H_ | 5 #ifndef CHROMECAST_RENDERER_MEDIA_VIDEO_PIPELINE_PROXY_H_ |
| 6 #define CHROMECAST_RENDERER_MEDIA_VIDEO_PIPELINE_PROXY_H_ | 6 #define CHROMECAST_RENDERER_MEDIA_VIDEO_PIPELINE_PROXY_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
| 14 #include "base/threading/thread_checker.h" | 14 #include "base/threading/thread_checker.h" |
| 15 #include "chromecast/media/cma/pipeline/video_pipeline.h" | 15 #include "chromecast/renderer/media/video_pipeline.h" |
| 16 #include "media/base/pipeline_status.h" | 16 #include "media/base/pipeline_status.h" |
| 17 | 17 |
| 18 namespace base { | 18 namespace base { |
| 19 class SingleThreadTaskRunner; | 19 class SingleThreadTaskRunner; |
| 20 class SharedMemory; | 20 class SharedMemory; |
| 21 } | 21 } |
| 22 | 22 |
| 23 namespace media { | 23 namespace media { |
| 24 class VideoDecoderConfig; | 24 class VideoDecoderConfig; |
| 25 } | 25 } |
| 26 | 26 |
| 27 namespace chromecast { | 27 namespace chromecast { |
| 28 namespace media { | 28 namespace media { |
| 29 struct AvPipelineClient; | |
| 30 class AvStreamerProxy; | 29 class AvStreamerProxy; |
| 31 class CodedFrameProvider; | 30 class CodedFrameProvider; |
| 32 class VideoPipelineProxyInternal; | 31 class VideoPipelineProxyInternal; |
| 33 class MediaChannelProxy; | 32 class MediaChannelProxy; |
| 34 | 33 |
| 35 class VideoPipelineProxy : public VideoPipeline { | 34 class VideoPipelineProxy : public VideoPipeline { |
| 36 public: | 35 public: |
| 37 VideoPipelineProxy(scoped_refptr<base::SingleThreadTaskRunner> io_task_runner, | 36 VideoPipelineProxy(scoped_refptr<base::SingleThreadTaskRunner> io_task_runner, |
| 38 scoped_refptr<MediaChannelProxy> media_channel_proxy); | 37 scoped_refptr<MediaChannelProxy> media_channel_proxy); |
| 39 ~VideoPipelineProxy() override; | 38 ~VideoPipelineProxy() override; |
| 40 | 39 |
| 41 void Initialize(const std::vector<::media::VideoDecoderConfig>& configs, | 40 void Initialize(const std::vector<::media::VideoDecoderConfig>& configs, |
| 42 scoped_ptr<CodedFrameProvider> frame_provider, | 41 scoped_ptr<CodedFrameProvider> frame_provider, |
| 43 const ::media::PipelineStatusCB& status_cb); | 42 const ::media::PipelineStatusCB& status_cb); |
| 44 void StartFeeding(); | 43 void StartFeeding(); |
| 45 void Flush(const base::Closure& done_cb); | 44 void Flush(const base::Closure& done_cb); |
| 46 void Stop(); | 45 void Stop(); |
| 47 | 46 |
| 48 // VideoPipeline implementation. | 47 // RendererVideoPipeline implementation. |
| 49 void SetClient(const VideoPipelineClient& video_client) override; | 48 void SetClient(const VideoPipelineClient& video_client) override; |
| 50 | 49 |
| 51 private: | 50 private: |
| 52 base::ThreadChecker thread_checker_; | 51 base::ThreadChecker thread_checker_; |
| 53 | 52 |
| 54 void OnAvPipeCreated( | 53 void OnAvPipeCreated( |
| 55 const std::vector<::media::VideoDecoderConfig>& configs, | 54 const std::vector<::media::VideoDecoderConfig>& configs, |
| 56 const ::media::PipelineStatusCB& status_cb, | 55 const ::media::PipelineStatusCB& status_cb, |
| 57 scoped_ptr<base::SharedMemory> shared_memory); | 56 scoped_ptr<base::SharedMemory> shared_memory); |
| 58 void OnPipeWrite(); | 57 void OnPipeWrite(); |
| 59 void OnPipeRead(); | 58 void OnPipeRead(); |
| 60 | 59 |
| 61 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; | 60 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; |
| 62 | 61 |
| 63 // |proxy_| main goal is to convert function calls to IPC messages. | 62 // |proxy_| main goal is to convert function calls to IPC messages. |
| 64 scoped_ptr<VideoPipelineProxyInternal> proxy_; | 63 scoped_ptr<VideoPipelineProxyInternal> proxy_; |
| 65 | 64 |
| 66 scoped_ptr<AvStreamerProxy> video_streamer_; | 65 scoped_ptr<AvStreamerProxy> video_streamer_; |
| 67 | 66 |
| 68 base::WeakPtr<VideoPipelineProxy> weak_this_; | 67 base::WeakPtr<VideoPipelineProxy> weak_this_; |
| 69 base::WeakPtrFactory<VideoPipelineProxy> weak_factory_; | 68 base::WeakPtrFactory<VideoPipelineProxy> weak_factory_; |
| 70 | 69 |
| 71 DISALLOW_COPY_AND_ASSIGN(VideoPipelineProxy); | 70 DISALLOW_COPY_AND_ASSIGN(VideoPipelineProxy); |
| 72 }; | 71 }; |
| 73 | 72 |
| 74 } // namespace media | 73 } // namespace media |
| 75 } // namespace chromecast | 74 } // namespace chromecast |
| 76 | 75 |
| 77 #endif // CHROMECAST_RENDERER_MEDIA_VIDEO_PIPELINE_PROXY_H_ | 76 #endif // CHROMECAST_RENDERER_MEDIA_VIDEO_PIPELINE_PROXY_H_ |
| OLD | NEW |