Remove non-default VideoEncoder::EncoderInfo() ctor

This removes the constructor that takes all members as parameters.
A main goal with this struct is to make it easy to add or remove fields
without having to refactor implementations and usage all over the palce,
this breaks down if we need to update the arguments in this constructor
every time.

Also cleans up a few commented-out lines that were forgotten in an
earliers cl.

Bug: webrtc:9722
Change-Id: I22db35d399469bdb3bfd8bdc531b24ead9fe1c3e
Reviewed-on: https://webrtc-review.googlesource.com/c/109570
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25542}
This commit is contained in:
Erik Språng
2018-11-06 15:32:48 +01:00
committed by Commit Bot
parent 36d907b6cd
commit ff7020af27
3 changed files with 12 additions and 16 deletions

View File

@ -86,8 +86,11 @@ class VideoEncoderSoftwareFallbackWrapperTest : public ::testing::Test {
EncoderInfo GetEncoderInfo() const override {
++supports_native_handle_count_;
return EncoderInfo(ScalingSettings(kLowThreshold, kHighThreshold),
supports_native_handle_, "fake-encoder");
EncoderInfo info;
info.scaling_settings = ScalingSettings(kLowThreshold, kHighThreshold);
info.supports_native_handle = supports_native_handle_;
info.implementation_name = "fake-encoder";
return info;
}
int init_encode_count_ = 0;

View File

@ -88,13 +88,6 @@ VideoEncoder::EncoderInfo::EncoderInfo()
supports_native_handle(false),
implementation_name("unknown") {}
VideoEncoder::EncoderInfo::EncoderInfo(const ScalingSettings& scaling_settings,
bool supports_native_handle,
const std::string& implementation_name)
: scaling_settings(scaling_settings),
supports_native_handle(supports_native_handle),
implementation_name(implementation_name) {}
VideoEncoder::EncoderInfo::~EncoderInfo() = default;
int32_t VideoEncoder::SetRates(uint32_t bitrate, uint32_t framerate) {
@ -120,9 +113,14 @@ const char* VideoEncoder::ImplementationName() const {
return "unknown";
}
// TODO(webrtc:9722): Remove and make pure virtual when the three legacy
// methods called here are gone.
VideoEncoder::EncoderInfo VideoEncoder::GetEncoderInfo() const {
return EncoderInfo(GetScalingSettings(), SupportsNativeHandle(),
ImplementationName());
EncoderInfo info;
info.scaling_settings = GetScalingSettings();
info.supports_native_handle = SupportsNativeHandle();
info.implementation_name = ImplementationName();
return info;
}
int32_t VideoEncoder::SetChannelParameters(uint32_t packet_loss, int64_t rtt) {

View File

@ -120,11 +120,6 @@ class RTC_EXPORT VideoEncoder {
// Struct containing metadata about the encoder implementing this interface.
struct EncoderInfo {
EncoderInfo();
EncoderInfo(const ScalingSettings& scaling_settings,
bool supports_native_handle,
const std::string& implementation_name);
// EncoderInfo(const EncoderInfo& rhs);
// EncoderInfo& operator=(const EncoderInfo& rhs);
~EncoderInfo();
// Any encoder implementation wishing to use the WebRTC provided