Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(869)

Unified Diff: media/audio/audio_low_latency_input_output_unittest.cc

Issue 12316131: Moved AudioUtil static functions to AudioManager interfaces (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: made the GetPreferredOutputStreamParameters protected Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/audio/audio_input_volume_unittest.cc ('k') | media/audio/audio_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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() {}
« no previous file with comments | « media/audio/audio_input_volume_unittest.cc ('k') | media/audio/audio_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698