OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <vector> | 5 #include <vector> |
6 | 6 |
7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/memory/aligned_memory.h" | 10 #include "base/memory/aligned_memory.h" |
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
449 MockMediaConstraintFactory constraint_factory; | 449 MockMediaConstraintFactory constraint_factory; |
450 scoped_refptr<WebRtcAudioDeviceImpl> webrtc_audio_device( | 450 scoped_refptr<WebRtcAudioDeviceImpl> webrtc_audio_device( |
451 new WebRtcAudioDeviceImpl()); | 451 new WebRtcAudioDeviceImpl()); |
452 scoped_refptr<MediaStreamAudioProcessor> audio_processor( | 452 scoped_refptr<MediaStreamAudioProcessor> audio_processor( |
453 new rtc::RefCountedObject<MediaStreamAudioProcessor>( | 453 new rtc::RefCountedObject<MediaStreamAudioProcessor>( |
454 constraint_factory.CreateWebMediaConstraints(), input_device_params_, | 454 constraint_factory.CreateWebMediaConstraints(), input_device_params_, |
455 webrtc_audio_device.get())); | 455 webrtc_audio_device.get())); |
456 EXPECT_TRUE(audio_processor->has_audio_processing()); | 456 EXPECT_TRUE(audio_processor->has_audio_processing()); |
457 | 457 |
458 static const int kSupportedSampleRates[] = | 458 static const int kSupportedSampleRates[] = |
459 { 8000, 16000, 22050, 32000, 44100, 48000, 88200, 96000 }; | 459 { 8000, 16000, 22050, 32000, 44100, 48000 }; |
460 for (size_t i = 0; i < arraysize(kSupportedSampleRates); ++i) { | 460 for (size_t i = 0; i < arraysize(kSupportedSampleRates); ++i) { |
461 int buffer_size = (kSupportedSampleRates[i] / 100) < 128 ? | 461 int buffer_size = (kSupportedSampleRates[i] / 100) < 128 ? |
462 kSupportedSampleRates[i] / 100 : 128; | 462 kSupportedSampleRates[i] / 100 : 128; |
463 media::AudioParameters params( | 463 media::AudioParameters params( |
464 media::AudioParameters::AUDIO_PCM_LOW_LATENCY, | 464 media::AudioParameters::AUDIO_PCM_LOW_LATENCY, |
465 media::CHANNEL_LAYOUT_STEREO, kSupportedSampleRates[i], 16, | 465 media::CHANNEL_LAYOUT_STEREO, kSupportedSampleRates[i], 16, |
466 buffer_size); | 466 buffer_size); |
467 audio_processor->OnCaptureFormatChanged(params); | 467 audio_processor->OnCaptureFormatChanged(params); |
468 VerifyDefaultComponents(audio_processor.get()); | 468 VerifyDefaultComponents(audio_processor.get()); |
469 | 469 |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
588 ProcessDataAndVerifyFormat(audio_processor.get(), | 588 ProcessDataAndVerifyFormat(audio_processor.get(), |
589 kAudioProcessingSampleRate, | 589 kAudioProcessingSampleRate, |
590 kAudioProcessingNumberOfChannel, | 590 kAudioProcessingNumberOfChannel, |
591 kAudioProcessingSampleRate / 100); | 591 kAudioProcessingSampleRate / 100); |
592 // Set |audio_processor| to NULL to make sure |webrtc_audio_device| outlives | 592 // Set |audio_processor| to NULL to make sure |webrtc_audio_device| outlives |
593 // |audio_processor|. | 593 // |audio_processor|. |
594 audio_processor = NULL; | 594 audio_processor = NULL; |
595 } | 595 } |
596 | 596 |
597 } // namespace content | 597 } // namespace content |
OLD | NEW |