Add audioproc_f support for testing the runtime settings of whether the output is used
Bug: b/177830919 Change-Id: Iddcb79000f471eac165e3f44f14fad41435e6ccb Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/211241 Reviewed-by: Sam Zackrisson <saza@webrtc.org> Commit-Queue: Per Åhgren <peah@webrtc.org> Cr-Commit-Position: refs/heads/master@{#33426}
This commit is contained in:
@ -226,6 +226,20 @@ void AudioProcessingSimulator::ProcessStream(bool fixed_interface) {
|
|||||||
: analog_mic_level_);
|
: analog_mic_level_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Post any scheduled runtime settings.
|
||||||
|
if (settings_.frame_for_sending_capture_output_used_false &&
|
||||||
|
*settings_.frame_for_sending_capture_output_used_false ==
|
||||||
|
static_cast<int>(num_process_stream_calls_)) {
|
||||||
|
ap_->PostRuntimeSetting(
|
||||||
|
AudioProcessing::RuntimeSetting::CreateCaptureOutputUsedSetting(false));
|
||||||
|
}
|
||||||
|
if (settings_.frame_for_sending_capture_output_used_true &&
|
||||||
|
*settings_.frame_for_sending_capture_output_used_true ==
|
||||||
|
static_cast<int>(num_process_stream_calls_)) {
|
||||||
|
ap_->PostRuntimeSetting(
|
||||||
|
AudioProcessing::RuntimeSetting::CreateCaptureOutputUsedSetting(true));
|
||||||
|
}
|
||||||
|
|
||||||
// Process the current audio frame.
|
// Process the current audio frame.
|
||||||
if (fixed_interface) {
|
if (fixed_interface) {
|
||||||
{
|
{
|
||||||
|
@ -124,6 +124,8 @@ struct SimulationSettings {
|
|||||||
absl::optional<bool> multi_channel_render;
|
absl::optional<bool> multi_channel_render;
|
||||||
absl::optional<bool> multi_channel_capture;
|
absl::optional<bool> multi_channel_capture;
|
||||||
absl::optional<int> simulated_mic_kind;
|
absl::optional<int> simulated_mic_kind;
|
||||||
|
absl::optional<int> frame_for_sending_capture_output_used_false;
|
||||||
|
absl::optional<int> frame_for_sending_capture_output_used_true;
|
||||||
bool report_performance = false;
|
bool report_performance = false;
|
||||||
absl::optional<std::string> performance_report_output_filename;
|
absl::optional<std::string> performance_report_output_filename;
|
||||||
bool report_bitexactness = false;
|
bool report_bitexactness = false;
|
||||||
|
@ -201,6 +201,16 @@ ABSL_FLAG(int,
|
|||||||
simulated_mic_kind,
|
simulated_mic_kind,
|
||||||
kParameterNotSpecifiedValue,
|
kParameterNotSpecifiedValue,
|
||||||
"Specify which microphone kind to use for microphone simulation");
|
"Specify which microphone kind to use for microphone simulation");
|
||||||
|
ABSL_FLAG(int,
|
||||||
|
frame_for_sending_capture_output_used_false,
|
||||||
|
kParameterNotSpecifiedValue,
|
||||||
|
"Capture frame index for sending a runtime setting for that the "
|
||||||
|
"capture output is not used.");
|
||||||
|
ABSL_FLAG(int,
|
||||||
|
frame_for_sending_capture_output_used_true,
|
||||||
|
kParameterNotSpecifiedValue,
|
||||||
|
"Capture frame index for sending a runtime setting for that the "
|
||||||
|
"capture output is used.");
|
||||||
ABSL_FLAG(bool, performance_report, false, "Report the APM performance ");
|
ABSL_FLAG(bool, performance_report, false, "Report the APM performance ");
|
||||||
ABSL_FLAG(std::string,
|
ABSL_FLAG(std::string,
|
||||||
performance_report_output_file,
|
performance_report_output_file,
|
||||||
@ -451,6 +461,12 @@ SimulationSettings CreateSettings() {
|
|||||||
settings.simulate_mic_gain = absl::GetFlag(FLAGS_simulate_mic_gain);
|
settings.simulate_mic_gain = absl::GetFlag(FLAGS_simulate_mic_gain);
|
||||||
SetSettingIfSpecified(absl::GetFlag(FLAGS_simulated_mic_kind),
|
SetSettingIfSpecified(absl::GetFlag(FLAGS_simulated_mic_kind),
|
||||||
&settings.simulated_mic_kind);
|
&settings.simulated_mic_kind);
|
||||||
|
SetSettingIfSpecified(
|
||||||
|
absl::GetFlag(FLAGS_frame_for_sending_capture_output_used_false),
|
||||||
|
&settings.frame_for_sending_capture_output_used_false);
|
||||||
|
SetSettingIfSpecified(
|
||||||
|
absl::GetFlag(FLAGS_frame_for_sending_capture_output_used_true),
|
||||||
|
&settings.frame_for_sending_capture_output_used_true);
|
||||||
settings.report_performance = absl::GetFlag(FLAGS_performance_report);
|
settings.report_performance = absl::GetFlag(FLAGS_performance_report);
|
||||||
SetSettingIfSpecified(absl::GetFlag(FLAGS_performance_report_output_file),
|
SetSettingIfSpecified(absl::GetFlag(FLAGS_performance_report_output_file),
|
||||||
&settings.performance_report_output_filename);
|
&settings.performance_report_output_filename);
|
||||||
|
Reference in New Issue
Block a user