OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // Audio rendering unit utilizing audio output stream provided by browser | 5 // Audio rendering unit utilizing audio output stream provided by browser |
6 // process through IPC. | 6 // process through IPC. |
7 // | 7 // |
8 // Relationship of classes. | 8 // Relationship of classes. |
9 // | 9 // |
10 // AudioOutputController AudioDevice | 10 // AudioOutputController AudioDevice |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
69 #include "base/memory/scoped_ptr.h" | 69 #include "base/memory/scoped_ptr.h" |
70 #include "base/message_loop.h" | 70 #include "base/message_loop.h" |
71 #include "base/shared_memory.h" | 71 #include "base/shared_memory.h" |
72 #include "content/common/content_export.h" | 72 #include "content/common/content_export.h" |
73 #include "content/renderer/media/audio_device_thread.h" | 73 #include "content/renderer/media/audio_device_thread.h" |
74 #include "content/renderer/media/audio_message_filter.h" | 74 #include "content/renderer/media/audio_message_filter.h" |
75 #include "content/renderer/media/scoped_loop_observer.h" | 75 #include "content/renderer/media/scoped_loop_observer.h" |
76 #include "media/audio/audio_parameters.h" | 76 #include "media/audio/audio_parameters.h" |
77 #include "media/base/audio_renderer_sink.h" | 77 #include "media/base/audio_renderer_sink.h" |
78 | 78 |
79 class AudioMessageFilter; | |
80 | |
79 namespace media { | 81 namespace media { |
80 class AudioParameters; | 82 class AudioParameters; |
81 } | 83 } |
82 | 84 |
83 class CONTENT_EXPORT AudioDevice | 85 class CONTENT_EXPORT AudioDevice |
84 : NON_EXPORTED_BASE(public media::AudioRendererSink), | 86 : NON_EXPORTED_BASE(public media::AudioRendererSink), |
85 public AudioMessageFilter::Delegate, | 87 public AudioMessageFilter::Delegate, |
86 NON_EXPORTED_BASE(public ScopedLoopObserver) { | 88 NON_EXPORTED_BASE(public ScopedLoopObserver) { |
87 public: | 89 public: |
88 // Methods called on main render thread ------------------------------------- | 90 // Methods called on main render thread ------------------------------------- |
89 | 91 |
90 // Minimal constructor where Initialize() must be called later. | 92 // Minimal constructor where Initialize() must be called later. |
91 AudioDevice(); | 93 explicit AudioDevice(AudioMessageFilter* filter); |
Chris Rogers
2012/06/14 17:41:44
This is leaking internal implementation details fo
tommi (sloooow) - chröme
2012/06/16 09:09:06
AudioDevice is the implementation, media::AudioRen
| |
92 | |
93 AudioDevice(const media::AudioParameters& params, RenderCallback* callback); | |
94 | 94 |
95 // AudioRendererSink implementation. | 95 // AudioRendererSink implementation. |
96 virtual void Initialize(const media::AudioParameters& params, | 96 virtual void Initialize(const media::AudioParameters& params, |
97 RenderCallback* callback) OVERRIDE; | 97 RenderCallback* callback) OVERRIDE; |
98 virtual void Start() OVERRIDE; | 98 virtual void Start() OVERRIDE; |
99 virtual void Stop() OVERRIDE; | 99 virtual void Stop() OVERRIDE; |
100 virtual void Play() OVERRIDE; | 100 virtual void Play() OVERRIDE; |
101 virtual void Pause(bool flush) OVERRIDE; | 101 virtual void Pause(bool flush) OVERRIDE; |
102 virtual bool SetVolume(double volume) OVERRIDE; | 102 virtual bool SetVolume(double volume) OVERRIDE; |
103 virtual void GetVolume(double* volume) OVERRIDE; | 103 virtual void GetVolume(double* volume) OVERRIDE; |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
161 // guard to control stopping and starting the audio thread. | 161 // guard to control stopping and starting the audio thread. |
162 base::Lock audio_thread_lock_; | 162 base::Lock audio_thread_lock_; |
163 AudioDeviceThread audio_thread_; | 163 AudioDeviceThread audio_thread_; |
164 scoped_ptr<AudioDevice::AudioThreadCallback> audio_callback_; | 164 scoped_ptr<AudioDevice::AudioThreadCallback> audio_callback_; |
165 | 165 |
166 | 166 |
167 DISALLOW_COPY_AND_ASSIGN(AudioDevice); | 167 DISALLOW_COPY_AND_ASSIGN(AudioDevice); |
168 }; | 168 }; |
169 | 169 |
170 #endif // CONTENT_RENDERER_MEDIA_AUDIO_DEVICE_H_ | 170 #endif // CONTENT_RENDERER_MEDIA_AUDIO_DEVICE_H_ |
OLD | NEW |