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 ece5b63f051695fe7a79b265ccf67cde210a40b4..d566ea82b05145e14789603c8424d911320ac39a 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 |
@@ -83,6 +83,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_; |
codec_specific_info_->codecType = codec_specific_info->codecType; |
// Skip |codec_name|, to avoid allocating. |
@@ -273,6 +274,26 @@ TEST_F(TestVp8Impl, EncoderParameterTest) { |
EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK, decoder_->InitDecode(&codec_settings_, 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); |