From patchwork Wed Sep 9 15:54:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 9561 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 27F3BBDB1D for ; Wed, 9 Sep 2020 15:51:24 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 04CC362D5E; Wed, 9 Sep 2020 17:51:24 +0200 (CEST) Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 0B2A862D04 for ; Wed, 9 Sep 2020 17:51:22 +0200 (CEST) X-Originating-IP: 93.34.118.233 Received: from uno.lan (93-34-118-233.ip49.fastwebnet.it [93.34.118.233]) (Authenticated sender: jacopo@jmondi.org) by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id 16E301BF20C; Wed, 9 Sep 2020 15:51:20 +0000 (UTC) From: Jacopo Mondi To: libcamera-devel@lists.libcamera.org Date: Wed, 9 Sep 2020 17:54:53 +0200 Message-Id: <20200909155457.153907-5-jacopo@jmondi.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200909155457.153907-1-jacopo@jmondi.org> References: <20200909155457.153907-1-jacopo@jmondi.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 4/8] android: camera_device: Clear allocator at configureStream X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: hanlinchen@chromium.org Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The configureStream operation might be called by the Android framework in two successive capture session without going through a close(). Clear all the allocated buffers before configuring the camera streams. Signed-off-by: Jacopo Mondi Reviewed-by: Niklas Söderlund Reviewed-by: Hirokazu Honda --- src/android/camera_device.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp index 98cfa3d5aa59..d35c6b93b654 100644 --- a/src/android/camera_device.cpp +++ b/src/android/camera_device.cpp @@ -1187,6 +1187,7 @@ int CameraDevice::configureStreams(camera3_stream_configuration_t *stream_list) */ streams_.clear(); streams_.reserve(stream_list->num_streams); + allocator_.clear(); /* First handle all non-MJPEG streams. */ camera3_stream_t *jpegStream = nullptr;