Merge "Camera: Switch the jpeg orientation when using the native encoder" into sc-qpr1-dev am: 6e60223a63 am: 92105a485a

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15899922

Change-Id: Iae9359177b79773e67a9b509e751b36b559e61a0
This commit is contained in:
TreeHugger Robot
2021-09-23 22:15:10 +00:00
committed by Automerger Merge Worker

View File

@@ -58,7 +58,7 @@ public class CameraExtensionJpegProcessor implements ICaptureProcessorImpl {
private static final class JpegParameters { private static final class JpegParameters {
public HashSet<Long> mTimeStamps = new HashSet<>(); public HashSet<Long> mTimeStamps = new HashSet<>();
public int mRotation = JPEG_DEFAULT_ROTATION; // CCW multiple of 90 degrees public int mRotation = JPEG_DEFAULT_ROTATION; // CW multiple of 90 degrees
public int mQuality = JPEG_DEFAULT_QUALITY; // [0..100] public int mQuality = JPEG_DEFAULT_QUALITY; // [0..100]
} }
@@ -100,7 +100,8 @@ public class CameraExtensionJpegProcessor implements ICaptureProcessorImpl {
Integer orientation = captureBundles.get(0).captureResult.get( Integer orientation = captureBundles.get(0).captureResult.get(
CaptureResult.JPEG_ORIENTATION); CaptureResult.JPEG_ORIENTATION);
if (orientation != null) { if (orientation != null) {
ret.mRotation = orientation / 90; // The jpeg encoder expects CCW rotation, convert from CW
ret.mRotation = (360 - (orientation % 360)) / 90;
} else { } else {
Log.w(TAG, "No jpeg rotation set, using default: " + JPEG_DEFAULT_ROTATION); Log.w(TAG, "No jpeg rotation set, using default: " + JPEG_DEFAULT_ROTATION);
} }