From patchwork Mon Oct 25 20:38:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 14295 X-Patchwork-Delegate: umang.jain@ideasonboard.com 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 2426BBF415 for ; Mon, 25 Oct 2021 20:38:46 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id DA84C6487B; Mon, 25 Oct 2021 22:38:45 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="OpuzZ8c6"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 62F586486E for ; Mon, 25 Oct 2021 22:38:44 +0200 (CEST) Received: from perceval.ideasonboard.com (unknown [103.251.226.211]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id D52B7119F; Mon, 25 Oct 2021 22:38:42 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1635194324; bh=Rfs5vxK5XN2WVTefTRqQ59wwjvesdClvoK29ikEUPZ4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OpuzZ8c6erYemdSX7LwbITsmt6SaroiDoCjpQZtI73BXPdJmaHr+Yj0Lc8l1hPzr+ 2yRw7nY3gtp8ZdAI4NhQa307dNy9qW6CFn/UiGzJFExQmkqECKvm3h/s1vSF9tg4q6 aEWDe9lQr3xIPQjXuFUyOrRhCGZNs6fsMPnp+014= From: Umang Jain To: libcamera-devel@lists.libcamera.org Date: Tue, 26 Oct 2021 02:08:27 +0530 Message-Id: <20211025203833.122460-2-umang.jain@ideasonboard.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211025203833.122460-1-umang.jain@ideasonboard.com> References: <20211025203833.122460-1-umang.jain@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v7 1/7] android: camera_stream: Replace post-processor nullptr check 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Instead of checking postProcessor for nullptr, replace this check with an assertion that checks if the camera stream's type is not Type::Direct. Since it makes no sense to call CameraStream::process() on a Type::Direct camera stream. Signed-off-by: Umang Jain Reviewed-by: Laurent Pinchart Reviewed-by: Hirokazu Honda Reviewed-by: Kieran Bingham --- src/android/camera_stream.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/android/camera_stream.cpp b/src/android/camera_stream.cpp index f44a2717..5d991fe5 100644 --- a/src/android/camera_stream.cpp +++ b/src/android/camera_stream.cpp @@ -150,6 +150,8 @@ int CameraStream::process(const FrameBuffer &source, Camera3RequestDescriptor::StreamBuffer &dest, Camera3RequestDescriptor *request) { + ASSERT(type_ != Type::Direct); + /* Handle waiting on fences on the destination buffer. */ if (dest.fence != -1) { int ret = waitFence(dest.fence); @@ -163,9 +165,6 @@ int CameraStream::process(const FrameBuffer &source, dest.fence = -1; } - if (!postProcessor_) - return 0; - /* * \todo Buffer mapping and processing should be moved to a * separate thread.