Stereo in APM fuzzer.

Add support for stereo in APM fuzzer.

Bug: webrtc:9413
Change-Id: Ie4b19037bd4613c050b03ad0bacf0f44f9feccd3
Reviewed-on: https://webrtc-review.googlesource.com/87221
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Alex Loiko <aleloi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23854}
This commit is contained in:
Alex Loiko 2018-07-05 11:14:28 +02:00 committed by Commit Bot
parent b4918dad6a
commit c480e9d7a8
2 changed files with 5 additions and 2 deletions

View File

@ -90,7 +90,9 @@ std::unique_ptr<AudioProcessing> CreateApm(test::FuzzDataHelper* fuzz_data,
fuzz_data->ReadByteArray(kSizeOfConfigSegment - fuzz_data->BytesRead()));
// Filter out incompatible settings that lead to CHECK failures.
if (use_aecm && use_aec) {
if ((use_aecm && use_aec) || // These settings cause CHECK failure.
(use_aecm && aec3 && use_ns) // These settings trigger webrtc:9489.
) {
return nullptr;
}

View File

@ -80,7 +80,7 @@ void FuzzAudioProcessing(test::FuzzDataHelper* fuzz_data,
const auto output_rate =
static_cast<size_t>(fuzz_data->SelectOneOf(rate_kinds));
const bool num_channels = fuzz_data->ReadOrDefaultValue(true) ? 2 : 1;
const int num_channels = fuzz_data->ReadOrDefaultValue(true) ? 2 : 1;
const uint8_t stream_delay = fuzz_data->ReadOrDefaultValue<uint8_t>(0);
// API call needed for AEC-2 and AEC-m to run.
@ -121,6 +121,7 @@ void FuzzAudioProcessing(test::FuzzDataHelper* fuzz_data,
// codeways.
static_cast<void>(apm->GetStatistics());
static_cast<void>(apm->GetStatistics(true));
static_cast<void>(apm->UpdateHistogramsOnCallEnd());
RTC_DCHECK_NE(apm_return_code, AudioProcessing::kBadDataLengthError);
}