Loading services/camera/libcameraservice/api2/CameraDeviceClient.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -81,7 +81,8 @@ status_t CameraDeviceClient::initialize(camera_module_t *module) mFrameProcessor->registerListener(FRAME_PROCESSOR_LISTENER_MIN_ID, FRAME_PROCESSOR_LISTENER_MAX_ID, /*listener*/this); /*listener*/this, /*quirkSendPartials*/true); return OK; } Loading services/camera/libcameraservice/common/FrameProcessorBase.cpp +7 −5 Original line number Diff line number Diff line Loading @@ -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; } Loading Loading @@ -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); Loading @@ -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); Loading services/camera/libcameraservice/common/FrameProcessorBase.h +5 −2 Original line number Diff line number Diff line Loading @@ -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); Loading @@ -64,6 +66,7 @@ class FrameProcessorBase: public Thread { int32_t minId; int32_t maxId; wp<FilteredListener> listener; bool quirkSendPartials; }; List<RangeListener> mRangeListeners; Loading services/camera/libcameraservice/device3/Camera3Device.cpp +13 −5 Original line number Diff line number Diff line Loading @@ -1405,7 +1405,8 @@ status_t Camera3Device::registerInFlight(int32_t frameNumber, * Check if all 3A fields are ready, and send off a partial 3A-only result * to the output frame queue */ bool Camera3Device::processPartial3AQuirk(int32_t frameNumber, bool Camera3Device::processPartial3AQuirk( int32_t frameNumber, int32_t requestId, const CameraMetadata& partial) { // Check if all 3A states are present Loading Loading @@ -1452,10 +1453,10 @@ bool Camera3Device::processPartial3AQuirk(int32_t frameNumber, if (!gotAllStates) return false; ALOGVV("%s: Camera %d: Frame %d: AF mode %d, AWB mode %d, " ALOGVV("%s: Camera %d: Frame %d, Request ID %d: AF mode %d, AWB mode %d, " "AF state %d, AE state %d, AWB state %d, " "AF trigger %d, AE precapture trigger %d", __FUNCTION__, mId, frameNumber, __FUNCTION__, mId, frameNumber, requestId, afMode, awbMode, afState, aeState, awbState, afTriggerId, aeTriggerId); Loading @@ -1463,9 +1464,10 @@ bool Camera3Device::processPartial3AQuirk(int32_t frameNumber, // Got all states, so construct a minimal result to send // In addition to the above fields, this means adding in // android.request.frameCount // android.request.requestId // android.quirks.partialResult const size_t kMinimal3AResultEntries = 7; const size_t kMinimal3AResultEntries = 10; Mutex::Autolock l(mOutputLock); Loading @@ -1479,6 +1481,11 @@ bool Camera3Device::processPartial3AQuirk(int32_t frameNumber, return false; } if (!insert3AResult(min3AResult, ANDROID_REQUEST_ID, &requestId, frameNumber)) { return false; } static const uint8_t partialResult = ANDROID_QUIRKS_PARTIAL_RESULT_PARTIAL; if (!insert3AResult(min3AResult, ANDROID_QUIRKS_PARTIAL_RESULT, &partialResult, frameNumber)) { Loading Loading @@ -1615,6 +1622,7 @@ void Camera3Device::processCaptureResult(const camera3_capture_result *result) { if (!request.partialResultQuirk.haveSent3A) { request.partialResultQuirk.haveSent3A = processPartial3AQuirk(frameNumber, request.requestId, request.partialResultQuirk.collectedResult); } } Loading services/camera/libcameraservice/device3/Camera3Device.h +2 −1 Original line number Diff line number Diff line Loading @@ -491,7 +491,8 @@ class Camera3Device : * and if so, queue up 3A-only result to the client. Returns true if 3A * is sent. */ bool processPartial3AQuirk(int32_t frameNumber, const CameraMetadata& partial); bool processPartial3AQuirk(int32_t frameNumber, int32_t requestId, const CameraMetadata& partial); // Helpers for reading and writing 3A metadata into to/from partial results template<typename T> Loading Loading
services/camera/libcameraservice/api2/CameraDeviceClient.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -81,7 +81,8 @@ status_t CameraDeviceClient::initialize(camera_module_t *module) mFrameProcessor->registerListener(FRAME_PROCESSOR_LISTENER_MIN_ID, FRAME_PROCESSOR_LISTENER_MAX_ID, /*listener*/this); /*listener*/this, /*quirkSendPartials*/true); return OK; } Loading
services/camera/libcameraservice/common/FrameProcessorBase.cpp +7 −5 Original line number Diff line number Diff line Loading @@ -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; } Loading Loading @@ -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); Loading @@ -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); Loading
services/camera/libcameraservice/common/FrameProcessorBase.h +5 −2 Original line number Diff line number Diff line Loading @@ -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); Loading @@ -64,6 +66,7 @@ class FrameProcessorBase: public Thread { int32_t minId; int32_t maxId; wp<FilteredListener> listener; bool quirkSendPartials; }; List<RangeListener> mRangeListeners; Loading
services/camera/libcameraservice/device3/Camera3Device.cpp +13 −5 Original line number Diff line number Diff line Loading @@ -1405,7 +1405,8 @@ status_t Camera3Device::registerInFlight(int32_t frameNumber, * Check if all 3A fields are ready, and send off a partial 3A-only result * to the output frame queue */ bool Camera3Device::processPartial3AQuirk(int32_t frameNumber, bool Camera3Device::processPartial3AQuirk( int32_t frameNumber, int32_t requestId, const CameraMetadata& partial) { // Check if all 3A states are present Loading Loading @@ -1452,10 +1453,10 @@ bool Camera3Device::processPartial3AQuirk(int32_t frameNumber, if (!gotAllStates) return false; ALOGVV("%s: Camera %d: Frame %d: AF mode %d, AWB mode %d, " ALOGVV("%s: Camera %d: Frame %d, Request ID %d: AF mode %d, AWB mode %d, " "AF state %d, AE state %d, AWB state %d, " "AF trigger %d, AE precapture trigger %d", __FUNCTION__, mId, frameNumber, __FUNCTION__, mId, frameNumber, requestId, afMode, awbMode, afState, aeState, awbState, afTriggerId, aeTriggerId); Loading @@ -1463,9 +1464,10 @@ bool Camera3Device::processPartial3AQuirk(int32_t frameNumber, // Got all states, so construct a minimal result to send // In addition to the above fields, this means adding in // android.request.frameCount // android.request.requestId // android.quirks.partialResult const size_t kMinimal3AResultEntries = 7; const size_t kMinimal3AResultEntries = 10; Mutex::Autolock l(mOutputLock); Loading @@ -1479,6 +1481,11 @@ bool Camera3Device::processPartial3AQuirk(int32_t frameNumber, return false; } if (!insert3AResult(min3AResult, ANDROID_REQUEST_ID, &requestId, frameNumber)) { return false; } static const uint8_t partialResult = ANDROID_QUIRKS_PARTIAL_RESULT_PARTIAL; if (!insert3AResult(min3AResult, ANDROID_QUIRKS_PARTIAL_RESULT, &partialResult, frameNumber)) { Loading Loading @@ -1615,6 +1622,7 @@ void Camera3Device::processCaptureResult(const camera3_capture_result *result) { if (!request.partialResultQuirk.haveSent3A) { request.partialResultQuirk.haveSent3A = processPartial3AQuirk(frameNumber, request.requestId, request.partialResultQuirk.collectedResult); } } Loading
services/camera/libcameraservice/device3/Camera3Device.h +2 −1 Original line number Diff line number Diff line Loading @@ -491,7 +491,8 @@ class Camera3Device : * and if so, queue up 3A-only result to the client. Returns true if 3A * is sent. */ bool processPartial3AQuirk(int32_t frameNumber, const CameraMetadata& partial); bool processPartial3AQuirk(int32_t frameNumber, int32_t requestId, const CameraMetadata& partial); // Helpers for reading and writing 3A metadata into to/from partial results template<typename T> Loading