Android: Optimize apply_rotation in case the rotation is 0.
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 <magjed@webrtc.org>
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20038}
diff --git a/sdk/android/src/jni/androidvideotracksource.cc b/sdk/android/src/jni/androidvideotracksource.cc
index e5bfcaf..9099f01 100644
--- a/sdk/android/src/jni/androidvideotracksource.cc
+++ b/sdk/android/src/jni/androidvideotracksource.cc
@@ -192,7 +192,7 @@
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();
}