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