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_AUDIO_PIPELINE_PROXY_H_ |
| 6 #define CHROMECAST_RENDERER_MEDIA_AUDIO_PIPELINE_PROXY_H_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "base/memory/weak_ptr.h" |
| 12 #include "base/threading/thread_checker.h" |
| 13 #include "chromecast/common/media/cma_ipc_common.h" |
| 14 #include "chromecast/media/cma/pipeline/audio_pipeline.h" |
| 15 #include "media/base/pipeline_status.h" |
| 16 |
| 17 namespace base { |
| 18 class MessageLoopProxy; |
| 19 class SharedMemory; |
| 20 } |
| 21 |
| 22 namespace media { |
| 23 class AudioDecoderConfig; |
| 24 } |
| 25 |
| 26 namespace chromecast { |
| 27 namespace media { |
| 28 class AudioPipelineProxyInternal; |
| 29 struct AvPipelineClient; |
| 30 class AvStreamerProxy; |
| 31 class CodedFrameProvider; |
| 32 class MediaChannelProxy; |
| 33 |
| 34 class AudioPipelineProxy : public AudioPipeline { |
| 35 public: |
| 36 AudioPipelineProxy( |
| 37 scoped_refptr<base::MessageLoopProxy> io_message_loop_proxy, |
| 38 scoped_refptr<MediaChannelProxy> media_channel_proxy); |
| 39 ~AudioPipelineProxy() override; |
| 40 |
| 41 void Initialize( |
| 42 const ::media::AudioDecoderConfig& config, |
| 43 scoped_ptr<CodedFrameProvider> frame_provider, |
| 44 const ::media::PipelineStatusCB& status_cb); |
| 45 void StartFeeding(); |
| 46 void Flush(const base::Closure& done_cb); |
| 47 void Stop(); |
| 48 |
| 49 // AudioPipeline implementation. |
| 50 void SetClient(const AvPipelineClient& client) override; |
| 51 void SetVolume(float volume) override; |
| 52 |
| 53 private: |
| 54 base::ThreadChecker thread_checker_; |
| 55 |
| 56 void OnAvPipeCreated( |
| 57 const ::media::AudioDecoderConfig& config, |
| 58 const ::media::PipelineStatusCB& status_cb, |
| 59 scoped_ptr<base::SharedMemory> shared_memory); |
| 60 void OnPipeWrite(); |
| 61 void OnPipeRead(); |
| 62 |
| 63 scoped_refptr<base::MessageLoopProxy> io_message_loop_proxy_; |
| 64 |
| 65 // |proxy_| main goal is to convert function calls to IPC messages. |
| 66 scoped_ptr<AudioPipelineProxyInternal> proxy_; |
| 67 |
| 68 scoped_ptr<AvStreamerProxy> audio_streamer_; |
| 69 |
| 70 base::WeakPtr<AudioPipelineProxy> weak_this_; |
| 71 base::WeakPtrFactory<AudioPipelineProxy> weak_factory_; |
| 72 |
| 73 DISALLOW_COPY_AND_ASSIGN(AudioPipelineProxy); |
| 74 }; |
| 75 |
| 76 } // namespace media |
| 77 } // namespace chromecast |
| 78 |
| 79 #endif // CHROMECAST_RENDERER_MEDIA_AUDIO_PIPELINE_PROXY_H_ |
OLD | NEW |