Replace rtc::Optional with absl::optional in api
This is a no-op change because rtc::Optional is an alias to absl::optional
This CL generated by running script with parameter 'api'
Then undo changes to optional target itself and optional_unittests
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: I44093da213369d6a502e33792c694f620f53b779
Reviewed-on: https://webrtc-review.googlesource.com/84621
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23707}
This commit is contained in:
committed by
Commit Bot
parent
1ff41eb784
commit
0bc58cf876
@ -29,14 +29,14 @@ struct Helper;
|
||||
template <>
|
||||
struct Helper<> {
|
||||
static void AppendSupportedEncoders(std::vector<AudioCodecSpec>* specs) {}
|
||||
static rtc::Optional<AudioCodecInfo> QueryAudioEncoder(
|
||||
static absl::optional<AudioCodecInfo> QueryAudioEncoder(
|
||||
const SdpAudioFormat& format) {
|
||||
return rtc::nullopt;
|
||||
return absl::nullopt;
|
||||
}
|
||||
static std::unique_ptr<AudioEncoder> MakeAudioEncoder(
|
||||
int payload_type,
|
||||
const SdpAudioFormat& format,
|
||||
rtc::Optional<AudioCodecPairId> codec_pair_id) {
|
||||
absl::optional<AudioCodecPairId> codec_pair_id) {
|
||||
return nullptr;
|
||||
}
|
||||
};
|
||||
@ -49,21 +49,21 @@ struct Helper<T, Ts...> {
|
||||
T::AppendSupportedEncoders(specs);
|
||||
Helper<Ts...>::AppendSupportedEncoders(specs);
|
||||
}
|
||||
static rtc::Optional<AudioCodecInfo> QueryAudioEncoder(
|
||||
static absl::optional<AudioCodecInfo> QueryAudioEncoder(
|
||||
const SdpAudioFormat& format) {
|
||||
auto opt_config = T::SdpToConfig(format);
|
||||
static_assert(std::is_same<decltype(opt_config),
|
||||
rtc::Optional<typename T::Config>>::value,
|
||||
absl::optional<typename T::Config>>::value,
|
||||
"T::SdpToConfig() must return a value of type "
|
||||
"rtc::Optional<T::Config>");
|
||||
return opt_config ? rtc::Optional<AudioCodecInfo>(
|
||||
"absl::optional<T::Config>");
|
||||
return opt_config ? absl::optional<AudioCodecInfo>(
|
||||
T::QueryAudioEncoder(*opt_config))
|
||||
: Helper<Ts...>::QueryAudioEncoder(format);
|
||||
}
|
||||
static std::unique_ptr<AudioEncoder> MakeAudioEncoder(
|
||||
int payload_type,
|
||||
const SdpAudioFormat& format,
|
||||
rtc::Optional<AudioCodecPairId> codec_pair_id) {
|
||||
absl::optional<AudioCodecPairId> codec_pair_id) {
|
||||
auto opt_config = T::SdpToConfig(format);
|
||||
if (opt_config) {
|
||||
return T::MakeAudioEncoder(*opt_config, payload_type, codec_pair_id);
|
||||
@ -83,7 +83,7 @@ class AudioEncoderFactoryT : public AudioEncoderFactory {
|
||||
return specs;
|
||||
}
|
||||
|
||||
rtc::Optional<AudioCodecInfo> QueryAudioEncoder(
|
||||
absl::optional<AudioCodecInfo> QueryAudioEncoder(
|
||||
const SdpAudioFormat& format) override {
|
||||
return Helper<Ts...>::QueryAudioEncoder(format);
|
||||
}
|
||||
@ -91,7 +91,7 @@ class AudioEncoderFactoryT : public AudioEncoderFactory {
|
||||
std::unique_ptr<AudioEncoder> MakeAudioEncoder(
|
||||
int payload_type,
|
||||
const SdpAudioFormat& format,
|
||||
rtc::Optional<AudioCodecPairId> codec_pair_id) override {
|
||||
absl::optional<AudioCodecPairId> codec_pair_id) override {
|
||||
return Helper<Ts...>::MakeAudioEncoder(payload_type, format, codec_pair_id);
|
||||
}
|
||||
};
|
||||
@ -106,7 +106,7 @@ class AudioEncoderFactoryT : public AudioEncoderFactory {
|
||||
// // Converts |audio_format| to a ConfigType instance. Returns an empty
|
||||
// // optional if |audio_format| doesn't correctly specify an encoder of our
|
||||
// // type.
|
||||
// rtc::Optional<ConfigType> SdpToConfig(const SdpAudioFormat& audio_format);
|
||||
// absl::optional<ConfigType> SdpToConfig(const SdpAudioFormat& audio_format);
|
||||
//
|
||||
// // Appends zero or more AudioCodecSpecs to the list that will be returned
|
||||
// // by AudioEncoderFactory::GetSupportedEncoders().
|
||||
@ -121,7 +121,7 @@ class AudioEncoderFactoryT : public AudioEncoderFactory {
|
||||
// std::unique_ptr<AudioDecoder> MakeAudioEncoder(
|
||||
// const ConfigType& config,
|
||||
// int payload_type,
|
||||
// rtc::Optional<AudioCodecPairId> codec_pair_id);
|
||||
// absl::optional<AudioCodecPairId> codec_pair_id);
|
||||
//
|
||||
// ConfigType should be a type that encapsulates all the settings needed to
|
||||
// create an AudioEncoder. T::Config (where T is the encoder struct) should
|
||||
|
||||
Reference in New Issue
Block a user