From 4c4d01dd3dc804404dabf9ed1830bcac9c9dc4de Mon Sep 17 00:00:00 2001 From: "mikhal@webrtc.org" Date: Wed, 21 Nov 2012 22:18:32 +0000 Subject: [PATCH] Setting capture stride to width Review URL: https://webrtc-codereview.appspot.com/935021 git-svn-id: http://webrtc.googlecode.com/svn/trunk@3148 4adac7df-926f-26a2-2b94-8c16560cd09d --- webrtc/modules/video_capture/video_capture_impl.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/webrtc/modules/video_capture/video_capture_impl.cc b/webrtc/modules/video_capture/video_capture_impl.cc index 0034cc2bc2..49762376ba 100644 --- a/webrtc/modules/video_capture/video_capture_impl.cc +++ b/webrtc/modules/video_capture/video_capture_impl.cc @@ -282,8 +282,8 @@ WebRtc_Word32 VideoCaptureImpl::IncomingFrame( return -1; } - int stride_y = 0; - int stride_uv = 0; + int stride_y = width; + int stride_uv = (width + 1) / 2; int target_width = width; int target_height = height; // Rotating resolution when for 90/270 degree rotations. @@ -291,7 +291,8 @@ WebRtc_Word32 VideoCaptureImpl::IncomingFrame( target_width = abs(height); target_height = width; } - Calc16ByteAlignedStride(target_width, &stride_y, &stride_uv); + // TODO(mikhal): Update correct aligned stride values. + //Calc16ByteAlignedStride(target_width, &stride_y, &stride_uv); // 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).