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

Side by Side Diff: media/audio/win/audio_low_latency_input_win_unittest.cc

Issue 509893002: Revert of Remove the last piece of deprecated synchronous IO code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « media/audio/win/audio_low_latency_input_win.cc ('k') | media/audio/win/audio_manager_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <windows.h> 5 #include <windows.h>
6 #include <mmsystem.h> 6 #include <mmsystem.h>
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/environment.h" 9 #include "base/environment.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 return ChannelLayoutToChannelCount(default_params_.channel_layout()); 201 return ChannelLayoutToChannelCount(default_params_.channel_layout());
202 } 202 }
203 int bits_per_sample() const { return default_params_.bits_per_sample(); } 203 int bits_per_sample() const { return default_params_.bits_per_sample(); }
204 int sample_rate() const { return default_params_.sample_rate(); } 204 int sample_rate() const { return default_params_.sample_rate(); }
205 int frames_per_buffer() const { return frames_per_buffer_; } 205 int frames_per_buffer() const { return frames_per_buffer_; }
206 206
207 private: 207 private:
208 AudioInputStream* CreateInputStream() { 208 AudioInputStream* CreateInputStream() {
209 AudioInputStream* ais = audio_man_->MakeAudioInputStream( 209 AudioInputStream* ais = audio_man_->MakeAudioInputStream(
210 AudioParameters(format(), default_params_.channel_layout(), 210 AudioParameters(format(), default_params_.channel_layout(),
211 default_params_.input_channels(),
211 sample_rate(), bits_per_sample(), frames_per_buffer_, 212 sample_rate(), bits_per_sample(), frames_per_buffer_,
212 default_params_.effects()), 213 default_params_.effects()),
213 AudioManagerBase::kDefaultDeviceId); 214 AudioManagerBase::kDefaultDeviceId);
214 EXPECT_TRUE(ais); 215 EXPECT_TRUE(ais);
215 return ais; 216 return ais;
216 } 217 }
217 218
218 ScopedCOMInitializer com_init_; 219 ScopedCOMInitializer com_init_;
219 AudioManager* audio_man_; 220 AudioManager* audio_man_;
220 const AudioParameters default_params_; 221 const AudioParameters default_params_;
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
486 WriteToFileAudioSink file_sink(file_name, aisw.bits_per_sample()); 487 WriteToFileAudioSink file_sink(file_name, aisw.bits_per_sample());
487 VLOG(0) << ">> Speak into the default microphone while recording."; 488 VLOG(0) << ">> Speak into the default microphone while recording.";
488 ais->Start(&file_sink); 489 ais->Start(&file_sink);
489 base::PlatformThread::Sleep(TestTimeouts::action_timeout()); 490 base::PlatformThread::Sleep(TestTimeouts::action_timeout());
490 ais->Stop(); 491 ais->Stop();
491 VLOG(0) << ">> Recording has stopped."; 492 VLOG(0) << ">> Recording has stopped.";
492 ais.Close(); 493 ais.Close();
493 } 494 }
494 495
495 } // namespace media 496 } // namespace media
OLDNEW
« no previous file with comments | « media/audio/win/audio_low_latency_input_win.cc ('k') | media/audio/win/audio_manager_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698