Replace rtc::Optional with absl::optional
This is a no-op change because rtc::Optional is an alias to absl::optional This CL generated by running script from modules with parameters 'pacing video_coding congestion_controller remote_bitrate_estimator': 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: I8ea501d7f1ee36e8d8cd3ed37e6b763c7fe29118 Reviewed-on: https://webrtc-review.googlesource.com/83900 Reviewed-by: Philip Eliasson <philipel@webrtc.org> Commit-Queue: Danil Chapovalov <danilchap@webrtc.org> Cr-Commit-Position: refs/heads/master@{#23640}
This commit is contained in:

committed by
Commit Bot

parent
ae1888629a
commit
0040b66ad3
@ -44,10 +44,10 @@ class QualityScaler::QpSmoother {
|
||||
explicit QpSmoother(float alpha)
|
||||
: alpha_(alpha), last_sample_ms_(rtc::TimeMillis()), smoother_(alpha) {}
|
||||
|
||||
rtc::Optional<int> GetAvg() const {
|
||||
absl::optional<int> GetAvg() const {
|
||||
float value = smoother_.filtered();
|
||||
if (value == rtc::ExpFilter::kValueUndefined) {
|
||||
return rtc::nullopt;
|
||||
return absl::nullopt;
|
||||
}
|
||||
return static_cast<int>(value);
|
||||
}
|
||||
@ -182,7 +182,7 @@ void QualityScaler::CheckQp() {
|
||||
observed_enough_frames_ = true;
|
||||
|
||||
// Check if we should scale down due to high frame drop.
|
||||
const rtc::Optional<int> drop_rate =
|
||||
const absl::optional<int> drop_rate =
|
||||
config_.use_all_drop_reasons ? framedrop_percent_all_.GetAverage()
|
||||
: framedrop_percent_media_opt_.GetAverage();
|
||||
if (drop_rate && *drop_rate >= kFramedropPercentThreshold) {
|
||||
@ -192,10 +192,10 @@ void QualityScaler::CheckQp() {
|
||||
}
|
||||
|
||||
// Check if we should scale up or down based on QP.
|
||||
const rtc::Optional<int> avg_qp_high = qp_smoother_high_
|
||||
? qp_smoother_high_->GetAvg()
|
||||
: average_qp_.GetAverage();
|
||||
const rtc::Optional<int> avg_qp_low =
|
||||
const absl::optional<int> avg_qp_high = qp_smoother_high_
|
||||
? qp_smoother_high_->GetAvg()
|
||||
: average_qp_.GetAverage();
|
||||
const absl::optional<int> avg_qp_low =
|
||||
qp_smoother_low_ ? qp_smoother_low_->GetAvg() : average_qp_.GetAverage();
|
||||
if (avg_qp_high && avg_qp_low) {
|
||||
RTC_LOG(LS_INFO) << "Checking average QP " << *avg_qp_high << " ("
|
||||
|
Reference in New Issue
Block a user