From patchwork Tue Oct 26 07:21:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 14303 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 68C45BF415 for ; Tue, 26 Oct 2021 07:22:00 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 2A65D64878; Tue, 26 Oct 2021 09:22:00 +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="sYwbduH8"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 63A8C60123 for ; Tue, 26 Oct 2021 09:21:58 +0200 (CEST) Received: from perceval.ideasonboard.com (unknown [103.251.226.211]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id EBDAA3F0; Tue, 26 Oct 2021 09:21:56 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1635232918; bh=Rfs5vxK5XN2WVTefTRqQ59wwjvesdClvoK29ikEUPZ4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sYwbduH86ktsnckH5N94oK6eY0dOEflCBbProh6RTlBI0ZH2eLPAkN5mk1WpV4c7B VOw4FoJCzXdV/SyKO6AeKb5g/ZsP7FpXOIsFgGKX9Dx6iOuQFoGzHiA2LWnvNUTg9L yKWsO3WhenqnthpLg4W+4qWA6lJZcT20h6Fqs9ho= From: Umang Jain To: libcamera-devel@lists.libcamera.org Date: Tue, 26 Oct 2021 12:51:42 +0530 Message-Id: <20211026072148.164831-2-umang.jain@ideasonboard.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211026072148.164831-1-umang.jain@ideasonboard.com> References: <20211026072148.164831-1-umang.jain@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v8 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.