summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIvan Evlogiev <x0099089@ti.com>2012-02-14 18:44:38 +0200
committerDaniel Levin <dendy@ti.com>2012-07-25 08:55:41 -0500
commit7b3b53a00c6aed6225827ba901fa15f55d389bfb (patch)
treed0c642e345028378a8a6554e69977d9343b51683
parenta5f87e96b1bc1bdfd4e3d326034147fd5ace960b (diff)
downloadhardware_ti_omap4-7b3b53a00c6aed6225827ba901fa15f55d389bfb.zip
hardware_ti_omap4-7b3b53a00c6aed6225827ba901fa15f55d389bfb.tar.gz
hardware_ti_omap4-7b3b53a00c6aed6225827ba901fa15f55d389bfb.tar.bz2
CameraHal: Use max zoom value from capabilities
Maximum zoom value for stereo is different from the one in mono. Ducati returns maximum possible zoom possition in the capabilities. And this exact possition is used as camera adapter maximum zoom value Change-Id: I23ac8f657b69ad28038ed68286ee0a51f9ffc6b8 Signed-off-by: Ivan Evlogiev <x0099089@ti.com>
-rw-r--r--camera/OMXCameraAdapter/OMXCameraAdapter.cpp6
-rw-r--r--camera/OMXCameraAdapter/OMXZoom.cpp15
-rw-r--r--camera/inc/OMXCameraAdapter/OMXCameraAdapter.h2
3 files changed, 13 insertions, 10 deletions
diff --git a/camera/OMXCameraAdapter/OMXCameraAdapter.cpp b/camera/OMXCameraAdapter/OMXCameraAdapter.cpp
index 18c1c88..493ea2f 100644
--- a/camera/OMXCameraAdapter/OMXCameraAdapter.cpp
+++ b/camera/OMXCameraAdapter/OMXCameraAdapter.cpp
@@ -222,6 +222,12 @@ status_t OMXCameraAdapter::initialize(CameraProperties::Properties* caps)
mEXIFData.mModelValid = false;
mEXIFData.mMakeValid = false;
+ if (mCapabilities->get(CameraProperties::SUPPORTED_ZOOM_STAGES) != NULL) {
+ mMaxZoomSupported = mCapabilities->getInt(CameraProperties::SUPPORTED_ZOOM_STAGES) + 1;
+ } else {
+ mMaxZoomSupported = 1;
+ }
+
// initialize command handling thread
if(mCommandHandler.get() == NULL)
mCommandHandler = new CommandHandler(this);
diff --git a/camera/OMXCameraAdapter/OMXZoom.cpp b/camera/OMXCameraAdapter/OMXZoom.cpp
index 478fd81..f2775b5 100644
--- a/camera/OMXCameraAdapter/OMXZoom.cpp
+++ b/camera/OMXCameraAdapter/OMXZoom.cpp
@@ -57,8 +57,7 @@ status_t OMXCameraAdapter::setParametersZoom(const CameraParameters &params,
if ( ( ZOOM_ACTIVE & state ) != ZOOM_ACTIVE )
{
int zoom = params.getInt(CameraParameters::KEY_ZOOM);
- if( ( zoom >= 0 ) && ( zoom < ZOOM_STAGES ) )
- {
+ if (( zoom >= 0 ) && ( zoom < mMaxZoomSupported )) {
mTargetZoomIdx = zoom;
//Immediate zoom should be applied instantly ( CTS requirement )
@@ -93,8 +92,7 @@ status_t OMXCameraAdapter::doZoom(int index)
ret = -1;
}
- if ( ( 0 > index) || ( ( ZOOM_STAGES - 1 ) < index ) )
- {
+ if (( 0 > index) || ((mMaxZoomSupported - 1 ) < index )) {
CAMHAL_LOGEB("Zoom index %d out of range", index);
ret = -EINVAL;
}
@@ -243,17 +241,14 @@ status_t OMXCameraAdapter::startSmoothZoom(int targetIdx)
targetIdx,
mCurrentZoomIdx);
- if ( ( targetIdx >= 0 ) && ( targetIdx < ZOOM_STAGES ) )
- {
+ if (( targetIdx >= 0 ) && ( targetIdx < mMaxZoomSupported )) {
mTargetZoomIdx = targetIdx;
mZoomParameterIdx = mCurrentZoomIdx;
mReturnZoomStatus = false;
- }
- else
- {
+ } else {
CAMHAL_LOGEB("Smooth value out of range %d!", targetIdx);
ret = -EINVAL;
- }
+ }
LOG_FUNCTION_NAME_EXIT;
diff --git a/camera/inc/OMXCameraAdapter/OMXCameraAdapter.h b/camera/inc/OMXCameraAdapter/OMXCameraAdapter.h
index 7bce4ae..7c1e7ff 100644
--- a/camera/inc/OMXCameraAdapter/OMXCameraAdapter.h
+++ b/camera/inc/OMXCameraAdapter/OMXCameraAdapter.h
@@ -1048,6 +1048,8 @@ private:
OMX_TI_DCCDATATYPE mDccData;
Mutex mDccDataLock;
+
+ int mMaxZoomSupported;
};
}; //// namespace
#endif //OMX_CAMERA_ADAPTER_H