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

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

Issue 2574123002: Revert of Delete VideoFrame default constructor, and IsZeroSize method. (Closed)
Patch Set: Created 4 years 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/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 5bcbb9b1b31262f5e5514569316ff612403e7b36..d4c4de61592dbdf33fc861d9d2403dc06ea7e1d2 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
@@ -13,7 +13,6 @@
#include <memory>
#include "webrtc/base/checks.h"
-#include "webrtc/base/optional.h"
#include "webrtc/base/timeutils.h"
#include "webrtc/common_video/libyuv/include/webrtc_libyuv.h"
#include "webrtc/modules/video_coding/codecs/vp8/include/vp8.h"
@@ -89,7 +88,7 @@
class Vp8UnitTestDecodeCompleteCallback : public webrtc::DecodedImageCallback {
public:
- explicit Vp8UnitTestDecodeCompleteCallback(rtc::Optional<VideoFrame>* frame)
+ explicit Vp8UnitTestDecodeCompleteCallback(VideoFrame* frame)
: decoded_frame_(frame), decode_complete(false) {}
int32_t Decoded(VideoFrame& frame) override;
int32_t Decoded(VideoFrame& frame, int64_t decode_time_ms) override {
@@ -99,7 +98,7 @@
bool DecodeComplete();
private:
- rtc::Optional<VideoFrame>* decoded_frame_;
+ VideoFrame* decoded_frame_;
bool decode_complete;
};
@@ -112,7 +111,7 @@
}
int Vp8UnitTestDecodeCompleteCallback::Decoded(VideoFrame& image) {
- *decoded_frame_ = rtc::Optional<VideoFrame>(image);
+ *decoded_frame_ = image;
decode_complete = true;
return 0;
}
@@ -185,8 +184,8 @@
int64_t startTime = rtc::TimeMillis();
while (rtc::TimeMillis() - startTime < kMaxWaitDecTimeMs) {
if (decode_complete_callback_->DecodeComplete()) {
- return CalcBufferSize(kI420, decoded_frame_->width(),
- decoded_frame_->height());
+ return CalcBufferSize(kI420, decoded_frame_.width(),
+ decoded_frame_.height());
}
}
return 0;
@@ -203,7 +202,7 @@
std::unique_ptr<VideoEncoder> encoder_;
std::unique_ptr<VideoDecoder> decoder_;
EncodedImage encoded_frame_;
- rtc::Optional<VideoFrame> decoded_frame_;
+ VideoFrame decoded_frame_;
VideoCodec codec_inst_;
TemporalLayersFactory tl_factory_;
};
@@ -253,11 +252,10 @@
EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK,
decoder_->Decode(encoded_frame_, false, NULL));
EXPECT_GT(WaitForDecodedFrame(), 0u);
- ASSERT_TRUE(decoded_frame_);
// Compute PSNR on all planes (faster than SSIM).
- EXPECT_GT(I420PSNR(input_frame_.get(), &*decoded_frame_), 36);
- EXPECT_EQ(kTestTimestamp, decoded_frame_->timestamp());
- EXPECT_EQ(kTestNtpTimeMs, decoded_frame_->ntp_time_ms());
+ EXPECT_GT(I420PSNR(input_frame_.get(), &decoded_frame_), 36);
+ EXPECT_EQ(kTestTimestamp, decoded_frame_.timestamp());
+ EXPECT_EQ(kTestNtpTimeMs, decoded_frame_.ntp_time_ms());
}
#if defined(WEBRTC_ANDROID)
@@ -282,8 +280,7 @@
encoded_frame_._frameType = kVideoFrameKey;
EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK,
decoder_->Decode(encoded_frame_, false, NULL));
- ASSERT_TRUE(decoded_frame_);
- EXPECT_GT(I420PSNR(input_frame_.get(), &*decoded_frame_), 36);
+ EXPECT_GT(I420PSNR(input_frame_.get(), &decoded_frame_), 36);
}
} // namespace webrtc

Powered by Google App Engine
This is Rietveld 408576698