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

Unified Diff: content/renderer/media/media_stream_audio_processor.cc

Issue 259663005: Use AudioProcessing::Initialize(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/media_stream_audio_processor.cc
diff --git a/content/renderer/media/media_stream_audio_processor.cc b/content/renderer/media/media_stream_audio_processor.cc
index 01cee0c6e6a601f2a9541aec8c7dffba381fe7c8..c82a1b654e0d4d05922957d4a32adf5c6c2b0bf1 100644
--- a/content/renderer/media/media_stream_audio_processor.cc
+++ b/content/renderer/media/media_stream_audio_processor.cc
@@ -33,6 +33,8 @@ const int kAudioProcessingSampleRate = 16000;
const int kAudioProcessingSampleRate = 32000;
#endif
const int kAudioProcessingNumberOfChannels = 1;
+const AudioProcessing::ChannelLayout kAudioProcessingChannelLayout =
+ AudioProcessing::kMono;
const int kMaxNumberOfBuffersInFifo = 2;
@@ -351,11 +353,13 @@ void MediaStreamAudioProcessor::InitializeAudioProcessingModule(
}
// Create and configure the webrtc::AudioProcessing.
- audio_processing_.reset(webrtc::AudioProcessing::Create(0));
- // TODO(ajm): Replace with AudioProcessing::Initialize() when this rolls to
- // Chromium: http://review.webrtc.org/9919004/
- CHECK_EQ(0,
- audio_processing_->set_sample_rate_hz(kAudioProcessingSampleRate));
+ audio_processing_.reset(webrtc::AudioProcessing::Create());
+ CHECK_EQ(0, audio_processing_->Initialize(kAudioProcessingSampleRate,
+ kAudioProcessingSampleRate,
+ kAudioProcessingSampleRate,
+ kAudioProcessingChannelLayout,
+ kAudioProcessingChannelLayout,
+ kAudioProcessingChannelLayout));
// Enable the audio processing components.
if (enable_aec) {
@@ -459,7 +463,7 @@ int MediaStreamAudioProcessor::ProcessData(webrtc::AudioFrame* audio_frame,
return 0;
TRACE_EVENT0("audio", "MediaStreamAudioProcessor::ProcessData");
- DCHECK_EQ(audio_processing_->sample_rate_hz(),
+ DCHECK_EQ(audio_processing_->input_sample_rate_hz(),
capture_converter_->sink_parameters().sample_rate());
DCHECK_EQ(audio_processing_->num_input_channels(),
capture_converter_->sink_parameters().channels());
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698