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

Side by Side Diff: webrtc/modules/audio_processing/audio_processing_impl.cc

Issue 1410833002: Lock scheme #4: Introduced the render sample queue for the aec and aecm (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@aec_error_report_CL
Patch Set: Merge with latest master Created 5 years, 1 month 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
« no previous file with comments | « no previous file | webrtc/modules/audio_processing/echo_cancellation_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after
523 523
524 int AudioProcessingImpl::ProcessStream(const float* const* src, 524 int AudioProcessingImpl::ProcessStream(const float* const* src,
525 const StreamConfig& input_config, 525 const StreamConfig& input_config,
526 const StreamConfig& output_config, 526 const StreamConfig& output_config,
527 float* const* dest) { 527 float* const* dest) {
528 CriticalSectionScoped crit_scoped(crit_); 528 CriticalSectionScoped crit_scoped(crit_);
529 if (!src || !dest) { 529 if (!src || !dest) {
530 return kNullPointerError; 530 return kNullPointerError;
531 } 531 }
532 532
533 echo_cancellation_->ReadQueuedRenderData();
534 echo_control_mobile_->ReadQueuedRenderData();
535
533 ProcessingConfig processing_config = api_format_; 536 ProcessingConfig processing_config = api_format_;
534 processing_config.input_stream() = input_config; 537 processing_config.input_stream() = input_config;
535 processing_config.output_stream() = output_config; 538 processing_config.output_stream() = output_config;
536 539
537 RETURN_ON_ERR(MaybeInitializeLocked(processing_config)); 540 RETURN_ON_ERR(MaybeInitializeLocked(processing_config));
538 assert(processing_config.input_stream().num_frames() == 541 assert(processing_config.input_stream().num_frames() ==
539 api_format_.input_stream().num_frames()); 542 api_format_.input_stream().num_frames());
540 543
541 #ifdef WEBRTC_AUDIOPROC_DEBUG_DUMP 544 #ifdef WEBRTC_AUDIOPROC_DEBUG_DUMP
542 if (debug_file_->Open()) { 545 if (debug_file_->Open()) {
(...skipping 21 matching lines...) Expand all
564 msg->add_output_channel(dest[i], channel_size); 567 msg->add_output_channel(dest[i], channel_size);
565 RETURN_ON_ERR(WriteMessageToDebugFile()); 568 RETURN_ON_ERR(WriteMessageToDebugFile());
566 } 569 }
567 #endif 570 #endif
568 571
569 return kNoError; 572 return kNoError;
570 } 573 }
571 574
572 int AudioProcessingImpl::ProcessStream(AudioFrame* frame) { 575 int AudioProcessingImpl::ProcessStream(AudioFrame* frame) {
573 CriticalSectionScoped crit_scoped(crit_); 576 CriticalSectionScoped crit_scoped(crit_);
577 echo_cancellation_->ReadQueuedRenderData();
578 echo_control_mobile_->ReadQueuedRenderData();
579
574 if (!frame) { 580 if (!frame) {
575 return kNullPointerError; 581 return kNullPointerError;
576 } 582 }
577 // Must be a native rate. 583 // Must be a native rate.
578 if (frame->sample_rate_hz_ != kSampleRate8kHz && 584 if (frame->sample_rate_hz_ != kSampleRate8kHz &&
579 frame->sample_rate_hz_ != kSampleRate16kHz && 585 frame->sample_rate_hz_ != kSampleRate16kHz &&
580 frame->sample_rate_hz_ != kSampleRate32kHz && 586 frame->sample_rate_hz_ != kSampleRate32kHz &&
581 frame->sample_rate_hz_ != kSampleRate48kHz) { 587 frame->sample_rate_hz_ != kSampleRate48kHz) {
582 return kBadSampleRateError; 588 return kBadSampleRateError;
583 } 589 }
(...skipping 682 matching lines...) Expand 10 before | Expand all | Expand 10 after
1266 1272
1267 event_msg_->set_type(audioproc::Event::CONFIG); 1273 event_msg_->set_type(audioproc::Event::CONFIG);
1268 event_msg_->mutable_config()->CopyFrom(config); 1274 event_msg_->mutable_config()->CopyFrom(config);
1269 1275
1270 RETURN_ON_ERR(WriteMessageToDebugFile()); 1276 RETURN_ON_ERR(WriteMessageToDebugFile());
1271 return kNoError; 1277 return kNoError;
1272 } 1278 }
1273 #endif // WEBRTC_AUDIOPROC_DEBUG_DUMP 1279 #endif // WEBRTC_AUDIOPROC_DEBUG_DUMP
1274 1280
1275 } // namespace webrtc 1281 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | webrtc/modules/audio_processing/echo_cancellation_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698