From 311f69f18c41909e3087e4205548095762a2ecb7 Mon Sep 17 00:00:00 2001 From: Alex Ray Date: Tue, 2 Oct 2012 23:30:07 -0700 Subject: [PATCH] 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 --- services/camera/libcameraservice/camera2/CaptureSequencer.cpp | 7 ------- 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 c9498c2c71..98aa380201 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 1bcf97e007..7977f9dbd0 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) { -- 2.11.0