Replace rtc::Optional with absl::optional in modules/audio processing
This is a no-op change because rtc::Optional is an alias to absl::optional
This CL generated by running script with parameter 'modules/audio_processing'
find $@ -type f \( -name \*.h -o -name \*.cc \) \
-exec sed -i 's|rtc::Optional|absl::optional|g' {} \+ \
-exec sed -i 's|rtc::nullopt|absl::nullopt|g' {} \+ \
-exec sed -i 's|#include "api/optional.h"|#include "absl/types/optional.h"|' {} \+
find $@ -type f -name BUILD.gn \
-exec sed -r -i 's|"(../)*api:optional"|"//third_party/abseil-cpp/absl/types:optional"|' {} \+;
git cl format
Bug: webrtc:9078
Change-Id: Id29f8de59dba704787c2c38a3d05c60827c181b0
Reviewed-on: https://webrtc-review.googlesource.com/83982
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23653}
This commit is contained in:
committed by
Commit Bot
parent
c66613daf7
commit
db9f7ab9f9
@ -17,7 +17,7 @@
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include "api/optional.h"
|
||||
#include "absl/types/optional.h"
|
||||
#include "common_audio/channel_buffer.h"
|
||||
#include "modules/audio_processing/include/audio_processing.h"
|
||||
#include "modules/audio_processing/test/fake_recording_device.h"
|
||||
@ -34,63 +34,63 @@ struct SimulationSettings {
|
||||
SimulationSettings();
|
||||
SimulationSettings(const SimulationSettings&);
|
||||
~SimulationSettings();
|
||||
rtc::Optional<int> stream_delay;
|
||||
rtc::Optional<bool> use_stream_delay;
|
||||
rtc::Optional<int> stream_drift_samples;
|
||||
rtc::Optional<int> output_sample_rate_hz;
|
||||
rtc::Optional<int> output_num_channels;
|
||||
rtc::Optional<int> reverse_output_sample_rate_hz;
|
||||
rtc::Optional<int> reverse_output_num_channels;
|
||||
rtc::Optional<std::string> output_filename;
|
||||
rtc::Optional<std::string> reverse_output_filename;
|
||||
rtc::Optional<std::string> input_filename;
|
||||
rtc::Optional<std::string> reverse_input_filename;
|
||||
rtc::Optional<std::string> artificial_nearend_filename;
|
||||
rtc::Optional<bool> use_aec;
|
||||
rtc::Optional<bool> use_aecm;
|
||||
rtc::Optional<bool> use_ed; // Residual Echo Detector.
|
||||
rtc::Optional<std::string> ed_graph_output_filename;
|
||||
rtc::Optional<bool> use_agc;
|
||||
rtc::Optional<bool> use_agc2;
|
||||
rtc::Optional<bool> use_pre_amplifier;
|
||||
rtc::Optional<bool> use_hpf;
|
||||
rtc::Optional<bool> use_ns;
|
||||
rtc::Optional<bool> use_ts;
|
||||
rtc::Optional<bool> use_bf;
|
||||
rtc::Optional<bool> use_ie;
|
||||
rtc::Optional<bool> use_vad;
|
||||
rtc::Optional<bool> use_le;
|
||||
rtc::Optional<bool> use_all;
|
||||
rtc::Optional<int> aec_suppression_level;
|
||||
rtc::Optional<bool> use_delay_agnostic;
|
||||
rtc::Optional<bool> use_extended_filter;
|
||||
rtc::Optional<bool> use_drift_compensation;
|
||||
rtc::Optional<bool> use_aec3;
|
||||
rtc::Optional<bool> use_experimental_agc;
|
||||
rtc::Optional<int> aecm_routing_mode;
|
||||
rtc::Optional<bool> use_aecm_comfort_noise;
|
||||
rtc::Optional<int> agc_mode;
|
||||
rtc::Optional<int> agc_target_level;
|
||||
rtc::Optional<bool> use_agc_limiter;
|
||||
rtc::Optional<int> agc_compression_gain;
|
||||
absl::optional<int> stream_delay;
|
||||
absl::optional<bool> use_stream_delay;
|
||||
absl::optional<int> stream_drift_samples;
|
||||
absl::optional<int> output_sample_rate_hz;
|
||||
absl::optional<int> output_num_channels;
|
||||
absl::optional<int> reverse_output_sample_rate_hz;
|
||||
absl::optional<int> reverse_output_num_channels;
|
||||
absl::optional<std::string> output_filename;
|
||||
absl::optional<std::string> reverse_output_filename;
|
||||
absl::optional<std::string> input_filename;
|
||||
absl::optional<std::string> reverse_input_filename;
|
||||
absl::optional<std::string> artificial_nearend_filename;
|
||||
absl::optional<bool> use_aec;
|
||||
absl::optional<bool> use_aecm;
|
||||
absl::optional<bool> use_ed; // Residual Echo Detector.
|
||||
absl::optional<std::string> ed_graph_output_filename;
|
||||
absl::optional<bool> use_agc;
|
||||
absl::optional<bool> use_agc2;
|
||||
absl::optional<bool> use_pre_amplifier;
|
||||
absl::optional<bool> use_hpf;
|
||||
absl::optional<bool> use_ns;
|
||||
absl::optional<bool> use_ts;
|
||||
absl::optional<bool> use_bf;
|
||||
absl::optional<bool> use_ie;
|
||||
absl::optional<bool> use_vad;
|
||||
absl::optional<bool> use_le;
|
||||
absl::optional<bool> use_all;
|
||||
absl::optional<int> aec_suppression_level;
|
||||
absl::optional<bool> use_delay_agnostic;
|
||||
absl::optional<bool> use_extended_filter;
|
||||
absl::optional<bool> use_drift_compensation;
|
||||
absl::optional<bool> use_aec3;
|
||||
absl::optional<bool> use_experimental_agc;
|
||||
absl::optional<int> aecm_routing_mode;
|
||||
absl::optional<bool> use_aecm_comfort_noise;
|
||||
absl::optional<int> agc_mode;
|
||||
absl::optional<int> agc_target_level;
|
||||
absl::optional<bool> use_agc_limiter;
|
||||
absl::optional<int> agc_compression_gain;
|
||||
float agc2_fixed_gain_db;
|
||||
float pre_amplifier_gain_factor;
|
||||
rtc::Optional<int> vad_likelihood;
|
||||
rtc::Optional<int> ns_level;
|
||||
rtc::Optional<bool> use_refined_adaptive_filter;
|
||||
absl::optional<int> vad_likelihood;
|
||||
absl::optional<int> ns_level;
|
||||
absl::optional<bool> use_refined_adaptive_filter;
|
||||
int initial_mic_level;
|
||||
bool simulate_mic_gain = false;
|
||||
rtc::Optional<int> simulated_mic_kind;
|
||||
absl::optional<int> simulated_mic_kind;
|
||||
bool report_performance = false;
|
||||
bool report_bitexactness = false;
|
||||
bool use_verbose_logging = false;
|
||||
bool discard_all_settings_in_aecdump = true;
|
||||
rtc::Optional<std::string> aec_dump_input_filename;
|
||||
rtc::Optional<std::string> aec_dump_output_filename;
|
||||
absl::optional<std::string> aec_dump_input_filename;
|
||||
absl::optional<std::string> aec_dump_output_filename;
|
||||
bool fixed_interface = false;
|
||||
bool store_intermediate_output = false;
|
||||
rtc::Optional<std::string> custom_call_order_filename;
|
||||
rtc::Optional<std::string> aec3_settings_filename;
|
||||
absl::optional<std::string> custom_call_order_filename;
|
||||
absl::optional<std::string> aec3_settings_filename;
|
||||
};
|
||||
|
||||
// Holds a few statistics about a series of TickIntervals.
|
||||
|
||||
@ -184,19 +184,19 @@ DEFINE_string(aec3_settings,
|
||||
DEFINE_bool(help, false, "Print this message");
|
||||
|
||||
void SetSettingIfSpecified(const std::string& value,
|
||||
rtc::Optional<std::string>* parameter) {
|
||||
absl::optional<std::string>* parameter) {
|
||||
if (value.compare("") != 0) {
|
||||
*parameter = value;
|
||||
}
|
||||
}
|
||||
|
||||
void SetSettingIfSpecified(int value, rtc::Optional<int>* parameter) {
|
||||
void SetSettingIfSpecified(int value, absl::optional<int>* parameter) {
|
||||
if (value != kParameterNotSpecifiedValue) {
|
||||
*parameter = value;
|
||||
}
|
||||
}
|
||||
|
||||
void SetSettingIfFlagSet(int32_t flag, rtc::Optional<bool>* parameter) {
|
||||
void SetSettingIfFlagSet(int32_t flag, absl::optional<bool>* parameter) {
|
||||
if (flag == 0) {
|
||||
*parameter = false;
|
||||
} else if (flag == 1) {
|
||||
|
||||
@ -69,11 +69,11 @@ rtc_source_set("unittest") {
|
||||
"../../../..:webrtc_common",
|
||||
"../../../../:typedefs",
|
||||
"../../../../api:array_view",
|
||||
"../../../../api:optional",
|
||||
"../../../../common_audio",
|
||||
"../../../../rtc_base:rtc_base_approved",
|
||||
"../../../../test:fileutils",
|
||||
"../../../../test:test_support",
|
||||
"//testing/gtest",
|
||||
"//third_party/abseil-cpp/absl/types:optional",
|
||||
]
|
||||
}
|
||||
|
||||
@ -42,7 +42,7 @@
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include "api/optional.h"
|
||||
#include "absl/types/optional.h"
|
||||
#include "common_audio/wav_file.h"
|
||||
#include "modules/audio_processing/test/conversational_speech/config.h"
|
||||
#include "modules/audio_processing/test/conversational_speech/mock_wavreader_factory.h"
|
||||
@ -149,7 +149,7 @@ void CheckAudioTrackParams(const WavReaderFactory& wav_reader_factory,
|
||||
|
||||
void DeleteFolderAndContents(const std::string& dir) {
|
||||
if (!DirExists(dir)) { return; }
|
||||
rtc::Optional<std::vector<std::string>> dir_content = ReadDirectory(dir);
|
||||
absl::optional<std::vector<std::string>> dir_content = ReadDirectory(dir);
|
||||
EXPECT_TRUE(dir_content);
|
||||
for (const auto& path : *dir_content) {
|
||||
if (DirExists(path)) {
|
||||
|
||||
@ -49,9 +49,9 @@ bool DebugDumpReplayer::SetDumpFile(const std::string& filename) {
|
||||
}
|
||||
|
||||
// Get next event that has not run.
|
||||
rtc::Optional<audioproc::Event> DebugDumpReplayer::GetNextEvent() const {
|
||||
absl::optional<audioproc::Event> DebugDumpReplayer::GetNextEvent() const {
|
||||
if (!has_next_event_)
|
||||
return rtc::nullopt;
|
||||
return absl::nullopt;
|
||||
else
|
||||
return next_event_;
|
||||
}
|
||||
|
||||
@ -34,7 +34,7 @@ class DebugDumpReplayer {
|
||||
bool SetDumpFile(const std::string& filename);
|
||||
|
||||
// Return next event.
|
||||
rtc::Optional<audioproc::Event> GetNextEvent() const;
|
||||
absl::optional<audioproc::Event> GetNextEvent() const;
|
||||
|
||||
// Run the next event. Returns true if succeeded.
|
||||
bool RunNextEvent();
|
||||
|
||||
@ -275,8 +275,8 @@ class DebugDumpTest : public ::testing::Test {
|
||||
void DebugDumpTest::VerifyDebugDump(const std::string& in_filename) {
|
||||
ASSERT_TRUE(debug_dump_replayer_.SetDumpFile(in_filename));
|
||||
|
||||
while (const rtc::Optional<audioproc::Event> event =
|
||||
debug_dump_replayer_.GetNextEvent()) {
|
||||
while (const absl::optional<audioproc::Event> event =
|
||||
debug_dump_replayer_.GetNextEvent()) {
|
||||
debug_dump_replayer_.RunNextEvent();
|
||||
if (event->type() == audioproc::Event::STREAM) {
|
||||
const audioproc::Stream* msg = &event->stream();
|
||||
@ -388,7 +388,7 @@ TEST_F(DebugDumpTest, VerifyRefinedAdaptiveFilterExperimentalString) {
|
||||
|
||||
ASSERT_TRUE(debug_dump_replayer_.SetDumpFile(generator.dump_file_name()));
|
||||
|
||||
while (const rtc::Optional<audioproc::Event> event =
|
||||
while (const absl::optional<audioproc::Event> event =
|
||||
debug_dump_replayer_.GetNextEvent()) {
|
||||
debug_dump_replayer_.RunNextEvent();
|
||||
if (event->type() == audioproc::Event::CONFIG) {
|
||||
@ -416,7 +416,7 @@ TEST_F(DebugDumpTest, VerifyCombinedExperimentalStringInclusive) {
|
||||
|
||||
ASSERT_TRUE(debug_dump_replayer_.SetDumpFile(generator.dump_file_name()));
|
||||
|
||||
while (const rtc::Optional<audioproc::Event> event =
|
||||
while (const absl::optional<audioproc::Event> event =
|
||||
debug_dump_replayer_.GetNextEvent()) {
|
||||
debug_dump_replayer_.RunNextEvent();
|
||||
if (event->type() == audioproc::Event::CONFIG) {
|
||||
@ -444,7 +444,7 @@ TEST_F(DebugDumpTest, VerifyCombinedExperimentalStringExclusive) {
|
||||
|
||||
ASSERT_TRUE(debug_dump_replayer_.SetDumpFile(generator.dump_file_name()));
|
||||
|
||||
while (const rtc::Optional<audioproc::Event> event =
|
||||
while (const absl::optional<audioproc::Event> event =
|
||||
debug_dump_replayer_.GetNextEvent()) {
|
||||
debug_dump_replayer_.RunNextEvent();
|
||||
if (event->type() == audioproc::Event::CONFIG) {
|
||||
@ -472,7 +472,7 @@ TEST_F(DebugDumpTest, VerifyAec3ExperimentalString) {
|
||||
|
||||
ASSERT_TRUE(debug_dump_replayer_.SetDumpFile(generator.dump_file_name()));
|
||||
|
||||
while (const rtc::Optional<audioproc::Event> event =
|
||||
while (const absl::optional<audioproc::Event> event =
|
||||
debug_dump_replayer_.GetNextEvent()) {
|
||||
debug_dump_replayer_.RunNextEvent();
|
||||
if (event->type() == audioproc::Event::CONFIG) {
|
||||
@ -497,7 +497,7 @@ TEST_F(DebugDumpTest, VerifyAgcClippingLevelExperimentalString) {
|
||||
|
||||
ASSERT_TRUE(debug_dump_replayer_.SetDumpFile(generator.dump_file_name()));
|
||||
|
||||
while (const rtc::Optional<audioproc::Event> event =
|
||||
while (const absl::optional<audioproc::Event> event =
|
||||
debug_dump_replayer_.GetNextEvent()) {
|
||||
debug_dump_replayer_.RunNextEvent();
|
||||
if (event->type() == audioproc::Event::CONFIG) {
|
||||
@ -520,7 +520,7 @@ TEST_F(DebugDumpTest, VerifyEmptyExperimentalString) {
|
||||
|
||||
ASSERT_TRUE(debug_dump_replayer_.SetDumpFile(generator.dump_file_name()));
|
||||
|
||||
while (const rtc::Optional<audioproc::Event> event =
|
||||
while (const absl::optional<audioproc::Event> event =
|
||||
debug_dump_replayer_.GetNextEvent()) {
|
||||
debug_dump_replayer_.RunNextEvent();
|
||||
if (event->type() == audioproc::Event::CONFIG) {
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#include "api/optional.h"
|
||||
#include "absl/types/optional.h"
|
||||
#include "rtc_base/logging.h"
|
||||
#include "rtc_base/ptr_util.h"
|
||||
|
||||
@ -44,7 +44,7 @@ class FakeRecordingDeviceWorker {
|
||||
// Mic level to simulate.
|
||||
int mic_level_;
|
||||
// Optional mic level to undo.
|
||||
rtc::Optional<int> undo_mic_level_;
|
||||
absl::optional<int> undo_mic_level_;
|
||||
};
|
||||
|
||||
namespace {
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "api/optional.h"
|
||||
#include "absl/types/optional.h"
|
||||
#include "system_wrappers/include/clock.h"
|
||||
|
||||
namespace webrtc {
|
||||
@ -37,7 +37,7 @@ class PerformanceTimer {
|
||||
|
||||
private:
|
||||
webrtc::Clock* clock_;
|
||||
rtc::Optional<int64_t> start_timestamp_us_;
|
||||
absl::optional<int64_t> start_timestamp_us_;
|
||||
std::vector<int64_t> timestamps_us_;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user