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" | |
16 #include "media/base/pipeline_status.h" | 15 #include "media/base/pipeline_status.h" |
17 | 16 |
18 namespace base { | 17 namespace base { |
19 class SingleThreadTaskRunner; | 18 class SingleThreadTaskRunner; |
20 class SharedMemory; | 19 class SharedMemory; |
21 } | 20 } |
22 | 21 |
23 namespace media { | 22 namespace media { |
24 class VideoDecoderConfig; | 23 class VideoDecoderConfig; |
25 } | 24 } |
26 | 25 |
27 namespace chromecast { | 26 namespace chromecast { |
28 namespace media { | 27 namespace media { |
29 struct AvPipelineClient; | |
30 class AvStreamerProxy; | 28 class AvStreamerProxy; |
31 class CodedFrameProvider; | 29 class CodedFrameProvider; |
| 30 class MediaChannelProxy; |
| 31 struct VideoPipelineClient; |
32 class VideoPipelineProxyInternal; | 32 class VideoPipelineProxyInternal; |
33 class MediaChannelProxy; | |
34 | 33 |
35 class VideoPipelineProxy : public VideoPipeline { | 34 class VideoPipelineProxy { |
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(); |
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 void SetClient(const VideoPipelineClient& video_client); |
49 void SetClient(const VideoPipelineClient& video_client) override; | |
50 | 48 |
51 private: | 49 private: |
52 base::ThreadChecker thread_checker_; | 50 base::ThreadChecker thread_checker_; |
53 | 51 |
54 void OnAvPipeCreated( | 52 void OnAvPipeCreated( |
55 const std::vector<::media::VideoDecoderConfig>& configs, | 53 const std::vector<::media::VideoDecoderConfig>& configs, |
56 const ::media::PipelineStatusCB& status_cb, | 54 const ::media::PipelineStatusCB& status_cb, |
57 scoped_ptr<base::SharedMemory> shared_memory); | 55 scoped_ptr<base::SharedMemory> shared_memory); |
58 void OnPipeWrite(); | 56 void OnPipeWrite(); |
59 void OnPipeRead(); | 57 void OnPipeRead(); |
60 | 58 |
61 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; | 59 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; |
62 | 60 |
63 // |proxy_| main goal is to convert function calls to IPC messages. | 61 // |proxy_| main goal is to convert function calls to IPC messages. |
64 scoped_ptr<VideoPipelineProxyInternal> proxy_; | 62 scoped_ptr<VideoPipelineProxyInternal> proxy_; |
65 | 63 |
66 scoped_ptr<AvStreamerProxy> video_streamer_; | 64 scoped_ptr<AvStreamerProxy> video_streamer_; |
67 | 65 |
68 base::WeakPtr<VideoPipelineProxy> weak_this_; | 66 base::WeakPtr<VideoPipelineProxy> weak_this_; |
69 base::WeakPtrFactory<VideoPipelineProxy> weak_factory_; | 67 base::WeakPtrFactory<VideoPipelineProxy> weak_factory_; |
70 | 68 |
71 DISALLOW_COPY_AND_ASSIGN(VideoPipelineProxy); | 69 DISALLOW_COPY_AND_ASSIGN(VideoPipelineProxy); |
72 }; | 70 }; |
73 | 71 |
74 } // namespace media | 72 } // namespace media |
75 } // namespace chromecast | 73 } // namespace chromecast |
76 | 74 |
77 #endif // CHROMECAST_RENDERER_MEDIA_VIDEO_PIPELINE_PROXY_H_ | 75 #endif // CHROMECAST_RENDERER_MEDIA_VIDEO_PIPELINE_PROXY_H_ |
OLD | NEW |