From b9ce3b79fc3e46956f0e1222de2c9fea63bb3f5b Mon Sep 17 00:00:00 2001 From: Danil Chapovalov Date: Fri, 23 Feb 2024 14:57:50 +0100 Subject: [PATCH] Delete deprecated VP8Decoder::Create Bug: webrtc:15791 Change-Id: Ic198706535da9f299735cd0a7bbf571cda643098 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/340461 Reviewed-by: Philip Eliasson Commit-Queue: Danil Chapovalov Cr-Commit-Position: refs/heads/main@{#41837} --- modules/video_coding/BUILD.gn | 1 - modules/video_coding/codecs/vp8/include/vp8.h | 6 ----- .../codecs/vp8/libvpx_vp8_decoder.cc | 22 +++++-------------- .../codecs/vp8/libvpx_vp8_decoder.h | 5 +---- 4 files changed, 7 insertions(+), 27 deletions(-) diff --git a/modules/video_coding/BUILD.gn b/modules/video_coding/BUILD.gn index eec1e66af4..58a92d5403 100644 --- a/modules/video_coding/BUILD.gn +++ b/modules/video_coding/BUILD.gn @@ -559,7 +559,6 @@ rtc_library("webrtc_vp8") { "../../api:field_trials_view", "../../api:scoped_refptr", "../../api/environment", - "../../api/transport:field_trial_based_config", "../../api/units:time_delta", "../../api/units:timestamp", "../../api/video:encoded_image", diff --git a/modules/video_coding/codecs/vp8/include/vp8.h b/modules/video_coding/codecs/vp8/include/vp8.h index b03200ade5..cb49516aa9 100644 --- a/modules/video_coding/codecs/vp8/include/vp8.h +++ b/modules/video_coding/codecs/vp8/include/vp8.h @@ -41,12 +41,6 @@ class VP8Encoder { static std::unique_ptr Create(Settings settings); }; -// TODO: bugs.webrtc.org/15791 - Delete in favor of the CreateVp8Decoder below. -class VP8Decoder { - public: - [[deprecated]] static std::unique_ptr Create(); -}; - std::unique_ptr CreateVp8Decoder(const Environment& env); } // namespace webrtc diff --git a/modules/video_coding/codecs/vp8/libvpx_vp8_decoder.cc b/modules/video_coding/codecs/vp8/libvpx_vp8_decoder.cc index 3466080c83..3eed384716 100644 --- a/modules/video_coding/codecs/vp8/libvpx_vp8_decoder.cc +++ b/modules/video_coding/codecs/vp8/libvpx_vp8_decoder.cc @@ -21,7 +21,6 @@ #include "api/environment/environment.h" #include "api/field_trials_view.h" #include "api/scoped_refptr.h" -#include "api/transport/field_trial_based_config.h" #include "api/video/i420_buffer.h" #include "api/video/video_frame.h" #include "api/video/video_frame_buffer.h" @@ -87,10 +86,6 @@ GetPostProcParamsFromFieldTrialGroup(const FieldTrialsView& field_trials) { } // namespace -std::unique_ptr VP8Decoder::Create() { - return std::make_unique(); -} - std::unique_ptr CreateVp8Decoder(const Environment& env) { return std::make_unique(env); } @@ -119,15 +114,10 @@ class LibvpxVp8Decoder::QpSmoother { rtc::ExpFilter smoother_; }; -LibvpxVp8Decoder::LibvpxVp8Decoder() - : LibvpxVp8Decoder(FieldTrialBasedConfig()) {} - LibvpxVp8Decoder::LibvpxVp8Decoder(const Environment& env) - : LibvpxVp8Decoder(env.field_trials()) {} - -LibvpxVp8Decoder::LibvpxVp8Decoder(const FieldTrialsView& field_trials) - : use_postproc_(kIsArm ? field_trials.IsEnabled(kVp8PostProcArmFieldTrial) - : true), + : use_postproc_( + kIsArm ? env.field_trials().IsEnabled(kVp8PostProcArmFieldTrial) + : true), buffer_pool_(false, 300 /* max_number_of_buffers*/), decode_complete_callback_(NULL), inited_(false), @@ -135,9 +125,9 @@ LibvpxVp8Decoder::LibvpxVp8Decoder(const FieldTrialsView& field_trials) last_frame_width_(0), last_frame_height_(0), key_frame_required_(true), - deblock_params_(use_postproc_ - ? GetPostProcParamsFromFieldTrialGroup(field_trials) - : absl::nullopt), + deblock_params_(use_postproc_ ? GetPostProcParamsFromFieldTrialGroup( + env.field_trials()) + : absl::nullopt), qp_smoother_(use_postproc_ ? new QpSmoother() : nullptr) {} LibvpxVp8Decoder::~LibvpxVp8Decoder() { diff --git a/modules/video_coding/codecs/vp8/libvpx_vp8_decoder.h b/modules/video_coding/codecs/vp8/libvpx_vp8_decoder.h index 8ed8e7ca88..c14a2b7e4d 100644 --- a/modules/video_coding/codecs/vp8/libvpx_vp8_decoder.h +++ b/modules/video_coding/codecs/vp8/libvpx_vp8_decoder.h @@ -28,9 +28,6 @@ namespace webrtc { class LibvpxVp8Decoder : public VideoDecoder { public: - // TODO: bugs.webrtc.org/15791 - Delete default constructor when - // Environment is always propagated. - LibvpxVp8Decoder(); explicit LibvpxVp8Decoder(const Environment& env); ~LibvpxVp8Decoder() override; @@ -61,7 +58,7 @@ class LibvpxVp8Decoder : public VideoDecoder { private: class QpSmoother; - explicit LibvpxVp8Decoder(const FieldTrialsView& field_trials); + int ReturnFrame(const vpx_image_t* img, uint32_t timeStamp, int qp,