From f20dd6b779d0e156dccabb6d56b769eb5d6f5f5c Mon Sep 17 00:00:00 2001 From: Emilian Peev Date: Mon, 15 Oct 2018 16:28:06 +0100 Subject: [PATCH] Camera: Don't drop preview buffers during video In case the camera device supports ZSL, avoid dropping preview buffers while video recording is active. Preview must not get interrupted in this case. Bug: 117640175 Test: Manual using application, Camera CTS Change-Id: I9021b4c46428e008298ddef0a86972640b0afa41 Merged-In: I9021b4c46428e008298ddef0a86972640b0afa41 (cherry picked from commit 6c79c9aa7fe61ea81a154f5c92f96b34889029a0) --- .../camera/libcameraservice/api1/client2/CaptureSequencer.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/services/camera/libcameraservice/api1/client2/CaptureSequencer.cpp b/services/camera/libcameraservice/api1/client2/CaptureSequencer.cpp index 1ee216fd9a..a9b2e7550e 100644 --- a/services/camera/libcameraservice/api1/client2/CaptureSequencer.cpp +++ b/services/camera/libcameraservice/api1/client2/CaptureSequencer.cpp @@ -553,9 +553,11 @@ CaptureSequencer::CaptureState CaptureSequencer::manageStandardCapture( return DONE; } - if (l.mParameters.isDeviceZslSupported) { + if ((l.mParameters.isDeviceZslSupported) && (l.mParameters.state != Parameters::RECORD) && + (l.mParameters.state != Parameters::VIDEO_SNAPSHOT)) { // If device ZSL is supported, drop all pending preview buffers to reduce the chance of // rendering preview frames newer than the still frame. + // Additionally, preview must not get interrupted during video recording. client->getCameraDevice()->dropStreamBuffers(true, client->getPreviewStreamId()); }