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

Unified Diff: webrtc/modules/video_coding/codecs/vp8/test/vp8_impl_unittest.cc

Issue 2853463004: Don't reinit encoder when rotation changes. (Closed)
Patch Set: Add trivial unit tests. Created 3 years, 8 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
« no previous file with comments | « no previous file | webrtc/modules/video_coding/codecs/vp9/test/vp9_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/video_coding/codecs/vp8/test/vp8_impl_unittest.cc
diff --git a/webrtc/modules/video_coding/codecs/vp8/test/vp8_impl_unittest.cc b/webrtc/modules/video_coding/codecs/vp8/test/vp8_impl_unittest.cc
index c4c600d67e328eb96f00cf7e68346eba07db9353..2b5cff028011e183ddb2321a131d8d5c86ef6b37 100644
--- a/webrtc/modules/video_coding/codecs/vp8/test/vp8_impl_unittest.cc
+++ b/webrtc/modules/video_coding/codecs/vp8/test/vp8_impl_unittest.cc
@@ -76,6 +76,7 @@ Vp8UnitTestEncodeCompleteCallback::OnEncodedImage(
encoded_frame_->_timeStamp = encoded_frame._timeStamp;
encoded_frame_->_frameType = encoded_frame._frameType;
encoded_frame_->_completeFrame = encoded_frame._completeFrame;
+ encoded_frame_->rotation_ = encoded_frame.rotation_;
encoded_frame_->qp_ = encoded_frame.qp_;
encode_complete_ = true;
return Result(Result::OK, 0);
@@ -252,6 +253,26 @@ TEST_F(TestVp8Impl, EncoderParameterTest) {
EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK, decoder_->InitDecode(&codec_inst_, 1));
}
+// We only test the encoder here, since the decoded frame rotation is set based
+// on the CVO RTP header extension in VCMDecodedFrameCallback::Decoded.
+// TODO(brandtr): Consider passing through the rotation flag through the decoder
+// in the same way as done in the encoder.
+TEST_F(TestVp8Impl, EncodedRotationEqualsInputRotation) {
+ SetUpEncodeDecode();
+
+ input_frame_->set_rotation(kVideoRotation_0);
+ EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK,
+ encoder_->Encode(*input_frame_, nullptr, nullptr));
+ WaitForEncodedFrame();
+ EXPECT_EQ(kVideoRotation_0, encoded_frame_.rotation_);
+
+ input_frame_->set_rotation(kVideoRotation_90);
+ EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK,
+ encoder_->Encode(*input_frame_, nullptr, nullptr));
+ WaitForEncodedFrame();
+ EXPECT_EQ(kVideoRotation_90, encoded_frame_.rotation_);
+}
+
TEST_F(TestVp8Impl, DecodedQpEqualsEncodedQp) {
SetUpEncodeDecode();
encoder_->Encode(*input_frame_, nullptr, nullptr);
« no previous file with comments | « no previous file | webrtc/modules/video_coding/codecs/vp9/test/vp9_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698