diff options
author | Tyler Luu <tluu@ti.com> | 2011-08-19 01:40:38 -0500 |
---|---|---|
committer | Wu-cheng Li <wuchengli@google.com> | 2011-08-19 15:40:58 +0800 |
commit | 00fd87fc096d092bfbe3579cd7fe2c1824e6eac0 (patch) | |
tree | 2297af49823e2e04ffc30b8bb7dd2dd5b7b98977 | |
parent | 02a96054aba7b7470e4cab1c36e2582aac43747e (diff) | |
download | hardware_ti_omap4xxx-00fd87fc096d092bfbe3579cd7fe2c1824e6eac0.zip hardware_ti_omap4xxx-00fd87fc096d092bfbe3579cd7fe2c1824e6eac0.tar.gz hardware_ti_omap4xxx-00fd87fc096d092bfbe3579cd7fe2c1824e6eac0.tar.bz2 |
CameraHal: Fix face detection for front sensor
When sensor is in landscape orientation, we should not be
accounting for the mirroring in the sensor orientation
calculations.
bug:5183013
Change-Id: I3bc854c79d210622d99edaf0718c9ba0ca40ceee
-rw-r--r-- | camera/OMXCameraAdapter/OMXCameraAdapter.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/camera/OMXCameraAdapter/OMXCameraAdapter.cpp b/camera/OMXCameraAdapter/OMXCameraAdapter.cpp index c57c391..131072c 100644 --- a/camera/OMXCameraAdapter/OMXCameraAdapter.cpp +++ b/camera/OMXCameraAdapter/OMXCameraAdapter.cpp @@ -2335,8 +2335,10 @@ void OMXCameraAdapter::onOrientationEvent(uint32_t orientation, uint32_t tilt) } // calculate device orientation relative to the sensor orientation - // front camera display is mirrored - if (facing_direction && !strcmp(facing_direction, TICameraParameters::FACING_FRONT)) { + // front camera display is mirrored...needs to be accounted for when orientation + // is 90 or 270...since this will result in a flip on orientation otherwise + if (facing_direction && !strcmp(facing_direction, TICameraParameters::FACING_FRONT) && + (orientation == 90 || orientation == 270)) { device_orientation = (orientation - mount_orientation + 360) % 360; } else { // back-facing camera device_orientation = (orientation + mount_orientation) % 360; |