summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/imageprocessor
diff options
context:
space:
mode:
authorjunjiez <junjiez@codeaurora.org>2016-11-28 14:09:34 +0800
committerArne Coucheron <arco68@gmail.com>2017-06-13 07:18:39 +0200
commit9d21c697f4bd8f62892c374e993ff41d6d98722b (patch)
tree6bb1e9c1ffe182fda3ac116aa81203e6eaa18f22 /src/com/android/camera/imageprocessor
parentcc08b441ef6e94b95babc9f93420798bc6f52311 (diff)
downloadandroid_packages_apps_Snap-9d21c697f4bd8f62892c374e993ff41d6d98722b.tar.gz
android_packages_apps_Snap-9d21c697f4bd8f62892c374e993ff41d6d98722b.tar.bz2
android_packages_apps_Snap-9d21c697f4bd8f62892c374e993ff41d6d98722b.zip
SnapdragonCamera: Fix preview is flipped on 8996
Modidfy render script to implement flip another way not 90 according to the camera mounting position. Change-Id: Id6b305fd2b00bc4193f1ba73d4253794e04ee3a6 CRs-Fixed: 1087483
Diffstat (limited to 'src/com/android/camera/imageprocessor')
-rw-r--r--src/com/android/camera/imageprocessor/FrameProcessor.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/com/android/camera/imageprocessor/FrameProcessor.java b/src/com/android/camera/imageprocessor/FrameProcessor.java
index 4bee19194..a85636bc1 100644
--- a/src/com/android/camera/imageprocessor/FrameProcessor.java
+++ b/src/com/android/camera/imageprocessor/FrameProcessor.java
@@ -31,6 +31,7 @@ package com.android.camera.imageprocessor;
import android.app.Activity;
import android.graphics.ImageFormat;
+import android.hardware.camera2.CameraCharacteristics;
import android.media.Image;
import android.media.ImageReader;
import android.os.Handler;
@@ -39,6 +40,7 @@ import android.renderscript.Allocation;
import android.renderscript.Element;
import android.renderscript.RenderScript;
import android.renderscript.Type;
+import android.util.Log;
import android.util.Size;
import android.view.Surface;
import android.widget.Toast;
@@ -152,7 +154,12 @@ public class FrameProcessor {
mRsRotator.set_width(width);
mRsRotator.set_height(height);
mRsRotator.set_pad(stridePad);
- mRsRotator.set_gFlip(!mModule.isBackCamera());
+ int degree = 90;
+ if(mModule.getMainCameraCharacteristics() != null) {
+ degree = mModule.getMainCameraCharacteristics().
+ get(CameraCharacteristics.SENSOR_ORIENTATION);
+ }
+ mRsRotator.set_degree(degree);
mRsYuvToRGB.set_gIn(mProcessAllocation);
mRsYuvToRGB.set_width(height);
mRsYuvToRGB.set_height(width);