| Index: content/renderer/media/render_audiosourceprovider.cc
|
| diff --git a/content/renderer/media/render_audiosourceprovider.cc b/content/renderer/media/render_audiosourceprovider.cc
|
| index 750db7fe0a47472c99bbdc50ff3ba7f612062da2..fb1295f9173d5393c69a5f2e74759ce3883ce6ad 100644
|
| --- a/content/renderer/media/render_audiosourceprovider.cc
|
| +++ b/content/renderer/media/render_audiosourceprovider.cc
|
| @@ -9,9 +9,10 @@
|
| #include "base/basictypes.h"
|
| #include "base/command_line.h"
|
| #include "base/logging.h"
|
| -#include "content/renderer/media/audio_device_factory.h"
|
| +#include "content/renderer/media/audio_message_filter.h"
|
| #include "content/renderer/media/audio_renderer_mixer_manager.h"
|
| #include "content/renderer/render_thread_impl.h"
|
| +#include "media/audio/audio_output_device.h"
|
| #include "media/base/audio_renderer_mixer_input.h"
|
| #include "media/base/media_switches.h"
|
| #include "third_party/WebKit/Source/WebKit/chromium/public/WebAudioSourceProviderClient.h"
|
| @@ -21,7 +22,7 @@ using WebKit::WebVector;
|
|
|
| namespace content {
|
|
|
| -RenderAudioSourceProvider::RenderAudioSourceProvider()
|
| +RenderAudioSourceProvider::RenderAudioSourceProvider(int source_render_view_id)
|
| : is_initialized_(false),
|
| channels_(0),
|
| sample_rate_(0),
|
| @@ -44,8 +45,22 @@ RenderAudioSourceProvider::RenderAudioSourceProvider()
|
| if (use_mixing) {
|
| default_sink_ = RenderThreadImpl::current()->
|
| GetAudioRendererMixerManager()->CreateInput();
|
| + // TODO(miu): Partition mixer instances per RenderView.
|
| } else {
|
| - default_sink_ = AudioDeviceFactory::NewOutputDevice();
|
| + RenderThreadImpl* const render_thread = RenderThreadImpl::current();
|
| + scoped_refptr<media::AudioOutputDevice> device =
|
| + new media::AudioOutputDevice(render_thread->audio_message_filter(),
|
| + render_thread->GetIOMessageLoopProxy());
|
| + // The RenderView creating RenderAudioSourceProvider will be the source of
|
| + // the audio (WebMediaPlayer is always associated with a single frame).
|
| + //
|
| + // TODO(miu): Unfortunately, there is one use case where this is not true:
|
| + // JavaScript code can call new Audio() and pass the object around. The
|
| + // RenderAudioSourceProvider is not instantiated until the "src" attribute
|
| + // has been set.
|
| + render_thread->audio_message_filter()->AssociateStreamWithProducer(
|
| + device->stream_id(), source_render_view_id);
|
| + default_sink_ = device;
|
| }
|
| }
|
|
|
|
|