diff options
author | Alex Ray <aray@google.com> | 2012-10-02 23:30:07 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-10-03 13:58:19 -0700 |
commit | c20630569431234db23b6182dd17102023dee68e (patch) | |
tree | 96489ce27ea06e8c4e8ba90323d3702eb78f5c6a | |
parent | b3e97b347dceb882983427ac872b772e25f3f166 (diff) |
Camera2: Fix prematurely clearing stream request
Zsl handling was clearing the stream request before a capture request
was ready to be sent to the HAL, which would cause capture delays and
timeouts in certain conditions.
Bug: 7259520
Change-Id: Idde8bc4fc58b8b426c6985feac87759740e338ea
-rw-r--r-- | services/camera/libcameraservice/camera2/CaptureSequencer.cpp | 7 | ||||
-rw-r--r-- | services/camera/libcameraservice/camera2/ZslProcessor.cpp | 8 |
2 files changed, 8 insertions, 7 deletions
diff --git a/services/camera/libcameraservice/camera2/CaptureSequencer.cpp b/services/camera/libcameraservice/camera2/CaptureSequencer.cpp index c9498c2c..98aa3802 100644 --- a/services/camera/libcameraservice/camera2/CaptureSequencer.cpp +++ b/services/camera/libcameraservice/camera2/CaptureSequencer.cpp @@ -289,13 +289,6 @@ CaptureSequencer::CaptureState CaptureSequencer::manageZslStart( client->registerFrameListener(mCaptureId, this); - res = client->getCameraDevice()->clearStreamingRequest(); - if (res != OK) { - ALOGE("%s: Camera %d: Unable to stop preview for ZSL capture: " - "%s (%d)", - __FUNCTION__, client->getCameraId(), strerror(-res), res); - return DONE; - } // TODO: Actually select the right thing here. res = processor->pushToReprocess(mCaptureId); if (res != OK) { diff --git a/services/camera/libcameraservice/camera2/ZslProcessor.cpp b/services/camera/libcameraservice/camera2/ZslProcessor.cpp index 1bcf97e0..7977f9db 100644 --- a/services/camera/libcameraservice/camera2/ZslProcessor.cpp +++ b/services/camera/libcameraservice/camera2/ZslProcessor.cpp @@ -297,6 +297,14 @@ status_t ZslProcessor::pushToReprocess(int32_t requestId) { return INVALID_OPERATION; } + res = client->getCameraDevice()->clearStreamingRequest(); + if (res != OK) { + ALOGE("%s: Camera %d: Unable to stop preview for ZSL capture: " + "%s (%d)", + __FUNCTION__, client->getCameraId(), strerror(-res), res); + return INVALID_OPERATION; + } + // TODO: have push-and-clear be atomic res = client->getCameraDevice()->pushReprocessBuffer(mZslReprocessStreamId, handle, this); if (res != OK) { |