Optional: Use nullopt and implicit construction in /modules/rtp_rtcp
Changes places where we explicitly construct an Optional to instead use nullopt or the requisite value type only. This CL was uploaded by git cl split. R=danilchap@webrtc.org Bug: None Change-Id: Ib4694d183f04d675f2ea66d39661fdffb2a984f1 Reviewed-on: https://webrtc-review.googlesource.com/23604 Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> Commit-Queue: Oskar Sundbom <ossu@webrtc.org> Cr-Commit-Position: refs/heads/master@{#20846}
This commit is contained in:

committed by
Commit Bot

parent
057ce1de45
commit
3419cf909e
@ -56,7 +56,7 @@ bool ExtendedReports::Parse(const CommonHeader& packet) {
|
||||
rrtr_block_.reset();
|
||||
dlrr_block_.ClearItems();
|
||||
voip_metric_block_.reset();
|
||||
target_bitrate_ = rtc::Optional<TargetBitrate>();
|
||||
target_bitrate_ = rtc::nullopt;
|
||||
|
||||
const uint8_t* current_block = packet.payload() + kXrBaseLength;
|
||||
const uint8_t* const packet_end =
|
||||
@ -118,7 +118,7 @@ void ExtendedReports::SetTargetBitrate(const TargetBitrate& bitrate) {
|
||||
if (target_bitrate_)
|
||||
RTC_LOG(LS_WARNING) << "TargetBitrate already set, overwriting.";
|
||||
|
||||
target_bitrate_ = rtc::Optional<TargetBitrate>(bitrate);
|
||||
target_bitrate_ = bitrate;
|
||||
}
|
||||
|
||||
size_t ExtendedReports::BlockLength() const {
|
||||
|
@ -312,7 +312,7 @@ rtc::Optional<RtpUtility::Payload> RTPPayloadRegistry::PayloadTypeToPayload(
|
||||
rtc::CritScope cs(&crit_sect_);
|
||||
const auto it = payload_type_map_.find(payload_type);
|
||||
return it == payload_type_map_.end()
|
||||
? rtc::Optional<RtpUtility::Payload>()
|
||||
? rtc::nullopt
|
||||
: rtc::Optional<RtpUtility::Payload>(it->second);
|
||||
}
|
||||
|
||||
|
@ -191,7 +191,7 @@ bool RtpReceiverImpl::IncomingRtpPacket(const RTPHeader& rtp_header,
|
||||
auto audio_level =
|
||||
rtp_header.extension.hasAudioLevel
|
||||
? rtc::Optional<uint8_t>(rtp_header.extension.audioLevel)
|
||||
: rtc::Optional<uint8_t>();
|
||||
: rtc::nullopt;
|
||||
UpdateSources(audio_level);
|
||||
|
||||
int32_t ret_val = rtp_media_receiver_->ParseRtpPacket(
|
||||
|
@ -267,7 +267,7 @@ void ModuleRtpRtcpImpl::SetRtxSendPayloadType(int payload_type,
|
||||
rtc::Optional<uint32_t> ModuleRtpRtcpImpl::FlexfecSsrc() const {
|
||||
if (rtp_sender_)
|
||||
return rtp_sender_->FlexfecSsrc();
|
||||
return rtc::Optional<uint32_t>();
|
||||
return rtc::nullopt;
|
||||
}
|
||||
|
||||
void ModuleRtpRtcpImpl::IncomingRtcpPacket(const uint8_t* rtcp_packet,
|
||||
|
@ -1118,7 +1118,7 @@ rtc::Optional<uint32_t> RTPSender::FlexfecSsrc() const {
|
||||
if (video_) {
|
||||
return video_->FlexfecSsrc();
|
||||
}
|
||||
return rtc::Optional<uint32_t>();
|
||||
return rtc::nullopt;
|
||||
}
|
||||
|
||||
void RTPSender::SetCsrcs(const std::vector<uint32_t>& csrcs) {
|
||||
|
@ -280,9 +280,9 @@ void RTPSenderVideo::SetFecParameters(const FecProtectionParams& delta_params,
|
||||
|
||||
rtc::Optional<uint32_t> RTPSenderVideo::FlexfecSsrc() const {
|
||||
if (flexfec_sender_) {
|
||||
return rtc::Optional<uint32_t>(flexfec_sender_->ssrc());
|
||||
return flexfec_sender_->ssrc();
|
||||
}
|
||||
return rtc::Optional<uint32_t>();
|
||||
return rtc::nullopt;
|
||||
}
|
||||
|
||||
bool RTPSenderVideo::SendVideo(RtpVideoCodecTypes video_type,
|
||||
|
Reference in New Issue
Block a user