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}
This commit is contained in:
Danil Chapovalov
2018-06-19 13:26:36 +02:00
committed by Commit Bot
parent bbfcc703ad
commit b602123a5a
82 changed files with 452 additions and 459 deletions

View File

@ -15,7 +15,7 @@
#include <memory>
#include <string>
#include "api/optional.h"
#include "absl/types/optional.h"
#include "common_types.h" // NOLINT(build/include)
#include "modules/audio_coding/neteq/tools/packet.h"
#include "modules/audio_coding/neteq/tools/packet_source.h"
@ -39,22 +39,22 @@ class NetEqInput {
// Returns at what time (in ms) NetEq::InsertPacket should be called next, or
// empty if the source is out of packets.
virtual rtc::Optional<int64_t> NextPacketTime() const = 0;
virtual absl::optional<int64_t> NextPacketTime() const = 0;
// Returns at what time (in ms) NetEq::GetAudio should be called next, or
// empty if no more output events are available.
virtual rtc::Optional<int64_t> NextOutputEventTime() const = 0;
virtual absl::optional<int64_t> NextOutputEventTime() const = 0;
// Returns the time (in ms) for the next event from either NextPacketTime()
// or NextOutputEventTime(), or empty if both are out of events.
rtc::Optional<int64_t> NextEventTime() const {
absl::optional<int64_t> NextEventTime() const {
const auto a = NextPacketTime();
const auto b = NextOutputEventTime();
// Return the minimum of non-empty |a| and |b|, or empty if both are empty.
if (a) {
return b ? std::min(*a, *b) : a;
}
return b ? b : rtc::nullopt;
return b ? b : absl::nullopt;
}
// Returns the next packet to be inserted into NetEq. The packet following the
@ -75,7 +75,7 @@ class NetEqInput {
// Returns the RTP header for the next packet, i.e., the packet that will be
// delivered next by PopPacket().
virtual rtc::Optional<RTPHeader> NextHeader() const = 0;
virtual absl::optional<RTPHeader> NextHeader() const = 0;
};
} // namespace test