Replace rtc::Optional with absl::optional in modules/audio_coding
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_coding'
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: Ic980ee605148fdb160666d4aa03cc87175e48fe8
Reviewed-on: https://webrtc-review.googlesource.com/84130
Reviewed-by: Oskar Sundbom <ossu@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23659}
diff --git a/modules/audio_coding/neteq/neteq_impl_unittest.cc b/modules/audio_coding/neteq/neteq_impl_unittest.cc
index de24cda..c8fd91a 100644
--- a/modules/audio_coding/neteq/neteq_impl_unittest.cc
+++ b/modules/audio_coding/neteq/neteq_impl_unittest.cc
@@ -314,7 +314,7 @@
new rtc::RefCountedObject<MockAudioDecoderFactory>);
EXPECT_CALL(*mock_decoder_factory, MakeAudioDecoderMock(_, _, _))
.WillOnce(Invoke([&](const SdpAudioFormat& format,
- rtc::Optional<AudioCodecPairId> codec_pair_id,
+ absl::optional<AudioCodecPairId> codec_pair_id,
std::unique_ptr<AudioDecoder>* dec) {
EXPECT_EQ("pcmu", format.name);
@@ -334,7 +334,7 @@
*dec = std::move(mock_decoder);
}));
- DecoderDatabase::DecoderInfo info(NetEqDecoder::kDecoderPCMu, rtc::nullopt,
+ DecoderDatabase::DecoderInfo info(NetEqDecoder::kDecoderPCMu, absl::nullopt,
mock_decoder_factory);
// Expectations for decoder database.
@@ -518,10 +518,10 @@
// The value of the last of the output samples is the same as the number of
// samples played from the decoded packet. Thus, this number + the RTP
// timestamp should match the playout timestamp.
- // Wrap the expected value in an rtc::Optional to compare them as such.
+ // Wrap the expected value in an absl::optional to compare them as such.
EXPECT_EQ(
- rtc::Optional<uint32_t>(rtp_header.timestamp +
- output.data()[output.samples_per_channel_ - 1]),
+ absl::optional<uint32_t>(rtp_header.timestamp +
+ output.data()[output.samples_per_channel_ - 1]),
neteq_->GetPlayoutTimestamp());
// Check the timestamp for the last value in the sync buffer. This should
@@ -783,12 +783,12 @@
bool muted;
EXPECT_EQ(NetEq::kOK, neteq_->GetAudio(&output, &muted));
- rtc::Optional<uint32_t> last_timestamp = neteq_->GetPlayoutTimestamp();
+ absl::optional<uint32_t> last_timestamp = neteq_->GetPlayoutTimestamp();
ASSERT_TRUE(last_timestamp);
// Lambda for verifying the timestamps.
auto verify_timestamp = [&last_timestamp, &expected_timestamp_increment](
- rtc::Optional<uint32_t> ts, size_t i) {
+ absl::optional<uint32_t> ts, size_t i) {
if (expected_timestamp_increment[i] == -1) {
// Expect to get an empty timestamp value during CNG and PLC.
EXPECT_FALSE(ts) << "i = " << i;