From 0e1d7989a54e146974eec758056f4af97273d2b7 Mon Sep 17 00:00:00 2001 From: Oskar Sundbom Date: Thu, 16 Nov 2017 10:52:42 +0100 Subject: [PATCH] Optional: Use nullopt and implicit construction in /api 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=pthatcher@webrtc.org Bug: None Change-Id: Icdc7e9e4395eeac053483c69e53501e5aa222107 Reviewed-on: https://webrtc-review.googlesource.com/23567 Reviewed-by: Steve Anton Reviewed-by: Peter Thatcher Commit-Queue: Oskar Sundbom Cr-Commit-Position: refs/heads/master@{#20867} --- api/mediaconstraintsinterface.cc | 4 ++-- api/video_codecs/video_encoder.cc | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/api/mediaconstraintsinterface.cc b/api/mediaconstraintsinterface.cc index 2894f5b23d..90a957cfa4 100644 --- a/api/mediaconstraintsinterface.cc +++ b/api/mediaconstraintsinterface.cc @@ -67,7 +67,7 @@ void ConstraintToOptional(const webrtc::MediaConstraintsInterface* constraints, T value; bool present = FindConstraint(constraints, key, &value, nullptr); if (present) { - *value_out = rtc::Optional(value); + *value_out = value; } } } // namespace @@ -268,7 +268,7 @@ void CopyConstraintsIntoAudioOptions( // When |kAudioNetworkAdaptorConfig| is defined, it both means that audio // network adaptor is desired, and provides the config string. if (options->audio_network_adaptor_config) { - options->audio_network_adaptor = rtc::Optional(true); + options->audio_network_adaptor = true; } } diff --git a/api/video_codecs/video_encoder.cc b/api/video_codecs/video_encoder.cc index e3cc516d6f..e1cc0cfac7 100644 --- a/api/video_codecs/video_encoder.cc +++ b/api/video_codecs/video_encoder.cc @@ -61,15 +61,14 @@ VideoCodecH264 VideoEncoder::GetDefaultH264Settings() { } VideoEncoder::ScalingSettings::ScalingSettings(bool on, int low, int high) - : enabled(on), - thresholds(rtc::Optional(QpThresholds(low, high))) {} + : enabled(on), thresholds(QpThresholds(low, high)) {} VideoEncoder::ScalingSettings::ScalingSettings(bool on, int low, int high, int min_pixels) : enabled(on), - thresholds(rtc::Optional(QpThresholds(low, high))), + thresholds(QpThresholds(low, high)), min_pixels_per_frame(min_pixels) {} VideoEncoder::ScalingSettings::ScalingSettings(bool on, int min_pixels)