From cbc4b1dc41ae34b36391e3bd8447fdd2a52c266e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20Kalliom=C3=A4ki?= Date: Fri, 29 Sep 2017 11:50:25 +0200 Subject: [PATCH] Android: Optimize apply_rotation in case the rotation is 0. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously VideoFrame.Buffers would be converted to I420 if apply_rotation() is true. With this change the operation is skipped if the rotation is 0. Bug: webrtc:7749 Change-Id: I24a1a8801e41d8f415b33fe57fec953b74df7459 Reviewed-on: https://webrtc-review.googlesource.com/4665 Reviewed-by: Magnus Jedvert Commit-Queue: Sami Kalliomäki Cr-Commit-Position: refs/heads/master@{#20038} --- sdk/android/src/jni/androidvideotracksource.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/android/src/jni/androidvideotracksource.cc b/sdk/android/src/jni/androidvideotracksource.cc index e5bfcafb77..9099f0117a 100644 --- a/sdk/android/src/jni/androidvideotracksource.cc +++ b/sdk/android/src/jni/androidvideotracksource.cc @@ -192,7 +192,7 @@ void AndroidVideoTrackSource::OnFrameCaptured(JNIEnv* jni, video_buffer_factory_.WrapBuffer(jni, j_adapted_video_frame_buffer); // AdaptedVideoTrackSource handles applying rotation for I420 frames. - if (apply_rotation()) { + if (apply_rotation() && rotation != kVideoRotation_0) { buffer = buffer->ToI420(); }