| 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 #include "content/renderer/media/render_audiosourceprovider.h" | 5 #include "content/renderer/media/render_audiosourceprovider.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "content/public/common/content_switches.h" | 12 #include "content/public/common/content_switches.h" |
| 13 #include "content/renderer/media/audio_device_factory.h" | 13 #include "content/renderer/media/audio_device_factory.h" |
| 14 #include "content/renderer/media/audio_renderer_mixer_manager.h" | 14 #include "content/renderer/media/audio_renderer_mixer_manager.h" |
| 15 #include "content/renderer/render_thread_impl.h" | 15 #include "content/renderer/render_thread_impl.h" |
| 16 #include "media/base/audio_renderer_mixer_input.h" | 16 #include "media/base/audio_renderer_mixer_input.h" |
| 17 #include "third_party/WebKit/Source/WebKit/chromium/public/WebAudioSourceProvide
rClient.h" | 17 #include "third_party/WebKit/Source/WebKit/chromium/public/WebAudioSourceProvide
rClient.h" |
| 18 | 18 |
| 19 using content::AudioDeviceFactory; | |
| 20 using content::AudioRendererMixerManager; | |
| 21 using std::vector; | 19 using std::vector; |
| 22 using WebKit::WebVector; | 20 using WebKit::WebVector; |
| 23 | 21 |
| 22 namespace content { |
| 23 |
| 24 RenderAudioSourceProvider::RenderAudioSourceProvider() | 24 RenderAudioSourceProvider::RenderAudioSourceProvider() |
| 25 : is_initialized_(false), | 25 : is_initialized_(false), |
| 26 channels_(0), | 26 channels_(0), |
| 27 sample_rate_(0), | 27 sample_rate_(0), |
| 28 is_running_(false), | 28 is_running_(false), |
| 29 renderer_(NULL), | 29 renderer_(NULL), |
| 30 client_(NULL) { | 30 client_(NULL) { |
| 31 // We create an AudioRendererSink here, but we don't yet know the audio format | 31 // We create an AudioRendererSink here, but we don't yet know the audio format |
| 32 // (sample-rate, etc.) at this point. Later, when Initialize() is called, we | 32 // (sample-rate, etc.) at this point. Later, when Initialize() is called, we |
| 33 // have the audio format information and call AudioRendererSink::Initialize() | 33 // have the audio format information and call AudioRendererSink::Initialize() |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 | 142 |
| 143 if (client_) { | 143 if (client_) { |
| 144 // Inform WebKit about the audio stream format. | 144 // Inform WebKit about the audio stream format. |
| 145 client_->setFormat(channels_, sample_rate_); | 145 client_->setFormat(channels_, sample_rate_); |
| 146 } | 146 } |
| 147 | 147 |
| 148 is_initialized_ = true; | 148 is_initialized_ = true; |
| 149 } | 149 } |
| 150 | 150 |
| 151 RenderAudioSourceProvider::~RenderAudioSourceProvider() {} | 151 RenderAudioSourceProvider::~RenderAudioSourceProvider() {} |
| 152 |
| 153 } // namespace content |
| OLD | NEW |