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 | |
143 // Will be set to true if we ended up opening the default communications | 138 // Will be set to true if we ended up opening the default communications |
144 // device. | 139 // device. |
145 bool communications_device = false; | 140 bool communications_device = false; |
146 | 141 |
147 // Create an IAudioClient interface for the default rendering IMMDevice. | 142 // Create an IAudioClient interface for the default rendering IMMDevice. |
148 ScopedComPtr<IAudioClient> audio_client; | 143 ScopedComPtr<IAudioClient> audio_client; |
149 if (device_id_.empty() || | 144 if (device_id_.empty() || |
150 CoreAudioUtil::DeviceIsDefault(eRender, device_role_, device_id_)) { | 145 CoreAudioUtil::DeviceIsDefault(eRender, device_role_, device_id_)) { |
151 audio_client = CoreAudioUtil::CreateDefaultClient(eRender, device_role_); | 146 audio_client = CoreAudioUtil::CreateDefaultClient(eRender, device_role_); |
152 communications_device = (device_role_ == eCommunications); | 147 communications_device = (device_role_ == eCommunications); |
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
621 | 616 |
622 // Ensure that we don't quit the main thread loop immediately next | 617 // Ensure that we don't quit the main thread loop immediately next |
623 // time Start() is called. | 618 // time Start() is called. |
624 ResetEvent(stop_render_event_.Get()); | 619 ResetEvent(stop_render_event_.Get()); |
625 } | 620 } |
626 | 621 |
627 source_ = NULL; | 622 source_ = NULL; |
628 } | 623 } |
629 | 624 |
630 } // namespace media | 625 } // namespace media |
OLD | NEW |