summaryrefslogtreecommitdiff
path: root/camera/CameraHal.cpp
diff options
context:
space:
mode:
authorTyler Luu <tluu@ti.com>2012-01-31 13:36:22 -0600
committerIliyan Malchev <malchev@google.com>2012-02-01 14:47:16 -0800
commit057f4fd59ec05ded909e9eb9a3363d9ea345b0ca (patch)
tree8687455a958ce799dfb7237f11d70a3c12b28038 /camera/CameraHal.cpp
parenta6e104aadf560de4e33291c8e85f79acc8fb46c9 (diff)
downloadomap4-aah-057f4fd59ec05ded909e9eb9a3363d9ea345b0ca.tar.gz
CameraHal: Implementation for CAF status callbacks
1. Remove internal handling of CAMERA_MSG_FOCUS. Before we were enabling CAMERA_MSG_FOCUS only when application calls autoFocus(). No longer needed since the CAMERA_MSG_FOCUS can come just during preview now. 2. Add handling of unregistered focus callbacks. Since OMXCamera will send callbacks even when we are not waiting for one, add some handling. Signed-off-by: Tyler Luu <tluu@ti.com> Change-Id: I457e67b33b2561dd0b1ce3863ce807a8c27f79f6 Conflicts: camera/OMXCameraAdapter/OMXFocus.cpp
Diffstat (limited to 'camera/CameraHal.cpp')
-rw-r--r--camera/CameraHal.cpp26
1 files changed, 22 insertions, 4 deletions
diff --git a/camera/CameraHal.cpp b/camera/CameraHal.cpp
index c64b7e2..9a158f4 100644
--- a/camera/CameraHal.cpp
+++ b/camera/CameraHal.cpp
@@ -131,9 +131,7 @@ void CameraHal::enableMsgType(int32_t msgType)
// ignoring enable focus message from camera service
// we will enable internally in autoFocus call
- if (msgType & CAMERA_MSG_FOCUS) {
- msgType &= ~CAMERA_MSG_FOCUS;
- }
+ msgType &= ~(CAMERA_MSG_FOCUS | CAMERA_MSG_FOCUS_MOVE);
{
Mutex::Autolock lock(mLock);
@@ -2678,15 +2676,35 @@ status_t CameraHal::sendCommand(int32_t cmd, int32_t arg1, int32_t arg2)
if ( ( NO_ERROR == ret ) && ( NULL == mCameraAdapter ) )
{
CAMHAL_LOGEA("No CameraAdapter instance");
- ret = -EINVAL;
+ return -EINVAL;
}
+ ///////////////////////////////////////////////////////
+ // Following commands do NOT need preview to be started
+ ///////////////////////////////////////////////////////
+ switch(cmd) {
+ case CAMERA_CMD_ENABLE_FOCUS_MOVE_MSG:
+ bool enable = static_cast<bool>(arg1);
+ Mutex::Autolock lock(mLock);
+ if (enable) {
+ mMsgEnabled |= CAMERA_MSG_FOCUS_MOVE;
+ } else {
+ mMsgEnabled &= ~CAMERA_MSG_FOCUS_MOVE;
+ }
+ return NO_ERROR;
+ break;
+ }
+
if ( ( NO_ERROR == ret ) && ( !previewEnabled() ))
{
CAMHAL_LOGEA("Preview is not running");
ret = -EINVAL;
}
+ ///////////////////////////////////////////////////////
+ // Following commands NEED preview to be started
+ ///////////////////////////////////////////////////////
+
if ( NO_ERROR == ret )
{
switch(cmd)