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

Unified Diff: webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter_unittest.cc

Issue 2354223002: Revert of Move MutableDataY{,U,V} methods to I420Buffer only. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: 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
Index: webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter_unittest.cc
diff --git a/webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter_unittest.cc b/webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter_unittest.cc
index d13dbb165b7fac941abcfec17bb873beba9c65b0..47d2322d0b30c7e98136b8b6d530069d1f918d35 100644
--- a/webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter_unittest.cc
+++ b/webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter_unittest.cc
@@ -535,11 +535,17 @@
.WillOnce(Return(WEBRTC_VIDEO_CODEC_FALLBACK_SOFTWARE));
// Send a fake frame and assert the return is software fallback.
+ VideoFrame input_frame;
int half_width = (kDefaultWidth + 1) / 2;
- rtc::scoped_refptr<I420Buffer> input_buffer = I420Buffer::Create(
- kDefaultWidth, kDefaultHeight, kDefaultWidth, half_width, half_width);
- input_buffer->InitializeData();
- VideoFrame input_frame(input_buffer, 0, 0, webrtc::kVideoRotation_0);
+ input_frame.CreateEmptyFrame(kDefaultWidth, kDefaultHeight, kDefaultWidth,
+ half_width, half_width);
+ memset(input_frame.video_frame_buffer()->MutableDataY(), 0,
+ input_frame.allocated_size(kYPlane));
+ memset(input_frame.video_frame_buffer()->MutableDataU(), 0,
+ input_frame.allocated_size(kUPlane));
+ memset(input_frame.video_frame_buffer()->MutableDataV(), 0,
+ input_frame.allocated_size(kVPlane));
+
std::vector<FrameType> frame_types(3, kVideoFrameKey);
EXPECT_EQ(WEBRTC_VIDEO_CODEC_FALLBACK_SOFTWARE,
adapter_->Encode(input_frame, nullptr, &frame_types));

Powered by Google App Engine
This is Rietveld 408576698