diff options
author | Yin-Chia Yeh <yinchiayeh@google.com> | 2014-06-23 14:07:56 -0700 |
---|---|---|
committer | Yin-Chia Yeh <yinchiayeh@google.com> | 2014-06-24 13:29:20 -0700 |
commit | 741ace8776f052245e33a47a0b99400f75996f45 (patch) | |
tree | 8e47d7a29f0f3d89e2915aa6119ee8b3374560ee /services/camera/libcameraservice/device3 | |
parent | cd8fce8fbe0f515e53a0ea0f50b739cf42ee57a4 (diff) | |
download | frameworks_av-741ace8776f052245e33a47a0b99400f75996f45.zip frameworks_av-741ace8776f052245e33a47a0b99400f75996f45.tar.gz frameworks_av-741ace8776f052245e33a47a0b99400f75996f45.tar.bz2 |
cameraservice: Deprecate triggerId tags
The following two tags are deprecated from HAL 3.2:
ANDROID_CONTROL_AF_TRIGGER_ID
ANDROID_CONTROL_AE_PRECAPTURE_ID
Trigger IDs are now internal to camera service.
Change-Id: Iaebd62ecb0905a811fa37fe7850e0221c38a0006
Diffstat (limited to 'services/camera/libcameraservice/device3')
-rw-r--r-- | services/camera/libcameraservice/device3/Camera3Device.cpp | 38 |
1 files changed, 23 insertions, 15 deletions
diff --git a/services/camera/libcameraservice/device3/Camera3Device.cpp b/services/camera/libcameraservice/device3/Camera3Device.cpp index 24df819..5973625 100644 --- a/services/camera/libcameraservice/device3/Camera3Device.cpp +++ b/services/camera/libcameraservice/device3/Camera3Device.cpp @@ -1188,7 +1188,7 @@ status_t Camera3Device::triggerAutofocus(uint32_t id) { { ANDROID_CONTROL_AF_TRIGGER_ID, static_cast<int32_t>(id) - }, + } }; return mRequestThread->queueTrigger(trigger, @@ -1209,7 +1209,7 @@ status_t Camera3Device::triggerCancelAutofocus(uint32_t id) { { ANDROID_CONTROL_AF_TRIGGER_ID, static_cast<int32_t>(id) - }, + } }; return mRequestThread->queueTrigger(trigger, @@ -1230,7 +1230,7 @@ status_t Camera3Device::triggerPrecaptureMetering(uint32_t id) { { ANDROID_CONTROL_AE_PRECAPTURE_ID, static_cast<int32_t>(id) - }, + } }; return mRequestThread->queueTrigger(trigger, @@ -1571,8 +1571,6 @@ bool Camera3Device::processPartial3AQuirk( uint8_t aeState; uint8_t afState; uint8_t awbState; - int32_t afTriggerId; - int32_t aeTriggerId; gotAllStates &= get3AResult(partial, ANDROID_CONTROL_AF_MODE, &afMode, frameNumber); @@ -1589,12 +1587,6 @@ bool Camera3Device::processPartial3AQuirk( gotAllStates &= get3AResult(partial, ANDROID_CONTROL_AWB_STATE, &awbState, frameNumber); - gotAllStates &= get3AResult(partial, ANDROID_CONTROL_AF_TRIGGER_ID, - &afTriggerId, frameNumber); - - gotAllStates &= get3AResult(partial, ANDROID_CONTROL_AE_PRECAPTURE_ID, - &aeTriggerId, frameNumber); - if (!gotAllStates) return false; ALOGVV("%s: Camera %d: Frame %d, Request ID %d: AF mode %d, AWB mode %d, " @@ -1603,7 +1595,7 @@ bool Camera3Device::processPartial3AQuirk( __FUNCTION__, mId, frameNumber, resultExtras.requestId, afMode, awbMode, afState, aeState, awbState, - afTriggerId, aeTriggerId); + resultExtras.afTriggerId, resultExtras.precaptureTriggerId); // Got all states, so construct a minimal result to send // In addition to the above fields, this means adding in @@ -1667,12 +1659,12 @@ bool Camera3Device::processPartial3AQuirk( } if (!insert3AResult(min3AResult.mMetadata, ANDROID_CONTROL_AF_TRIGGER_ID, - &afTriggerId, frameNumber)) { + &resultExtras.afTriggerId, frameNumber)) { return false; } if (!insert3AResult(min3AResult.mMetadata, ANDROID_CONTROL_AE_PRECAPTURE_ID, - &aeTriggerId, frameNumber)) { + &resultExtras.precaptureTriggerId, frameNumber)) { return false; } @@ -2609,13 +2601,29 @@ status_t Camera3Device::RequestThread::insertTriggers( Mutex::Autolock al(mTriggerMutex); + sp<Camera3Device> parent = mParent.promote(); + if (parent == NULL) { + CLOGE("RequestThread: Parent is gone"); + return DEAD_OBJECT; + } + CameraMetadata &metadata = request->mSettings; size_t count = mTriggerMap.size(); for (size_t i = 0; i < count; ++i) { RequestTrigger trigger = mTriggerMap.valueAt(i); - uint32_t tag = trigger.metadataTag; + + if (tag == ANDROID_CONTROL_AF_TRIGGER_ID || tag == ANDROID_CONTROL_AE_PRECAPTURE_ID) { + bool isAeTrigger = (trigger.metadataTag == ANDROID_CONTROL_AE_PRECAPTURE_ID); + uint32_t triggerId = static_cast<uint32_t>(trigger.entryValue); + isAeTrigger ? request->mResultExtras.precaptureTriggerId = triggerId : + request->mResultExtras.afTriggerId = triggerId; + if (parent->mDeviceVersion >= CAMERA_DEVICE_API_VERSION_3_2) { + continue; // Trigger ID tag is deprecated since device HAL 3.2 + } + } + camera_metadata_entry entry = metadata.find(tag); if (entry.count > 0) { |