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

Unified Diff: webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.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.cc
diff --git a/webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.cc b/webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.cc
index 1c8037a60e9ce4657a146cd0ba888798e416ac40..766e517484671a4e1cfa7ac0c7f9621a91f7ea6e 100644
--- a/webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.cc
+++ b/webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.cc
@@ -298,10 +298,11 @@
return ret;
}
} else {
+ VideoFrame dst_frame;
+ // Making sure that destination frame is of sufficient size.
// Aligning stride values based on width.
- rtc::scoped_refptr<I420Buffer> dst_buffer =
- I420Buffer::Create(dst_width, dst_height, dst_width,
- (dst_width + 1) / 2, (dst_width + 1) / 2);
+ dst_frame.CreateEmptyFrame(dst_width, dst_height, dst_width,
+ (dst_width + 1) / 2, (dst_width + 1) / 2);
libyuv::I420Scale(input_image.video_frame_buffer()->DataY(),
input_image.video_frame_buffer()->StrideY(),
input_image.video_frame_buffer()->DataU(),
@@ -309,16 +310,18 @@
input_image.video_frame_buffer()->DataV(),
input_image.video_frame_buffer()->StrideV(),
src_width, src_height,
- dst_buffer->MutableDataY(), dst_buffer->StrideY(),
- dst_buffer->MutableDataU(), dst_buffer->StrideU(),
- dst_buffer->MutableDataV(), dst_buffer->StrideV(),
+ dst_frame.video_frame_buffer()->MutableDataY(),
+ dst_frame.video_frame_buffer()->StrideY(),
+ dst_frame.video_frame_buffer()->MutableDataU(),
+ dst_frame.video_frame_buffer()->StrideU(),
+ dst_frame.video_frame_buffer()->MutableDataV(),
+ dst_frame.video_frame_buffer()->StrideV(),
dst_width, dst_height,
libyuv::kFilterBilinear);
-
+ dst_frame.set_timestamp(input_image.timestamp());
+ dst_frame.set_render_time_ms(input_image.render_time_ms());
int ret = streaminfos_[stream_idx].encoder->Encode(
- VideoFrame(dst_buffer, input_image.timestamp(),
- input_image.render_time_ms(), webrtc::kVideoRotation_0),
- codec_specific_info, &stream_frame_types);
+ dst_frame, codec_specific_info, &stream_frame_types);
if (ret != WEBRTC_VIDEO_CODEC_OK) {
return ret;
}

Powered by Google App Engine
This is Rietveld 408576698