From patchwork Sat Oct 23 10:32:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 14286 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 B66ADBDB1C for ; Sat, 23 Oct 2021 10:33:12 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id F042564870; Sat, 23 Oct 2021 12:33:11 +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="QiPU0l0l"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 48DE860129 for ; Sat, 23 Oct 2021 12:33:10 +0200 (CEST) Received: from perceval.ideasonboard.com (unknown [103.251.226.213]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 2618B547; Sat, 23 Oct 2021 12:33:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1634985189; bh=YOubQsf6mPYYuPhi4WJ9UIdmlR6mwTbmNg5VxNj2CMY=; h=From:To:Cc:Subject:Date:From; b=QiPU0l0lEG/mHV/0iGXlwrbIXDpV9omvzPZZlzQDHi6BuHohGF/T2zrLzpnmj8c+S hpz3cEQHD1xZv/poqnwoNWXe7QR3mbEyXzAea6jij22zBRvqydw3Ju4pYrFdy90p/k mVMBGwa+/elCBB5aNNaVbatzcQsV7RcS+wJ9kS98= From: Umang Jain To: libcamera-devel@lists.libcamera.org Date: Sat, 23 Oct 2021 16:02:55 +0530 Message-Id: <20211023103302.152769-1-umang.jain@ideasonboard.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v6 0/7] Async Post Processor 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" This series primarily introduces a Thread worker class along with a queue, in which request for post-process of streams are queued and processed ansychronously. All the context information is carried via Camera3RequestDescriptor. 1/7 and 2/7 are improved !nullptr checks that were spotted in previous review. 3/7 under takes a refactor of splitting Camera3RequestDescriptor::Status to denote only status(success/error). The "pending" status is de-coupled into a separate variable now. 4/7 Consolidates all the information we need to run the post-processor into Camera3RequestDescriptor::Stream. Now use this structure only and update signature of PostProcessor::process() vfunc. 5/7 Introduces a post-processing request tracking std::map and a signal of completion. The tracking map will help us to know if there are multiple post-processing streams per descriptor (i.e. capture request). If so, we need to wait, track until all streams are processed. Only then we can mark descriptor for completion. 6/7 is a small inherent patch based on 5/7's change 7/7 is where a post-processor's worker class is introduced. At this point, the post-processor will run asynchronously. Umang Jain (7): android: camera_stream: Replace post-processor nullptr check android: post_processor_jpeg: Replace encoder_ nullptr check android: camera_device: Refactor descriptor status and sendCaptureResults() android: post_processor: Consolidate contextual information android: Track and notify post processing of streams android: post_processor: Drop return value for process() android: post_processor: Make post processing async src/android/camera_device.cpp | 144 ++++++++++++++--------- src/android/camera_device.h | 5 + src/android/camera_request.cpp | 3 +- src/android/camera_request.h | 18 ++- src/android/camera_stream.cpp | 133 +++++++++++++++++++-- src/android/camera_stream.h | 41 ++++++- src/android/jpeg/post_processor_jpeg.cpp | 20 ++-- src/android/jpeg/post_processor_jpeg.h | 4 +- src/android/post_processor.h | 16 ++- src/android/yuv/post_processor_yuv.cpp | 21 ++-- src/android/yuv/post_processor_yuv.h | 4 +- 11 files changed, 305 insertions(+), 104 deletions(-)