webrtc/api/test/audioproc_float.cc
Per Åhgren e9cd6177eb Add ability for audioproc_f to operate on any AudioProcessing object.
This CL extends the WebRTC testing API to allow audioproc_f -based
testing using a pre-created AudioProcessing object. This is an
important feature to allow testing any AudioProcessing objects
that are injected into WebRTC.

Beyond adding this, the CL also changes the simulation code to
operate on a scoped_refptr<AudioProcessing> object instead of a
std::unique<AudioProcessing> object

Bug: webrtc:5298
Change-Id: I70179f19518fc583ad0101bd59c038478a3cc23d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/175568
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31319}
2020-05-19 11:37:18 +00:00

44 lines
1.5 KiB
C++

/*
* Copyright (c) 2018 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#include "api/test/audioproc_float.h"
#include <utility>
#include "modules/audio_processing/test/audioproc_float_impl.h"
namespace webrtc {
namespace test {
int AudioprocFloat(rtc::scoped_refptr<AudioProcessing> audio_processing,
int argc,
char* argv[]) {
return AudioprocFloatImpl(std::move(audio_processing), argc, argv);
}
int AudioprocFloat(std::unique_ptr<AudioProcessingBuilder> ap_builder,
int argc,
char* argv[]) {
return AudioprocFloatImpl(std::move(ap_builder), argc, argv,
/*input_aecdump=*/"",
/*processed_capture_samples=*/nullptr);
}
int AudioprocFloat(std::unique_ptr<AudioProcessingBuilder> ap_builder,
int argc,
char* argv[],
absl::string_view input_aecdump,
std::vector<float>* processed_capture_samples) {
return AudioprocFloatImpl(std::move(ap_builder), argc, argv, input_aecdump,
processed_capture_samples);
}
} // namespace test
} // namespace webrtc