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

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

Issue 518433002: Revert of 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(),
212 sample_rate(), bits_per_sample(), frames_per_buffer_, 211 sample_rate(), bits_per_sample(), frames_per_buffer_,
213 default_params_.effects()), 212 default_params_.effects()),
214 AudioManagerBase::kDefaultDeviceId); 213 AudioManagerBase::kDefaultDeviceId);
215 EXPECT_TRUE(ais); 214 EXPECT_TRUE(ais);
216 return ais; 215 return ais;
217 } 216 }
218 217
219 ScopedCOMInitializer com_init_; 218 ScopedCOMInitializer com_init_;
220 AudioManager* audio_man_; 219 AudioManager* audio_man_;
221 const AudioParameters default_params_; 220 const AudioParameters default_params_;
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
487 WriteToFileAudioSink file_sink(file_name, aisw.bits_per_sample()); 486 WriteToFileAudioSink file_sink(file_name, aisw.bits_per_sample());
488 VLOG(0) << ">> Speak into the default microphone while recording."; 487 VLOG(0) << ">> Speak into the default microphone while recording.";
489 ais->Start(&file_sink); 488 ais->Start(&file_sink);
490 base::PlatformThread::Sleep(TestTimeouts::action_timeout()); 489 base::PlatformThread::Sleep(TestTimeouts::action_timeout());
491 ais->Stop(); 490 ais->Stop();
492 VLOG(0) << ">> Recording has stopped."; 491 VLOG(0) << ">> Recording has stopped.";
493 ais.Close(); 492 ais.Close();
494 } 493 }
495 494
496 } // namespace media 495 } // 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