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

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

Issue 1766233003: Drop the restriction on same forward and reverse sample rate on the AudioFrame interface of the APM (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 9 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
« no previous file with comments | « no previous file | webrtc/modules/audio_processing/audio_processing_impl_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 853 matching lines...) Expand 10 before | Expand all | Expand 10 after
864 if (frame == nullptr) { 864 if (frame == nullptr) {
865 return kNullPointerError; 865 return kNullPointerError;
866 } 866 }
867 // Must be a native rate. 867 // Must be a native rate.
868 if (frame->sample_rate_hz_ != kSampleRate8kHz && 868 if (frame->sample_rate_hz_ != kSampleRate8kHz &&
869 frame->sample_rate_hz_ != kSampleRate16kHz && 869 frame->sample_rate_hz_ != kSampleRate16kHz &&
870 frame->sample_rate_hz_ != kSampleRate32kHz && 870 frame->sample_rate_hz_ != kSampleRate32kHz &&
871 frame->sample_rate_hz_ != kSampleRate48kHz) { 871 frame->sample_rate_hz_ != kSampleRate48kHz) {
872 return kBadSampleRateError; 872 return kBadSampleRateError;
873 } 873 }
874 // This interface does not tolerate different forward and reverse rates.
875 if (frame->sample_rate_hz_ !=
876 formats_.api_format.input_stream().sample_rate_hz()) {
877 return kBadSampleRateError;
878 }
879 874
880 if (frame->num_channels_ <= 0) { 875 if (frame->num_channels_ <= 0) {
881 return kBadNumberChannelsError; 876 return kBadNumberChannelsError;
882 } 877 }
883 878
884 ProcessingConfig processing_config = formats_.api_format; 879 ProcessingConfig processing_config = formats_.api_format;
885 processing_config.reverse_input_stream().set_sample_rate_hz( 880 processing_config.reverse_input_stream().set_sample_rate_hz(
886 frame->sample_rate_hz_); 881 frame->sample_rate_hz_);
887 processing_config.reverse_input_stream().set_num_channels( 882 processing_config.reverse_input_stream().set_num_channels(
888 frame->num_channels_); 883 frame->num_channels_);
(...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after
1456 debug_dump_.capture.event_msg->mutable_config()->CopyFrom(config); 1451 debug_dump_.capture.event_msg->mutable_config()->CopyFrom(config);
1457 1452
1458 RETURN_ON_ERR(WriteMessageToDebugFile(debug_dump_.debug_file.get(), 1453 RETURN_ON_ERR(WriteMessageToDebugFile(debug_dump_.debug_file.get(),
1459 &debug_dump_.num_bytes_left_for_log_, 1454 &debug_dump_.num_bytes_left_for_log_,
1460 &crit_debug_, &debug_dump_.capture)); 1455 &crit_debug_, &debug_dump_.capture));
1461 return kNoError; 1456 return kNoError;
1462 } 1457 }
1463 #endif // WEBRTC_AUDIOPROC_DEBUG_DUMP 1458 #endif // WEBRTC_AUDIOPROC_DEBUG_DUMP
1464 1459
1465 } // namespace webrtc 1460 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | webrtc/modules/audio_processing/audio_processing_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698