Chromium Code Reviews| 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 "media/audio/audio_manager_base.h" | 5 #include "media/audio/audio_manager_base.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 76 max_num_input_streams_(kDefaultMaxInputStreams), | 76 max_num_input_streams_(kDefaultMaxInputStreams), |
| 77 num_output_streams_(0), | 77 num_output_streams_(0), |
| 78 num_input_streams_(0), | 78 num_input_streams_(0), |
| 79 // TODO(dalecurtis): Switch this to an ObserverListThreadSafe, so we don't | 79 // TODO(dalecurtis): Switch this to an ObserverListThreadSafe, so we don't |
| 80 // block the UI thread when swapping devices. | 80 // block the UI thread when swapping devices. |
| 81 output_listeners_( | 81 output_listeners_( |
| 82 ObserverList<AudioDeviceListener>::NOTIFY_EXISTING_ONLY), | 82 ObserverList<AudioDeviceListener>::NOTIFY_EXISTING_ONLY), |
| 83 audio_thread_("AudioThread"), | 83 audio_thread_("AudioThread"), |
| 84 audio_log_factory_(audio_log_factory) { | 84 audio_log_factory_(audio_log_factory) { |
| 85 #if defined(OS_WIN) | 85 #if defined(OS_WIN) |
| 86 audio_thread_.init_com_with_mta(true); | 86 // Do not use MTA mode initalization as it causes hangs for a significant |
|
henrika (OOO until Aug 14)
2015/04/17 09:17:03
are we certain that is does?
DaleCurtis
2015/04/17 17:58:55
If it doesn't I'll be reverting this CL :)
| |
| 87 // population of users and is not supported on Windows 8 for audio capture | |
| 88 // and rendering. See http://crbug.com/422522. | |
| 89 audio_thread_.init_com_with_mta(false); | |
| 87 #elif defined(OS_MACOSX) | 90 #elif defined(OS_MACOSX) |
| 88 // CoreAudio calls must occur on the main thread of the process, which in our | 91 // CoreAudio calls must occur on the main thread of the process, which in our |
| 89 // case is sadly the browser UI thread. Failure to execute calls on the right | 92 // case is sadly the browser UI thread. Failure to execute calls on the right |
| 90 // thread leads to crashes and odd behavior. See http://crbug.com/158170. | 93 // thread leads to crashes and odd behavior. See http://crbug.com/158170. |
| 91 // TODO(dalecurtis): We should require the message loop to be passed in. | 94 // TODO(dalecurtis): We should require the message loop to be passed in. |
| 92 if (base::MessageLoopForUI::IsCurrent()) { | 95 if (base::MessageLoopForUI::IsCurrent()) { |
| 93 task_runner_ = base::MessageLoopProxy::current(); | 96 task_runner_ = base::MessageLoopProxy::current(); |
| 94 return; | 97 return; |
| 95 } | 98 } |
| 96 #endif | 99 #endif |
| (...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 398 scoped_ptr<AudioLog> AudioManagerBase::CreateAudioLog( | 401 scoped_ptr<AudioLog> AudioManagerBase::CreateAudioLog( |
| 399 AudioLogFactory::AudioComponent component) { | 402 AudioLogFactory::AudioComponent component) { |
| 400 return audio_log_factory_->CreateAudioLog(component); | 403 return audio_log_factory_->CreateAudioLog(component); |
| 401 } | 404 } |
| 402 | 405 |
| 403 void AudioManagerBase::SetHasKeyboardMic() { | 406 void AudioManagerBase::SetHasKeyboardMic() { |
| 404 NOTREACHED(); | 407 NOTREACHED(); |
| 405 } | 408 } |
| 406 | 409 |
| 407 } // namespace media | 410 } // namespace media |
| OLD | NEW |