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

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

Issue 2517173004: Move VideoFrame and related declarations to webrtc/api/video. (Closed)
Patch Set: Fix gn dependencies. Created 4 years 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/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 28ae3f2bd4102ac119778141a1cca2a0ed660052..559abaca426d5536991e7c43749cb600a9d4ac36 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,21 +160,8 @@ 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 =
- (rotation == kVideoRotation_180)
- ? I420Buffer::Create(adapted_width, adapted_height)
- : I420Buffer::Create(adapted_height, adapted_width);
- 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;
+ buffer = I420Buffer::Rotate(buffer->NativeToI420Buffer(),
+ rotation);
}
OnFrame(webrtc::VideoFrame(buffer, rotation, translated_camera_time_us),

Powered by Google App Engine
This is Rietveld 408576698