Index: webrtc/video/video_encoder_unittest.cc |
diff --git a/webrtc/video/video_encoder_unittest.cc b/webrtc/video/video_encoder_unittest.cc |
index d14215aa998d416ac7ec6558ee70b81e3d9c13b9..5f6f17e7b49e2da1655df6b4b0d5722e31e39dfb 100644 |
--- a/webrtc/video/video_encoder_unittest.cc |
+++ b/webrtc/video/video_encoder_unittest.cc |
@@ -10,11 +10,8 @@ |
#include "webrtc/video_encoder.h" |
-#include "webrtc/base/checks.h" |
-#include "webrtc/modules/video_coding/codecs/vp8/temporal_layers.h" |
#include "webrtc/modules/video_coding/include/video_codec_interface.h" |
#include "webrtc/modules/video_coding/include/video_error_codes.h" |
-#include "webrtc/modules/video_coding/utility/simulcast_rate_allocator.h" |
#include "webrtc/test/gtest.h" |
namespace webrtc { |
@@ -66,8 +63,7 @@ |
return WEBRTC_VIDEO_CODEC_OK; |
} |
- int32_t SetRateAllocation(const BitrateAllocation& bitrate_allocation, |
- uint32_t framerate) override { |
+ int32_t SetRates(uint32_t bitrate, uint32_t framerate) override { |
++set_rates_count_; |
return WEBRTC_VIDEO_CODEC_OK; |
} |
@@ -121,7 +117,6 @@ |
VideoEncoderSoftwareFallbackWrapper fallback_wrapper_; |
VideoCodec codec_ = {}; |
std::unique_ptr<VideoFrame> frame_; |
- std::unique_ptr<SimulcastRateAllocator> rate_allocator_; |
}; |
void VideoEncoderSoftwareFallbackWrapperTest::EncodeFrame() { |
@@ -144,19 +139,10 @@ |
codec_.maxFramerate = 30; |
codec_.width = kWidth; |
codec_.height = kHeight; |
- codec_.codecSpecific.VP8.numberOfTemporalLayers = 1; |
- std::unique_ptr<TemporalLayersFactory> tl_factory( |
- new TemporalLayersFactory()); |
- codec_.codecSpecific.VP8.tl_factory = tl_factory.get(); |
- rate_allocator_.reset( |
- new SimulcastRateAllocator(codec_, std::move(tl_factory))); |
- |
fake_encoder_.init_encode_return_code_ = WEBRTC_VIDEO_CODEC_ERROR; |
EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK, |
fallback_wrapper_.InitEncode(&codec_, 2, kMaxPayloadSize)); |
- EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK, |
- fallback_wrapper_.SetRateAllocation( |
- rate_allocator_->GetAllocation(300000, 30), 30)); |
+ EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK, fallback_wrapper_.SetRates(300, 30)); |
int callback_count = callback_.callback_count_; |
int encode_count = fake_encoder_.encode_count_; |
@@ -171,16 +157,8 @@ |
codec_.maxFramerate = 30; |
codec_.width = kWidth; |
codec_.height = kHeight; |
- codec_.codecSpecific.VP8.numberOfTemporalLayers = 1; |
- std::unique_ptr<TemporalLayersFactory> tl_factory( |
- new TemporalLayersFactory()); |
- codec_.codecSpecific.VP8.tl_factory = tl_factory.get(); |
- rate_allocator_.reset( |
- new SimulcastRateAllocator(codec_, std::move(tl_factory))); |
fallback_wrapper_.InitEncode(&codec_, 2, kMaxPayloadSize); |
- EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK, |
- fallback_wrapper_.SetRateAllocation( |
- rate_allocator_->GetAllocation(300000, 30), 30)); |
+ EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK, fallback_wrapper_.SetRates(300, 30)); |
EXPECT_EQ(1, fake_encoder_.init_encode_count_); |
// Have the non-fallback encoder request a software fallback. |
@@ -263,7 +241,7 @@ |
SetRatesForwardedDuringFallback) { |
UtilizeFallbackEncoder(); |
EXPECT_EQ(1, fake_encoder_.set_rates_count_); |
- fallback_wrapper_.SetRateAllocation(BitrateAllocation(), 1); |
+ fallback_wrapper_.SetRates(1, 1); |
EXPECT_EQ(2, fake_encoder_.set_rates_count_); |
EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK, fallback_wrapper_.Release()); |
} |