Use I420Buffer rather than VideoFrameBuffer when writing pixels.

Prepares for deleting VideoFrameBuffer::MutableDataY{,U,V}. objc
changes extracted from cl https://codereview.webrtc.org/2278883002/.

BUG=webrtc:5921

Review-Url: https://codereview.webrtc.org/2346453002
Cr-Commit-Position: refs/heads/master@{#14236}
This commit is contained in:
nisse 2016-09-15 07:20:40 -07:00 committed by Commit bot
parent 8faf9e047e
commit edebf45712

View File

@ -740,17 +740,20 @@ void AVFoundationVideoCapturer::CaptureSampleBuffer(
} else { } else {
// Applying rotation is only supported for legacy reasons and performance // Applying rotation is only supported for legacy reasons and performance
// is not critical here. // is not critical here.
buffer = (rotation == webrtc::kVideoRotation_180) rtc::scoped_refptr<webrtc::I420Buffer> rotated_buffer(
? I420Buffer::Create(adapted_width, adapted_height) (rotation == webrtc::kVideoRotation_180)
: I420Buffer::Create(adapted_height, adapted_width); ? I420Buffer::Create(adapted_width, adapted_height)
libyuv::I420Rotate(scaled_buffer->DataY(), scaled_buffer->StrideY(), : I420Buffer::Create(adapted_height, adapted_width));
scaled_buffer->DataU(), scaled_buffer->StrideU(), libyuv::I420Rotate(
scaled_buffer->DataV(), scaled_buffer->StrideV(), scaled_buffer->DataY(), scaled_buffer->StrideY(),
buffer->MutableDataY(), buffer->StrideY(), scaled_buffer->DataU(), scaled_buffer->StrideU(),
buffer->MutableDataU(), buffer->StrideU(), scaled_buffer->DataV(), scaled_buffer->StrideV(),
buffer->MutableDataV(), buffer->StrideV(), rotated_buffer->MutableDataY(), rotated_buffer->StrideY(),
crop_width, crop_height, rotated_buffer->MutableDataU(), rotated_buffer->StrideU(),
static_cast<libyuv::RotationMode>(rotation)); rotated_buffer->MutableDataV(), rotated_buffer->StrideV(),
crop_width, crop_height,
static_cast<libyuv::RotationMode>(rotation));
buffer = rotated_buffer;
} }
} }