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 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
503 agc_manager_->SetCaptureMuted(output_will_be_muted_); | 503 agc_manager_->SetCaptureMuted(output_will_be_muted_); |
504 } | 504 } |
505 } | 505 } |
506 | 506 |
507 bool AudioProcessingImpl::output_will_be_muted() const { | 507 bool AudioProcessingImpl::output_will_be_muted() const { |
508 CriticalSectionScoped lock(crit_); | 508 CriticalSectionScoped lock(crit_); |
509 return output_will_be_muted_; | 509 return output_will_be_muted_; |
510 } | 510 } |
511 | 511 |
512 int AudioProcessingImpl::ProcessStream(const float* const* src, | 512 int AudioProcessingImpl::ProcessStream(const float* const* src, |
513 int samples_per_channel, | 513 size_t samples_per_channel, |
514 int input_sample_rate_hz, | 514 int input_sample_rate_hz, |
515 ChannelLayout input_layout, | 515 ChannelLayout input_layout, |
516 int output_sample_rate_hz, | 516 int output_sample_rate_hz, |
517 ChannelLayout output_layout, | 517 ChannelLayout output_layout, |
518 float* const* dest) { | 518 float* const* dest) { |
519 CriticalSectionScoped crit_scoped(crit_); | 519 CriticalSectionScoped crit_scoped(crit_); |
520 StreamConfig input_stream = api_format_.input_stream(); | 520 StreamConfig input_stream = api_format_.input_stream(); |
521 input_stream.set_sample_rate_hz(input_sample_rate_hz); | 521 input_stream.set_sample_rate_hz(input_sample_rate_hz); |
522 input_stream.set_num_channels(ChannelsFromLayout(input_layout)); | 522 input_stream.set_num_channels(ChannelsFromLayout(input_layout)); |
523 input_stream.set_has_keyboard(LayoutHasKeyboard(input_layout)); | 523 input_stream.set_has_keyboard(LayoutHasKeyboard(input_layout)); |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
709 } | 709 } |
710 | 710 |
711 // The level estimator operates on the recombined data. | 711 // The level estimator operates on the recombined data. |
712 RETURN_ON_ERR(level_estimator_->ProcessStream(ca)); | 712 RETURN_ON_ERR(level_estimator_->ProcessStream(ca)); |
713 | 713 |
714 was_stream_delay_set_ = false; | 714 was_stream_delay_set_ = false; |
715 return kNoError; | 715 return kNoError; |
716 } | 716 } |
717 | 717 |
718 int AudioProcessingImpl::AnalyzeReverseStream(const float* const* data, | 718 int AudioProcessingImpl::AnalyzeReverseStream(const float* const* data, |
719 int samples_per_channel, | 719 size_t samples_per_channel, |
720 int rev_sample_rate_hz, | 720 int rev_sample_rate_hz, |
721 ChannelLayout layout) { | 721 ChannelLayout layout) { |
722 const StreamConfig reverse_config = { | 722 const StreamConfig reverse_config = { |
723 rev_sample_rate_hz, ChannelsFromLayout(layout), LayoutHasKeyboard(layout), | 723 rev_sample_rate_hz, ChannelsFromLayout(layout), LayoutHasKeyboard(layout), |
724 }; | 724 }; |
725 if (samples_per_channel != reverse_config.num_frames()) { | 725 if (samples_per_channel != reverse_config.num_frames()) { |
726 return kBadDataLengthError; | 726 return kBadDataLengthError; |
727 } | 727 } |
728 return AnalyzeReverseStream(data, reverse_config, reverse_config); | 728 return AnalyzeReverseStream(data, reverse_config, reverse_config); |
729 } | 729 } |
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1242 int err = WriteMessageToDebugFile(); | 1242 int err = WriteMessageToDebugFile(); |
1243 if (err != kNoError) { | 1243 if (err != kNoError) { |
1244 return err; | 1244 return err; |
1245 } | 1245 } |
1246 | 1246 |
1247 return kNoError; | 1247 return kNoError; |
1248 } | 1248 } |
1249 #endif // WEBRTC_AUDIOPROC_DEBUG_DUMP | 1249 #endif // WEBRTC_AUDIOPROC_DEBUG_DUMP |
1250 | 1250 |
1251 } // namespace webrtc | 1251 } // namespace webrtc |
OLD | NEW |