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

Unified Diff: webrtc/modules/video_capture/video_capture_impl.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_capture/video_capture_impl.cc
diff --git a/webrtc/modules/video_capture/video_capture_impl.cc b/webrtc/modules/video_capture/video_capture_impl.cc
index 90ac26713a2cd9ccd8ec1911bb5bce0c17fe2e23..e6b2d55f98692497229f905138113febc3ff50ae 100644
--- a/webrtc/modules/video_capture/video_capture_impl.cc
+++ b/webrtc/modules/video_capture/video_capture_impl.cc
@@ -275,14 +275,14 @@
// Setting absolute height (in case it was negative).
// In Windows, the image starts bottom left, instead of top left.
// Setting a negative source height, inverts the image (within LibYuv).
-
- // TODO(nisse): Use a pool?
- rtc::scoped_refptr<I420Buffer> buffer = I420Buffer::Create(
- target_width, abs(target_height), stride_y, stride_uv, stride_uv);
+ _captureFrame.CreateEmptyFrame(target_width,
+ abs(target_height),
+ stride_y,
+ stride_uv, stride_uv);
const int conversionResult = ConvertToI420(
commonVideoType, videoFrame, 0, 0, // No cropping
width, height, videoFrameLength,
- apply_rotation ? _rotateFrame : kVideoRotation_0, buffer.get());
+ apply_rotation ? _rotateFrame : kVideoRotation_0, &_captureFrame);
if (conversionResult < 0)
{
LOG(LS_ERROR) << "Failed to convert capture frame from type "
@@ -290,12 +290,15 @@
return -1;
}
- VideoFrame captureFrame(
- buffer, 0, rtc::TimeMillis(),
- !apply_rotation ? _rotateFrame : kVideoRotation_0);
- captureFrame.set_ntp_time_ms(captureTime);
-
- DeliverCapturedFrame(captureFrame);
+ if (!apply_rotation) {
+ _captureFrame.set_rotation(_rotateFrame);
+ } else {
+ _captureFrame.set_rotation(kVideoRotation_0);
+ }
+ _captureFrame.set_ntp_time_ms(captureTime);
+ _captureFrame.set_render_time_ms(rtc::TimeMillis());
+
+ DeliverCapturedFrame(_captureFrame);
}
else // Encoded format
{
« no previous file with comments | « webrtc/modules/video_capture/video_capture_impl.h ('k') | webrtc/modules/video_coding/codecs/h264/h264_decoder_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698