Chromium Code Reviews| Index: content/renderer/media/audio_renderer_impl.h |
| =================================================================== |
| --- content/renderer/media/audio_renderer_impl.h (revision 114311) |
| +++ content/renderer/media/audio_renderer_impl.h (working copy) |
| @@ -26,6 +26,7 @@ |
| #include "media/audio/audio_io.h" |
| #include "media/audio/audio_parameters.h" |
| #include "media/filters/audio_renderer_base.h" |
| +#include "media/filters/audio_renderer_sink.h" |
| class AudioMessageFilter; |
| @@ -74,11 +75,15 @@ |
| void DoPause(); |
| void DoSeek(); |
| - // AudioDevice::RenderCallback implementation. |
| + // media::AudioRendererSink::RenderCallback implementation. |
| virtual void Render(const std::vector<float*>& audio_data, |
| size_t number_of_frames, |
| size_t audio_delay_milliseconds) OVERRIDE; |
| + // Detach from normal playback with AudioDevice and use the given sink. |
| + // Passing in NULL means to use the default sink which is the AudioDevice. |
|
tommi (sloooow) - chröme
2011/12/19 15:26:24
should this documentation perhaps rather be in the
Chris Rogers
2011/12/19 21:40:35
I think you're right given that it's part of the i
tommi (sloooow) - chröme
2011/12/20 15:05:46
That sounds reasonable to me.
|
| + virtual void SetAudioRendererSink(media::AudioRendererSink* sink) OVERRIDE; |
| + |
| // Accessors used by tests. |
| base::Time earliest_end_time() const { |
| return earliest_end_time_; |
| @@ -103,9 +108,18 @@ |
| // A flag that indicates this filter is called to stop. |
| bool stopped_; |
| - // audio_device_ is the sink (destination) for rendered audio. |
| + // sink_ is the sink (destination) for rendered audio. |
| + media::AudioRendererSink* sink_; |
| + |
| + // Protects access to sink_ |
| + base::Lock sink_lock_; |
| + |
| + // audio_device_ is the default sink. |
| scoped_refptr<AudioDevice> audio_device_; |
| + // Set to true when OnInitialize() is called. |
| + bool is_initialized_; |
| + |
| // We're supposed to know amount of audio data OS or hardware buffered, but |
| // that is not always so -- on my Linux box |
| // AudioBuffersState::hardware_delay_bytes never reaches 0. |