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

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 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 513 matching lines...) Expand 10 before | Expand all | Expand 10 after
524 const StreamConfig& input_config, 524 const StreamConfig& input_config,
525 const StreamConfig& output_config, 525 const StreamConfig& output_config,
526 float* const* dest) { 526 float* const* dest) {
527 CriticalSectionScoped crit_scoped(crit_); 527 CriticalSectionScoped crit_scoped(crit_);
528 if (!src || !dest) { 528 if (!src || !dest) {
529 return kNullPointerError; 529 return kNullPointerError;
530 } 530 }
531 531
532 echo_cancellation_->ReadQueuedRenderData(); 532 echo_cancellation_->ReadQueuedRenderData();
533 echo_control_mobile_->ReadQueuedRenderData(); 533 echo_control_mobile_->ReadQueuedRenderData();
534 gain_control_->ReadQueuedRenderData();
534 535
535 ProcessingConfig processing_config = api_format_; 536 ProcessingConfig processing_config = api_format_;
536 processing_config.input_stream() = input_config; 537 processing_config.input_stream() = input_config;
537 processing_config.output_stream() = output_config; 538 processing_config.output_stream() = output_config;
538 539
539 RETURN_ON_ERR(MaybeInitializeLocked(processing_config)); 540 RETURN_ON_ERR(MaybeInitializeLocked(processing_config));
540 assert(processing_config.input_stream().num_frames() == 541 assert(processing_config.input_stream().num_frames() ==
541 api_format_.input_stream().num_frames()); 542 api_format_.input_stream().num_frames());
542 543
543 #ifdef WEBRTC_AUDIOPROC_DEBUG_DUMP 544 #ifdef WEBRTC_AUDIOPROC_DEBUG_DUMP
(...skipping 24 matching lines...) Expand all
568 } 569 }
569 #endif 570 #endif
570 571
571 return kNoError; 572 return kNoError;
572 } 573 }
573 574
574 int AudioProcessingImpl::ProcessStream(AudioFrame* frame) { 575 int AudioProcessingImpl::ProcessStream(AudioFrame* frame) {
575 CriticalSectionScoped crit_scoped(crit_); 576 CriticalSectionScoped crit_scoped(crit_);
576 echo_cancellation_->ReadQueuedRenderData(); 577 echo_cancellation_->ReadQueuedRenderData();
577 echo_control_mobile_->ReadQueuedRenderData(); 578 echo_control_mobile_->ReadQueuedRenderData();
579 gain_control_->ReadQueuedRenderData();
578 580
579 if (!frame) { 581 if (!frame) {
580 return kNullPointerError; 582 return kNullPointerError;
581 } 583 }
582 // Must be a native rate. 584 // Must be a native rate.
583 if (frame->sample_rate_hz_ != kSampleRate8kHz && 585 if (frame->sample_rate_hz_ != kSampleRate8kHz &&
584 frame->sample_rate_hz_ != kSampleRate16kHz && 586 frame->sample_rate_hz_ != kSampleRate16kHz &&
585 frame->sample_rate_hz_ != kSampleRate32kHz && 587 frame->sample_rate_hz_ != kSampleRate32kHz &&
586 frame->sample_rate_hz_ != kSampleRate48kHz) { 588 frame->sample_rate_hz_ != kSampleRate48kHz) {
587 return kBadSampleRateError; 589 return kBadSampleRateError;
(...skipping 682 matching lines...) Expand 10 before | Expand all | Expand 10 after
1270 1272
1271 event_msg_->set_type(audioproc::Event::CONFIG); 1273 event_msg_->set_type(audioproc::Event::CONFIG);
1272 event_msg_->mutable_config()->CopyFrom(config); 1274 event_msg_->mutable_config()->CopyFrom(config);
1273 1275
1274 RETURN_ON_ERR(WriteMessageToDebugFile()); 1276 RETURN_ON_ERR(WriteMessageToDebugFile());
1275 return kNoError; 1277 return kNoError;
1276 } 1278 }
1277 #endif // WEBRTC_AUDIOPROC_DEBUG_DUMP 1279 #endif // WEBRTC_AUDIOPROC_DEBUG_DUMP
1278 1280
1279 } // namespace webrtc 1281 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698