| 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/media/cma/pipeline/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; |
| 33 struct RendererAvPipelineClient; |
| 34 | 34 |
| 35 class VideoPipelineProxy : public VideoPipeline { | 35 class VideoPipelineProxy : public VideoPipeline { |
| 36 public: | 36 public: |
| 37 VideoPipelineProxy(scoped_refptr<base::SingleThreadTaskRunner> io_task_runner, | 37 VideoPipelineProxy(scoped_refptr<base::SingleThreadTaskRunner> io_task_runner, |
| 38 scoped_refptr<MediaChannelProxy> media_channel_proxy); | 38 scoped_refptr<MediaChannelProxy> media_channel_proxy); |
| 39 ~VideoPipelineProxy() override; | 39 ~VideoPipelineProxy() override; |
| 40 | 40 |
| 41 void Initialize(const std::vector<::media::VideoDecoderConfig>& configs, | 41 void Initialize(const std::vector<::media::VideoDecoderConfig>& configs, |
| 42 scoped_ptr<CodedFrameProvider> frame_provider, | 42 scoped_ptr<CodedFrameProvider> frame_provider, |
| 43 const ::media::PipelineStatusCB& status_cb); | 43 const ::media::PipelineStatusCB& status_cb); |
| 44 void StartFeeding(); | 44 void StartFeeding(); |
| 45 void Flush(const base::Closure& done_cb); | 45 void Flush(const base::Closure& done_cb); |
| 46 void Stop(); | 46 void Stop(); |
| 47 | 47 |
| 48 // VideoPipeline implementation. | 48 // RendererVideoPipeline implementation. |
| 49 void SetClient(const VideoPipelineClient& video_client) override; | 49 void SetClient(const RendererVideoPipelineClient& video_client) override; |
| 50 | 50 |
| 51 private: | 51 private: |
| 52 base::ThreadChecker thread_checker_; | 52 base::ThreadChecker thread_checker_; |
| 53 | 53 |
| 54 void OnAvPipeCreated( | 54 void OnAvPipeCreated( |
| 55 const std::vector<::media::VideoDecoderConfig>& configs, | 55 const std::vector<::media::VideoDecoderConfig>& configs, |
| 56 const ::media::PipelineStatusCB& status_cb, | 56 const ::media::PipelineStatusCB& status_cb, |
| 57 scoped_ptr<base::SharedMemory> shared_memory); | 57 scoped_ptr<base::SharedMemory> shared_memory); |
| 58 void OnPipeWrite(); | 58 void OnPipeWrite(); |
| 59 void OnPipeRead(); | 59 void OnPipeRead(); |
| 60 | 60 |
| 61 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; | 61 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; |
| 62 | 62 |
| 63 // |proxy_| main goal is to convert function calls to IPC messages. | 63 // |proxy_| main goal is to convert function calls to IPC messages. |
| 64 scoped_ptr<VideoPipelineProxyInternal> proxy_; | 64 scoped_ptr<VideoPipelineProxyInternal> proxy_; |
| 65 | 65 |
| 66 scoped_ptr<AvStreamerProxy> video_streamer_; | 66 scoped_ptr<AvStreamerProxy> video_streamer_; |
| 67 | 67 |
| 68 base::WeakPtr<VideoPipelineProxy> weak_this_; | 68 base::WeakPtr<VideoPipelineProxy> weak_this_; |
| 69 base::WeakPtrFactory<VideoPipelineProxy> weak_factory_; | 69 base::WeakPtrFactory<VideoPipelineProxy> weak_factory_; |
| 70 | 70 |
| 71 DISALLOW_COPY_AND_ASSIGN(VideoPipelineProxy); | 71 DISALLOW_COPY_AND_ASSIGN(VideoPipelineProxy); |
| 72 }; | 72 }; |
| 73 | 73 |
| 74 } // namespace media | 74 } // namespace media |
| 75 } // namespace chromecast | 75 } // namespace chromecast |
| 76 | 76 |
| 77 #endif // CHROMECAST_RENDERER_MEDIA_VIDEO_PIPELINE_PROXY_H_ | 77 #endif // CHROMECAST_RENDERER_MEDIA_VIDEO_PIPELINE_PROXY_H_ |
| OLD | NEW |