OLD | NEW |
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 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
522 | 522 |
523 int AudioProcessingImpl::ProcessStream(const float* const* src, | 523 int AudioProcessingImpl::ProcessStream(const float* const* src, |
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(); |
| 533 echo_control_mobile_->ReadQueuedRenderData(); |
| 534 |
532 ProcessingConfig processing_config = api_format_; | 535 ProcessingConfig processing_config = api_format_; |
533 processing_config.input_stream() = input_config; | 536 processing_config.input_stream() = input_config; |
534 processing_config.output_stream() = output_config; | 537 processing_config.output_stream() = output_config; |
535 | 538 |
536 RETURN_ON_ERR(MaybeInitializeLocked(processing_config)); | 539 RETURN_ON_ERR(MaybeInitializeLocked(processing_config)); |
537 assert(processing_config.input_stream().num_frames() == | 540 assert(processing_config.input_stream().num_frames() == |
538 api_format_.input_stream().num_frames()); | 541 api_format_.input_stream().num_frames()); |
539 | 542 |
540 #ifdef WEBRTC_AUDIOPROC_DEBUG_DUMP | 543 #ifdef WEBRTC_AUDIOPROC_DEBUG_DUMP |
541 if (debug_file_->Open()) { | 544 if (debug_file_->Open()) { |
(...skipping 21 matching lines...) Expand all Loading... |
563 msg->add_output_channel(dest[i], channel_size); | 566 msg->add_output_channel(dest[i], channel_size); |
564 RETURN_ON_ERR(WriteMessageToDebugFile()); | 567 RETURN_ON_ERR(WriteMessageToDebugFile()); |
565 } | 568 } |
566 #endif | 569 #endif |
567 | 570 |
568 return kNoError; | 571 return kNoError; |
569 } | 572 } |
570 | 573 |
571 int AudioProcessingImpl::ProcessStream(AudioFrame* frame) { | 574 int AudioProcessingImpl::ProcessStream(AudioFrame* frame) { |
572 CriticalSectionScoped crit_scoped(crit_); | 575 CriticalSectionScoped crit_scoped(crit_); |
| 576 echo_cancellation_->ReadQueuedRenderData(); |
| 577 echo_control_mobile_->ReadQueuedRenderData(); |
| 578 |
573 if (!frame) { | 579 if (!frame) { |
574 return kNullPointerError; | 580 return kNullPointerError; |
575 } | 581 } |
576 // Must be a native rate. | 582 // Must be a native rate. |
577 if (frame->sample_rate_hz_ != kSampleRate8kHz && | 583 if (frame->sample_rate_hz_ != kSampleRate8kHz && |
578 frame->sample_rate_hz_ != kSampleRate16kHz && | 584 frame->sample_rate_hz_ != kSampleRate16kHz && |
579 frame->sample_rate_hz_ != kSampleRate32kHz && | 585 frame->sample_rate_hz_ != kSampleRate32kHz && |
580 frame->sample_rate_hz_ != kSampleRate48kHz) { | 586 frame->sample_rate_hz_ != kSampleRate48kHz) { |
581 return kBadSampleRateError; | 587 return kBadSampleRateError; |
582 } | 588 } |
(...skipping 681 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1264 | 1270 |
1265 event_msg_->set_type(audioproc::Event::CONFIG); | 1271 event_msg_->set_type(audioproc::Event::CONFIG); |
1266 event_msg_->mutable_config()->CopyFrom(config); | 1272 event_msg_->mutable_config()->CopyFrom(config); |
1267 | 1273 |
1268 RETURN_ON_ERR(WriteMessageToDebugFile()); | 1274 RETURN_ON_ERR(WriteMessageToDebugFile()); |
1269 return kNoError; | 1275 return kNoError; |
1270 } | 1276 } |
1271 #endif // WEBRTC_AUDIOPROC_DEBUG_DUMP | 1277 #endif // WEBRTC_AUDIOPROC_DEBUG_DUMP |
1272 | 1278 |
1273 } // namespace webrtc | 1279 } // namespace webrtc |
OLD | NEW |