| OLD | NEW |
| 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 "media/audio/win/audio_low_latency_input_win.h" | 5 #include "media/audio/win/audio_low_latency_input_win.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 #include <mmsystem.h> | 8 #include <mmsystem.h> |
| 9 #include <stddef.h> | 9 #include <stddef.h> |
| 10 #include <stdint.h> | 10 #include <stdint.h> |
| (...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 353 EXPECT_TRUE(wais->started()); | 353 EXPECT_TRUE(wais->started()); |
| 354 | 354 |
| 355 // Stop(), Stop() is a valid calling sequence (second call does nothing). | 355 // Stop(), Stop() is a valid calling sequence (second call does nothing). |
| 356 ais->Stop(); | 356 ais->Stop(); |
| 357 EXPECT_FALSE(wais->started()); | 357 EXPECT_FALSE(wais->started()); |
| 358 ais->Stop(); | 358 ais->Stop(); |
| 359 EXPECT_FALSE(wais->started()); | 359 EXPECT_FALSE(wais->started()); |
| 360 ais.Close(); | 360 ais.Close(); |
| 361 } | 361 } |
| 362 | 362 |
| 363 TEST_F(WinAudioInputTest, WASAPIAudioInputStreamTestPacketSizes) { | 363 // TODO(fdoray): investigate failure and re-enable. crbug.com/641142 |
| 364 TEST_F(WinAudioInputTest, DISABLED_WASAPIAudioInputStreamTestPacketSizes) { |
| 364 ABORT_AUDIO_TEST_IF_NOT(HasCoreAudioAndInputDevices(audio_manager_.get())); | 365 ABORT_AUDIO_TEST_IF_NOT(HasCoreAudioAndInputDevices(audio_manager_.get())); |
| 365 | 366 |
| 366 int count = 0; | 367 int count = 0; |
| 367 | 368 |
| 368 // 10 ms packet size. | 369 // 10 ms packet size. |
| 369 | 370 |
| 370 // Create default WASAPI input stream which records in stereo using | 371 // Create default WASAPI input stream which records in stereo using |
| 371 // the shared mixing rate. The default buffer size is 10ms. | 372 // the shared mixing rate. The default buffer size is 10ms. |
| 372 AudioInputStreamWrapper aisw(audio_manager_.get()); | 373 AudioInputStreamWrapper aisw(audio_manager_.get()); |
| 373 ScopedAudioInputStream ais(aisw.Create()); | 374 ScopedAudioInputStream ais(aisw.Create()); |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 487 WriteToFileAudioSink file_sink(file_name, aisw.bits_per_sample()); | 488 WriteToFileAudioSink file_sink(file_name, aisw.bits_per_sample()); |
| 488 VLOG(0) << ">> Speak into the default microphone while recording."; | 489 VLOG(0) << ">> Speak into the default microphone while recording."; |
| 489 ais->Start(&file_sink); | 490 ais->Start(&file_sink); |
| 490 base::PlatformThread::Sleep(TestTimeouts::action_timeout()); | 491 base::PlatformThread::Sleep(TestTimeouts::action_timeout()); |
| 491 ais->Stop(); | 492 ais->Stop(); |
| 492 VLOG(0) << ">> Recording has stopped."; | 493 VLOG(0) << ">> Recording has stopped."; |
| 493 ais.Close(); | 494 ais.Close(); |
| 494 } | 495 } |
| 495 | 496 |
| 496 } // namespace media | 497 } // namespace media |
| OLD | NEW |