summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilen Mitkov <mmitkov@mm-sol.com>2011-08-26 16:20:10 +0300
committerIliyan Malchev <malchev@google.com>2011-09-02 14:02:52 -0700
commitd33c79311f06dfd04b25f42ec2da89a3fe1e37d1 (patch)
tree8225464ccc8865816adb9ef0affdf02efc945148
parent664ce73b9414b1ece5eff9419ccd6eef37826fef (diff)
downloadhardware_ti_omap4-d33c79311f06dfd04b25f42ec2da89a3fe1e37d1.zip
hardware_ti_omap4-d33c79311f06dfd04b25f42ec2da89a3fe1e37d1.tar.gz
hardware_ti_omap4-d33c79311f06dfd04b25f42ec2da89a3fe1e37d1.tar.bz2
CameraHAL : Multiple focus and exposure areas support
Adds support for multiple focus and exposure areas and also correctly returning the number of maximum supported focus and exposure areas. - Patch set 4: converting the coordinates, which are sent to 3A in the range 0 - 255. Both Focus and Exposure algorithms use this range - Patch set 5: Handling special area (0, 0, 0, 0, 0), rebasing and also memory allocation alignment to 4K chunks. - Patch set 6: Freeing the alloc'd buffer in case of error. Change-Id: I45bdd4309b75ac4d50deb05e97120362cdb1937b Signed-off-by: Milen Mitkov <mmitkov@mm-sol.com>
-rw-r--r--camera/CameraHal.cpp5
-rw-r--r--camera/OMXCameraAdapter/OMX3A.cpp146
-rw-r--r--camera/OMXCameraAdapter/OMXCapabilities.cpp31
-rw-r--r--camera/OMXCameraAdapter/OMXDefaults.cpp1
-rw-r--r--camera/OMXCameraAdapter/OMXFocus.cpp109
-rw-r--r--camera/inc/CameraHal.h6
-rw-r--r--camera/inc/CameraProperties.h1
-rw-r--r--camera/inc/General3A_Settings.h1
-rw-r--r--camera/inc/OMXCameraAdapter/OMXCameraAdapter.h13
9 files changed, 265 insertions, 48 deletions
diff --git a/camera/CameraHal.cpp b/camera/CameraHal.cpp
index 2f291c6..4830ebf 100644
--- a/camera/CameraHal.cpp
+++ b/camera/CameraHal.cpp
@@ -827,6 +827,11 @@ int CameraHal::setParameters(const CameraParameters& params)
CAMHAL_LOGDB("Auto WhiteBalance Lock set %s", params.get(CameraParameters::KEY_AUTO_WHITEBALANCE_LOCK));
mParameters.set(CameraParameters::KEY_AUTO_WHITEBALANCE_LOCK, valstr);
}
+ if( (valstr = params.get(CameraParameters::KEY_METERING_AREAS)) != NULL )
+ {
+ CAMHAL_LOGEB("Metering areas position set %s", params.get(CameraParameters::KEY_METERING_AREAS));
+ mParameters.set(CameraParameters::KEY_METERING_AREAS, valstr);
+ }
CameraParameters adapterParams = mParameters;
diff --git a/camera/OMXCameraAdapter/OMX3A.cpp b/camera/OMXCameraAdapter/OMX3A.cpp
index 7b3119b..d093af3 100644
--- a/camera/OMXCameraAdapter/OMX3A.cpp
+++ b/camera/OMXCameraAdapter/OMX3A.cpp
@@ -33,6 +33,8 @@
#define TRUE "true"
#define FALSE "false"
+#define METERING_AREAS_RANGE 0xFF
+
namespace android {
status_t OMXCameraAdapter::setParameters3A(const CameraParameters &params,
@@ -267,6 +269,30 @@ status_t OMXCameraAdapter::setParameters3A(const CameraParameters &params,
}
}
+ str = params.get(CameraParameters::KEY_METERING_AREAS);
+ if ( (str != NULL) )
+ {
+ size_t MAX_METERING_AREAS;
+ MAX_METERING_AREAS = atoi(params.get(CameraParameters::KEY_MAX_NUM_METERING_AREAS));
+
+ mMeteringAreas.clear();
+
+ CameraArea::parseFocusArea(str, strlen(str), mMeteringAreas);
+
+ if ( MAX_METERING_AREAS > mMeteringAreas.size() )
+ {
+ CAMHAL_LOGDB("Setting Metering Areas %s",
+ params.get(CameraParameters::KEY_METERING_AREAS));
+
+ mPending3Asettings |= SetMeteringAreas;
+ }
+ else
+ {
+ CAMHAL_LOGEB("Metering areas supported %d, metering areas set %d",
+ MAX_METERING_AREAS, mMeteringAreas.size());
+ }
+ }
+
LOG_FUNCTION_NAME_EXIT;
return ret;
@@ -483,21 +509,7 @@ status_t OMXCameraAdapter::setFocusMode(Gen3A_settings& Gen3A)
//Enable region algorithm priority
setAlgoPriority(REGION_PRIORITY, FOCUS_ALGO, true);
- //Set position
- OMXCameraPortParameters * mPreviewData = NULL;
- mPreviewData = &mCameraAdapterParameters.mCameraPortParams[mCameraAdapterParameters.mPrevPortIndex];
- focusArea->transfrom(mPreviewData->mWidth,
- mPreviewData->mHeight,
- top,
- left,
- width,
- height);
- setTouchFocus(left,
- top,
- width,
- height,
- mPreviewData->mWidth,
- mPreviewData->mHeight);
+ setTouchFocus();
//Do normal focus afterwards
//FIXME: Check if the extended focus control is needed? this overrides caf
@@ -1078,6 +1090,106 @@ status_t OMXCameraAdapter::set3ALock(OMX_BOOL toggle)
}
+status_t OMXCameraAdapter::setMeteringAreas(Gen3A_settings& Gen3A)
+{
+ status_t ret = NO_ERROR;
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+
+ OMX_ALGOAREASTYPE **meteringAreas;
+ OMX_TI_CONFIG_SHAREDBUFFER sharedBuffer;
+ MemoryManager memMgr;
+ int areasSize = 0;
+
+ LOG_FUNCTION_NAME
+
+ if ( OMX_StateInvalid == mComponentState )
+ {
+ CAMHAL_LOGEA("OMX component is in invalid state");
+ return NO_INIT;
+ }
+
+ areasSize = ((sizeof(OMX_ALGOAREASTYPE)+4095)/4096)*4096;
+ meteringAreas = (OMX_ALGOAREASTYPE**) memMgr.allocateBuffer(0, 0, NULL, areasSize, 1);
+
+ OMXCameraPortParameters * mPreviewData = NULL;
+ mPreviewData = &mCameraAdapterParameters.mCameraPortParams[mCameraAdapterParameters.mPrevPortIndex];
+
+ if (!meteringAreas)
+ {
+ CAMHAL_LOGEB("Error allocating buffer for metering areas %d", eError);
+ return -ENOMEM;
+ }
+
+ OMX_INIT_STRUCT_PTR (meteringAreas[0], OMX_ALGOAREASTYPE);
+
+ meteringAreas[0]->nPortIndex = OMX_ALL;
+ meteringAreas[0]->nNumAreas = mMeteringAreas.size();
+ meteringAreas[0]->nAlgoAreaPurpose = OMX_AlgoAreaExposure;
+
+ for ( unsigned int n = 0; n < mMeteringAreas.size(); n++)
+ {
+ // transform the coordinates to 3A-type coordinates
+ mMeteringAreas.itemAt(n)->transfrom((size_t)mPreviewData->mWidth,
+ (size_t)mPreviewData->mHeight,
+ (size_t&)meteringAreas[0]->tAlgoAreas[n].nTop,
+ (size_t&)meteringAreas[0]->tAlgoAreas[n].nLeft,
+ (size_t&)meteringAreas[0]->tAlgoAreas[n].nWidth,
+ (size_t&)meteringAreas[0]->tAlgoAreas[n].nHeight);
+
+ meteringAreas[0]->tAlgoAreas[n].nLeft =
+ ( meteringAreas[0]->tAlgoAreas[n].nLeft * METERING_AREAS_RANGE ) / mPreviewData->mWidth;
+ meteringAreas[0]->tAlgoAreas[n].nTop =
+ ( meteringAreas[0]->tAlgoAreas[n].nTop* METERING_AREAS_RANGE ) / mPreviewData->mHeight;
+ meteringAreas[0]->tAlgoAreas[n].nWidth =
+ ( meteringAreas[0]->tAlgoAreas[n].nWidth * METERING_AREAS_RANGE ) / mPreviewData->mWidth;
+ meteringAreas[0]->tAlgoAreas[n].nHeight =
+ ( meteringAreas[0]->tAlgoAreas[n].nHeight * METERING_AREAS_RANGE ) / mPreviewData->mHeight;
+
+ meteringAreas[0]->tAlgoAreas[n].nPriority = mMeteringAreas.itemAt(n)->getWeight();
+
+ CAMHAL_LOGDB("Metering area %d : top = %d left = %d width = %d height = %d prio = %d",
+ n, (int)meteringAreas[0]->tAlgoAreas[n].nTop, (int)meteringAreas[0]->tAlgoAreas[n].nLeft,
+ (int)meteringAreas[0]->tAlgoAreas[n].nWidth, (int)meteringAreas[0]->tAlgoAreas[n].nHeight,
+ (int)meteringAreas[0]->tAlgoAreas[n].nPriority);
+
+ }
+
+ OMX_INIT_STRUCT_PTR (&sharedBuffer, OMX_TI_CONFIG_SHAREDBUFFER);
+
+ sharedBuffer.nPortIndex = OMX_ALL;
+ sharedBuffer.nSharedBuffSize = areasSize;
+ sharedBuffer.pSharedBuff = (OMX_U8 *) meteringAreas[0];
+
+ if ( NULL == sharedBuffer.pSharedBuff )
+ {
+ CAMHAL_LOGEA("No resources to allocate OMX shared buffer");
+ ret = -ENOMEM;
+ goto EXIT;
+ }
+
+ eError = OMX_SetConfig(mCameraAdapterParameters.mHandleComp,
+ (OMX_INDEXTYPE) OMX_TI_IndexConfigAlgoAreas, &sharedBuffer);
+
+ if ( OMX_ErrorNone != eError )
+ {
+ CAMHAL_LOGEB("Error while setting Focus Areas configuration 0x%x", eError);
+ ret = -EINVAL;
+ }
+ else
+ {
+ CAMHAL_LOGDA("Metering Areas SetConfig successfull.");
+ }
+
+ EXIT:
+ if (NULL != meteringAreas)
+ {
+ memMgr.freeBuffer((void*) meteringAreas);
+ meteringAreas = NULL;
+ }
+
+ return ret;
+}
+
status_t OMXCameraAdapter::apply3Asettings( Gen3A_settings& Gen3A )
{
status_t ret = NO_ERROR;
@@ -1193,6 +1305,10 @@ status_t OMXCameraAdapter::apply3Asettings( Gen3A_settings& Gen3A )
ret |= setWhiteBalanceLock(Gen3A);
break;
}
+ case SetMeteringAreas:
+ {
+ ret |= setMeteringAreas(Gen3A);
+ }
default:
CAMHAL_LOGEB("this setting (0x%x) is still not supported in CameraAdapter ",
diff --git a/camera/OMXCameraAdapter/OMXCapabilities.cpp b/camera/OMXCameraAdapter/OMXCapabilities.cpp
index 0272f8a..5525a3f 100644
--- a/camera/OMXCameraAdapter/OMXCapabilities.cpp
+++ b/camera/OMXCameraAdapter/OMXCapabilities.cpp
@@ -925,6 +925,29 @@ status_t OMXCameraAdapter::insertFlickerModes(CameraProperties::Properties* para
return ret;
}
+status_t OMXCameraAdapter::insertAreas(CameraProperties::Properties* params, OMX_TI_CAPTYPE &caps) {
+ status_t ret = NO_ERROR;
+ char supported[MAX_PROP_VALUE_LENGTH];
+ const char *p;
+
+ LOG_FUNCTION_NAME;
+
+ memset(supported, '\0', MAX_PROP_VALUE_LENGTH);
+
+ sprintf(supported, "%d", caps.ulAlgoAreasFocusCount);
+ params->set(CameraProperties::MAX_FOCUS_AREAS, supported);
+ CAMHAL_LOGDB("Maximum supported focus areas %s", supported);
+
+ memset(supported, '\0', MAX_PROP_VALUE_LENGTH);
+ sprintf(supported, "%d", caps.ulAlgoAreasExposureCount);
+ params->set(CameraProperties::MAX_NUM_METERING_AREAS, supported);
+ CAMHAL_LOGDB("Maximum supported exposure areas %s", supported);
+
+ LOG_FUNCTION_NAME;
+
+ return ret;
+}
+
status_t OMXCameraAdapter::insertLocks(CameraProperties::Properties* params, OMX_TI_CAPTYPE &caps) {
status_t ret = NO_ERROR;
@@ -967,7 +990,6 @@ status_t OMXCameraAdapter::insertDefaults(CameraProperties::Properties* params,
params->set(CameraProperties::PREVIEW_SIZE, DEFAULT_PREVIEW_SIZE);
params->set(CameraProperties::REQUIRED_PREVIEW_BUFS, DEFAULT_NUM_PREV_BUFS);
params->set(CameraProperties::REQUIRED_IMAGE_BUFS, DEFAULT_NUM_PIC_BUFS);
- params->set(CameraProperties::MAX_FOCUS_AREAS, DEFAULT_MAX_FOCUS_AREAS);
params->set(CameraProperties::SATURATION, DEFAULT_SATURATION);
params->set(CameraProperties::SCENE_MODE, DEFAULT_SCENE_MODE);
params->set(CameraProperties::SHARPNESS, DEFAULT_SHARPNESS);
@@ -978,7 +1000,6 @@ status_t OMXCameraAdapter::insertDefaults(CameraProperties::Properties* params,
params->set(CameraProperties::MAX_FD_SW_FACES, DEFAULT_MAX_FD_SW_FACES);
params->set(CameraProperties::AUTO_EXPOSURE_LOCK, DEFAULT_AE_LOCK);
params->set(CameraProperties::AUTO_WHITEBALANCE_LOCK, DEFAULT_AWB_LOCK);
- params->set(CameraProperties::MAX_NUM_METERING_AREAS, DEFAULT_MAX_NUM_METERING_AREAS);
params->set(CameraProperties::FOCAL_LENGTH, DEFAULT_FOCAL_LENGTH);
params->set(CameraProperties::HOR_ANGLE, DEFAULT_HOR_ANGLE);
params->set(CameraProperties::VER_ANGLE, DEFAULT_VER_ANGLE);
@@ -1105,11 +1126,17 @@ status_t OMXCameraAdapter::insertCapabilities(CameraProperties::Properties* para
if ( NO_ERROR == ret ) {
ret = insertLocks(params, caps);
}
+ if ( NO_ERROR == ret) {
+ ret = insertAreas(params, caps);
+
+ }
if ( NO_ERROR == ret ) {
ret = insertDefaults(params, caps);
}
+
+
LOG_FUNCTION_NAME_EXIT;
return ret;
diff --git a/camera/OMXCameraAdapter/OMXDefaults.cpp b/camera/OMXCameraAdapter/OMXDefaults.cpp
index bcc52e8..6661f50 100644
--- a/camera/OMXCameraAdapter/OMXDefaults.cpp
+++ b/camera/OMXCameraAdapter/OMXDefaults.cpp
@@ -71,6 +71,5 @@ const char OMXCameraAdapter::DEFAULT_MAX_NUM_METERING_AREAS[] = "0";
const char OMXCameraAdapter::DEFAULT_LOCK_SUPPORTED[] = "true";
const char OMXCameraAdapter::DEFAULT_LOCK_UNSUPPORTED[] = "false";
-const size_t OMXCameraAdapter::MAX_FOCUS_AREAS = 1;
};
diff --git a/camera/OMXCameraAdapter/OMXFocus.cpp b/camera/OMXCameraAdapter/OMXFocus.cpp
index 3469394..b7517a8 100644
--- a/camera/OMXCameraAdapter/OMXFocus.cpp
+++ b/camera/OMXCameraAdapter/OMXFocus.cpp
@@ -41,10 +41,15 @@ status_t OMXCameraAdapter::setParametersFocus(const CameraParameters &params,
status_t ret = NO_ERROR;
const char *str = NULL;
Mutex::Autolock lock(mFocusAreasLock);
+ size_t MAX_FOCUS_AREAS;
+
LOG_FUNCTION_NAME;
str = params.get(CameraParameters::KEY_FOCUS_AREAS);
+
+ MAX_FOCUS_AREAS = atoi(params.get(CameraParameters::KEY_MAX_NUM_FOCUS_AREAS));
+
mFocusAreas.clear();
if ( NULL != str ) {
ret = CameraArea::parseFocusArea(str, ( strlen(str) + 1 ), mFocusAreas);
@@ -647,16 +652,15 @@ status_t OMXCameraAdapter::addFocusDistances(OMX_U32 &near,
return ret;
}
-status_t OMXCameraAdapter::setTouchFocus(size_t posX,
- size_t posY,
- size_t posWidth,
- size_t posHeight,
- size_t previewWidth,
- size_t previewHeight)
+status_t OMXCameraAdapter::setTouchFocus()
{
status_t ret = NO_ERROR;
OMX_ERRORTYPE eError = OMX_ErrorNone;
- OMX_CONFIG_EXTFOCUSREGIONTYPE touchControl;
+
+ OMX_ALGOAREASTYPE **focusAreas;
+ OMX_TI_CONFIG_SHAREDBUFFER sharedBuffer;
+ MemoryManager memMgr;
+ int areasSize = 0;
LOG_FUNCTION_NAME;
@@ -668,27 +672,86 @@ status_t OMXCameraAdapter::setTouchFocus(size_t posX,
if ( NO_ERROR == ret )
{
- OMX_INIT_STRUCT_PTR (&touchControl, OMX_CONFIG_EXTFOCUSREGIONTYPE);
- touchControl.nLeft = ( posX * TOUCH_FOCUS_RANGE ) / previewWidth;
- touchControl.nTop = ( posY * TOUCH_FOCUS_RANGE ) / previewHeight;
- touchControl.nWidth = ( posWidth * TOUCH_FOCUS_RANGE ) / previewWidth;
- touchControl.nHeight = ( posHeight * TOUCH_FOCUS_RANGE ) / previewHeight;
- eError = OMX_SetConfig(mCameraAdapterParameters.mHandleComp,
- ( OMX_INDEXTYPE ) OMX_IndexConfigExtFocusRegion,
- &touchControl);
+ areasSize = ((sizeof(OMX_ALGOAREASTYPE)+4095)/4096)*4096;
+ focusAreas = (OMX_ALGOAREASTYPE**) memMgr.allocateBuffer(0, 0, NULL, areasSize, 1);
+
+ OMXCameraPortParameters * mPreviewData = NULL;
+ mPreviewData = &mCameraAdapterParameters.mCameraPortParams[mCameraAdapterParameters.mPrevPortIndex];
+
+ if (!focusAreas)
+ {
+ CAMHAL_LOGEB("Error allocating buffer for focus areas %d", eError);
+ return -ENOMEM;
+ }
+
+ OMX_INIT_STRUCT_PTR (focusAreas[0], OMX_ALGOAREASTYPE);
+
+ focusAreas[0]->nPortIndex = OMX_ALL;
+ focusAreas[0]->nNumAreas = mFocusAreas.size();
+ focusAreas[0]->nAlgoAreaPurpose = OMX_AlgoAreaFocus;
+
+ // If the area is the special case of (0, 0, 0, 0, 0), then
+ // the algorithm needs nNumAreas to be set to 0,
+ // in order to automatically choose the best fitting areas.
+ if ( mFocusAreas.itemAt(0)->isZeroArea() )
+ {
+ focusAreas[0]->nNumAreas = 0;
+ }
+
+ for ( unsigned int n = 0; n < mFocusAreas.size(); n++)
+ {
+ // transform the coordinates to 3A-type coordinates
+ mFocusAreas.itemAt(n)->transfrom((size_t)mPreviewData->mWidth,
+ (size_t)mPreviewData->mHeight,
+ (size_t&)focusAreas[0]->tAlgoAreas[n].nTop,
+ (size_t&)focusAreas[0]->tAlgoAreas[n].nLeft,
+ (size_t&)focusAreas[0]->tAlgoAreas[n].nWidth,
+ (size_t&)focusAreas[0]->tAlgoAreas[n].nHeight);
+
+ focusAreas[0]->tAlgoAreas[n].nLeft =
+ ( focusAreas[0]->tAlgoAreas[n].nLeft * TOUCH_FOCUS_RANGE ) / mPreviewData->mWidth;
+ focusAreas[0]->tAlgoAreas[n].nTop =
+ ( focusAreas[0]->tAlgoAreas[n].nTop* TOUCH_FOCUS_RANGE ) / mPreviewData->mHeight;
+ focusAreas[0]->tAlgoAreas[n].nWidth =
+ ( focusAreas[0]->tAlgoAreas[n].nWidth * TOUCH_FOCUS_RANGE ) / mPreviewData->mWidth;
+ focusAreas[0]->tAlgoAreas[n].nHeight =
+ ( focusAreas[0]->tAlgoAreas[n].nHeight * TOUCH_FOCUS_RANGE ) / mPreviewData->mHeight;
+ focusAreas[0]->tAlgoAreas[n].nPriority = mFocusAreas.itemAt(n)->getWeight();
+
+ CAMHAL_LOGDB("Focus area %d : top = %d left = %d width = %d height = %d prio = %d",
+ n, (int)focusAreas[0]->tAlgoAreas[n].nTop, (int)focusAreas[0]->tAlgoAreas[n].nLeft,
+ (int)focusAreas[0]->tAlgoAreas[n].nWidth, (int)focusAreas[0]->tAlgoAreas[n].nHeight,
+ (int)focusAreas[0]->tAlgoAreas[n].nPriority);
+ }
+
+ OMX_INIT_STRUCT_PTR (&sharedBuffer, OMX_TI_CONFIG_SHAREDBUFFER);
+
+ sharedBuffer.nPortIndex = OMX_ALL;
+ sharedBuffer.nSharedBuffSize = areasSize;
+ sharedBuffer.pSharedBuff = (OMX_U8 *) focusAreas[0];
+
+ if ( NULL == sharedBuffer.pSharedBuff )
+ {
+ CAMHAL_LOGEA("No resources to allocate OMX shared buffer");
+ ret = -ENOMEM;
+ goto EXIT;
+ }
+
+ eError = OMX_SetConfig(mCameraAdapterParameters.mHandleComp,
+ (OMX_INDEXTYPE) OMX_TI_IndexConfigAlgoAreas, &sharedBuffer);
+
if ( OMX_ErrorNone != eError )
{
- CAMHAL_LOGEB("Error while configuring touch focus 0x%x", eError);
- ret = -1;
+ CAMHAL_LOGEB("Error while setting Focus Areas configuration 0x%x", eError);
+ ret = -EINVAL;
}
- else
+
+ EXIT:
+ if (NULL != focusAreas)
{
- CAMHAL_LOGDB("Touch focus %d,%d %d,%d configured successfuly",
- ( int ) touchControl.nLeft,
- ( int ) touchControl.nTop,
- ( int ) touchControl.nWidth,
- ( int ) touchControl.nHeight);
+ memMgr.freeBuffer((void*) focusAreas);
+ focusAreas = NULL;
}
}
diff --git a/camera/inc/CameraHal.h b/camera/inc/CameraHal.h
index b7104da..8c09701 100644
--- a/camera/inc/CameraHal.h
+++ b/camera/inc/CameraHal.h
@@ -139,6 +139,12 @@ public:
return ( ( 0 != mTop ) || ( 0 != mLeft ) || ( 0 != mBottom ) || ( 0 != mRight) );
}
+ bool isZeroArea()
+ {
+ return ( (0 == mTop ) && ( 0 == mLeft ) && ( 0 == mBottom )
+ && ( 0 == mRight ) && ( 0 == mWeight ));
+ }
+
size_t getWeight()
{
return mWeight;
diff --git a/camera/inc/CameraProperties.h b/camera/inc/CameraProperties.h
index 57dfe80..0af80f2 100644
--- a/camera/inc/CameraProperties.h
+++ b/camera/inc/CameraProperties.h
@@ -127,6 +127,7 @@ public:
static const char AUTO_WHITEBALANCE_LOCK_SUPPORTED[];
static const char MAX_NUM_METERING_AREAS[];
static const char METERING_AREAS[];
+ static const char MAX_NUM_FOCUS_AREAS[];
CameraProperties();
~CameraProperties();
diff --git a/camera/inc/General3A_Settings.h b/camera/inc/General3A_Settings.h
index 9e0e798..8267c04 100644
--- a/camera/inc/General3A_Settings.h
+++ b/camera/inc/General3A_Settings.h
@@ -253,6 +253,7 @@ enum E3ASettingsFlags
SetFlash = 1 << 15,
SetExpLock = 1 << 16,
SetWBLock = 1 << 17,
+ SetMeteringAreas = 1 << 18,
E3aSettingMax,
E3AsettingsAll = ( ((E3aSettingMax -1 ) << 1) -1 ) /// all possible flags raised
diff --git a/camera/inc/OMXCameraAdapter/OMXCameraAdapter.h b/camera/inc/OMXCameraAdapter/OMXCameraAdapter.h
index e7a7649..a87f9a5 100644
--- a/camera/inc/OMXCameraAdapter/OMXCameraAdapter.h
+++ b/camera/inc/OMXCameraAdapter/OMXCameraAdapter.h
@@ -474,6 +474,7 @@ private:
status_t setExposureLock(Gen3A_settings& Gen3A);
status_t setWhiteBalanceLock(Gen3A_settings& Gen3A);
status_t set3ALock(OMX_BOOL toggle);
+ status_t setMeteringAreas(Gen3A_settings& Gen3A);
//API to set FrameRate using VFR interface
status_t setVFramerate(OMX_U32 minFrameRate,OMX_U32 maxFrameRate);
@@ -496,12 +497,7 @@ private:
status_t printComponentVersion(OMX_HANDLETYPE handle);
//Touch AF
- status_t setTouchFocus(size_t posX,
- size_t posY,
- size_t posWidth,
- size_t posHeight,
- size_t previewWidth,
- size_t previewHeight);
+ status_t setTouchFocus();
//Face detection
status_t setParametersFD(const CameraParameters &params,
@@ -557,6 +553,7 @@ private:
static status_t insertSenMount(CameraProperties::Properties*, OMX_TI_CAPTYPE&);
static status_t insertDefaults(CameraProperties::Properties*, OMX_TI_CAPTYPE&);
static status_t insertLocks(CameraProperties::Properties*, OMX_TI_CAPTYPE&);
+ static status_t insertAreas(CameraProperties::Properties*, OMX_TI_CAPTYPE&);
status_t setParametersCapture(const CameraParameters &params,
BaseCameraAdapter::AdapterState state);
@@ -712,7 +709,6 @@ private:
static const char DEFAULT_FOCAL_LENGTH[];
static const char DEFAULT_HOR_ANGLE[];
static const char DEFAULT_VER_ANGLE[];
- static const size_t MAX_FOCUS_AREAS;
OMX_VERSIONTYPE mCompRevision;
@@ -729,6 +725,9 @@ private:
Vector< sp<CameraArea> > mFocusAreas;
mutable Mutex mFocusAreasLock;
+ // Current Metering areas
+ Vector< sp<CameraArea> > mMeteringAreas;
+
CaptureMode mCapMode;
size_t mBurstFrames;
size_t mCapturedFrames;