Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(149)

Unified Diff: webrtc/video/video_encoder_unittest.cc

Issue 2434073003: Extract bitrate allocation of spatial/temporal layers out of codec impl. (Closed)
Patch Set: Updated tl listener registration. Fixed tests. Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/video/video_encoder_unittest.cc
diff --git a/webrtc/video/video_encoder_unittest.cc b/webrtc/video/video_encoder_unittest.cc
index 5f6f17e7b49e2da1655df6b4b0d5722e31e39dfb..57d17a0c2223da18b0aa0573afb3fe6251c81819 100644
--- a/webrtc/video/video_encoder_unittest.cc
+++ b/webrtc/video/video_encoder_unittest.cc
@@ -10,6 +10,7 @@
#include "webrtc/video_encoder.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/test/gtest.h"
@@ -117,6 +118,7 @@ class VideoEncoderSoftwareFallbackWrapperTest : public ::testing::Test {
VideoEncoderSoftwareFallbackWrapper fallback_wrapper_;
VideoCodec codec_ = {};
std::unique_ptr<VideoFrame> frame_;
+ TemporalLayersFactory tl_factory_;
};
void VideoEncoderSoftwareFallbackWrapperTest::EncodeFrame() {
@@ -139,6 +141,7 @@ void VideoEncoderSoftwareFallbackWrapperTest::UtilizeFallbackEncoder() {
codec_.maxFramerate = 30;
codec_.width = kWidth;
codec_.height = kHeight;
+ codec_.codecSpecific.VP8.tl_factory = &tl_factory_;
fake_encoder_.init_encode_return_code_ = WEBRTC_VIDEO_CODEC_ERROR;
EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK,
fallback_wrapper_.InitEncode(&codec_, 2, kMaxPayloadSize));
@@ -157,6 +160,7 @@ void VideoEncoderSoftwareFallbackWrapperTest::FallbackFromEncodeRequest() {
codec_.maxFramerate = 30;
codec_.width = kWidth;
codec_.height = kHeight;
+ codec_.codecSpecific.VP8.tl_factory = &tl_factory_;
fallback_wrapper_.InitEncode(&codec_, 2, kMaxPayloadSize);
EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK, fallback_wrapper_.SetRates(300, 30));
EXPECT_EQ(1, fake_encoder_.init_encode_count_);

Powered by Google App Engine
This is Rietveld 408576698