diff options
author | Zhijun He <zhijunhe@google.com> | 2014-06-25 11:40:02 -0700 |
---|---|---|
committer | Zhijun He <zhijunhe@google.com> | 2014-06-27 17:53:38 -0700 |
commit | 25a0aef19e170d2695f64b4c48296e7914155a88 (patch) | |
tree | 39dfc94b9202060d8b8645497effa989cef2670f | |
parent | e8f2c6cfe9afc5b303ab6b0fb51e18ddce512b54 (diff) | |
download | frameworks_av-25a0aef19e170d2695f64b4c48296e7914155a88.zip frameworks_av-25a0aef19e170d2695f64b4c48296e7914155a88.tar.gz frameworks_av-25a0aef19e170d2695f64b4c48296e7914155a88.tar.bz2 |
Camera1: Don't send partial results to ZSL clients
ZSL clients expect each received result as a complete result, and send back to
HAL as a reprocess capture request. CaptureSequencer client assumes results to
be non-partial too, it need look into some metadata that may not be present in
partial results.
Change-Id: Id716913fd6e1c914726abd6610fddf91141783c2
8 files changed, 25 insertions, 14 deletions
diff --git a/services/camera/libcameraservice/api1/Camera2Client.cpp b/services/camera/libcameraservice/api1/Camera2Client.cpp index 0b6ad92..1642896 100644 --- a/services/camera/libcameraservice/api1/Camera2Client.cpp +++ b/services/camera/libcameraservice/api1/Camera2Client.cpp @@ -1674,8 +1674,8 @@ int Camera2Client::getZslStreamId() const { } status_t Camera2Client::registerFrameListener(int32_t minId, int32_t maxId, - wp<camera2::FrameProcessor::FilteredListener> listener) { - return mFrameProcessor->registerListener(minId, maxId, listener); + wp<camera2::FrameProcessor::FilteredListener> listener, bool sendPartials) { + return mFrameProcessor->registerListener(minId, maxId, listener, sendPartials); } status_t Camera2Client::removeFrameListener(int32_t minId, int32_t maxId, diff --git a/services/camera/libcameraservice/api1/Camera2Client.h b/services/camera/libcameraservice/api1/Camera2Client.h index 0e06195..5ce757a 100644 --- a/services/camera/libcameraservice/api1/Camera2Client.h +++ b/services/camera/libcameraservice/api1/Camera2Client.h @@ -117,7 +117,8 @@ public: int getZslStreamId() const; status_t registerFrameListener(int32_t minId, int32_t maxId, - wp<camera2::FrameProcessor::FilteredListener> listener); + wp<camera2::FrameProcessor::FilteredListener> listener, + bool sendPartials = true); status_t removeFrameListener(int32_t minId, int32_t maxId, wp<camera2::FrameProcessor::FilteredListener> listener); diff --git a/services/camera/libcameraservice/api1/client2/CaptureSequencer.cpp b/services/camera/libcameraservice/api1/client2/CaptureSequencer.cpp index 8268f65..cb9aca6 100644 --- a/services/camera/libcameraservice/api1/client2/CaptureSequencer.cpp +++ b/services/camera/libcameraservice/api1/client2/CaptureSequencer.cpp @@ -350,8 +350,10 @@ CaptureSequencer::CaptureState CaptureSequencer::manageZslStart( return DONE; } + // We don't want to get partial results for ZSL capture. client->registerFrameListener(mCaptureId, mCaptureId + 1, - this); + this, + /*sendPartials*/false); // TODO: Actually select the right thing here. res = processor->pushToReprocess(mCaptureId); @@ -393,8 +395,14 @@ CaptureSequencer::CaptureState CaptureSequencer::manageStandardStart( bool isAeConverged = false; // Get the onFrameAvailable callback when the requestID == mCaptureId + // We don't want to get partial results for normal capture, as we need + // Get ANDROID_SENSOR_TIMESTAMP from the capture result, but partial + // result doesn't have to have this metadata available. + // TODO: Update to use the HALv3 shutter notification for remove the + // need for this listener and make it faster. see bug 12530628. client->registerFrameListener(mCaptureId, mCaptureId + 1, - this); + this, + /*sendPartials*/false); { Mutex::Autolock l(mInputMutex); diff --git a/services/camera/libcameraservice/api1/client2/ZslProcessor.cpp b/services/camera/libcameraservice/api1/client2/ZslProcessor.cpp index 2a2a5af..10463c1 100644 --- a/services/camera/libcameraservice/api1/client2/ZslProcessor.cpp +++ b/services/camera/libcameraservice/api1/client2/ZslProcessor.cpp @@ -202,7 +202,8 @@ status_t ZslProcessor::updateStream(const Parameters ¶ms) { } client->registerFrameListener(Camera2Client::kPreviewRequestIdStart, Camera2Client::kPreviewRequestIdEnd, - this); + this, + /*sendPartials*/false); return OK; } diff --git a/services/camera/libcameraservice/api1/client2/ZslProcessor3.cpp b/services/camera/libcameraservice/api1/client2/ZslProcessor3.cpp index 1dcb718..79ea2c3 100644 --- a/services/camera/libcameraservice/api1/client2/ZslProcessor3.cpp +++ b/services/camera/libcameraservice/api1/client2/ZslProcessor3.cpp @@ -148,7 +148,8 @@ status_t ZslProcessor3::updateStream(const Parameters ¶ms) { } client->registerFrameListener(Camera2Client::kPreviewRequestIdStart, Camera2Client::kPreviewRequestIdEnd, - this); + this, + /*sendPartials*/false); return OK; } diff --git a/services/camera/libcameraservice/api2/CameraDeviceClient.cpp b/services/camera/libcameraservice/api2/CameraDeviceClient.cpp index 544f736..de42cee 100644 --- a/services/camera/libcameraservice/api2/CameraDeviceClient.cpp +++ b/services/camera/libcameraservice/api2/CameraDeviceClient.cpp @@ -82,7 +82,7 @@ status_t CameraDeviceClient::initialize(camera_module_t *module) mFrameProcessor->registerListener(FRAME_PROCESSOR_LISTENER_MIN_ID, FRAME_PROCESSOR_LISTENER_MAX_ID, /*listener*/this, - /*quirkSendPartials*/true); + /*sendPartials*/true); return OK; } diff --git a/services/camera/libcameraservice/common/FrameProcessorBase.cpp b/services/camera/libcameraservice/common/FrameProcessorBase.cpp index f6a971a..2c82049 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, bool quirkSendPartials) { + int32_t maxId, wp<FilteredListener> listener, bool sendPartials) { Mutex::Autolock l(mInputMutex); ALOGV("%s: Registering listener for frame id range %d - %d", __FUNCTION__, minId, maxId); - RangeListener rListener = { minId, maxId, listener, quirkSendPartials }; + RangeListener rListener = { minId, maxId, listener, sendPartials }; mRangeListeners.push_back(rListener); return OK; } @@ -176,7 +176,7 @@ status_t FrameProcessorBase::processListeners(const CaptureResult &result, List<RangeListener>::iterator item = mRangeListeners.begin(); while (item != mRangeListeners.end()) { if (requestId >= item->minId && requestId < item->maxId && - (!quirkIsPartial || item->quirkSendPartials)) { + (!quirkIsPartial || item->sendPartials)) { 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 15a014e..ee44a8b 100644 --- a/services/camera/libcameraservice/common/FrameProcessorBase.h +++ b/services/camera/libcameraservice/common/FrameProcessorBase.h @@ -45,10 +45,10 @@ class FrameProcessorBase: public Thread { // Register a listener for a range of IDs [minId, maxId). Multiple listeners // can be listening to the same range. - // QUIRK: sendPartials controls whether partial results will be sent. + // sendPartials controls whether partial results will be sent. status_t registerListener(int32_t minId, int32_t maxId, wp<FilteredListener> listener, - bool quirkSendPartials = true); + bool sendPartials = true); status_t removeListener(int32_t minId, int32_t maxId, wp<FilteredListener> listener); @@ -66,7 +66,7 @@ class FrameProcessorBase: public Thread { int32_t minId; int32_t maxId; wp<FilteredListener> listener; - bool quirkSendPartials; + bool sendPartials; }; List<RangeListener> mRangeListeners; |