| 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" |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "base/metrics/histogram.h" | 12 #include "base/metrics/histogram.h" |
| 13 #include "base/strings/utf_string_conversions.h" | 13 #include "base/strings/utf_string_conversions.h" |
| 14 #include "base/trace_event/trace_event.h" | 14 #include "base/trace_event/trace_event.h" |
| 15 #include "base/win/scoped_propvariant.h" | 15 #include "base/win/scoped_propvariant.h" |
| 16 #include "media/audio/audio_device_description.h" |
| 16 #include "media/audio/win/audio_manager_win.h" | 17 #include "media/audio/win/audio_manager_win.h" |
| 17 #include "media/audio/win/avrt_wrapper_win.h" | 18 #include "media/audio/win/avrt_wrapper_win.h" |
| 18 #include "media/audio/win/core_audio_util_win.h" | 19 #include "media/audio/win/core_audio_util_win.h" |
| 19 #include "media/base/limits.h" | 20 #include "media/base/limits.h" |
| 20 #include "media/base/media_switches.h" | 21 #include "media/base/media_switches.h" |
| 21 | 22 |
| 22 using base::win::ScopedComPtr; | 23 using base::win::ScopedComPtr; |
| 23 using base::win::ScopedCOMInitializer; | 24 using base::win::ScopedCOMInitializer; |
| 24 using base::win::ScopedCoMem; | 25 using base::win::ScopedCoMem; |
| 25 | 26 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 device_role_(device_role), | 70 device_role_(device_role), |
| 70 share_mode_(GetShareMode()), | 71 share_mode_(GetShareMode()), |
| 71 num_written_frames_(0), | 72 num_written_frames_(0), |
| 72 source_(NULL), | 73 source_(NULL), |
| 73 audio_bus_(AudioBus::Create(params)) { | 74 audio_bus_(AudioBus::Create(params)) { |
| 74 DCHECK(manager_); | 75 DCHECK(manager_); |
| 75 | 76 |
| 76 // The empty string is used to indicate a default device and the | 77 // The empty string is used to indicate a default device and the |
| 77 // |device_role_| member controls whether that's the default or default | 78 // |device_role_| member controls whether that's the default or default |
| 78 // communications device. | 79 // communications device. |
| 79 DCHECK_NE(device_id_, AudioManagerBase::kDefaultDeviceId); | 80 DCHECK_NE(device_id_, AudioDeviceDescription::kDefaultDeviceId); |
| 80 DCHECK_NE(device_id_, AudioManagerBase::kCommunicationsDeviceId); | 81 DCHECK_NE(device_id_, AudioDeviceDescription::kCommunicationsDeviceId); |
| 81 | 82 |
| 82 DVLOG(1) << "WASAPIAudioOutputStream::WASAPIAudioOutputStream()"; | 83 DVLOG(1) << "WASAPIAudioOutputStream::WASAPIAudioOutputStream()"; |
| 83 DVLOG_IF(1, share_mode_ == AUDCLNT_SHAREMODE_EXCLUSIVE) | 84 DVLOG_IF(1, share_mode_ == AUDCLNT_SHAREMODE_EXCLUSIVE) |
| 84 << "Core Audio (WASAPI) EXCLUSIVE MODE is enabled."; | 85 << "Core Audio (WASAPI) EXCLUSIVE MODE is enabled."; |
| 85 | 86 |
| 86 // Load the Avrt DLL if not already loaded. Required to support MMCSS. | 87 // Load the Avrt DLL if not already loaded. Required to support MMCSS. |
| 87 bool avrt_init = avrt::Initialize(); | 88 bool avrt_init = avrt::Initialize(); |
| 88 DCHECK(avrt_init) << "Failed to load the avrt.dll"; | 89 DCHECK(avrt_init) << "Failed to load the avrt.dll"; |
| 89 | 90 |
| 90 // Set up the desired render format specified by the client. We use the | 91 // Set up the desired render format specified by the client. We use the |
| (...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 651 | 652 |
| 652 // Ensure that we don't quit the main thread loop immediately next | 653 // Ensure that we don't quit the main thread loop immediately next |
| 653 // time Start() is called. | 654 // time Start() is called. |
| 654 ResetEvent(stop_render_event_.Get()); | 655 ResetEvent(stop_render_event_.Get()); |
| 655 } | 656 } |
| 656 | 657 |
| 657 source_ = NULL; | 658 source_ = NULL; |
| 658 } | 659 } |
| 659 | 660 |
| 660 } // namespace media | 661 } // namespace media |
| OLD | NEW |