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

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

Issue 1227213002: Update audio code to use size_t more correctly, webrtc/modules/audio_processing/ (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Resync Created 5 years, 4 months 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 465 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 agc_manager_->SetCaptureMuted(output_will_be_muted_); 476 agc_manager_->SetCaptureMuted(output_will_be_muted_);
477 } 477 }
478 } 478 }
479 479
480 bool AudioProcessingImpl::output_will_be_muted() const { 480 bool AudioProcessingImpl::output_will_be_muted() const {
481 CriticalSectionScoped lock(crit_); 481 CriticalSectionScoped lock(crit_);
482 return output_will_be_muted_; 482 return output_will_be_muted_;
483 } 483 }
484 484
485 int AudioProcessingImpl::ProcessStream(const float* const* src, 485 int AudioProcessingImpl::ProcessStream(const float* const* src,
486 int samples_per_channel, 486 size_t samples_per_channel,
487 int input_sample_rate_hz, 487 int input_sample_rate_hz,
488 ChannelLayout input_layout, 488 ChannelLayout input_layout,
489 int output_sample_rate_hz, 489 int output_sample_rate_hz,
490 ChannelLayout output_layout, 490 ChannelLayout output_layout,
491 float* const* dest) { 491 float* const* dest) {
492 StreamConfig input_stream = api_format_.input_stream(); 492 StreamConfig input_stream = api_format_.input_stream();
493 input_stream.set_sample_rate_hz(input_sample_rate_hz); 493 input_stream.set_sample_rate_hz(input_sample_rate_hz);
494 input_stream.set_num_channels(ChannelsFromLayout(input_layout)); 494 input_stream.set_num_channels(ChannelsFromLayout(input_layout));
495 input_stream.set_has_keyboard(LayoutHasKeyboard(input_layout)); 495 input_stream.set_has_keyboard(LayoutHasKeyboard(input_layout));
496 496
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
675 } 675 }
676 676
677 // The level estimator operates on the recombined data. 677 // The level estimator operates on the recombined data.
678 RETURN_ON_ERR(level_estimator_->ProcessStream(ca)); 678 RETURN_ON_ERR(level_estimator_->ProcessStream(ca));
679 679
680 was_stream_delay_set_ = false; 680 was_stream_delay_set_ = false;
681 return kNoError; 681 return kNoError;
682 } 682 }
683 683
684 int AudioProcessingImpl::AnalyzeReverseStream(const float* const* data, 684 int AudioProcessingImpl::AnalyzeReverseStream(const float* const* data,
685 int samples_per_channel, 685 size_t samples_per_channel,
686 int sample_rate_hz, 686 int sample_rate_hz,
687 ChannelLayout layout) { 687 ChannelLayout layout) {
688 const StreamConfig reverse_config = { 688 const StreamConfig reverse_config = {
689 sample_rate_hz, ChannelsFromLayout(layout), LayoutHasKeyboard(layout), 689 sample_rate_hz, ChannelsFromLayout(layout), LayoutHasKeyboard(layout),
690 }; 690 };
691 if (samples_per_channel != reverse_config.num_frames()) { 691 if (samples_per_channel != reverse_config.num_frames()) {
692 return kBadDataLengthError; 692 return kBadDataLengthError;
693 } 693 }
694 return AnalyzeReverseStream(data, reverse_config); 694 return AnalyzeReverseStream(data, reverse_config);
695 } 695 }
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after
1140 int err = WriteMessageToDebugFile(); 1140 int err = WriteMessageToDebugFile();
1141 if (err != kNoError) { 1141 if (err != kNoError) {
1142 return err; 1142 return err;
1143 } 1143 }
1144 1144
1145 return kNoError; 1145 return kNoError;
1146 } 1146 }
1147 #endif // WEBRTC_AUDIOPROC_DEBUG_DUMP 1147 #endif // WEBRTC_AUDIOPROC_DEBUG_DUMP
1148 1148
1149 } // namespace webrtc 1149 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698