Revert of Don't reinit encoder when rotation changes. (patchset #3 id:40001 of https://codereview.webrtc.org/2853463004/ )

Reason for revert:
Breaks compile on buildbots.

Original issue's description:
> Don't reinit encoder when rotation changes.
>
> TESTED=By rotating phone in AppRTCMobile.
> BUG=webrtc:7535
>
> Review-Url: https://codereview.webrtc.org/2853463004
> Cr-Commit-Position: refs/heads/master@{#17985}
> Committed: 70e39e159e

TBR=magjed@webrtc.org,asapersson@webrtc.org,perkj@webrtc.org,sprang@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:7535

Review-Url: https://codereview.webrtc.org/2861633003
Cr-Commit-Position: refs/heads/master@{#17987}
This commit is contained in:
brandtr
2017-05-03 03:53:09 -07:00
committed by Commit bot
parent cee5141eb0
commit 823e900d2c
4 changed files with 11 additions and 45 deletions

View File

@ -83,7 +83,6 @@ 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.
@ -274,26 +273,6 @@ 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);

View File

@ -66,25 +66,6 @@ TEST_F(TestVp9Impl, EncodeDecode) {
EXPECT_GT(I420PSNR(input_frame_.get(), decoded_frame.get()), 36);
}
// 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(TestVp9Impl, EncodedRotationEqualsInputRotation) {
input_frame_->set_rotation(kVideoRotation_0);
EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK,
encoder_->Encode(*input_frame_, nullptr, nullptr));
EncodedImage encoded_frame;
ASSERT_TRUE(WaitForEncodedFrame(&encoded_frame));
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));
ASSERT_TRUE(WaitForEncodedFrame(&encoded_frame));
EXPECT_EQ(kVideoRotation_90, encoded_frame.rotation_);
}
TEST_F(TestVp9Impl, DecodedQpEqualsEncodedQp) {
EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK,
encoder_->Encode(*input_frame_, nullptr, nullptr));