diff --git a/modules/video_coding/BUILD.gn b/modules/video_coding/BUILD.gn index 3e98a7c3fd..6624069b46 100644 --- a/modules/video_coding/BUILD.gn +++ b/modules/video_coding/BUILD.gn @@ -802,7 +802,6 @@ if (rtc_include_tests) { "utility/frame_dropper_unittest.cc", "utility/framerate_controller_unittest.cc", "utility/ivf_file_writer_unittest.cc", - "utility/mock/mock_frame_dropper.h", "utility/moving_average_unittest.cc", "utility/quality_scaler_unittest.cc", "utility/simulcast_rate_allocator_unittest.cc", diff --git a/modules/video_coding/codecs/vp8/screenshare_layers_unittest.cc b/modules/video_coding/codecs/vp8/screenshare_layers_unittest.cc index 547fc62cdb..0853523557 100644 --- a/modules/video_coding/codecs/vp8/screenshare_layers_unittest.cc +++ b/modules/video_coding/codecs/vp8/screenshare_layers_unittest.cc @@ -14,10 +14,10 @@ #include "modules/video_coding/codecs/vp8/libvpx_vp8_encoder.h" #include "modules/video_coding/codecs/vp8/screenshare_layers.h" #include "modules/video_coding/include/video_codec_interface.h" -#include "modules/video_coding/utility/mock/mock_frame_dropper.h" #include "system_wrappers/include/clock.h" #include "system_wrappers/include/metrics.h" #include "system_wrappers/include/metrics_default.h" +#include "test/gmock.h" #include "test/gtest.h" using ::testing::_; diff --git a/modules/video_coding/utility/frame_dropper.cc b/modules/video_coding/utility/frame_dropper.cc index 918f5da026..5c518fa57a 100644 --- a/modules/video_coding/utility/frame_dropper.cc +++ b/modules/video_coding/utility/frame_dropper.cc @@ -50,6 +50,8 @@ FrameDropper::FrameDropper() Reset(); } +FrameDropper::~FrameDropper() = default; + void FrameDropper::Reset() { key_frame_ratio_.Reset(kDefaultKeyFrameRatioAlpha); key_frame_ratio_.Apply(1.0f, kDefaultKeyFrameRatioValue); diff --git a/modules/video_coding/utility/frame_dropper.h b/modules/video_coding/utility/frame_dropper.h index 2764994b25..50a8d58e66 100644 --- a/modules/video_coding/utility/frame_dropper.h +++ b/modules/video_coding/utility/frame_dropper.h @@ -24,18 +24,18 @@ namespace webrtc { class FrameDropper { public: FrameDropper(); - virtual ~FrameDropper() {} + ~FrameDropper(); // Resets the FrameDropper to its initial state. - virtual void Reset(); + void Reset(); - virtual void Enable(bool enable); + void Enable(bool enable); // Answers the question if it's time to drop a frame if we want to reach a // given frame rate. Must be called for every frame. // // Return value : True if we should drop the current frame. - virtual bool DropFrame(); + bool DropFrame(); // Updates the FrameDropper with the size of the latest encoded frame. // The FrameDropper calculates a new drop ratio (can be seen as the @@ -45,15 +45,15 @@ class FrameDropper { // - framesize_bytes : The size of the latest frame returned // from the encoder. // - delta_frame : True if the encoder returned a key frame. - virtual void Fill(size_t framesize_bytes, bool delta_frame); + void Fill(size_t framesize_bytes, bool delta_frame); - virtual void Leak(uint32_t input_framerate); + void Leak(uint32_t input_framerate); // Sets the target bit rate and the frame rate produced by the camera. // // Input: // - bitrate : The target bit rate. - virtual void SetRates(float bitrate, float incoming_frame_rate); + void SetRates(float bitrate, float incoming_frame_rate); private: void UpdateRatio(); diff --git a/modules/video_coding/utility/mock/mock_frame_dropper.h b/modules/video_coding/utility/mock/mock_frame_dropper.h deleted file mode 100644 index a0f2220080..0000000000 --- a/modules/video_coding/utility/mock/mock_frame_dropper.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ -#ifndef MODULES_VIDEO_CODING_UTILITY_MOCK_MOCK_FRAME_DROPPER_H_ -#define MODULES_VIDEO_CODING_UTILITY_MOCK_MOCK_FRAME_DROPPER_H_ - -#include - -#include "modules/video_coding/utility/frame_dropper.h" -#include "test/gmock.h" - -namespace webrtc { - -class MockFrameDropper : public FrameDropper { - public: - MOCK_METHOD0(Reset, void()); - MOCK_METHOD1(Enable, void(bool enable)); - MOCK_METHOD0(DropFrame, bool()); - MOCK_METHOD2(Fill, void(size_t frameSizeBytes, bool deltaFrame)); - MOCK_METHOD1(Leak, void(uint32_t inputFrameRate)); - MOCK_METHOD2(SetRates, void(float bitRate, float incoming_frame_rate)); - MOCK_CONST_METHOD1(ActualFrameRate, float(uint32_t inputFrameRate)); -}; - -} // namespace webrtc - -#endif // MODULES_VIDEO_CODING_UTILITY_MOCK_MOCK_FRAME_DROPPER_H_