summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorChien-Yu Chen <cychen@google.com>2014-11-03 22:00:10 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-11-03 22:00:11 +0000
commit3736dbc5c4ef7c0e0cf81ff3fc73579527cad50a (patch)
treee02f98e76d6eb7ef6c3a90a8c07eb59405c42776 /services
parent0c629a3857c31bee6fa39ba7a9a8cbcabeb383fd (diff)
parent1bbc1c93b5db545e503dc27c262eef38685d0726 (diff)
downloadframeworks_av-3736dbc5c4ef7c0e0cf81ff3fc73579527cad50a.zip
frameworks_av-3736dbc5c4ef7c0e0cf81ff3fc73579527cad50a.tar.gz
frameworks_av-3736dbc5c4ef7c0e0cf81ff3fc73579527cad50a.tar.bz2
Merge "CameraService: API1: fix picture FOV" into lmp-mr1-dev
Diffstat (limited to 'services')
-rw-r--r--services/camera/libcameraservice/api1/client2/Parameters.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/services/camera/libcameraservice/api1/client2/Parameters.cpp b/services/camera/libcameraservice/api1/client2/Parameters.cpp
index 7b90d28..42a5507 100644
--- a/services/camera/libcameraservice/api1/client2/Parameters.cpp
+++ b/services/camera/libcameraservice/api1/client2/Parameters.cpp
@@ -2954,6 +2954,10 @@ status_t Parameters::calculatePictureFovs(float *horizFov, float *vertFov)
staticInfo(ANDROID_SENSOR_INFO_PHYSICAL_SIZE, 2, 2);
if (!sensorSize.count) return NO_INIT;
+ camera_metadata_ro_entry_t pixelArraySize =
+ staticInfo(ANDROID_SENSOR_INFO_PIXEL_ARRAY_SIZE, 2, 2);
+ if (!pixelArraySize.count) return NO_INIT;
+
float arrayAspect = static_cast<float>(fastInfo.arrayWidth) /
fastInfo.arrayHeight;
float stillAspect = static_cast<float>(pictureWidth) / pictureHeight;
@@ -3003,6 +3007,16 @@ status_t Parameters::calculatePictureFovs(float *horizFov, float *vertFov)
vertCropFactor = (arrayAspect < stillAspect) ?
(arrayAspect / stillAspect) : 1.f;
}
+
+ /**
+ * Convert the crop factors w.r.t the active array size to the crop factors
+ * w.r.t the pixel array size.
+ */
+ horizCropFactor *= (static_cast<float>(fastInfo.arrayWidth) /
+ pixelArraySize.data.i32[0]);
+ vertCropFactor *= (static_cast<float>(fastInfo.arrayHeight) /
+ pixelArraySize.data.i32[1]);
+
ALOGV("Horiz crop factor: %f, vert crop fact: %f",
horizCropFactor, vertCropFactor);
/**