Index: media/audio/audio_low_latency_input_output_unittest.cc |
diff --git a/media/audio/audio_low_latency_input_output_unittest.cc b/media/audio/audio_low_latency_input_output_unittest.cc |
index 8c05b12c2c667b1865fcefaebf60bce3f4e3cf66..a13d3baa8e3a1bf20b665ac6f57aa03536aa2007 100644 |
--- a/media/audio/audio_low_latency_input_output_unittest.cc |
+++ b/media/audio/audio_low_latency_input_output_unittest.cc |
@@ -14,7 +14,6 @@ |
#include "build/build_config.h" |
#include "media/audio/audio_io.h" |
#include "media/audio/audio_manager_base.h" |
-#include "media/audio/audio_util.h" |
#include "media/base/seekable_buffer.h" |
#include "testing/gmock/include/gmock/gmock.h" |
#include "testing/gtest/include/gtest/gtest.h" |
@@ -286,14 +285,10 @@ class AudioInputStreamTraits { |
public: |
typedef AudioInputStream StreamType; |
- static int HardwareSampleRate() { |
- return static_cast<int>(media::GetAudioInputHardwareSampleRate( |
- AudioManagerBase::kDefaultDeviceId)); |
- } |
- |
- // TODO(henrika): add support for GetAudioInputHardwareBufferSize in media. |
- static int HardwareBufferSize() { |
- return static_cast<int>(media::GetAudioHardwareBufferSize()); |
+ static AudioParameters GetDefaultAudioStreamParameters( |
+ AudioManager* audio_manager) { |
+ return audio_manager->GetInputStreamParameters( |
+ AudioManagerBase::kDefaultDeviceId); |
} |
static StreamType* CreateStream(AudioManager* audio_manager, |
@@ -307,12 +302,9 @@ class AudioOutputStreamTraits { |
public: |
typedef AudioOutputStream StreamType; |
- static int HardwareSampleRate() { |
- return static_cast<int>(media::GetAudioHardwareSampleRate()); |
- } |
- |
- static int HardwareBufferSize() { |
- return static_cast<int>(media::GetAudioHardwareBufferSize()); |
+ static AudioParameters GetDefaultAudioStreamParameters( |
+ AudioManager* audio_manager) { |
+ return audio_manager->GetDefaultOutputStreamParameters(); |
} |
static StreamType* CreateStream(AudioManager* audio_manager, |
@@ -339,11 +331,13 @@ class StreamWrapper { |
#endif |
bits_per_sample_(16) { |
// Use the preferred sample rate. |
- sample_rate_ = StreamTraits::HardwareSampleRate(); |
+ const AudioParameters& params = |
+ StreamTraits::GetDefaultAudioStreamParameters(audio_manager_); |
+ sample_rate_ = params.sample_rate(); |
// Use the preferred buffer size. Note that the input side uses the same |
// size as the output side in this implementation. |
- samples_per_packet_ = StreamTraits::HardwareBufferSize(); |
+ samples_per_packet_ = params.frames_per_buffer(); |
} |
virtual ~StreamWrapper() {} |