| 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/win/audio_low_latency_output_win.h" | 5 #include "media/audio/win/audio_low_latency_output_win.h" |
| 6 | 6 |
| 7 #include <Functiondiscoverykeys_devpkey.h> | 7 #include <Functiondiscoverykeys_devpkey.h> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 | 128 |
| 129 bool WASAPIAudioOutputStream::Open() { | 129 bool WASAPIAudioOutputStream::Open() { |
| 130 DVLOG(1) << "WASAPIAudioOutputStream::Open()"; | 130 DVLOG(1) << "WASAPIAudioOutputStream::Open()"; |
| 131 DCHECK_EQ(GetCurrentThreadId(), creating_thread_id_); | 131 DCHECK_EQ(GetCurrentThreadId(), creating_thread_id_); |
| 132 if (opened_) | 132 if (opened_) |
| 133 return true; | 133 return true; |
| 134 | 134 |
| 135 DCHECK(!audio_client_.get()); | 135 DCHECK(!audio_client_.get()); |
| 136 DCHECK(!audio_render_client_.get()); | 136 DCHECK(!audio_render_client_.get()); |
| 137 | 137 |
| 138 // Don't allow WASAPI streams to be created for remote output devices, this |
| 139 // frequently leads to hangs of the audio thread. http://crbug.com/422522. |
| 140 if (CoreAudioUtil::IsRemoteOutputDevice(device_id_)) |
| 141 return false; |
| 142 |
| 138 // Will be set to true if we ended up opening the default communications | 143 // Will be set to true if we ended up opening the default communications |
| 139 // device. | 144 // device. |
| 140 bool communications_device = false; | 145 bool communications_device = false; |
| 141 | 146 |
| 142 // Create an IAudioClient interface for the default rendering IMMDevice. | 147 // Create an IAudioClient interface for the default rendering IMMDevice. |
| 143 ScopedComPtr<IAudioClient> audio_client; | 148 ScopedComPtr<IAudioClient> audio_client; |
| 144 if (device_id_.empty() || | 149 if (device_id_.empty() || |
| 145 CoreAudioUtil::DeviceIsDefault(eRender, device_role_, device_id_)) { | 150 CoreAudioUtil::DeviceIsDefault(eRender, device_role_, device_id_)) { |
| 146 audio_client = CoreAudioUtil::CreateDefaultClient(eRender, device_role_); | 151 audio_client = CoreAudioUtil::CreateDefaultClient(eRender, device_role_); |
| 147 communications_device = (device_role_ == eCommunications); | 152 communications_device = (device_role_ == eCommunications); |
| (...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 616 | 621 |
| 617 // Ensure that we don't quit the main thread loop immediately next | 622 // Ensure that we don't quit the main thread loop immediately next |
| 618 // time Start() is called. | 623 // time Start() is called. |
| 619 ResetEvent(stop_render_event_.Get()); | 624 ResetEvent(stop_render_event_.Get()); |
| 620 } | 625 } |
| 621 | 626 |
| 622 source_ = NULL; | 627 source_ = NULL; |
| 623 } | 628 } |
| 624 | 629 |
| 625 } // namespace media | 630 } // namespace media |
| OLD | NEW |