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

Side by Side Diff: content/renderer/media/media_stream_audio_processor_unittest.cc

Issue 1528473003: Feed the WebRTC APM with empty far-end frames for the number of frames skipped by OS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Code review. Rebase. Created 5 years 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
OLDNEW
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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 const bool is_aec_enabled = ap && ap->echo_cancellation()->is_enabled(); 124 const bool is_aec_enabled = ap && ap->echo_cancellation()->is_enabled();
125 #endif 125 #endif
126 if (is_aec_enabled) { 126 if (is_aec_enabled) {
127 if (params.channels() > kMaxNumberOfPlayoutDataChannels) { 127 if (params.channels() > kMaxNumberOfPlayoutDataChannels) {
128 for (int i = 0; i < kMaxNumberOfPlayoutDataChannels; ++i) { 128 for (int i = 0; i < kMaxNumberOfPlayoutDataChannels; ++i) {
129 data_bus_playout->SetChannelData( 129 data_bus_playout->SetChannelData(
130 i, const_cast<float*>(data_bus->channel(i))); 130 i, const_cast<float*>(data_bus->channel(i)));
131 } 131 }
132 } 132 }
133 audio_processor->OnPlayoutData(data_bus_playout_to_use, 133 audio_processor->OnPlayoutData(data_bus_playout_to_use,
134 params.sample_rate(), 10); 134 params.sample_rate(), 10, 0);
135 } 135 }
136 136
137 media::AudioBus* processed_data = nullptr; 137 media::AudioBus* processed_data = nullptr;
138 base::TimeDelta capture_delay; 138 base::TimeDelta capture_delay;
139 int new_volume = 0; 139 int new_volume = 0;
140 while (audio_processor->ProcessAndConsumeData( 140 while (audio_processor->ProcessAndConsumeData(
141 255, false, &processed_data, &capture_delay, &new_volume)) { 141 255, false, &processed_data, &capture_delay, &new_volume)) {
142 EXPECT_TRUE(processed_data); 142 EXPECT_TRUE(processed_data);
143 EXPECT_NEAR(input_capture_delay.InMillisecondsF(), 143 EXPECT_NEAR(input_capture_delay.InMillisecondsF(),
144 capture_delay.InMillisecondsF(), 144 capture_delay.InMillisecondsF(),
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « content/renderer/media/media_stream_audio_processor.cc ('k') | content/renderer/media/webrtc_audio_device_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698