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

Unified Diff: webrtc/sdk/objc/Framework/Classes/avfoundationvideocapturer.mm

Issue 2346453002: Use I420Buffer rather than VideoFrameBuffer when writing pixels. (Closed)
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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/sdk/objc/Framework/Classes/avfoundationvideocapturer.mm
diff --git a/webrtc/sdk/objc/Framework/Classes/avfoundationvideocapturer.mm b/webrtc/sdk/objc/Framework/Classes/avfoundationvideocapturer.mm
index ef29049aaa9895667af8b57e310d8fc3b60b9ba3..5708346ae2bccdee06da02c5eea8d2a13d37d453 100644
--- a/webrtc/sdk/objc/Framework/Classes/avfoundationvideocapturer.mm
+++ b/webrtc/sdk/objc/Framework/Classes/avfoundationvideocapturer.mm
@@ -740,17 +740,20 @@ void AVFoundationVideoCapturer::CaptureSampleBuffer(
} else {
// Applying rotation is only supported for legacy reasons and performance
// is not critical here.
- buffer = (rotation == webrtc::kVideoRotation_180)
- ? I420Buffer::Create(adapted_width, adapted_height)
- : I420Buffer::Create(adapted_height, adapted_width);
- libyuv::I420Rotate(scaled_buffer->DataY(), scaled_buffer->StrideY(),
- scaled_buffer->DataU(), scaled_buffer->StrideU(),
- scaled_buffer->DataV(), scaled_buffer->StrideV(),
- buffer->MutableDataY(), buffer->StrideY(),
- buffer->MutableDataU(), buffer->StrideU(),
- buffer->MutableDataV(), buffer->StrideV(),
- crop_width, crop_height,
- static_cast<libyuv::RotationMode>(rotation));
+ rtc::scoped_refptr<webrtc::I420Buffer> rotated_buffer(
+ (rotation == webrtc::kVideoRotation_180)
+ ? I420Buffer::Create(adapted_width, adapted_height)
+ : I420Buffer::Create(adapted_height, adapted_width));
+ libyuv::I420Rotate(
+ scaled_buffer->DataY(), scaled_buffer->StrideY(),
+ scaled_buffer->DataU(), scaled_buffer->StrideU(),
+ scaled_buffer->DataV(), scaled_buffer->StrideV(),
+ rotated_buffer->MutableDataY(), rotated_buffer->StrideY(),
+ rotated_buffer->MutableDataU(), rotated_buffer->StrideU(),
+ rotated_buffer->MutableDataV(), rotated_buffer->StrideV(),
+ crop_width, crop_height,
+ static_cast<libyuv::RotationMode>(rotation));
+ buffer = rotated_buffer;
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698