diff options
author | Eino-Ville Talvala <etalvala@google.com> | 2013-11-07 15:13:16 -0800 |
---|---|---|
committer | Eino-Ville Talvala <etalvala@google.com> | 2013-11-12 10:24:42 -0800 |
commit | 184dfe4ea5e2ba33951bed2b1366007aee0ce3da (patch) | |
tree | ada678fb9d95fed7b4b25aead2615eaa4f003495 /services/camera/libcameraservice/common | |
parent | caee8747b7df3b1119426594d4ba1c0e300ff6db (diff) | |
download | frameworks_av-184dfe4ea5e2ba33951bed2b1366007aee0ce3da.zip frameworks_av-184dfe4ea5e2ba33951bed2b1366007aee0ce3da.tar.gz frameworks_av-184dfe4ea5e2ba33951bed2b1366007aee0ce3da.tar.bz2 |
Camera API2: Add support for partial result quirk
- Camera3Device: Include requestId in partial 3A results
- FrameProcessorBase: Add support for partial result listeners
- CameraDeviceClient: Listen and forward partial results to client
Bug: 11115603
Change-Id: If1cc6bbc32932742ac142c058688761ebf6a8024
Diffstat (limited to 'services/camera/libcameraservice/common')
-rw-r--r-- | services/camera/libcameraservice/common/FrameProcessorBase.cpp | 12 | ||||
-rw-r--r-- | services/camera/libcameraservice/common/FrameProcessorBase.h | 7 |
2 files changed, 12 insertions, 7 deletions
diff --git a/services/camera/libcameraservice/common/FrameProcessorBase.cpp b/services/camera/libcameraservice/common/FrameProcessorBase.cpp index b2c9b33..f2064fb 100644 --- a/services/camera/libcameraservice/common/FrameProcessorBase.cpp +++ b/services/camera/libcameraservice/common/FrameProcessorBase.cpp @@ -37,11 +37,11 @@ FrameProcessorBase::~FrameProcessorBase() { } status_t FrameProcessorBase::registerListener(int32_t minId, - int32_t maxId, wp<FilteredListener> listener) { + int32_t maxId, wp<FilteredListener> listener, bool quirkSendPartials) { Mutex::Autolock l(mInputMutex); ALOGV("%s: Registering listener for frame id range %d - %d", __FUNCTION__, minId, maxId); - RangeListener rListener = { minId, maxId, listener }; + RangeListener rListener = { minId, maxId, listener, quirkSendPartials }; mRangeListeners.push_back(rListener); return OK; } @@ -145,13 +145,14 @@ status_t FrameProcessorBase::processListeners(const CameraMetadata &frame, ATRACE_CALL(); camera_metadata_ro_entry_t entry; - // Quirks: Don't deliver partial results to listeners + // Quirks: Don't deliver partial results to listeners that don't want them + bool quirkIsPartial = false; entry = frame.find(ANDROID_QUIRKS_PARTIAL_RESULT); if (entry.count != 0 && entry.data.u8[0] == ANDROID_QUIRKS_PARTIAL_RESULT_PARTIAL) { ALOGV("%s: Camera %d: Not forwarding partial result to listeners", __FUNCTION__, device->getId()); - return OK; + quirkIsPartial = true; } entry = frame.find(ANDROID_REQUEST_ID); @@ -169,7 +170,8 @@ status_t FrameProcessorBase::processListeners(const CameraMetadata &frame, List<RangeListener>::iterator item = mRangeListeners.begin(); while (item != mRangeListeners.end()) { if (requestId >= item->minId && - requestId < item->maxId) { + requestId < item->maxId && + (!quirkIsPartial || item->quirkSendPartials) ) { sp<FilteredListener> listener = item->listener.promote(); if (listener == 0) { item = mRangeListeners.erase(item); diff --git a/services/camera/libcameraservice/common/FrameProcessorBase.h b/services/camera/libcameraservice/common/FrameProcessorBase.h index 4d80ebf..89b608a 100644 --- a/services/camera/libcameraservice/common/FrameProcessorBase.h +++ b/services/camera/libcameraservice/common/FrameProcessorBase.h @@ -44,9 +44,11 @@ class FrameProcessorBase: public Thread { }; // Register a listener for a range of IDs [minId, maxId). Multiple listeners - // can be listening to the same range + // can be listening to the same range. + // QUIRK: sendPartials controls whether partial results will be sent. status_t registerListener(int32_t minId, int32_t maxId, - wp<FilteredListener> listener); + wp<FilteredListener> listener, + bool quirkSendPartials = true); status_t removeListener(int32_t minId, int32_t maxId, wp<FilteredListener> listener); @@ -64,6 +66,7 @@ class FrameProcessorBase: public Thread { int32_t minId; int32_t maxId; wp<FilteredListener> listener; + bool quirkSendPartials; }; List<RangeListener> mRangeListeners; |