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

Unified Diff: webrtc/video/video_encoder_unittest.cc

Issue 2278883002: Move MutableDataY{,U,V} methods to I420Buffer only. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Delete unused variable. Created 4 years, 3 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 | « webrtc/modules/video_processing/test/video_processing_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/video/video_encoder_unittest.cc
diff --git a/webrtc/video/video_encoder_unittest.cc b/webrtc/video/video_encoder_unittest.cc
index 84ac4fd46699366eaa01ca03825efb5efd29c6a5..eb2b45026bdcc3242caebb8c859b7abd9a559a93 100644
--- a/webrtc/video/video_encoder_unittest.cc
+++ b/webrtc/video/video_encoder_unittest.cc
@@ -116,22 +116,18 @@ class VideoEncoderSoftwareFallbackWrapperTest : public ::testing::Test {
CountingFakeEncoder fake_encoder_;
VideoEncoderSoftwareFallbackWrapper fallback_wrapper_;
VideoCodec codec_ = {};
- VideoFrame frame_;
+ std::unique_ptr<VideoFrame> frame_;
};
void VideoEncoderSoftwareFallbackWrapperTest::EncodeFrame() {
- frame_.CreateEmptyFrame(kWidth, kHeight, kWidth, (kWidth + 1) / 2,
- (kWidth + 1) / 2);
- memset(frame_.video_frame_buffer()->MutableDataY(), 16,
- frame_.allocated_size(webrtc::kYPlane));
- memset(frame_.video_frame_buffer()->MutableDataU(), 128,
- frame_.allocated_size(webrtc::kUPlane));
- memset(frame_.video_frame_buffer()->MutableDataV(), 128,
- frame_.allocated_size(webrtc::kVPlane));
-
+ rtc::scoped_refptr<I420Buffer> buffer = I420Buffer::Create(
+ kWidth, kHeight, kWidth, (kWidth + 1) / 2, (kWidth + 1) / 2);
+ buffer->SetToBlack();
std::vector<FrameType> types(1, kVideoFrameKey);
+
+ frame_.reset(new VideoFrame(buffer, 0, 0, webrtc::kVideoRotation_0));
EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK,
- fallback_wrapper_.Encode(frame_, nullptr, &types));
+ fallback_wrapper_.Encode(*frame_, nullptr, &types));
}
void VideoEncoderSoftwareFallbackWrapperTest::UtilizeFallbackEncoder() {
@@ -225,9 +221,9 @@ TEST_F(VideoEncoderSoftwareFallbackWrapperTest,
// Encoding a frame using the fallback should arrive at the new callback.
std::vector<FrameType> types(1, kVideoFrameKey);
- frame_.set_timestamp(frame_.timestamp() + 1000);
+ frame_->set_timestamp(frame_->timestamp() + 1000);
EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK,
- fallback_wrapper_.Encode(frame_, nullptr, &types));
+ fallback_wrapper_.Encode(*frame_, nullptr, &types));
EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK, fallback_wrapper_.Release());
}
« no previous file with comments | « webrtc/modules/video_processing/test/video_processing_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698