Remove unused MockFrameDropper and make FrameDropper non-virtual.

Bug: webrtc:9711
Change-Id: I962039c3ebea1a9445ab3a43071279c4ce8a55cf
Reviewed-on: https://webrtc-review.googlesource.com/97326
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24535}
This commit is contained in:
Rasmus Brandt
2018-09-03 12:59:51 +02:00
committed by Commit Bot
parent fd5770df4e
commit 260182d9f3
5 changed files with 10 additions and 42 deletions

View File

@ -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",

View File

@ -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::_;

View File

@ -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);

View File

@ -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();

View File

@ -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 <string>
#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_