summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjunjiez <junjiez@codeaurora.org>2016-12-07 07:44:46 (GMT)
committerArne Coucheron <arco68@gmail.com>2017-06-13 05:18:41 (GMT)
commit708af54ab42e5f4143d987ef6a9aa476499763ae (patch)
tree413d460adc9bf494f92d0da8e5d68636e5c962b7
parent9d21c697f4bd8f62892c374e993ff41d6d98722b (diff)
downloadandroid_packages_apps_Snap-708af54ab42e5f4143d987ef6a9aa476499763ae.zip
android_packages_apps_Snap-708af54ab42e5f4143d987ef6a9aa476499763ae.tar.gz
android_packages_apps_Snap-708af54ab42e5f4143d987ef6a9aa476499763ae.tar.bz2
SnapdragonCamera: Fix front camera preview flipped
Modidfy render script to implement new flip way according to the front camera mounting position. Change-Id: I5681447aa17c0499bcb7dc47eef6d4793ee68818 CRs-Fixed: 1097179
-rwxr-xr-xrs/rotator.rs9
-rw-r--r--src/com/android/camera/imageprocessor/FrameProcessor.java3
2 files changed, 12 insertions, 0 deletions
diff --git a/rs/rotator.rs b/rs/rotator.rs
index 2c57951..62257d2 100755
--- a/rs/rotator.rs
+++ b/rs/rotator.rs
@@ -50,6 +50,10 @@ uchar __attribute__((kernel)) rotate90andMerge(uint32_t x, uint32_t y) {
if(x >= width - pad)
return (uchar)0;
rsSetElementAt_uchar(gOut, yValue, (width-1-x-pad)*height + y);
+ } else if (degree == 0) {
+ if(x >= width - pad)
+ return (uchar)0;
+ rsSetElementAt_uchar(gOut, yValue, x*height + y);
}
@@ -71,6 +75,11 @@ uchar __attribute__((kernel)) rotate90andMerge(uint32_t x, uint32_t y) {
return (uchar)0;
rsSetElementAt_uchar(gOut, uValue, ySize + (width-1-x-pad)/2*height + y -1);
rsSetElementAt_uchar(gOut, vValue, ySize + (width-1-x-pad)/2*height + y);
+ } else if (degree == 0) {
+ if(x >= (width - pad))
+ return (uchar)0;
+ rsSetElementAt_uchar(gOut, uValue, ySize + x/2*height + y - 1);
+ rsSetElementAt_uchar(gOut, vValue, ySize + x/2*height + y);
}
}
return (uchar)0;
diff --git a/src/com/android/camera/imageprocessor/FrameProcessor.java b/src/com/android/camera/imageprocessor/FrameProcessor.java
index a85636b..d4b4790 100644
--- a/src/com/android/camera/imageprocessor/FrameProcessor.java
+++ b/src/com/android/camera/imageprocessor/FrameProcessor.java
@@ -158,6 +158,9 @@ public class FrameProcessor {
if(mModule.getMainCameraCharacteristics() != null) {
degree = mModule.getMainCameraCharacteristics().
get(CameraCharacteristics.SENSOR_ORIENTATION);
+ if (mModule.getMainCameraId() == CaptureModule.FRONT_ID) {
+ degree = Math.abs(degree - 90);
+ }
}
mRsRotator.set_degree(degree);
mRsYuvToRGB.set_gIn(mProcessAllocation);