Replace rtc::Optional with absl::optional in pc
This is a no-op change because rtc::Optional is an alias to absl::optional
This CL generated by running script with parameter 'pc'
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: Ide3b9eb32df7f25991f898ac58fcb119c9f8ae12
Reviewed-on: https://webrtc-review.googlesource.com/84181
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23669}
diff --git a/pc/BUILD.gn b/pc/BUILD.gn
index 704b459..405c2a5 100644
--- a/pc/BUILD.gn
+++ b/pc/BUILD.gn
@@ -68,7 +68,6 @@
"../api:array_view",
"../api:call_api",
"../api:libjingle_peerconnection_api",
- "../api:optional",
"../api:ortc_api",
"../api/video:video_frame",
"../call:rtp_interfaces",
@@ -86,6 +85,7 @@
"../rtc_base:rtc_task_queue",
"../rtc_base:stringutils",
"../system_wrappers:metrics_api",
+ "//third_party/abseil-cpp/absl/types:optional",
]
if (rtc_build_libsrtp) {
@@ -193,7 +193,6 @@
"../api:call_api",
"../api:fec_controller_api",
"../api:libjingle_peerconnection_api",
- "../api:optional",
"../api:rtc_stats_api",
"../api/video:video_frame",
"../api/video_codecs:video_codecs_api",
@@ -215,6 +214,7 @@
"../stats",
"../system_wrappers",
"../system_wrappers:field_trial_api",
+ "//third_party/abseil-cpp/absl/types:optional",
]
}
@@ -506,7 +506,6 @@
"../api:callfactory_api",
"../api:fakemetricsobserver",
"../api:libjingle_peerconnection_test_api",
- "../api:optional",
"../api:rtc_stats_api",
"../api/audio_codecs:audio_codecs_api",
"../api/audio_codecs:builtin_audio_decoder_factory",
@@ -538,6 +537,7 @@
"../system_wrappers:runtime_enabled_features_default",
"../test:audio_codec_mocks",
"../test:test_support",
+ "//third_party/abseil-cpp/absl/types:optional",
]
if (is_android) {
diff --git a/pc/channel.cc b/pc/channel.cc
index 8ee2ba5..713cd39 100644
--- a/pc/channel.cc
+++ b/pc/channel.cc
@@ -363,7 +363,7 @@
}
void BaseChannel::OnNetworkRouteChanged(
- rtc::Optional<rtc::NetworkRoute> network_route) {
+ absl::optional<rtc::NetworkRoute> network_route) {
RTC_DCHECK(network_thread_->IsCurrent());
rtc::NetworkRoute new_route;
if (network_route) {
diff --git a/pc/channel.h b/pc/channel.h
index 6dd2709..35be5c5 100644
--- a/pc/channel.h
+++ b/pc/channel.h
@@ -218,7 +218,7 @@
// From RtpTransportInternal
void OnWritableState(bool writable);
- void OnNetworkRouteChanged(rtc::Optional<rtc::NetworkRoute> network_route);
+ void OnNetworkRouteChanged(absl::optional<rtc::NetworkRoute> network_route);
bool PacketIsRtcp(const rtc::PacketTransportInternal* transport,
const char* data,
diff --git a/pc/channel_unittest.cc b/pc/channel_unittest.cc
index f854826..29d2bd7 100644
--- a/pc/channel_unittest.cc
+++ b/pc/channel_unittest.cc
@@ -863,7 +863,7 @@
// The transport channel becomes disconnected.
fake_rtp_dtls_transport1_->ice_transport()->SignalNetworkRouteChanged(
- rtc::Optional<rtc::NetworkRoute>(network_route));
+ absl::optional<rtc::NetworkRoute>(network_route));
});
WaitForThreads();
EXPECT_EQ(1, media_channel1->num_network_route_changes());
@@ -880,7 +880,7 @@
// The transport channel becomes connected.
fake_rtp_dtls_transport1_->ice_transport()->SignalNetworkRouteChanged(
- rtc::Optional<rtc::NetworkRoute>(network_route));
+ absl::optional<rtc::NetworkRoute>(network_route));
});
WaitForThreads();
EXPECT_EQ(1, media_channel1->num_network_route_changes());
@@ -1348,7 +1348,7 @@
return channel1_->SetRemoteContent(&content, SdpType::kOffer, NULL);
}
- webrtc::RtpParameters BitrateLimitedParameters(rtc::Optional<int> limit) {
+ webrtc::RtpParameters BitrateLimitedParameters(absl::optional<int> limit) {
webrtc::RtpParameters parameters;
webrtc::RtpEncodingParameters encoding;
encoding.max_bitrate_bps = std::move(limit);
@@ -1357,7 +1357,7 @@
}
void VerifyMaxBitrate(const webrtc::RtpParameters& parameters,
- rtc::Optional<int> expected_bitrate) {
+ absl::optional<int> expected_bitrate) {
EXPECT_EQ(1UL, parameters.encodings.size());
EXPECT_EQ(expected_bitrate, parameters.encodings[0].max_bitrate_bps);
}
@@ -1368,7 +1368,7 @@
SdpType::kOffer, NULL));
EXPECT_EQ(media_channel1_->max_bps(), -1);
VerifyMaxBitrate(media_channel1_->GetRtpSendParameters(kSsrc1),
- rtc::nullopt);
+ absl::nullopt);
}
// Test that when a channel gets new RtpTransport with a call to
diff --git a/pc/dtlssrtptransport.h b/pc/dtlssrtptransport.h
index a2d7aad..498f02e 100644
--- a/pc/dtlssrtptransport.h
+++ b/pc/dtlssrtptransport.h
@@ -88,8 +88,8 @@
cricket::DtlsTransportInternal* rtcp_dtls_transport_ = nullptr;
// The encrypted header extension IDs.
- rtc::Optional<std::vector<int>> send_extension_ids_;
- rtc::Optional<std::vector<int>> recv_extension_ids_;
+ absl::optional<std::vector<int>> send_extension_ids_;
+ absl::optional<std::vector<int>> recv_extension_ids_;
bool active_reset_srtp_params_ = false;
};
diff --git a/pc/jsepsessiondescription.cc b/pc/jsepsessiondescription.cc
index ecd2ee2..f52faf1 100644
--- a/pc/jsepsessiondescription.cc
+++ b/pc/jsepsessiondescription.cc
@@ -112,7 +112,7 @@
return "";
}
-rtc::Optional<SdpType> SdpTypeFromString(const std::string& type_str) {
+absl::optional<SdpType> SdpTypeFromString(const std::string& type_str) {
if (type_str == SessionDescriptionInterface::kOffer) {
return SdpType::kOffer;
} else if (type_str == SessionDescriptionInterface::kPrAnswer) {
@@ -120,14 +120,14 @@
} else if (type_str == SessionDescriptionInterface::kAnswer) {
return SdpType::kAnswer;
} else {
- return rtc::nullopt;
+ return absl::nullopt;
}
}
// TODO(steveanton): Remove this default implementation once Chromium has been
// updated.
SdpType SessionDescriptionInterface::GetType() const {
- rtc::Optional<SdpType> maybe_type = SdpTypeFromString(type());
+ absl::optional<SdpType> maybe_type = SdpTypeFromString(type());
if (maybe_type) {
return *maybe_type;
} else {
@@ -142,7 +142,7 @@
SessionDescriptionInterface* CreateSessionDescription(const std::string& type,
const std::string& sdp,
SdpParseError* error) {
- rtc::Optional<SdpType> maybe_type = SdpTypeFromString(type);
+ absl::optional<SdpType> maybe_type = SdpTypeFromString(type);
if (!maybe_type) {
return nullptr;
}
@@ -170,7 +170,7 @@
JsepSessionDescription::JsepSessionDescription(SdpType type) : type_(type) {}
JsepSessionDescription::JsepSessionDescription(const std::string& type) {
- rtc::Optional<SdpType> maybe_type = SdpTypeFromString(type);
+ absl::optional<SdpType> maybe_type = SdpTypeFromString(type);
if (maybe_type) {
type_ = *maybe_type;
} else {
diff --git a/pc/jseptransport.cc b/pc/jseptransport.cc
index adce4af..bea5d30 100644
--- a/pc/jseptransport.cc
+++ b/pc/jseptransport.cc
@@ -284,14 +284,14 @@
}
}
-rtc::Optional<rtc::SSLRole> JsepTransport::GetDtlsRole() const {
+absl::optional<rtc::SSLRole> JsepTransport::GetDtlsRole() const {
RTC_DCHECK(rtp_dtls_transport_);
rtc::SSLRole dtls_role;
if (!rtp_dtls_transport_->GetDtlsRole(&dtls_role)) {
- return rtc::Optional<rtc::SSLRole>();
+ return absl::optional<rtc::SSLRole>();
}
- return rtc::Optional<rtc::SSLRole>(dtls_role);
+ return absl::optional<rtc::SSLRole>(dtls_role);
}
bool JsepTransport::GetStats(TransportStats* stats) {
@@ -357,7 +357,7 @@
webrtc::RTCError JsepTransport::SetNegotiatedDtlsParameters(
DtlsTransportInternal* dtls_transport,
- rtc::Optional<rtc::SSLRole> dtls_role,
+ absl::optional<rtc::SSLRole> dtls_role,
rtc::SSLFingerprint* remote_fingerprint) {
RTC_DCHECK(dtls_transport);
// Set SSL role. Role must be set before fingerprint is applied, which
@@ -483,7 +483,7 @@
"without applying any offer.");
}
std::unique_ptr<rtc::SSLFingerprint> remote_fingerprint;
- rtc::Optional<rtc::SSLRole> negotiated_dtls_role;
+ absl::optional<rtc::SSLRole> negotiated_dtls_role;
rtc::SSLFingerprint* local_fp =
local_description_->transport_desc.identity_fingerprint.get();
@@ -531,7 +531,7 @@
SdpType local_description_type,
ConnectionRole local_connection_role,
ConnectionRole remote_connection_role,
- rtc::Optional<rtc::SSLRole>* negotiated_dtls_role) {
+ absl::optional<rtc::SSLRole>* negotiated_dtls_role) {
// From RFC 4145, section-4.1, The following are the values that the
// 'setup' attribute can take in an offer/answer exchange:
// Offer Answer
diff --git a/pc/jseptransport.h b/pc/jseptransport.h
index 392f861..fc9ed5b 100644
--- a/pc/jseptransport.h
+++ b/pc/jseptransport.h
@@ -16,9 +16,9 @@
#include <string>
#include <vector>
+#include "absl/types/optional.h"
#include "api/candidate.h"
#include "api/jsep.h"
-#include "api/optional.h"
#include "p2p/base/dtlstransport.h"
#include "p2p/base/p2pconstants.h"
#include "p2p/base/transportinfo.h"
@@ -125,9 +125,9 @@
// changed ufrag/password).
bool needs_ice_restart() const { return needs_ice_restart_; }
- // Returns role if negotiated, or empty Optional if it hasn't been negotiated
- // yet.
- rtc::Optional<rtc::SSLRole> GetDtlsRole() const;
+ // Returns role if negotiated, or empty absl::optional if it hasn't been
+ // negotiated yet.
+ absl::optional<rtc::SSLRole> GetDtlsRole() const;
// TODO(deadbeef): Make this const. See comment in transportcontroller.h.
bool GetStats(TransportStats* stats);
@@ -200,7 +200,7 @@
webrtc::SdpType local_description_type,
ConnectionRole local_connection_role,
ConnectionRole remote_connection_role,
- rtc::Optional<rtc::SSLRole>* negotiated_dtls_role);
+ absl::optional<rtc::SSLRole>* negotiated_dtls_role);
// Pushes down the ICE parameters from the local description, such
// as the ICE ufrag and pwd.
@@ -212,7 +212,7 @@
// Pushes down the DTLS parameters obtained via negotiation.
webrtc::RTCError SetNegotiatedDtlsParameters(
DtlsTransportInternal* dtls_transport,
- rtc::Optional<rtc::SSLRole> dtls_role,
+ absl::optional<rtc::SSLRole> dtls_role,
rtc::SSLFingerprint* remote_fingerprint);
bool GetTransportStats(DtlsTransportInternal* dtls_transport,
@@ -238,8 +238,8 @@
RtcpMuxFilter rtcp_mux_negotiator_;
// Cache the encrypted header extension IDs for SDES negoitation.
- rtc::Optional<std::vector<int>> send_extension_ids_;
- rtc::Optional<std::vector<int>> recv_extension_ids_;
+ absl::optional<std::vector<int>> send_extension_ids_;
+ absl::optional<std::vector<int>> recv_extension_ids_;
RTC_DISALLOW_COPY_AND_ASSIGN(JsepTransport);
};
diff --git a/pc/jseptransport_unittest.cc b/pc/jseptransport_unittest.cc
index f6f3e1e..16cc526 100644
--- a/pc/jseptransport_unittest.cc
+++ b/pc/jseptransport_unittest.cc
@@ -759,7 +759,7 @@
.ok());
// Sanity check that role was actually negotiated.
- rtc::Optional<rtc::SSLRole> role = jsep_transport_->GetDtlsRole();
+ absl::optional<rtc::SSLRole> role = jsep_transport_->GetDtlsRole();
ASSERT_TRUE(role);
EXPECT_EQ(rtc::SSL_CLIENT, *role);
@@ -804,7 +804,7 @@
.ok());
// Sanity check that role was actually negotiated.
- rtc::Optional<rtc::SSLRole> role = jsep_transport_->GetDtlsRole();
+ absl::optional<rtc::SSLRole> role = jsep_transport_->GetDtlsRole();
ASSERT_TRUE(role);
EXPECT_EQ(rtc::SSL_CLIENT, *role);
@@ -849,7 +849,7 @@
->SetRemoteJsepTransportDescription(remote_desc, SdpType::kAnswer)
.ok());
- rtc::Optional<rtc::SSLRole> role = jsep_transport_->GetDtlsRole();
+ absl::optional<rtc::SSLRole> role = jsep_transport_->GetDtlsRole();
ASSERT_TRUE(role);
// Since legacy answer ommitted setup atribute, and we offered actpass, we
// should act as passive (server).
diff --git a/pc/jseptransportcontroller.cc b/pc/jseptransportcontroller.cc
index 52519c0..80b7237 100644
--- a/pc/jseptransportcontroller.cc
+++ b/pc/jseptransportcontroller.cc
@@ -192,16 +192,16 @@
return transport->needs_ice_restart();
}
-rtc::Optional<rtc::SSLRole> JsepTransportController::GetDtlsRole(
+absl::optional<rtc::SSLRole> JsepTransportController::GetDtlsRole(
const std::string& mid) const {
if (!network_thread_->IsCurrent()) {
- return network_thread_->Invoke<rtc::Optional<rtc::SSLRole>>(
+ return network_thread_->Invoke<absl::optional<rtc::SSLRole>>(
RTC_FROM_HERE, [&] { return GetDtlsRole(mid); });
}
const cricket::JsepTransport* t = GetJsepTransportForMid(mid);
if (!t) {
- return rtc::Optional<rtc::SSLRole>();
+ return absl::optional<rtc::SSLRole>();
}
return t->GetDtlsRole();
}
diff --git a/pc/jseptransportcontroller.h b/pc/jseptransportcontroller.h
index b678a09..56aed99 100644
--- a/pc/jseptransportcontroller.h
+++ b/pc/jseptransportcontroller.h
@@ -146,7 +146,7 @@
std::unique_ptr<rtc::SSLCertChain> GetRemoteSSLCertChain(
const std::string& mid) const;
// Get negotiated role, if one has been negotiated.
- rtc::Optional<rtc::SSLRole> GetDtlsRole(const std::string& mid) const;
+ absl::optional<rtc::SSLRole> GetDtlsRole(const std::string& mid) const;
// TODO(deadbeef): GetStats isn't const because all the way down to
// OpenSSLStreamAdapter, GetSslCipherSuite and GetDtlsSrtpCryptoSuite are not
@@ -206,8 +206,8 @@
const std::vector<int>& encrypted_extension_ids,
int rtp_abs_sendtime_extn_id);
- rtc::Optional<std::string> bundled_mid() const {
- rtc::Optional<std::string> bundled_mid;
+ absl::optional<std::string> bundled_mid() const {
+ absl::optional<std::string> bundled_mid;
if (bundle_group_ && bundle_group_->FirstContentName()) {
bundled_mid = *(bundle_group_->FirstContentName());
}
@@ -312,9 +312,9 @@
Config config_;
const cricket::SessionDescription* local_desc_ = nullptr;
const cricket::SessionDescription* remote_desc_ = nullptr;
- rtc::Optional<bool> initial_offerer_;
+ absl::optional<bool> initial_offerer_;
- rtc::Optional<cricket::ContentGroup> bundle_group_;
+ absl::optional<cricket::ContentGroup> bundle_group_;
cricket::IceConfig ice_config_;
cricket::IceRole ice_role_ = cricket::ICEROLE_CONTROLLING;
diff --git a/pc/jseptransportcontroller_unittest.cc b/pc/jseptransportcontroller_unittest.cc
index f3bf2af..93f14c8 100644
--- a/pc/jseptransportcontroller_unittest.cc
+++ b/pc/jseptransportcontroller_unittest.cc
@@ -524,7 +524,7 @@
->SetLocalDescription(SdpType::kOffer, offer_desc.get())
.ok());
- rtc::Optional<rtc::SSLRole> role =
+ absl::optional<rtc::SSLRole> role =
transport_controller_->GetDtlsRole(kAudioMid1);
// The DTLS role is not decided yet.
EXPECT_FALSE(role);
diff --git a/pc/localaudiosource_unittest.cc b/pc/localaudiosource_unittest.cc
index b2d87ae..54766ca 100644
--- a/pc/localaudiosource_unittest.cc
+++ b/pc/localaudiosource_unittest.cc
@@ -33,5 +33,5 @@
TEST(LocalAudioSourceTest, InitWithNoOptions) {
rtc::scoped_refptr<LocalAudioSource> source =
LocalAudioSource::Create(nullptr);
- EXPECT_EQ(rtc::nullopt, source->options().highpass_filter);
+ EXPECT_EQ(absl::nullopt, source->options().highpass_filter);
}
diff --git a/pc/mediasession.cc b/pc/mediasession.cc
index 79aa975..37354b8 100644
--- a/pc/mediasession.cc
+++ b/pc/mediasession.cc
@@ -18,8 +18,8 @@
#include <unordered_map>
#include <utility>
+#include "absl/types/optional.h"
#include "api/cryptoparams.h"
-#include "api/optional.h"
#include "common_types.h" // NOLINT(build/include)
#include "media/base/h264_profile_level_id.h"
#include "media/base/mediaconstants.h"
diff --git a/pc/peerconnection.cc b/pc/peerconnection.cc
index 41e4368..d99e97f 100644
--- a/pc/peerconnection.cc
+++ b/pc/peerconnection.cc
@@ -609,11 +609,11 @@
return output;
}
-rtc::Optional<int> RTCConfigurationToIceConfigOptionalInt(
+absl::optional<int> RTCConfigurationToIceConfigOptionalInt(
int rtc_configuration_parameter) {
if (rtc_configuration_parameter ==
webrtc::PeerConnectionInterface::RTCConfiguration::kUndefined) {
- return rtc::nullopt;
+ return absl::nullopt;
}
return rtc_configuration_parameter;
}
@@ -665,9 +665,9 @@
int max_ipv6_networks;
bool disable_link_local_networks;
bool enable_rtp_data_channel;
- rtc::Optional<int> screencast_min_bitrate;
- rtc::Optional<bool> combined_audio_video_bwe;
- rtc::Optional<bool> enable_dtls_srtp;
+ absl::optional<int> screencast_min_bitrate;
+ absl::optional<bool> combined_audio_video_bwe;
+ absl::optional<bool> enable_dtls_srtp;
TcpCandidatePolicy tcp_candidate_policy;
CandidateNetworkPolicy candidate_network_policy;
int audio_jitter_buffer_max_packets;
@@ -681,16 +681,16 @@
bool presume_writable_when_fully_relayed;
bool enable_ice_renomination;
bool redetermine_role_on_ice_restart;
- rtc::Optional<int> ice_check_interval_strong_connectivity;
- rtc::Optional<int> ice_check_interval_weak_connectivity;
- rtc::Optional<int> ice_check_min_interval;
- rtc::Optional<int> ice_unwritable_timeout;
- rtc::Optional<int> ice_unwritable_min_checks;
- rtc::Optional<int> stun_candidate_keepalive_interval;
- rtc::Optional<rtc::IntervalRange> ice_regather_interval_range;
+ absl::optional<int> ice_check_interval_strong_connectivity;
+ absl::optional<int> ice_check_interval_weak_connectivity;
+ absl::optional<int> ice_check_min_interval;
+ absl::optional<int> ice_unwritable_timeout;
+ absl::optional<int> ice_unwritable_min_checks;
+ absl::optional<int> stun_candidate_keepalive_interval;
+ absl::optional<rtc::IntervalRange> ice_regather_interval_range;
webrtc::TurnCustomizer* turn_customizer;
SdpSemantics sdp_semantics;
- rtc::Optional<rtc::AdapterType> network_preference;
+ absl::optional<rtc::AdapterType> network_preference;
bool active_reset_srtp_params;
};
static_assert(sizeof(stuff_being_tested_for_equality) == sizeof(*this),
@@ -2714,8 +2714,8 @@
if (old_transceiver) {
RTC_LOG(LS_INFO) << "Dissociating transceiver for MID=" << old_mid
<< " since the media section is being recycled.";
- old_transceiver->internal()->set_mid(rtc::nullopt);
- old_transceiver->internal()->set_mline_index(rtc::nullopt);
+ old_transceiver->internal()->set_mid(absl::nullopt);
+ old_transceiver->internal()->set_mline_index(absl::nullopt);
}
}
const MediaContentDescription* media_desc = content.media_description();
@@ -3674,9 +3674,9 @@
(offer_answer_options.offer_to_receive_video > 0);
}
- rtc::Optional<size_t> audio_index;
- rtc::Optional<size_t> video_index;
- rtc::Optional<size_t> data_index;
+ absl::optional<size_t> audio_index;
+ absl::optional<size_t> video_index;
+ absl::optional<size_t> data_index;
// If a current description exists, generate m= sections in the same order,
// using the first audio/video/data section that appears and rejecting
// extraneous ones.
@@ -3922,9 +3922,9 @@
recv_video = (offer_answer_options.offer_to_receive_video > 0);
}
- rtc::Optional<size_t> audio_index;
- rtc::Optional<size_t> video_index;
- rtc::Optional<size_t> data_index;
+ absl::optional<size_t> audio_index;
+ absl::optional<size_t> video_index;
+ absl::optional<size_t> data_index;
// Generate m= sections that match those in the offer.
// Note that mediasession.cc will handle intersection our preferred
@@ -3983,9 +3983,9 @@
const SessionDescriptionInterface* session_desc,
RtpTransceiverDirection audio_direction,
RtpTransceiverDirection video_direction,
- rtc::Optional<size_t>* audio_index,
- rtc::Optional<size_t>* video_index,
- rtc::Optional<size_t>* data_index,
+ absl::optional<size_t>* audio_index,
+ absl::optional<size_t>* video_index,
+ absl::optional<size_t>* data_index,
cricket::MediaSessionOptions* session_options) {
for (const cricket::ContentInfo& content :
session_desc->description()->contents()) {
@@ -4054,17 +4054,17 @@
return options;
}
-rtc::Optional<std::string> PeerConnection::GetDataMid() const {
+absl::optional<std::string> PeerConnection::GetDataMid() const {
switch (data_channel_type_) {
case cricket::DCT_RTP:
if (!rtp_data_channel_) {
- return rtc::nullopt;
+ return absl::nullopt;
}
return rtp_data_channel_->content_name();
case cricket::DCT_SCTP:
return sctp_mid_;
default:
- return rtc::nullopt;
+ return absl::nullopt;
}
}
@@ -4727,7 +4727,7 @@
int candidate_pool_size,
bool prune_turn_ports,
webrtc::TurnCustomizer* turn_customizer,
- rtc::Optional<int> stun_candidate_keepalive_interval) {
+ absl::optional<int> stun_candidate_keepalive_interval) {
port_allocator_->set_candidate_filter(
ConvertIceTransportTypeToCandidateFilter(type));
// According to JSEP, after setLocalDescription, changing the candidate pool
@@ -5123,15 +5123,15 @@
sctp_ready_to_send_data_;
}
-rtc::Optional<std::string> PeerConnection::sctp_transport_name() const {
+absl::optional<std::string> PeerConnection::sctp_transport_name() const {
if (sctp_mid_ && transport_controller_) {
auto dtls_transport = transport_controller_->GetDtlsTransport(*sctp_mid_);
if (dtls_transport) {
return dtls_transport->transport_name();
}
- return rtc::Optional<std::string>();
+ return absl::optional<std::string>();
}
- return rtc::Optional<std::string>();
+ return absl::optional<std::string>();
}
cricket::CandidateStatsList PeerConnection::GetPooledCandidateStats() const {
@@ -5158,7 +5158,7 @@
rtp_data_channel_->transport_name();
}
if (sctp_transport_) {
- rtc::Optional<std::string> transport_name = sctp_transport_name();
+ absl::optional<std::string> transport_name = sctp_transport_name();
RTC_DCHECK(transport_name);
transport_names_by_mid[*sctp_mid_] = *transport_name;
}
@@ -6036,7 +6036,7 @@
cricket::MEDIA_TYPE_DATA);
}
- rtc::Optional<std::string> transport_name = sctp_transport_name();
+ absl::optional<std::string> transport_name = sctp_transport_name();
if (transport_name) {
media_types_by_transport_name[*transport_name].insert(
cricket::MEDIA_TYPE_DATA);
diff --git a/pc/peerconnection.h b/pc/peerconnection.h
index f753955..4113746 100644
--- a/pc/peerconnection.h
+++ b/pc/peerconnection.h
@@ -247,11 +247,11 @@
return sctp_data_channels_;
}
- rtc::Optional<std::string> sctp_content_name() const override {
+ absl::optional<std::string> sctp_content_name() const override {
return sctp_mid_;
}
- rtc::Optional<std::string> sctp_transport_name() const override;
+ absl::optional<std::string> sctp_transport_name() const override;
cricket::CandidateStatsList GetPooledCandidateStats() const override;
std::map<std::string, std::string> GetTransportNamesByMid() const override;
@@ -516,9 +516,9 @@
const SessionDescriptionInterface* session_desc,
RtpTransceiverDirection audio_direction,
RtpTransceiverDirection video_direction,
- rtc::Optional<size_t>* audio_index,
- rtc::Optional<size_t>* video_index,
- rtc::Optional<size_t>* data_index,
+ absl::optional<size_t>* audio_index,
+ absl::optional<size_t>* video_index,
+ absl::optional<size_t>* data_index,
cricket::MediaSessionOptions* session_options);
// Generates the active MediaDescriptionOptions for the local data channel
@@ -534,7 +534,7 @@
// Returns the MID for the data section associated with either the
// RtpDataChannel or SCTP data channel, if it has been set. If no data
// channels are configured this will return nullopt.
- rtc::Optional<std::string> GetDataMid() const;
+ absl::optional<std::string> GetDataMid() const;
// Remove all local and remote senders of type |media_type|.
// Called when a media type is rejected (m-line set to port 0).
@@ -665,7 +665,7 @@
int candidate_pool_size,
bool prune_turn_ports,
webrtc::TurnCustomizer* turn_customizer,
- rtc::Optional<int> stun_candidate_keepalive_interval);
+ absl::optional<int> stun_candidate_keepalive_interval);
void SetMetricObserver_n(UMAObserver* observer);
@@ -976,7 +976,7 @@
std::unique_ptr<cricket::SctpTransportInternal> sctp_transport_;
// |sctp_mid_| is the content name (MID) in SDP.
- rtc::Optional<std::string> sctp_mid_;
+ absl::optional<std::string> sctp_mid_;
// Value cached on signaling thread. Only updated when SctpReadyToSendData
// fires on the signaling thread.
bool sctp_ready_to_send_data_ = false;
diff --git a/pc/peerconnection_datachannel_unittest.cc b/pc/peerconnection_datachannel_unittest.cc
index db6c656..224d0e9 100644
--- a/pc/peerconnection_datachannel_unittest.cc
+++ b/pc/peerconnection_datachannel_unittest.cc
@@ -66,11 +66,11 @@
sctp_transport_factory_ = sctp_transport_factory;
}
- rtc::Optional<std::string> sctp_content_name() {
+ absl::optional<std::string> sctp_content_name() {
return GetInternalPeerConnection()->sctp_content_name();
}
- rtc::Optional<std::string> sctp_transport_name() {
+ absl::optional<std::string> sctp_transport_name() {
return GetInternalPeerConnection()->sctp_transport_name();
}
diff --git a/pc/peerconnection_ice_unittest.cc b/pc/peerconnection_ice_unittest.cc
index 5cf6965..cf9f016 100644
--- a/pc/peerconnection_ice_unittest.cc
+++ b/pc/peerconnection_ice_unittest.cc
@@ -981,7 +981,7 @@
config.ice_candidate_pool_size = 1;
CreatePeerConnection(config);
ASSERT_NE(port_allocator_, nullptr);
- rtc::Optional<int> actual_stun_keepalive_interval =
+ absl::optional<int> actual_stun_keepalive_interval =
port_allocator_->stun_candidate_keepalive_interval();
EXPECT_EQ(actual_stun_keepalive_interval.value_or(-1), 123);
config.stun_candidate_keepalive_interval = 321;
diff --git a/pc/peerconnection_jsep_unittest.cc b/pc/peerconnection_jsep_unittest.cc
index b414241..3058238 100644
--- a/pc/peerconnection_jsep_unittest.cc
+++ b/pc/peerconnection_jsep_unittest.cc
@@ -304,7 +304,7 @@
auto transceivers = callee->pc()->GetTransceivers();
ASSERT_EQ(2u, transceivers.size());
- EXPECT_EQ(rtc::nullopt, transceivers[0]->mid());
+ EXPECT_EQ(absl::nullopt, transceivers[0]->mid());
EXPECT_EQ(caller_audio->mid(), transceivers[1]->mid());
}
@@ -322,7 +322,7 @@
auto transceivers = callee->pc()->GetTransceivers();
ASSERT_EQ(2u, transceivers.size());
- EXPECT_EQ(rtc::nullopt, transceivers[0]->mid());
+ EXPECT_EQ(absl::nullopt, transceivers[0]->mid());
EXPECT_EQ(caller->pc()->GetTransceivers()[0]->mid(), transceivers[1]->mid());
EXPECT_EQ(MediaStreamTrackInterface::kAudioKind,
transceivers[1]->receiver()->track()->kind());
@@ -341,7 +341,7 @@
auto transceivers = callee->pc()->GetTransceivers();
ASSERT_EQ(2u, transceivers.size());
- EXPECT_EQ(rtc::nullopt, transceivers[0]->mid());
+ EXPECT_EQ(absl::nullopt, transceivers[0]->mid());
EXPECT_EQ(caller->pc()->GetTransceivers()[0]->mid(), transceivers[1]->mid());
EXPECT_EQ(MediaStreamTrackInterface::kAudioKind,
transceivers[1]->receiver()->track()->kind());
@@ -360,7 +360,7 @@
auto transceivers = callee->pc()->GetTransceivers();
ASSERT_EQ(2u, transceivers.size());
- EXPECT_EQ(rtc::nullopt, transceivers[0]->mid());
+ EXPECT_EQ(absl::nullopt, transceivers[0]->mid());
EXPECT_TRUE(transceivers[0]->stopped());
EXPECT_EQ(caller->pc()->GetTransceivers()[0]->mid(), transceivers[1]->mid());
EXPECT_FALSE(transceivers[1]->stopped());
@@ -606,7 +606,7 @@
caller->SetRemoteDescription(callee->CreateAnswerAndSetAsLocal()));
EXPECT_TRUE(first_transceiver->stopped());
// First transceivers aren't dissociated yet.
- ASSERT_NE(rtc::nullopt, first_transceiver->mid());
+ ASSERT_NE(absl::nullopt, first_transceiver->mid());
std::string first_mid = *first_transceiver->mid();
EXPECT_EQ(first_mid, callee->pc()->GetTransceivers()[0]->mid());
@@ -625,10 +625,10 @@
// associate the new transceivers.
ASSERT_TRUE(
caller->SetLocalDescription(CloneSessionDescription(offer.get())));
- EXPECT_EQ(rtc::nullopt, first_transceiver->mid());
+ EXPECT_EQ(absl::nullopt, first_transceiver->mid());
EXPECT_EQ(second_mid, caller->pc()->GetTransceivers()[1]->mid());
ASSERT_TRUE(callee->SetRemoteDescription(std::move(offer)));
- EXPECT_EQ(rtc::nullopt, callee->pc()->GetTransceivers()[0]->mid());
+ EXPECT_EQ(absl::nullopt, callee->pc()->GetTransceivers()[0]->mid());
EXPECT_EQ(second_mid, callee->pc()->GetTransceivers()[1]->mid());
// The new answer should also recycle the m section correctly.
@@ -644,11 +644,11 @@
ASSERT_TRUE(caller->SetRemoteDescription(std::move(answer)));
auto caller_transceivers = caller->pc()->GetTransceivers();
ASSERT_EQ(2u, caller_transceivers.size());
- EXPECT_EQ(rtc::nullopt, caller_transceivers[0]->mid());
+ EXPECT_EQ(absl::nullopt, caller_transceivers[0]->mid());
EXPECT_EQ(second_mid, caller_transceivers[1]->mid());
auto callee_transceivers = callee->pc()->GetTransceivers();
ASSERT_EQ(2u, callee_transceivers.size());
- EXPECT_EQ(rtc::nullopt, callee_transceivers[0]->mid());
+ EXPECT_EQ(absl::nullopt, callee_transceivers[0]->mid());
EXPECT_EQ(second_mid, callee_transceivers[1]->mid());
}
@@ -687,7 +687,7 @@
// Make sure that the caller's transceivers are associated correctly.
auto caller_transceivers = caller->pc()->GetTransceivers();
ASSERT_EQ(2u, caller_transceivers.size());
- EXPECT_EQ(rtc::nullopt, caller_transceivers[0]->mid());
+ EXPECT_EQ(absl::nullopt, caller_transceivers[0]->mid());
EXPECT_EQ(second_mid, caller_transceivers[1]->mid());
EXPECT_FALSE(caller_transceivers[1]->stopped());
}
@@ -737,7 +737,7 @@
// the MID for the new transceiver.
ASSERT_TRUE(
caller->SetLocalDescription(CloneSessionDescription(offer.get())));
- EXPECT_EQ(rtc::nullopt, first_transceiver->mid());
+ EXPECT_EQ(absl::nullopt, first_transceiver->mid());
EXPECT_EQ(second_mid, second_transceiver->mid());
// Setting the remote offer will dissociate the previous transceiver and
@@ -745,7 +745,7 @@
ASSERT_TRUE(callee->SetRemoteDescription(std::move(offer)));
auto callee_transceivers = callee->pc()->GetTransceivers();
ASSERT_EQ(2u, callee_transceivers.size());
- EXPECT_EQ(rtc::nullopt, callee_transceivers[0]->mid());
+ EXPECT_EQ(absl::nullopt, callee_transceivers[0]->mid());
EXPECT_EQ(first_type_, callee_transceivers[0]->media_type());
EXPECT_EQ(second_mid, callee_transceivers[1]->mid());
EXPECT_EQ(second_type_, callee_transceivers[1]->media_type());
diff --git a/pc/peerconnection_rtp_unittest.cc b/pc/peerconnection_rtp_unittest.cc
index d3ae2cb..ca2d3b1 100644
--- a/pc/peerconnection_rtp_unittest.cc
+++ b/pc/peerconnection_rtp_unittest.cc
@@ -791,10 +791,10 @@
auto caller = CreatePeerConnection();
auto transceiver = caller->AddTransceiver(cricket::MEDIA_TYPE_AUDIO);
- EXPECT_EQ(rtc::nullopt, transceiver->mid());
+ EXPECT_EQ(absl::nullopt, transceiver->mid());
EXPECT_FALSE(transceiver->stopped());
EXPECT_EQ(RtpTransceiverDirection::kSendRecv, transceiver->direction());
- EXPECT_EQ(rtc::nullopt, transceiver->current_direction());
+ EXPECT_EQ(absl::nullopt, transceiver->current_direction());
}
// Test that adding a transceiver with the audio kind creates an audio sender
diff --git a/pc/peerconnectionendtoend_unittest.cc b/pc/peerconnectionendtoend_unittest.cc
index dae5a2e..7e0667f 100644
--- a/pc/peerconnectionendtoend_unittest.cc
+++ b/pc/peerconnectionendtoend_unittest.cc
@@ -270,7 +270,7 @@
.WillRepeatedly(
Invoke([real_decoder_factory](
const webrtc::SdpAudioFormat& format,
- rtc::Optional<webrtc::AudioCodecPairId> codec_pair_id,
+ absl::optional<webrtc::AudioCodecPairId> codec_pair_id,
std::unique_ptr<webrtc::AudioDecoder>* return_value) {
auto real_decoder =
real_decoder_factory->MakeAudioDecoder(format, codec_pair_id);
@@ -284,7 +284,7 @@
struct AudioEncoderUnicornSparklesRainbow {
using Config = webrtc::AudioEncoderL16::Config;
- static rtc::Optional<Config> SdpToConfig(webrtc::SdpAudioFormat format) {
+ static absl::optional<Config> SdpToConfig(webrtc::SdpAudioFormat format) {
if (STR_CASE_CMP(format.name.c_str(), "UnicornSparklesRainbow") == 0) {
const webrtc::SdpAudioFormat::Parameters expected_params = {
{"num_horns", "1"}};
@@ -293,7 +293,7 @@
format.name = "L16";
return webrtc::AudioEncoderL16::SdpToConfig(format);
} else {
- return rtc::nullopt;
+ return absl::nullopt;
}
}
static void AppendSupportedEncoders(
@@ -313,7 +313,7 @@
static std::unique_ptr<webrtc::AudioEncoder> MakeAudioEncoder(
const Config& config,
int payload_type,
- rtc::Optional<webrtc::AudioCodecPairId> codec_pair_id = rtc::nullopt) {
+ absl::optional<webrtc::AudioCodecPairId> codec_pair_id = absl::nullopt) {
return webrtc::AudioEncoderL16::MakeAudioEncoder(config, payload_type,
codec_pair_id);
}
@@ -321,7 +321,7 @@
struct AudioDecoderUnicornSparklesRainbow {
using Config = webrtc::AudioDecoderL16::Config;
- static rtc::Optional<Config> SdpToConfig(webrtc::SdpAudioFormat format) {
+ static absl::optional<Config> SdpToConfig(webrtc::SdpAudioFormat format) {
if (STR_CASE_CMP(format.name.c_str(), "UnicornSparklesRainbow") == 0) {
const webrtc::SdpAudioFormat::Parameters expected_params = {
{"num_horns", "1"}};
@@ -330,7 +330,7 @@
format.name = "L16";
return webrtc::AudioDecoderL16::SdpToConfig(format);
} else {
- return rtc::nullopt;
+ return absl::nullopt;
}
}
static void AppendSupportedDecoders(
@@ -346,7 +346,7 @@
}
static std::unique_ptr<webrtc::AudioDecoder> MakeAudioDecoder(
const Config& config,
- rtc::Optional<webrtc::AudioCodecPairId> codec_pair_id = rtc::nullopt) {
+ absl::optional<webrtc::AudioCodecPairId> codec_pair_id = absl::nullopt) {
return webrtc::AudioDecoderL16::MakeAudioDecoder(config, codec_pair_id);
}
};
@@ -392,14 +392,14 @@
std::vector<webrtc::AudioCodecSpec> GetSupportedEncoders() override {
return fact_->GetSupportedEncoders();
}
- rtc::Optional<webrtc::AudioCodecInfo> QueryAudioEncoder(
+ absl::optional<webrtc::AudioCodecInfo> QueryAudioEncoder(
const webrtc::SdpAudioFormat& format) override {
return fact_->QueryAudioEncoder(format);
}
std::unique_ptr<webrtc::AudioEncoder> MakeAudioEncoder(
int payload_type,
const webrtc::SdpAudioFormat& format,
- rtc::Optional<webrtc::AudioCodecPairId> codec_pair_id) override {
+ absl::optional<webrtc::AudioCodecPairId> codec_pair_id) override {
EXPECT_TRUE(codec_pair_id.has_value());
codec_ids_->push_back(*codec_pair_id);
return fact_->MakeAudioEncoder(payload_type, format, codec_pair_id);
@@ -424,7 +424,7 @@
}
std::unique_ptr<webrtc::AudioDecoder> MakeAudioDecoder(
const webrtc::SdpAudioFormat& format,
- rtc::Optional<webrtc::AudioCodecPairId> codec_pair_id) override {
+ absl::optional<webrtc::AudioCodecPairId> codec_pair_id) override {
EXPECT_TRUE(codec_pair_id.has_value());
codec_ids_->push_back(*codec_pair_id);
return fact_->MakeAudioDecoder(format, codec_pair_id);
diff --git a/pc/peerconnectioninterface_unittest.cc b/pc/peerconnectioninterface_unittest.cc
index 5248d51..938e5b2 100644
--- a/pc/peerconnectioninterface_unittest.cc
+++ b/pc/peerconnectioninterface_unittest.cc
@@ -2487,7 +2487,7 @@
// require a very complex set of mocks.
TEST_P(PeerConnectionInterfaceTest, SetConfigurationChangesIceCheckInterval) {
PeerConnectionInterface::RTCConfiguration config;
- config.ice_check_min_interval = rtc::nullopt;
+ config.ice_check_min_interval = absl::nullopt;
CreatePeerConnection(config, nullptr);
config = pc_->GetConfiguration();
config.ice_check_min_interval = 100;
diff --git a/pc/peerconnectioninternal.h b/pc/peerconnectioninternal.h
index f0267a7..8a16954 100644
--- a/pc/peerconnectioninternal.h
+++ b/pc/peerconnectioninternal.h
@@ -53,8 +53,8 @@
virtual std::vector<rtc::scoped_refptr<DataChannel>> sctp_data_channels()
const = 0;
- virtual rtc::Optional<std::string> sctp_content_name() const = 0;
- virtual rtc::Optional<std::string> sctp_transport_name() const = 0;
+ virtual absl::optional<std::string> sctp_content_name() const = 0;
+ virtual absl::optional<std::string> sctp_transport_name() const = 0;
virtual cricket::CandidateStatsList GetPooledCandidateStats() const = 0;
diff --git a/pc/rtcstatscollector.h b/pc/rtcstatscollector.h
index bad281f..43d5653 100644
--- a/pc/rtcstatscollector.h
+++ b/pc/rtcstatscollector.h
@@ -17,7 +17,7 @@
#include <string>
#include <vector>
-#include "api/optional.h"
+#include "absl/types/optional.h"
#include "api/stats/rtcstats_objects.h"
#include "api/stats/rtcstatscollectorcallback.h"
#include "api/stats/rtcstatsreport.h"
@@ -145,8 +145,8 @@
struct RtpTransceiverStatsInfo {
rtc::scoped_refptr<RtpTransceiver> transceiver;
cricket::MediaType media_type;
- rtc::Optional<std::string> mid;
- rtc::Optional<std::string> transport_name;
+ absl::optional<std::string> mid;
+ absl::optional<std::string> transport_name;
std::unique_ptr<TrackMediaInfoMap> track_media_info_map;
};
diff --git a/pc/rtcstatscollector_unittest.cc b/pc/rtcstatscollector_unittest.cc
index 99bb88c..0c4bc03 100644
--- a/pc/rtcstatscollector_unittest.cc
+++ b/pc/rtcstatscollector_unittest.cc
@@ -1096,7 +1096,7 @@
connection_info.sent_total_bytes = 42;
connection_info.recv_total_bytes = 1234;
connection_info.total_round_trip_time_ms = 0;
- connection_info.current_round_trip_time_ms = rtc::nullopt;
+ connection_info.current_round_trip_time_ms = absl::nullopt;
connection_info.recv_ping_requests = 2020;
connection_info.sent_ping_requests_total = 2020;
connection_info.sent_ping_requests_before_first_response = 2000;
@@ -1638,7 +1638,7 @@
video_media_info.receivers[0].plis_sent = 6;
video_media_info.receivers[0].nacks_sent = 7;
video_media_info.receivers[0].frames_decoded = 8;
- video_media_info.receivers[0].qp_sum = rtc::nullopt;
+ video_media_info.receivers[0].qp_sum = absl::nullopt;
RtpCodecParameters codec_parameters;
codec_parameters.payload_type = 42;
@@ -1757,7 +1757,7 @@
video_media_info.senders[0].bytes_sent = 6;
video_media_info.senders[0].codec_payload_type = 42;
video_media_info.senders[0].frames_encoded = 8;
- video_media_info.senders[0].qp_sum = rtc::nullopt;
+ video_media_info.senders[0].qp_sum = absl::nullopt;
RtpCodecParameters codec_parameters;
codec_parameters.payload_type = 42;
diff --git a/pc/rtpreceiver.h b/pc/rtpreceiver.h
index 4d6457f..964a8f5 100644
--- a/pc/rtpreceiver.h
+++ b/pc/rtpreceiver.h
@@ -137,7 +137,7 @@
const rtc::scoped_refptr<RemoteAudioSource> source_;
const rtc::scoped_refptr<AudioTrackInterface> track_;
cricket::VoiceMediaChannel* media_channel_ = nullptr;
- rtc::Optional<uint32_t> ssrc_;
+ absl::optional<uint32_t> ssrc_;
std::vector<rtc::scoped_refptr<MediaStreamInterface>> streams_;
bool cached_track_enabled_;
double cached_volume_ = 1;
@@ -223,7 +223,7 @@
rtc::Thread* const worker_thread_;
const std::string id_;
cricket::VideoMediaChannel* media_channel_ = nullptr;
- rtc::Optional<uint32_t> ssrc_;
+ absl::optional<uint32_t> ssrc_;
// |source_| is held here to be able to change the state of the source when
// the VideoRtpReceiver is stopped.
rtc::scoped_refptr<VideoRtpTrackSource> source_;
diff --git a/pc/rtpsender.h b/pc/rtpsender.h
index 62b8b59..d1d278b 100644
--- a/pc/rtpsender.h
+++ b/pc/rtpsender.h
@@ -171,7 +171,7 @@
StatsCollector* stats_;
rtc::scoped_refptr<AudioTrackInterface> track_;
rtc::scoped_refptr<DtmfSenderInterface> dtmf_sender_proxy_;
- rtc::Optional<std::string> last_transaction_id_;
+ absl::optional<std::string> last_transaction_id_;
uint32_t ssrc_ = 0;
bool cached_track_enabled_ = false;
bool stopped_ = false;
@@ -253,7 +253,7 @@
std::vector<std::string> stream_ids_;
cricket::VideoMediaChannel* media_channel_ = nullptr;
rtc::scoped_refptr<VideoTrackInterface> track_;
- rtc::Optional<std::string> last_transaction_id_;
+ absl::optional<std::string> last_transaction_id_;
uint32_t ssrc_ = 0;
VideoTrackInterface::ContentHint cached_track_content_hint_ =
VideoTrackInterface::ContentHint::kNone;
diff --git a/pc/rtpsenderreceiver_unittest.cc b/pc/rtpsenderreceiver_unittest.cc
index 1575e96..99e624d 100644
--- a/pc/rtpsenderreceiver_unittest.cc
+++ b/pc/rtpsenderreceiver_unittest.cc
@@ -1101,7 +1101,7 @@
video_track_->set_enabled(true);
// Sender is not ready to send (no SSRC) so no option should have been set.
- EXPECT_EQ(rtc::nullopt, video_media_channel_->options().is_screencast);
+ EXPECT_EQ(absl::nullopt, video_media_channel_->options().is_screencast);
// Verify that the content hint is accounted for when video_rtp_sender_ does
// get enabled.
diff --git a/pc/rtptransceiver.cc b/pc/rtptransceiver.cc
index 37770b5..0114785 100644
--- a/pc/rtptransceiver.cc
+++ b/pc/rtptransceiver.cc
@@ -148,7 +148,7 @@
return media_type_;
}
-rtc::Optional<std::string> RtpTransceiver::mid() const {
+absl::optional<std::string> RtpTransceiver::mid() const {
return mid_;
}
@@ -203,7 +203,7 @@
SignalNegotiationNeeded();
}
-rtc::Optional<RtpTransceiverDirection> RtpTransceiver::current_direction()
+absl::optional<RtpTransceiverDirection> RtpTransceiver::current_direction()
const {
return current_direction_;
}
@@ -216,7 +216,7 @@
receiver->internal()->Stop();
}
stopped_ = true;
- current_direction_ = rtc::nullopt;
+ current_direction_ = absl::nullopt;
}
void RtpTransceiver::SetCodecPreferences(
diff --git a/pc/rtptransceiver.h b/pc/rtptransceiver.h
index 3cefda2..7656995 100644
--- a/pc/rtptransceiver.h
+++ b/pc/rtptransceiver.h
@@ -119,15 +119,15 @@
// when setting a local offer we need a way to remember which transceiver was
// used to create which media section in the offer. Storing the mline index
// in CreateOffer is specified in JSEP to allow us to do that.
- rtc::Optional<size_t> mline_index() const { return mline_index_; }
- void set_mline_index(rtc::Optional<size_t> mline_index) {
+ absl::optional<size_t> mline_index() const { return mline_index_; }
+ void set_mline_index(absl::optional<size_t> mline_index) {
mline_index_ = mline_index;
}
// Sets the MID for this transceiver. If the MID is not null, then the
// transceiver is considered "associated" with the media section that has the
// same MID.
- void set_mid(const rtc::Optional<std::string>& mid) { mid_ = mid; }
+ void set_mid(const absl::optional<std::string>& mid) { mid_ = mid; }
// Sets the intended direction for this transceiver. Intended to be used
// internally over SetDirection since this does not trigger a negotiation
@@ -160,13 +160,13 @@
// RtpTransceiverInterface implementation.
cricket::MediaType media_type() const override;
- rtc::Optional<std::string> mid() const override;
+ absl::optional<std::string> mid() const override;
rtc::scoped_refptr<RtpSenderInterface> sender() const override;
rtc::scoped_refptr<RtpReceiverInterface> receiver() const override;
bool stopped() const override;
RtpTransceiverDirection direction() const override;
void SetDirection(RtpTransceiverDirection new_direction) override;
- rtc::Optional<RtpTransceiverDirection> current_direction() const override;
+ absl::optional<RtpTransceiverDirection> current_direction() const override;
void Stop() override;
void SetCodecPreferences(rtc::ArrayView<RtpCodecCapability> codecs) override;
@@ -183,9 +183,9 @@
bool stopped_ = false;
RtpTransceiverDirection direction_ = RtpTransceiverDirection::kInactive;
- rtc::Optional<RtpTransceiverDirection> current_direction_;
- rtc::Optional<std::string> mid_;
- rtc::Optional<size_t> mline_index_;
+ absl::optional<RtpTransceiverDirection> current_direction_;
+ absl::optional<std::string> mid_;
+ absl::optional<size_t> mline_index_;
bool created_by_addtrack_ = false;
bool has_ever_been_used_to_send_ = false;
@@ -195,13 +195,13 @@
BEGIN_SIGNALING_PROXY_MAP(RtpTransceiver)
PROXY_SIGNALING_THREAD_DESTRUCTOR()
PROXY_CONSTMETHOD0(cricket::MediaType, media_type);
-PROXY_CONSTMETHOD0(rtc::Optional<std::string>, mid);
+PROXY_CONSTMETHOD0(absl::optional<std::string>, mid);
PROXY_CONSTMETHOD0(rtc::scoped_refptr<RtpSenderInterface>, sender);
PROXY_CONSTMETHOD0(rtc::scoped_refptr<RtpReceiverInterface>, receiver);
PROXY_CONSTMETHOD0(bool, stopped);
PROXY_CONSTMETHOD0(RtpTransceiverDirection, direction);
PROXY_METHOD1(void, SetDirection, RtpTransceiverDirection);
-PROXY_CONSTMETHOD0(rtc::Optional<RtpTransceiverDirection>, current_direction);
+PROXY_CONSTMETHOD0(absl::optional<RtpTransceiverDirection>, current_direction);
PROXY_METHOD0(void, Stop);
PROXY_METHOD1(void, SetCodecPreferences, rtc::ArrayView<RtpCodecCapability>);
END_PROXY_MAP();
diff --git a/pc/rtptransport.cc b/pc/rtptransport.cc
index 366d6e2..9e994e9 100644
--- a/pc/rtptransport.cc
+++ b/pc/rtptransport.cc
@@ -39,7 +39,7 @@
rtp_packet_transport_->SignalWritableState.disconnect(this);
rtp_packet_transport_->SignalSentPacket.disconnect(this);
// Reset the network route of the old transport.
- SignalNetworkRouteChanged(rtc::Optional<rtc::NetworkRoute>());
+ SignalNetworkRouteChanged(absl::optional<rtc::NetworkRoute>());
}
if (new_packet_transport) {
new_packet_transport->SignalReadyToSend.connect(
@@ -75,7 +75,7 @@
rtcp_packet_transport_->SignalWritableState.disconnect(this);
rtcp_packet_transport_->SignalSentPacket.disconnect(this);
// Reset the network route of the old transport.
- SignalNetworkRouteChanged(rtc::Optional<rtc::NetworkRoute>());
+ SignalNetworkRouteChanged(absl::optional<rtc::NetworkRoute>());
}
if (new_packet_transport) {
new_packet_transport->SignalReadyToSend.connect(
@@ -217,7 +217,7 @@
}
void RtpTransport::OnNetworkRouteChanged(
- rtc::Optional<rtc::NetworkRoute> network_route) {
+ absl::optional<rtc::NetworkRoute> network_route) {
SignalNetworkRouteChanged(network_route);
}
diff --git a/pc/rtptransport.h b/pc/rtptransport.h
index 6620095..0044615 100644
--- a/pc/rtptransport.h
+++ b/pc/rtptransport.h
@@ -100,7 +100,7 @@
// Overridden by SrtpTransport.
virtual void OnNetworkRouteChanged(
- rtc::Optional<rtc::NetworkRoute> network_route);
+ absl::optional<rtc::NetworkRoute> network_route);
virtual void OnRtpPacketReceived(rtc::CopyOnWriteBuffer* packet,
const rtc::PacketTime& packet_time);
virtual void OnRtcpPacketReceived(rtc::CopyOnWriteBuffer* packet,
diff --git a/pc/rtptransport_unittest.cc b/pc/rtptransport_unittest.cc
index 97ea2e4..7e4eb84 100644
--- a/pc/rtptransport_unittest.cc
+++ b/pc/rtptransport_unittest.cc
@@ -78,8 +78,8 @@
bool ready() const { return ready_; }
void OnReadyToSend(bool ready) { ready_ = ready; }
- rtc::Optional<rtc::NetworkRoute> network_route() { return network_route_; }
- void OnNetworkRouteChanged(rtc::Optional<rtc::NetworkRoute> network_route) {
+ absl::optional<rtc::NetworkRoute> network_route() { return network_route_; }
+ void OnNetworkRouteChanged(absl::optional<rtc::NetworkRoute> network_route) {
network_route_ = std::move(network_route);
}
@@ -102,7 +102,7 @@
int rtcp_transport_sent_count_ = 0;
RtpTransport* transport_ = nullptr;
bool ready_ = false;
- rtc::Optional<rtc::NetworkRoute> network_route_;
+ absl::optional<rtc::NetworkRoute> network_route_;
};
TEST(RtpTransportTest, SettingRtcpAndRtpSignalsReady) {
@@ -184,7 +184,7 @@
network_route.remote_network_id = kRemoteNetId;
network_route.last_sent_packet_id = kLastPacketId;
network_route.packet_overhead = kTransportOverheadPerPacket;
- fake_rtp.SetNetworkRoute(rtc::Optional<rtc::NetworkRoute>(network_route));
+ fake_rtp.SetNetworkRoute(absl::optional<rtc::NetworkRoute>(network_route));
transport.SetRtpPacketTransport(&fake_rtp);
ASSERT_TRUE(observer.network_route());
EXPECT_EQ(network_route, *(observer.network_route()));
@@ -211,7 +211,7 @@
network_route.remote_network_id = kRemoteNetId;
network_route.last_sent_packet_id = kLastPacketId;
network_route.packet_overhead = kTransportOverheadPerPacket;
- fake_rtcp.SetNetworkRoute(rtc::Optional<rtc::NetworkRoute>(network_route));
+ fake_rtcp.SetNetworkRoute(absl::optional<rtc::NetworkRoute>(network_route));
transport.SetRtcpPacketTransport(&fake_rtcp);
ASSERT_TRUE(observer.network_route());
EXPECT_EQ(network_route, *(observer.network_route()));
diff --git a/pc/rtptransportinternal.h b/pc/rtptransportinternal.h
index 7845d42..0ecaa1a 100644
--- a/pc/rtptransportinternal.h
+++ b/pc/rtptransportinternal.h
@@ -65,7 +65,7 @@
// Called whenever the network route of the P2P layer transport changes.
// The argument is an optional network route.
- sigslot::signal1<rtc::Optional<rtc::NetworkRoute>> SignalNetworkRouteChanged;
+ sigslot::signal1<absl::optional<rtc::NetworkRoute>> SignalNetworkRouteChanged;
// Called whenever a transport's writable state might change. The argument is
// true if the transport is writable, otherwise it is false.
diff --git a/pc/srtpfilter.cc b/pc/srtpfilter.cc
index a561d36..91142a5 100644
--- a/pc/srtpfilter.cc
+++ b/pc/srtpfilter.cc
@@ -186,8 +186,8 @@
offer_params_.clear();
applied_send_params_ = CryptoParams();
applied_recv_params_ = CryptoParams();
- send_cipher_suite_ = rtc::nullopt;
- recv_cipher_suite_ = rtc::nullopt;
+ send_cipher_suite_ = absl::nullopt;
+ recv_cipher_suite_ = absl::nullopt;
send_key_.Clear();
recv_key_.Clear();
state_ = ST_INIT;
diff --git a/pc/srtpfilter.h b/pc/srtpfilter.h
index e51d9fe..a4dd54f 100644
--- a/pc/srtpfilter.h
+++ b/pc/srtpfilter.h
@@ -17,10 +17,10 @@
#include <string>
#include <vector>
+#include "absl/types/optional.h"
#include "api/array_view.h"
#include "api/cryptoparams.h"
#include "api/jsep.h"
-#include "api/optional.h"
#include "pc/sessiondescription.h"
#include "rtc_base/buffer.h"
#include "rtc_base/constructormagic.h"
@@ -78,8 +78,8 @@
bool ResetParams();
- rtc::Optional<int> send_cipher_suite() { return send_cipher_suite_; }
- rtc::Optional<int> recv_cipher_suite() { return recv_cipher_suite_; }
+ absl::optional<int> send_cipher_suite() { return send_cipher_suite_; }
+ absl::optional<int> recv_cipher_suite() { return recv_cipher_suite_; }
rtc::ArrayView<const uint8_t> send_key() { return send_key_; }
rtc::ArrayView<const uint8_t> recv_key() { return recv_key_; }
@@ -135,8 +135,8 @@
std::vector<CryptoParams> offer_params_;
CryptoParams applied_send_params_;
CryptoParams applied_recv_params_;
- rtc::Optional<int> send_cipher_suite_;
- rtc::Optional<int> recv_cipher_suite_;
+ absl::optional<int> send_cipher_suite_;
+ absl::optional<int> recv_cipher_suite_;
rtc::ZeroOnFreeBuffer<uint8_t> send_key_;
rtc::ZeroOnFreeBuffer<uint8_t> recv_key_;
};
diff --git a/pc/srtptransport.cc b/pc/srtptransport.cc
index 1fe0cc8..a1c1a8a 100644
--- a/pc/srtptransport.cc
+++ b/pc/srtptransport.cc
@@ -237,7 +237,7 @@
}
void SrtpTransport::OnNetworkRouteChanged(
- rtc::Optional<rtc::NetworkRoute> network_route) {
+ absl::optional<rtc::NetworkRoute> network_route) {
// Only append the SRTP overhead when there is a selected network route.
if (network_route) {
int srtp_overhead = 0;
diff --git a/pc/srtptransport.h b/pc/srtptransport.h
index 3266e54..157392f 100644
--- a/pc/srtptransport.h
+++ b/pc/srtptransport.h
@@ -117,7 +117,7 @@
void OnRtcpPacketReceived(rtc::CopyOnWriteBuffer* packet,
const rtc::PacketTime& packet_time) override;
void OnNetworkRouteChanged(
- rtc::Optional<rtc::NetworkRoute> network_route) override;
+ absl::optional<rtc::NetworkRoute> network_route) override;
// Override the RtpTransport::OnWritableState.
void OnWritableState(rtc::PacketTransportInternal* packet_transport) override;
@@ -151,10 +151,10 @@
std::unique_ptr<cricket::SrtpSession> send_rtcp_session_;
std::unique_ptr<cricket::SrtpSession> recv_rtcp_session_;
- rtc::Optional<cricket::CryptoParams> send_params_;
- rtc::Optional<cricket::CryptoParams> recv_params_;
- rtc::Optional<int> send_cipher_suite_;
- rtc::Optional<int> recv_cipher_suite_;
+ absl::optional<cricket::CryptoParams> send_params_;
+ absl::optional<cricket::CryptoParams> recv_params_;
+ absl::optional<int> send_cipher_suite_;
+ absl::optional<int> recv_cipher_suite_;
rtc::ZeroOnFreeBuffer<uint8_t> send_key_;
rtc::ZeroOnFreeBuffer<uint8_t> recv_key_;
diff --git a/pc/test/fakepeerconnectionbase.h b/pc/test/fakepeerconnectionbase.h
index 203ab0f..d6b6118 100644
--- a/pc/test/fakepeerconnectionbase.h
+++ b/pc/test/fakepeerconnectionbase.h
@@ -266,12 +266,12 @@
return {};
}
- rtc::Optional<std::string> sctp_content_name() const override {
- return rtc::nullopt;
+ absl::optional<std::string> sctp_content_name() const override {
+ return absl::nullopt;
}
- rtc::Optional<std::string> sctp_transport_name() const override {
- return rtc::nullopt;
+ absl::optional<std::string> sctp_transport_name() const override {
+ return absl::nullopt;
}
std::map<std::string, std::string> GetTransportNamesByMid() const override {
diff --git a/pc/test/fakepeerconnectionforstats.h b/pc/test/fakepeerconnectionforstats.h
index 733291f..c8cc29b 100644
--- a/pc/test/fakepeerconnectionforstats.h
+++ b/pc/test/fakepeerconnectionforstats.h
@@ -45,7 +45,7 @@
}
private:
- rtc::Optional<cricket::VoiceMediaInfo> stats_;
+ absl::optional<cricket::VoiceMediaInfo> stats_;
};
// Fake VideoMediaChannel where the result of GetStats can be configured.
@@ -68,7 +68,7 @@
}
private:
- rtc::Optional<cricket::VideoMediaInfo> stats_;
+ absl::optional<cricket::VideoMediaInfo> stats_;
};
constexpr bool kDefaultRtcpMuxRequired = true;
diff --git a/pc/test/fakertccertificategenerator.h b/pc/test/fakertccertificategenerator.h
index bb56f3e..a3e7654 100644
--- a/pc/test/fakertccertificategenerator.h
+++ b/pc/test/fakertccertificategenerator.h
@@ -140,7 +140,7 @@
void GenerateCertificateAsync(
const rtc::KeyParams& key_params,
- const rtc::Optional<uint64_t>& expires_ms,
+ const absl::optional<uint64_t>& expires_ms,
const rtc::scoped_refptr<rtc::RTCCertificateGeneratorCallback>& callback)
override {
// The certificates are created from constant PEM strings and use its coded
diff --git a/pc/test/fakesctptransport.h b/pc/test/fakesctptransport.h
index 002caa6..294376d 100644
--- a/pc/test/fakesctptransport.h
+++ b/pc/test/fakesctptransport.h
@@ -40,8 +40,8 @@
int remote_port() const { return *remote_port_; }
private:
- rtc::Optional<int> local_port_;
- rtc::Optional<int> remote_port_;
+ absl::optional<int> local_port_;
+ absl::optional<int> remote_port_;
};
class FakeSctpTransportFactory : public cricket::SctpTransportInternalFactory {
diff --git a/pc/test/mockpeerconnectionobservers.h b/pc/test/mockpeerconnectionobservers.h
index 71c1523..e864706 100644
--- a/pc/test/mockpeerconnectionobservers.h
+++ b/pc/test/mockpeerconnectionobservers.h
@@ -293,7 +293,7 @@
private:
// Set on complete, on success this is set to an RTCError::OK() error.
- rtc::Optional<RTCError> error_;
+ absl::optional<RTCError> error_;
};
class MockDataChannelObserver : public webrtc::DataChannelObserver {
diff --git a/pc/trackmediainfomap.cc b/pc/trackmediainfomap.cc
index 5450cee..b5abb7e 100644
--- a/pc/trackmediainfomap.cc
+++ b/pc/trackmediainfomap.cc
@@ -266,11 +266,11 @@
return FindValueOrNull(video_track_by_receiver_info_, &video_receiver_info);
}
-rtc::Optional<int> TrackMediaInfoMap::GetAttachmentIdByTrack(
+absl::optional<int> TrackMediaInfoMap::GetAttachmentIdByTrack(
const MediaStreamTrackInterface* track) const {
auto it = attachment_id_by_track_.find(track);
- return it != attachment_id_by_track_.end() ? rtc::Optional<int>(it->second)
- : rtc::nullopt;
+ return it != attachment_id_by_track_.end() ? absl::optional<int>(it->second)
+ : absl::nullopt;
}
} // namespace webrtc
diff --git a/pc/trackmediainfomap.h b/pc/trackmediainfomap.h
index d603626..fa1f7e7 100644
--- a/pc/trackmediainfomap.h
+++ b/pc/trackmediainfomap.h
@@ -79,12 +79,12 @@
// It is not going to work if a track is attached multiple times, and
// it is not going to work if a received track is attached as a sending
// track (loopback).
- rtc::Optional<int> GetAttachmentIdByTrack(
+ absl::optional<int> GetAttachmentIdByTrack(
const MediaStreamTrackInterface* track) const;
private:
- rtc::Optional<std::string> voice_mid_;
- rtc::Optional<std::string> video_mid_;
+ absl::optional<std::string> voice_mid_;
+ absl::optional<std::string> video_mid_;
std::unique_ptr<cricket::VoiceMediaInfo> voice_media_info_;
std::unique_ptr<cricket::VideoMediaInfo> video_media_info_;
// These maps map tracks (identified by a pointer) to their corresponding info
diff --git a/pc/trackmediainfomap_unittest.cc b/pc/trackmediainfomap_unittest.cc
index c135564..1b320d0 100644
--- a/pc/trackmediainfomap_unittest.cc
+++ b/pc/trackmediainfomap_unittest.cc
@@ -408,7 +408,7 @@
CreateMap();
EXPECT_EQ(rtp_senders_[0]->AttachmentId(),
map_->GetAttachmentIdByTrack(local_audio_track_));
- EXPECT_EQ(rtc::nullopt, map_->GetAttachmentIdByTrack(local_video_track_));
+ EXPECT_EQ(absl::nullopt, map_->GetAttachmentIdByTrack(local_video_track_));
}
// Death tests.
diff --git a/pc/videocapturertracksource.cc b/pc/videocapturertracksource.cc
index d90ba51..0767dcf 100644
--- a/pc/videocapturertracksource.cc
+++ b/pc/videocapturertracksource.cc
@@ -242,7 +242,7 @@
// Return false if the key is mandatory, and the value is invalid.
bool ExtractOption(const MediaConstraintsInterface* all_constraints,
const std::string& key,
- rtc::Optional<bool>* option) {
+ absl::optional<bool>* option) {
size_t mandatory = 0;
bool value;
if (FindConstraint(all_constraints, key, &value, &mandatory)) {
diff --git a/pc/videocapturertracksource.h b/pc/videocapturertracksource.h
index 5854944..9039aa3 100644
--- a/pc/videocapturertracksource.h
+++ b/pc/videocapturertracksource.h
@@ -48,7 +48,9 @@
bool remote);
bool is_screencast() const final { return video_capturer_->IsScreencast(); }
- rtc::Optional<bool> needs_denoising() const final { return needs_denoising_; }
+ absl::optional<bool> needs_denoising() const final {
+ return needs_denoising_;
+ }
bool GetStats(Stats* stats) final;
@@ -76,7 +78,7 @@
std::unique_ptr<cricket::VideoCapturer> video_capturer_;
bool started_;
cricket::VideoFormat format_;
- rtc::Optional<bool> needs_denoising_;
+ absl::optional<bool> needs_denoising_;
};
} // namespace webrtc
diff --git a/pc/videocapturertracksource_unittest.cc b/pc/videocapturertracksource_unittest.cc
index 34d11b5..1ddfc6f 100644
--- a/pc/videocapturertracksource_unittest.cc
+++ b/pc/videocapturertracksource_unittest.cc
@@ -322,7 +322,7 @@
TEST_F(VideoCapturerTrackSourceTest, NoiseReductionConstraintNotSet) {
FakeConstraints constraints;
CreateVideoCapturerSource(&constraints);
- EXPECT_EQ(rtc::nullopt, source_->needs_denoising());
+ EXPECT_EQ(absl::nullopt, source_->needs_denoising());
}
TEST_F(VideoCapturerTrackSourceTest,
@@ -357,7 +357,7 @@
EXPECT_EQ_WAIT(MediaSourceInterface::kEnded, state_observer_->state(),
kMaxWaitMs);
- EXPECT_EQ(rtc::nullopt, source_->needs_denoising());
+ EXPECT_EQ(absl::nullopt, source_->needs_denoising());
}
TEST_F(VideoCapturerTrackSourceTest, InvalidDenoisingValueOptional) {
@@ -370,12 +370,13 @@
EXPECT_EQ_WAIT(MediaSourceInterface::kLive, state_observer_->state(),
kMaxWaitMs);
- EXPECT_EQ(rtc::nullopt, source_->needs_denoising());
+ EXPECT_EQ(absl::nullopt, source_->needs_denoising());
}
TEST_F(VideoCapturerTrackSourceTest, InvalidDenoisingValueMandatory) {
FakeConstraints constraints;
- // Optional constraints should be ignored if the mandatory constraints fail.
+ // absl::optional constraints should be ignored if the mandatory constraints
+ // fail.
constraints.AddOptional(MediaConstraintsInterface::kNoiseReduction, "false");
// Values are case-sensitive and must be all lower-case.
constraints.AddMandatory(MediaConstraintsInterface::kNoiseReduction, "True");
@@ -384,7 +385,7 @@
EXPECT_EQ_WAIT(MediaSourceInterface::kEnded, state_observer_->state(),
kMaxWaitMs);
- EXPECT_EQ(rtc::nullopt, source_->needs_denoising());
+ EXPECT_EQ(absl::nullopt, source_->needs_denoising());
}
TEST_F(VideoCapturerTrackSourceTest, MixedOptionsAndConstraints) {
diff --git a/pc/videotracksource.h b/pc/videotracksource.h
index fb6c7be..50488dd 100644
--- a/pc/videotracksource.h
+++ b/pc/videotracksource.h
@@ -30,7 +30,9 @@
bool remote() const override { return remote_; }
bool is_screencast() const override { return false; }
- rtc::Optional<bool> needs_denoising() const override { return rtc::nullopt; }
+ absl::optional<bool> needs_denoising() const override {
+ return absl::nullopt;
+ }
bool GetStats(Stats* stats) override { return false; }
diff --git a/pc/webrtcsdp.cc b/pc/webrtcsdp.cc
index 4bfb9ef..d068470 100644
--- a/pc/webrtcsdp.cc
+++ b/pc/webrtcsdp.cc
@@ -2032,7 +2032,7 @@
std::string(), error);
}
- // Optional lines
+ // absl::optional lines
// Those are the optional lines, so shouldn't return false if not present.
// RFC 4566
// i=* (session information)
diff --git a/pc/webrtcsessiondescriptionfactory.cc b/pc/webrtcsessiondescriptionfactory.cc
index 4a6221f..3d89932 100644
--- a/pc/webrtcsessiondescriptionfactory.cc
+++ b/pc/webrtcsessiondescriptionfactory.cc
@@ -175,7 +175,7 @@
// Request certificate. This happens asynchronously, so that the caller gets
// a chance to connect to |SignalCertificateReady|.
- cert_generator_->GenerateCertificateAsync(key_params, rtc::nullopt,
+ cert_generator_->GenerateCertificateAsync(key_params, absl::nullopt,
callback);
}
}