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" |
(...skipping 16 matching lines...) Expand all Loading... |
27 channels_(0), | 27 channels_(0), |
28 sample_rate_(0), | 28 sample_rate_(0), |
29 is_running_(false), | 29 is_running_(false), |
30 renderer_(NULL), | 30 renderer_(NULL), |
31 client_(NULL) { | 31 client_(NULL) { |
32 // We create an AudioRendererSink here, but we don't yet know the audio format | 32 // We create an AudioRendererSink here, but we don't yet know the audio format |
33 // (sample-rate, etc.) at this point. Later, when Initialize() is called, we | 33 // (sample-rate, etc.) at this point. Later, when Initialize() is called, we |
34 // have the audio format information and call AudioRendererSink::Initialize() | 34 // have the audio format information and call AudioRendererSink::Initialize() |
35 // to fully initialize it. | 35 // to fully initialize it. |
36 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); | 36 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); |
37 #if defined(OS_WIN) || defined(OS_MAC) | 37 #if defined(OS_WIN) || defined(OS_MACOSX) |
38 const bool use_mixing = | 38 const bool use_mixing = |
39 !cmd_line->HasSwitch(switches::kDisableRendererSideMixing); | 39 !cmd_line->HasSwitch(switches::kDisableRendererSideMixing); |
40 #else | 40 #else |
41 const bool use_mixing = | 41 const bool use_mixing = |
42 cmd_line->HasSwitch(switches::kEnableRendererSideMixing); | 42 cmd_line->HasSwitch(switches::kEnableRendererSideMixing); |
43 #endif | 43 #endif |
44 | 44 |
45 if (use_mixing) { | 45 if (use_mixing) { |
46 default_sink_ = RenderThreadImpl::current()-> | 46 default_sink_ = RenderThreadImpl::current()-> |
47 GetAudioRendererMixerManager()->CreateInput(); | 47 GetAudioRendererMixerManager()->CreateInput(); |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 // Inform WebKit about the audio stream format. | 160 // Inform WebKit about the audio stream format. |
161 client_->setFormat(channels_, sample_rate_); | 161 client_->setFormat(channels_, sample_rate_); |
162 } | 162 } |
163 | 163 |
164 is_initialized_ = true; | 164 is_initialized_ = true; |
165 } | 165 } |
166 | 166 |
167 RenderAudioSourceProvider::~RenderAudioSourceProvider() {} | 167 RenderAudioSourceProvider::~RenderAudioSourceProvider() {} |
168 | 168 |
169 } // namespace content | 169 } // namespace content |
OLD | NEW |