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

Unified Diff: media/audio/audio_input_volume_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
Index: media/audio/audio_input_volume_unittest.cc
diff --git a/media/audio/audio_input_volume_unittest.cc b/media/audio/audio_input_volume_unittest.cc
index 8f754cc336987f00e0e860a64a834e5ce936b62a..2f3bda9583cd21ee55c95eaad59e3bc61f596204 100644
--- a/media/audio/audio_input_volume_unittest.cc
+++ b/media/audio/audio_input_volume_unittest.cc
@@ -51,29 +51,10 @@ class AudioInputVolumeTest : public ::testing::Test {
}
AudioInputStream* CreateAndOpenStream(const std::string& device_id) {
- AudioParameters::Format format = AudioParameters::AUDIO_PCM_LOW_LATENCY;
- ChannelLayout channel_layout =
- media::GetAudioInputHardwareChannelLayout(device_id);
- int bits_per_sample = 16;
- int sample_rate =
- static_cast<int>(media::GetAudioInputHardwareSampleRate(device_id));
- int samples_per_packet = 0;
-#if defined(OS_MACOSX)
- samples_per_packet = (sample_rate / 100);
-#elif defined(OS_LINUX) || defined(OS_OPENBSD)
- samples_per_packet = (sample_rate / 100);
-#elif defined(OS_WIN)
- if (sample_rate == 44100)
- samples_per_packet = 448;
- else
- samples_per_packet = (sample_rate / 100);
-#else
-#error Unsupported platform
-#endif
+ const AudioParameters& params =
+ audio_manager_->GetInputStreamParameters(device_id);
AudioInputStream* ais = audio_manager_->MakeAudioInputStream(
- AudioParameters(format, channel_layout, sample_rate, bits_per_sample,
- samples_per_packet),
- device_id);
+ params, device_id);
EXPECT_TRUE(NULL != ais);
#if defined(OS_LINUX) || defined(OS_OPENBSD)
« no previous file with comments | « media/audio/android/audio_manager_android.cc ('k') | media/audio/audio_low_latency_input_output_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698