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 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
477 agc_manager_->SetCaptureMuted(output_will_be_muted_); | 477 agc_manager_->SetCaptureMuted(output_will_be_muted_); |
478 } | 478 } |
479 } | 479 } |
480 | 480 |
481 bool AudioProcessingImpl::output_will_be_muted() const { | 481 bool AudioProcessingImpl::output_will_be_muted() const { |
482 CriticalSectionScoped lock(crit_); | 482 CriticalSectionScoped lock(crit_); |
483 return output_will_be_muted_; | 483 return output_will_be_muted_; |
484 } | 484 } |
485 | 485 |
486 int AudioProcessingImpl::ProcessStream(const float* const* src, | 486 int AudioProcessingImpl::ProcessStream(const float* const* src, |
487 int samples_per_channel, | 487 size_t samples_per_channel, |
488 int input_sample_rate_hz, | 488 int input_sample_rate_hz, |
489 ChannelLayout input_layout, | 489 ChannelLayout input_layout, |
490 int output_sample_rate_hz, | 490 int output_sample_rate_hz, |
491 ChannelLayout output_layout, | 491 ChannelLayout output_layout, |
492 float* const* dest) { | 492 float* const* dest) { |
493 StreamConfig input_stream = api_format_.input_stream(); | 493 StreamConfig input_stream = api_format_.input_stream(); |
494 input_stream.set_sample_rate_hz(input_sample_rate_hz); | 494 input_stream.set_sample_rate_hz(input_sample_rate_hz); |
495 input_stream.set_num_channels(ChannelsFromLayout(input_layout)); | 495 input_stream.set_num_channels(ChannelsFromLayout(input_layout)); |
496 input_stream.set_has_keyboard(LayoutHasKeyboard(input_layout)); | 496 input_stream.set_has_keyboard(LayoutHasKeyboard(input_layout)); |
497 | 497 |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
676 } | 676 } |
677 | 677 |
678 // The level estimator operates on the recombined data. | 678 // The level estimator operates on the recombined data. |
679 RETURN_ON_ERR(level_estimator_->ProcessStream(ca)); | 679 RETURN_ON_ERR(level_estimator_->ProcessStream(ca)); |
680 | 680 |
681 was_stream_delay_set_ = false; | 681 was_stream_delay_set_ = false; |
682 return kNoError; | 682 return kNoError; |
683 } | 683 } |
684 | 684 |
685 int AudioProcessingImpl::AnalyzeReverseStream(const float* const* data, | 685 int AudioProcessingImpl::AnalyzeReverseStream(const float* const* data, |
686 int samples_per_channel, | 686 size_t samples_per_channel, |
687 int sample_rate_hz, | 687 int sample_rate_hz, |
688 ChannelLayout layout) { | 688 ChannelLayout layout) { |
689 const StreamConfig reverse_config = { | 689 const StreamConfig reverse_config = { |
690 sample_rate_hz, ChannelsFromLayout(layout), LayoutHasKeyboard(layout), | 690 sample_rate_hz, ChannelsFromLayout(layout), LayoutHasKeyboard(layout), |
691 }; | 691 }; |
692 if (samples_per_channel != reverse_config.num_frames()) { | 692 if (samples_per_channel != reverse_config.num_frames()) { |
693 return kBadDataLengthError; | 693 return kBadDataLengthError; |
694 } | 694 } |
695 return AnalyzeReverseStream(data, reverse_config); | 695 return AnalyzeReverseStream(data, reverse_config); |
696 } | 696 } |
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1141 int err = WriteMessageToDebugFile(); | 1141 int err = WriteMessageToDebugFile(); |
1142 if (err != kNoError) { | 1142 if (err != kNoError) { |
1143 return err; | 1143 return err; |
1144 } | 1144 } |
1145 | 1145 |
1146 return kNoError; | 1146 return kNoError; |
1147 } | 1147 } |
1148 #endif // WEBRTC_AUDIOPROC_DEBUG_DUMP | 1148 #endif // WEBRTC_AUDIOPROC_DEBUG_DUMP |
1149 | 1149 |
1150 } // namespace webrtc | 1150 } // namespace webrtc |
OLD | NEW |