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

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

Issue 1416583003: Lock scheme #5: Applied the render queueing to the agc (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@introduce_queue_CL
Patch Set: Merge from 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
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 514 matching lines...) Expand 10 before | Expand all | Expand 10 after
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(); 533 echo_cancellation_->ReadQueuedRenderData();
534 echo_control_mobile_->ReadQueuedRenderData(); 534 echo_control_mobile_->ReadQueuedRenderData();
535 gain_control_->ReadQueuedRenderData();
535 536
536 ProcessingConfig processing_config = api_format_; 537 ProcessingConfig processing_config = api_format_;
537 processing_config.input_stream() = input_config; 538 processing_config.input_stream() = input_config;
538 processing_config.output_stream() = output_config; 539 processing_config.output_stream() = output_config;
539 540
540 RETURN_ON_ERR(MaybeInitializeLocked(processing_config)); 541 RETURN_ON_ERR(MaybeInitializeLocked(processing_config));
541 assert(processing_config.input_stream().num_frames() == 542 assert(processing_config.input_stream().num_frames() ==
542 api_format_.input_stream().num_frames()); 543 api_format_.input_stream().num_frames());
543 544
544 #ifdef WEBRTC_AUDIOPROC_DEBUG_DUMP 545 #ifdef WEBRTC_AUDIOPROC_DEBUG_DUMP
(...skipping 24 matching lines...) Expand all
569 } 570 }
570 #endif 571 #endif
571 572
572 return kNoError; 573 return kNoError;
573 } 574 }
574 575
575 int AudioProcessingImpl::ProcessStream(AudioFrame* frame) { 576 int AudioProcessingImpl::ProcessStream(AudioFrame* frame) {
576 CriticalSectionScoped crit_scoped(crit_); 577 CriticalSectionScoped crit_scoped(crit_);
577 echo_cancellation_->ReadQueuedRenderData(); 578 echo_cancellation_->ReadQueuedRenderData();
578 echo_control_mobile_->ReadQueuedRenderData(); 579 echo_control_mobile_->ReadQueuedRenderData();
580 gain_control_->ReadQueuedRenderData();
579 581
580 if (!frame) { 582 if (!frame) {
581 return kNullPointerError; 583 return kNullPointerError;
582 } 584 }
583 // Must be a native rate. 585 // Must be a native rate.
584 if (frame->sample_rate_hz_ != kSampleRate8kHz && 586 if (frame->sample_rate_hz_ != kSampleRate8kHz &&
585 frame->sample_rate_hz_ != kSampleRate16kHz && 587 frame->sample_rate_hz_ != kSampleRate16kHz &&
586 frame->sample_rate_hz_ != kSampleRate32kHz && 588 frame->sample_rate_hz_ != kSampleRate32kHz &&
587 frame->sample_rate_hz_ != kSampleRate48kHz) { 589 frame->sample_rate_hz_ != kSampleRate48kHz) {
588 return kBadSampleRateError; 590 return kBadSampleRateError;
(...skipping 683 matching lines...) Expand 10 before | Expand all | Expand 10 after
1272 1274
1273 event_msg_->set_type(audioproc::Event::CONFIG); 1275 event_msg_->set_type(audioproc::Event::CONFIG);
1274 event_msg_->mutable_config()->CopyFrom(config); 1276 event_msg_->mutable_config()->CopyFrom(config);
1275 1277
1276 RETURN_ON_ERR(WriteMessageToDebugFile()); 1278 RETURN_ON_ERR(WriteMessageToDebugFile());
1277 return kNoError; 1279 return kNoError;
1278 } 1280 }
1279 #endif // WEBRTC_AUDIOPROC_DEBUG_DUMP 1281 #endif // WEBRTC_AUDIOPROC_DEBUG_DUMP
1280 1282
1281 } // namespace webrtc 1283 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698