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

Unified Diff: webrtc/modules/video_coding/codecs/i420/i420.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
Index: webrtc/modules/video_coding/codecs/i420/i420.cc
diff --git a/webrtc/modules/video_coding/codecs/i420/i420.cc b/webrtc/modules/video_coding/codecs/i420/i420.cc
index 93204dde9ce72f1e04032757def1dae5f902d8a8..d0c8d0c62c97113090ee35aea284a6098b4c4f58 100644
--- a/webrtc/modules/video_coding/codecs/i420/i420.cc
+++ b/webrtc/modules/video_coding/codecs/i420/i420.cc
@@ -137,8 +137,7 @@ int I420Encoder::RegisterEncodeCompleteCallback(
}
I420Decoder::I420Decoder()
- : _decodedImage(),
- _width(0),
+ : _width(0),
_height(0),
_inited(false),
_decodeCompleteCallback(NULL) {}
@@ -199,17 +198,19 @@ int I420Decoder::Decode(const EncodedImage& inputImage,
}
// Set decoded image parameters.
int half_width = (_width + 1) / 2;
- _decodedImage.CreateEmptyFrame(_width, _height, _width, half_width,
- half_width);
- // Converting from buffer to plane representation.
+ rtc::scoped_refptr<webrtc::I420Buffer> frame_buffer =
+ I420Buffer::Create(_width, _height, _width, half_width, half_width);
+
+ // Converting from raw buffer I420Buffer.
int ret = ConvertToI420(kI420, buffer, 0, 0, _width, _height, 0,
- kVideoRotation_0, &_decodedImage);
+ kVideoRotation_0, frame_buffer.get());
if (ret < 0) {
return WEBRTC_VIDEO_CODEC_MEMORY;
}
- _decodedImage.set_timestamp(inputImage._timeStamp);
- _decodeCompleteCallback->Decoded(_decodedImage);
+ VideoFrame decoded_image(frame_buffer, inputImage._timeStamp, 0,
+ webrtc::kVideoRotation_0);
+ _decodeCompleteCallback->Decoded(decoded_image);
return WEBRTC_VIDEO_CODEC_OK;
}

Powered by Google App Engine
This is Rietveld 408576698