Chromium Code Reviews| 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 cecb13cdb952052c0e9d9f0cdc88de6195f2c180..e73017b9040107bf035de10dfcbcec084778d1c2 100644 |
| --- a/webrtc/sdk/objc/Framework/Classes/avfoundationvideocapturer.mm |
| +++ b/webrtc/sdk/objc/Framework/Classes/avfoundationvideocapturer.mm |
| @@ -17,13 +17,13 @@ |
| #import "WebRTC/RTCLogging.h" |
| #include "avfoundationformatmapper.h" |
| -#include "libyuv/rotate.h" |
| + |
| +#include "webrtc/api/video/video_rotation.h" |
| #include "webrtc/base/bind.h" |
| #include "webrtc/base/checks.h" |
| #include "webrtc/base/logging.h" |
| #include "webrtc/base/thread.h" |
| #include "webrtc/common_video/include/corevideo_frame_buffer.h" |
| -#include "webrtc/common_video/rotation.h" |
| namespace webrtc { |
| @@ -160,25 +160,12 @@ void AVFoundationVideoCapturer::CaptureSampleBuffer( |
| // Applying rotation is only supported for legacy reasons and performance is |
| // not critical here. |
| if (apply_rotation() && rotation != kVideoRotation_0) { |
| - buffer = buffer->NativeToI420Buffer(); |
| - rtc::scoped_refptr<I420Buffer> rotated_buffer; |
| - if (rotation == kVideoRotation_0 || rotation == kVideoRotation_180) { |
| - rotated_buffer = I420Buffer::Create(adapted_width, adapted_height); |
| - } else { |
| - // Swap width and height. |
| - rotated_buffer = I420Buffer::Create(adapted_height, adapted_width); |
| + buffer = I420Buffer::Rotate(buffer->NativeToI420Buffer(), |
|
nisse-webrtc
2017/01/09 15:31:06
Magnus: Does this rebase with your rotation bugfix
magjed_webrtc
2017/01/10 13:48:37
It looks correct.
It's unclear for me as well how
|
| + rotation); |
| + if (rotation != kVideoRotation_180) { |
|
magjed_webrtc
2017/01/10 13:48:37
Makes more sense to do:
if (rotation == kVideoRota
nisse-webrtc
2017/01/10 14:09:00
Should be equivalent (since rotation 0 is excluded
|
| std::swap(captured_width, captured_height); |
| } |
| - libyuv::I420Rotate( |
| - buffer->DataY(), buffer->StrideY(), |
| - buffer->DataU(), buffer->StrideU(), |
| - buffer->DataV(), buffer->StrideV(), |
| - rotated_buffer->MutableDataY(), rotated_buffer->StrideY(), |
| - rotated_buffer->MutableDataU(), rotated_buffer->StrideU(), |
| - rotated_buffer->MutableDataV(), rotated_buffer->StrideV(), |
| - buffer->width(), buffer->height(), |
| - static_cast<libyuv::RotationMode>(rotation)); |
| - buffer = rotated_buffer; |
| + |
| rotation = kVideoRotation_0; |
| } |