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}
This commit is contained in:
Sami Kalliomäki
2017-09-29 11:50:25 +02:00
committed by Commit Bot
parent 5cd1cfb7c4
commit cbc4b1dc41

View File

@ -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();
}