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