From 9ce14e8c5094e4a4cd080746cf1baf990200f1a2 Mon Sep 17 00:00:00 2001 From: Rasmus Brandt Date: Thu, 19 Mar 2020 13:56:42 +0100 Subject: [PATCH] libvpx-vp8: Migrate to default member initializations. Bug: webrtc:11436 Change-Id: I9c7751e63efc51f2bdc3490e014c36e6b35b4b54 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/170634 Reviewed-by: Ilya Nikolaevskiy Commit-Queue: Rasmus Brandt Cr-Commit-Position: refs/heads/master@{#30835} --- .../codecs/vp8/libvpx_vp8_encoder.cc | 12 +---------- .../codecs/vp8/libvpx_vp8_encoder.h | 20 +++++++++---------- 2 files changed, 11 insertions(+), 21 deletions(-) diff --git a/modules/video_coding/codecs/vp8/libvpx_vp8_encoder.cc b/modules/video_coding/codecs/vp8/libvpx_vp8_encoder.cc index c0a9e545c8..6a2492548c 100644 --- a/modules/video_coding/codecs/vp8/libvpx_vp8_encoder.cc +++ b/modules/video_coding/codecs/vp8/libvpx_vp8_encoder.cc @@ -281,22 +281,12 @@ LibvpxVp8Encoder::LibvpxVp8Encoder( rate_control_settings_(RateControlSettings::ParseFromFieldTrials()), screenshare_max_qp_( ExperimentalScreenshareSettings::ParseFromFieldTrials().MaxQp()), - encoded_complete_callback_(nullptr), - inited_(false), - timestamp_(0), - qp_max_(56), // Setting for max quantizer. - cpu_speed_default_(-6), - number_of_cores_(0), - rc_max_intra_target_(0), - num_active_streams_(0), frame_buffer_controller_factory_( std::move(frame_buffer_controller_factory)), key_frame_request_(kMaxSimulcastStreams, false), variable_framerate_experiment_(ParseVariableFramerateConfig( "WebRTC-VP8VariableFramerateScreenshare")), - framerate_controller_(variable_framerate_experiment_.framerate_limit), - num_steady_state_frames_(0), - fec_controller_override_(nullptr) { + framerate_controller_(variable_framerate_experiment_.framerate_limit) { // TODO(eladalon/ilnik): These reservations might be wasting memory. // InitEncode() is resizing to the actual size, which might be smaller. raw_images_.reserve(kMaxSimulcastStreams); diff --git a/modules/video_coding/codecs/vp8/libvpx_vp8_encoder.h b/modules/video_coding/codecs/vp8/libvpx_vp8_encoder.h index a283a9472e..6af0bf1bc0 100644 --- a/modules/video_coding/codecs/vp8/libvpx_vp8_encoder.h +++ b/modules/video_coding/codecs/vp8/libvpx_vp8_encoder.h @@ -105,15 +105,15 @@ class LibvpxVp8Encoder : public VideoEncoder { const RateControlSettings rate_control_settings_; const absl::optional screenshare_max_qp_; - EncodedImageCallback* encoded_complete_callback_; + EncodedImageCallback* encoded_complete_callback_ = nullptr; VideoCodec codec_; - bool inited_; - int64_t timestamp_; - int qp_max_; - int cpu_speed_default_; - int number_of_cores_; - uint32_t rc_max_intra_target_; - int num_active_streams_; + bool inited_ = false; + int64_t timestamp_ = 0; + int qp_max_ = 56; + int cpu_speed_default_ = -6; + int number_of_cores_ = 0; + uint32_t rc_max_intra_target_ = 0; + int num_active_streams_ = 0; const std::unique_ptr frame_buffer_controller_factory_; std::unique_ptr frame_buffer_controller_; @@ -141,9 +141,9 @@ class LibvpxVp8Encoder : public VideoEncoder { static VariableFramerateExperiment ParseVariableFramerateConfig( std::string group_name); FramerateController framerate_controller_; - int num_steady_state_frames_; + int num_steady_state_frames_ = 0; - FecControllerOverride* fec_controller_override_; + FecControllerOverride* fec_controller_override_ = nullptr; }; } // namespace webrtc